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

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

Loading…
Cancel
Save