liudan 1 year ago
parent f0aa7523c6
commit bab0283936
  1. 26
      pages/lanhu_gongyinglian/index.vue

@ -41,9 +41,19 @@
activeTab: '0',
search: '',
fenlei: [],
goods: []
goods: [],
page:1,
isAllGood:false,
};
},
onReachBottom() {
console.log("到底")
if(!this.isAllGood){
this.page++;
this.getData2()
}
},
computed: {
...mapState(['user', 'statistics', 'common'])
},
@ -71,10 +81,18 @@
url: '/wanlshop/data/getGoodsList',
data: {
'id': this.activeTab,
'search': this.search
'search': this.search,
'page':this.page
},
success: res => {
this.goods = res
if(res.length==0){
this.isAllGood = true;
}else{
this.isAllGood = false;
this.goods.push(...res)
}
}
})
},
@ -91,6 +109,8 @@
changeTab(tab) {
console.log(tab)
this.activeTab = tab;
this.page = 1;
this.goods = [];
this.getData2()
}
}

Loading…
Cancel
Save