diff --git a/pages/lanhu_gongyinglian/index.vue b/pages/lanhu_gongyinglian/index.vue index 4cf8bfe..cec70f8 100644 --- a/pages/lanhu_gongyinglian/index.vue +++ b/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() } }