zhy #254

Merged
hansu merged 2 commits from zhy into master 2020-08-19 10:05:00 +00:00
Showing only changes of commit 4e842b127c - Show all commits

View File

@ -10,7 +10,7 @@
</view>
</view>
<u-empty text="暂无优惠券" mode="coupon" v-if="!couponList[index] || !couponList[index].length"></u-empty>
<u-loadmore :status="loadStatus[current]" bgColor="#FFFFFF" font-size="14" margin-top="20" margin-bottom="20" @loadmore="onreachBottom"></u-loadmore>
<u-loadmore :status="loadStatus[current]" bgColor="#FFFFFF" font-size="14" margin-top="20" margin-bottom="20" @loadmore="onreachBottom" v-if="!couponList[index] || couponList[index].length>=pageSize"></u-loadmore>
</scroll-view>
</swiper-item>
</swiper>
@ -33,6 +33,7 @@ export default {
swiperHeight: '',
couponList: [],
goodsClass: [],
pageSize: 6,
page: 0,
timer: true,
loadStatus: ['loadmore', 'loadmore', 'loadmore'],
@ -65,11 +66,10 @@ export default {
page: this.page,
})
this.timer = true;
if(res.errCode == 0) {
if(load == 'reload') this.couponList[this.current] = res.data;
else if(load == 'loadmore') this.couponList[this.current].push(...res.data);
}
if(load == 'reload') this.couponList[this.current] = res.data;
else if(load == 'loadmore') this.couponList[this.current].push(...res.data);
this.$forceUpdate();
// console.log(this.couponList);
return res.data.length;
},
onreachBottom() {
@ -87,7 +87,7 @@ export default {
})
},
useCoupon(coupon) {
console.log(coupon);
// console.log(coupon);
// if(coupon.type == 1) {
// this.$u.route({
// type: 'switchTab',