|
@@ -22,43 +22,46 @@
|
|
v-for="(item, index) in list"
|
|
v-for="(item, index) in list"
|
|
:key="index"
|
|
:key="index"
|
|
class="list-item border-bottom-1px"
|
|
class="list-item border-bottom-1px"
|
|
- @click="getOrderDetail(item.id)">
|
|
|
|
|
|
+ @click="getOrderDetail(item.goods_id)">
|
|
<div class="photo">
|
|
<div class="photo">
|
|
- <img src="" alt="">
|
|
|
|
|
|
+ <img
|
|
|
|
+ :src="item.goods_thumb_url"
|
|
|
|
+ alt="">
|
|
</div>
|
|
</div>
|
|
<div class="info">
|
|
<div class="info">
|
|
<div
|
|
<div
|
|
class="top">
|
|
class="top">
|
|
- <img src="" alt="">
|
|
|
|
- <p>这是名字这是名字这是名字这是名字这是名字这是名</p>
|
|
|
|
|
|
+ <p>{{ item.goods_name }}</p>
|
|
</div>
|
|
</div>
|
|
<div class="middle">
|
|
<div class="middle">
|
|
<div class="price-wrap">
|
|
<div class="price-wrap">
|
|
<p class="price">
|
|
<p class="price">
|
|
<span>¥</span>
|
|
<span>¥</span>
|
|
- <span>129</span>
|
|
|
|
|
|
+ <span>{{ item.price.toFixed(2) }}</span>
|
|
</p>
|
|
</p>
|
|
- <p class="origin">¥599</p>
|
|
|
|
- </div>
|
|
|
|
- <div class="sale-count">
|
|
|
|
- <span>已售</span>
|
|
|
|
- <span>0</span>
|
|
|
|
|
|
+ <p class="origin">¥{{ item.market_price.toFixed(2) }}</p>
|
|
</div>
|
|
</div>
|
|
|
|
+ <!--暂时不用这个字段-->
|
|
|
|
+ <!--<div class="sale-count">-->
|
|
|
|
+ <!--<span>已售</span>-->
|
|
|
|
+ <!--<span>0</span>-->
|
|
|
|
+ <!--</div>-->
|
|
</div>
|
|
</div>
|
|
- <div class="card">
|
|
|
|
- <p class="coupon">
|
|
|
|
|
|
+ <div class="card" v-show="item.discount > 0 && item.commission > 0">
|
|
|
|
+ <p class="coupon" v-show="item.discount > 0">
|
|
<span>券</span>
|
|
<span>券</span>
|
|
- <span>¥470</span>
|
|
|
|
|
|
+ <span>¥{{ item.discount }}</span>
|
|
</p>
|
|
</p>
|
|
- <p class="profit">
|
|
|
|
|
|
+ <p class="profit" v-show="item.commission > 0">
|
|
<span>分享赚</span>
|
|
<span>分享赚</span>
|
|
- <span>¥ 42.77</span>
|
|
|
|
|
|
+ <span>¥ {{ item.commission | fen2Yuan }}</span>
|
|
</p>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
- <div class="shop">
|
|
|
|
- <img src="" alt="">
|
|
|
|
- <p>店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名</p>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <!--暂时不用这个字段-->
|
|
|
|
+ <!--<div class="shop">-->
|
|
|
|
+ <!--<img src="" alt="">-->
|
|
|
|
+ <!--<p>店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名店名</p>-->
|
|
|
|
+ <!--</div>-->
|
|
</div>
|
|
</div>
|
|
</li>
|
|
</li>
|
|
<li class="pullup-wrapper">
|
|
<li class="pullup-wrapper">
|
|
@@ -80,20 +83,20 @@
|
|
<script>
|
|
<script>
|
|
import BScroll from 'better-scroll'
|
|
import BScroll from 'better-scroll'
|
|
import { Toast, Loading } from 'vant'
|
|
import { Toast, Loading } from 'vant'
|
|
-import { apiOrderList } from '../../../order/api/api'
|
|
|
|
|
|
+import { apiGoodsList } from '../api/api'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
components: {
|
|
components: {
|
|
'van-loading': Loading
|
|
'van-loading': Loading
|
|
},
|
|
},
|
|
props: {
|
|
props: {
|
|
- orderPlatformSonType: {
|
|
|
|
- type: Number,
|
|
|
|
- default: 0
|
|
|
|
|
|
+ source: {
|
|
|
|
+ type: String,
|
|
|
|
+ default: ''
|
|
},
|
|
},
|
|
- orderStatus: {
|
|
|
|
- type: Number,
|
|
|
|
- default: 0
|
|
|
|
|
|
+ catId: {
|
|
|
|
+ type: [String, Number],
|
|
|
|
+ default: ''
|
|
}
|
|
}
|
|
},
|
|
},
|
|
data () {
|
|
data () {
|
|
@@ -107,8 +110,8 @@ export default {
|
|
scroll: null
|
|
scroll: null
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- activated () {
|
|
|
|
- if (!this.$route.meta.isUseCache) {
|
|
|
|
|
|
+ methods: {
|
|
|
|
+ init () {
|
|
this.finished = false
|
|
this.finished = false
|
|
this.isRefresh = false
|
|
this.isRefresh = false
|
|
this.isFetchLock = false
|
|
this.isFetchLock = false
|
|
@@ -117,12 +120,7 @@ export default {
|
|
this.list = []
|
|
this.list = []
|
|
this.scroll = null
|
|
this.scroll = null
|
|
this.getList()
|
|
this.getList()
|
|
- } else {
|
|
|
|
- this.scroll && this.scroll.refresh()
|
|
|
|
- }
|
|
|
|
- this.$route.meta.isUseCache = false
|
|
|
|
- },
|
|
|
|
- methods: {
|
|
|
|
|
|
+ },
|
|
onRefresh () {
|
|
onRefresh () {
|
|
this.pagenum = 0
|
|
this.pagenum = 0
|
|
this.pagesize = 20
|
|
this.pagesize = 20
|
|
@@ -140,17 +138,14 @@ export default {
|
|
this.isFetchLock = true
|
|
this.isFetchLock = true
|
|
this.pagenum++
|
|
this.pagenum++
|
|
try {
|
|
try {
|
|
- const { status, data, msg } = await apiOrderList({
|
|
|
|
|
|
+ const { status, data, msg } = await apiGoodsList({
|
|
page: this.pagenum,
|
|
page: this.pagenum,
|
|
page_size: this.pagesize,
|
|
page_size: this.pagesize,
|
|
- order_platform_son_type: this.orderPlatformSonType,
|
|
|
|
- order_status: this.orderStatus
|
|
|
|
|
|
+ source: this.source,
|
|
|
|
+ cat_id: this.catId
|
|
})
|
|
})
|
|
if (status) {
|
|
if (status) {
|
|
- // const { list } = data
|
|
|
|
- // todo
|
|
|
|
- console.log(data)
|
|
|
|
- const list = [1, 2, 3, 4, 5]
|
|
|
|
|
|
+ const { list } = data
|
|
// 下拉刷新数据清空
|
|
// 下拉刷新数据清空
|
|
if (this.isRefresh) {
|
|
if (this.isRefresh) {
|
|
this.isRefresh = false
|
|
this.isRefresh = false
|
|
@@ -205,18 +200,18 @@ export default {
|
|
this.isFetchLock = false
|
|
this.isFetchLock = false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- async getOrderDetail (id) {
|
|
|
|
- this.$router.push({ name: 'CategoryDetail' })
|
|
|
|
|
|
+ getOrderDetail (id) {
|
|
|
|
+ this.$router.push({
|
|
|
|
+ name: 'CategoryDetail',
|
|
|
|
+ params: {
|
|
|
|
+ source: this.source,
|
|
|
|
+ goodsId: id
|
|
|
|
+ }
|
|
|
|
+ })
|
|
}
|
|
}
|
|
},
|
|
},
|
|
beforeDestroy () {
|
|
beforeDestroy () {
|
|
this.scroll && this.scroll.destroy()
|
|
this.scroll && this.scroll.destroy()
|
|
- },
|
|
|
|
- beforeRouteLeave (to, form, next) {
|
|
|
|
- if (['Mine', 'OrderDetail'].findIndex(item => item === to.name) > -1) {
|
|
|
|
- form.meta.isUseCache = true
|
|
|
|
- }
|
|
|
|
- next()
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
@@ -279,7 +274,6 @@ export default {
|
|
margin-right: 10px;
|
|
margin-right: 10px;
|
|
border-radius: 6px;
|
|
border-radius: 6px;
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
- background: pink;
|
|
|
|
|
|
|
|
img {
|
|
img {
|
|
display: block;
|
|
display: block;
|
|
@@ -293,20 +287,15 @@ export default {
|
|
}
|
|
}
|
|
|
|
|
|
.top {
|
|
.top {
|
|
- overflow: hidden;
|
|
|
|
-
|
|
|
|
- img {
|
|
|
|
- width: 30px;
|
|
|
|
- height: 16px;
|
|
|
|
- margin-right: 4px;
|
|
|
|
- float: left;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
p {
|
|
p {
|
|
|
|
+ display: -webkit-box;
|
|
font-size: 14px;
|
|
font-size: 14px;
|
|
font-weight: bold;
|
|
font-weight: bold;
|
|
color: #333333;
|
|
color: #333333;
|
|
line-height: 18px;
|
|
line-height: 18px;
|
|
|
|
+ -webkit-line-clamp: 2;
|
|
|
|
+ -webkit-box-orient: vertical;
|
|
|
|
+ overflow: hidden;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -423,7 +412,6 @@ export default {
|
|
width: 12px;
|
|
width: 12px;
|
|
height: 11px;
|
|
height: 11px;
|
|
margin-right: 6px;
|
|
margin-right: 6px;
|
|
- background: pink;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
p {
|
|
p {
|