From 7d239ebdac35ef13ade474c68c520a3569428e56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E7=81=B0=E7=81=B0?= Date: Mon, 21 Nov 2022 21:59:22 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E5=A4=8D=E3=80=91=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E4=BB=BF=E7=82=B9=E9=A4=90=E6=A8=A1=E5=BC=8F=E4=B8=8B?= =?UTF-8?q?=E5=AD=90=E5=88=97=E8=A1=A8=E6=95=B0=E6=8D=AE=E4=B8=8A=E6=8B=89?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CoreShop/pages/category/index/index.vue | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/CoreCms.Net.Uni-App/CoreShop/pages/category/index/index.vue b/CoreCms.Net.Uni-App/CoreShop/pages/category/index/index.vue index ac8107fb..3ab6b2eb 100644 --- a/CoreCms.Net.Uni-App/CoreShop/pages/category/index/index.vue +++ b/CoreCms.Net.Uni-App/CoreShop/pages/category/index/index.vue @@ -62,7 +62,7 @@ - + @@ -93,7 +93,7 @@ - + @@ -214,7 +214,6 @@ this.scorllH = e.windowHeight - e.statusBarHeight - 50; } }) - // 获取购物车数量 if (this.$store.state.config.cateStyle == 4) { this.goodsList = []; @@ -232,11 +231,6 @@ this.getCartNums(); } }, - onReachBottom() { - if (this.loadStatus != 'nomore') { - this.getGoods(); - } - }, methods: { // 点击左边的栏目切换 async swichMenu(index) { @@ -297,9 +291,11 @@ } } this.currentCateId = res.data[0].id; + this.needCurrentCateId = res.data[0].id; this.menuChilds = res.data[0].child; + this.getGoods(); } - this.getGoods(); + } } }); @@ -468,7 +464,12 @@ this.goodsList = []; this.getGoods(); }, - + scrolltolower() { + console.log("触底了"); + if (this.loadStatus != 'nomore') { + this.getGoods(); + } + }, //取得商品数据 getGoods: function () { uni.showLoading({ @@ -487,7 +488,7 @@ if (res.status) { const _list = res.data.list; _this.goodsList = [..._this.goodsList, ..._list]; - if (res.data.totalCount > _this.goodsList.length) { + if (res.data.totalPages >= _this.page) { _this.loadStatus = 'loadmore'; _this.page++; } else {