loadmore 7.27

This commit is contained in:
2020-07-27 17:59:47 +08:00
parent 100f31c6f9
commit 6eabd3a575
17 changed files with 421 additions and 58 deletions

View File

@@ -34,6 +34,8 @@ export default {
couponGroupList: [],
couponList: [],
page: 0,
loadStatus: 'loadmore',
timer: true,
}
},
components: {
@@ -50,6 +52,27 @@ export default {
}
},
methods: {
loadMore(page) {
if(!this.timer) return false;
this.loadStatus = "loading";
this.page++;
this.getGoodsRecommend({
gc_id: this.classifyList[this.current].gc_id,
page: this.page,
reload: false,
}).then(length => {
// console.log(length);
if(length == 0) {
this.page--;
this.loadStatus = 'nomore';
} else {
this.loadStatus = 'loading';
}
}).catch(() => {
this.loadStatus = "nomore";
this.page--;
})
},
getGoodsClass() {
this.$u.api.getGoodsClass().then(res => {
if(res.errCode == 0) {