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 {