upgrade version 8.18

This commit is contained in:
2020-08-18 17:42:26 +08:00
parent 2a382aa0b4
commit cb0a6fafa3
9 changed files with 240 additions and 116 deletions

View File

@@ -160,7 +160,7 @@
<text>选择订单</text>
<u-icon name="close" color="#A29FA3" size="32" @click="showPopup=false"></u-icon>
</view>
<scroll-view scroll-y class="order-list">
<scroll-view scroll-y class="order-list" @scrolltolower="onreachBottom">
<u-radio-group v-model="value" @change="radioChange">
<view v-for="(items, index) in orderList" :key="index" class="order-item">
<view class="store">
@@ -195,6 +195,7 @@
</view>
</view>
</u-radio-group>
<u-loadmore :status="loadStatu" bgColor="#FFFFFF" font-size="14" margin-top="20" margin-bottom="20"></u-loadmore>
</scroll-view>
<view class="order-btn" @click="confirm">确认</view>
</view>
@@ -222,7 +223,7 @@ export default {
}],
typeList: [], // 商品类型列表
orderList: [], // 商品列表
page: 0,
page: 1,
current: 0,
swiperCurrent: 0,
areaList: [], // 地址列表
@@ -244,6 +245,8 @@ export default {
name: 'common', // 其他图片
},
debounce: true,
timer: true,
loadStatu: 'loadmore'
}
},
onShow() {
@@ -284,17 +287,37 @@ export default {
// console.log(e);
this.type = e[0];
},
onreachBottom() {
if(!this.timer) return false;
this.timer = false;
this.loadStatu = "loading";
this.page++;
this.getOrderList({ load: 'loadmore' }).then(length => {
this.loadStatu = "nomore";
if(length == 0) this.page--;
}).catch(() => {
this.loadStatu = "nomore";
this.page--;
})
},
async getOrderList({ load = 'reload' } = {}) {
// const res = await this.$u.api.getSendOrderList({
// page: this.page,
// })
const res = await this.$u.api.getOrderList({
page: this.page,
// type: '40',
})
this.timer = true;
// if(res.errCode == 0) {
// if(load == 'reload') this.orderList = res.data.order_list;
// else this.orderList.push(...res.data.order_list);
// }
// return res.data.order_list.length;
if(res.errCode == 0) {
if(load == 'reload') this.orderList = res.data;
else this.orderList.push(...res.data);
}
return res;
return res.data.length;
},
submitImage() {
// console.log(222);