From bab0283936defc74df2145b4f20b98978406caa9 Mon Sep 17 00:00:00 2001 From: liudan <18634735655@163.com> Date: Thu, 9 Nov 2023 23:23:45 +0800 Subject: [PATCH] 1 --- pages/lanhu_gongyinglian/index.vue | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) 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() } }