loadmore 7.27
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user