修复了订单重复
This commit is contained in:
parent
f3c881cf76
commit
13258b3b63
@ -8,7 +8,7 @@
|
||||
<view class="order-status">{{ state }}</view>
|
||||
</view>
|
||||
<view class="goods-info">
|
||||
<view class="goods-item" @click="toOtherPage('Details')" v-for="goods in order.extend_order_goods" :key="goods.goods_id">
|
||||
<view class="goods-item" @click="toOtherPage('Details')" v-for="(goods,index) in order.extend_order_goods" :key="index">
|
||||
<image :src="goods.goods_image"></image>
|
||||
<view class="goods-text">
|
||||
<view class="goods-name u-line-2">{{ goods.goods_name }}</view>
|
||||
|
@ -7,7 +7,7 @@
|
||||
<swiper-item class="swiper-item" v-for="(item, index) in list" :key="index">
|
||||
<scroll-view scroll-y style="height: 100%;" @scrolltolower="reachBottom" class="order-scroll">
|
||||
<view v-if="orderList[index]">
|
||||
<view class="item-container" v-for="order in orderList[index]" :key="order.order_id">
|
||||
<view class="item-container" v-for="(order,index) in orderList[index]" :key="index">
|
||||
<OrderItem :order="order" @refreshOrderList="refreshOrderList" v-if="current != 4"></OrderItem>
|
||||
<TryOrderItem :order="order" @refreshOrderList="refreshOrderList" v-else></TryOrderItem>
|
||||
</view>
|
||||
@ -129,13 +129,30 @@ export default {
|
||||
page: this.page,
|
||||
type: type,
|
||||
})
|
||||
console.log(load)
|
||||
res.data.forEach(element => {
|
||||
element.extend_order_goods.forEach(i=>{
|
||||
console.log(i)
|
||||
})
|
||||
});
|
||||
this.timer = true;
|
||||
uni.stopPullDownRefresh(); // 结束刷新
|
||||
if(res.errCode == 0) {
|
||||
if(load == 'reload') this.orderList[this.current] = res.data;
|
||||
else if(load == 'loadmore') this.orderList[this.current].push(...res.data);
|
||||
if(load == 'reload'){
|
||||
this.orderList[this.current] = []
|
||||
this.orderList[this.current] = res.data;
|
||||
|
||||
}else if(load == 'loadmore'){
|
||||
this.orderList[this.current].push(...res.data);
|
||||
}
|
||||
}
|
||||
this.orderList[this.current].forEach(element => {
|
||||
element.extend_order_goods.forEach(i=>{
|
||||
console.log(i)
|
||||
})
|
||||
});
|
||||
this.$forceUpdate();
|
||||
|
||||
// console.log(this.orderList);
|
||||
return res.data.length;
|
||||
},
|
||||
@ -156,11 +173,16 @@ export default {
|
||||
const res = await this.$u.api.goodsTryOrderList({
|
||||
page: this.page,
|
||||
})
|
||||
console.log(res)
|
||||
uni.stopPullDownRefresh(); // 结束刷新
|
||||
this.timer = true;
|
||||
if(res.errCode == 0) {
|
||||
if(load == 'reload') this.orderList[this.current] = res.data.list;
|
||||
else if(load == 'loadmore') this.orderList[this.current].push(...res.data.list);
|
||||
if(load == 'reload') {
|
||||
this.orderList[this.current] = []
|
||||
this.orderList[this.current] = res.data.list;
|
||||
}else if(load == 'loadmore'){
|
||||
this.orderList[this.current].push(...res.data.list);
|
||||
}
|
||||
}
|
||||
this.$forceUpdate();
|
||||
return res.data.list.length;
|
||||
|
Loading…
Reference in New Issue
Block a user