From ff7604a3d6592afe60bdc70342611e1196eb2b83 Mon Sep 17 00:00:00 2001 From: fanfan Date: Thu, 4 Jul 2024 22:24:39 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/goods/list.vue | 34 +++++++++++++++-------------- pages/merchantTutorial/tutorial.vue | 2 +- pages/shopList/shopPage.vue | 2 +- 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/pages/goods/list.vue b/pages/goods/list.vue index 58ad462..269b501 100644 --- a/pages/goods/list.vue +++ b/pages/goods/list.vue @@ -263,7 +263,7 @@ options: {}, // 当前页面参数 list: [], // 商品列表数据 // list: getEmptyPaginateObj(), // 商品列表数据 - + isFirstLoad: true, // 用于标记是否是首次加载 // 上拉加载配置 upOption: { // 首次自动执行 @@ -314,11 +314,14 @@ // 设置微信公众号链接分享卡片内容 this.setWxofficialShareData() if (options.categoryId != 'undefined') { + this.upOption.auto = false + this.isFirstLoad = false; this.getGoodsTypeList(options.categoryId) } else { + this.upOption.auto = true + this.isFirstLoad = true; this.mescroll.resetUpScroll() } - }, methods: { @@ -344,6 +347,7 @@ that.isBanrdActive = 0 that.list = []; if (this.options.categoryId) { + this.list.data = [] that.onChage(that.tabbar[0], 1, 0) } else { // this.$refs.uWaterfall1.clear(); @@ -400,14 +404,18 @@ */ upCallback(page) { const app = this - // 设置列表数据 - app.getGoodsList(page.num) - .then(list => { - const curPageLen = list.data.length - const totalSize = list.data.total - app.mescroll.endBySize(curPageLen, totalSize) - }) - .catch(() => app.mescroll.endErr()) + if (app.isFirstLoad) { + // 设置列表数据 + app.getGoodsList(page.num) + .then(list => { + const curPageLen = list.data.length + const totalSize = list.data.total + app.mescroll.endBySize(curPageLen, totalSize) + }) + .catch(() => app.mescroll.endErr()) + } else { + app.isFirstLoad = true + } }, // 设置默认列表显示方式 @@ -449,23 +457,17 @@ keyword: app.options.search || '', // goods_source: this.multiIndex > -1 ? this.multiArray[this.multiIndex].value : '' } - console.log(param) return new Promise((resolve, reject) => { GoodsApi.list(param) .then(result => { selectorQuery.selectAll('.head').boundingClientRect((rects) => { - console.log("rects", rects) app.blheight = rects[0].height }).exec(); - // 合并新数据 - console.log(app.list) const newList = result.data.list - console.log(newList) let arr = getMoreListData(newList, app.list, pageNo); // app.list.data = app.arrayUnique(arr, 'goods_id') app.list.data = arr; app.total = result.data.list.total; - console.log(newList) resolve(newList) }) .catch(reject) diff --git a/pages/merchantTutorial/tutorial.vue b/pages/merchantTutorial/tutorial.vue index 7b292ff..7135283 100644 --- a/pages/merchantTutorial/tutorial.vue +++ b/pages/merchantTutorial/tutorial.vue @@ -66,7 +66,7 @@ loadText: { loadmore: '上拉加载更多', loading: '正在加载', - nomore: '没有更多了 ' + nomore: '亲,没有更多了 ' } } }, diff --git a/pages/shopList/shopPage.vue b/pages/shopList/shopPage.vue index 47f0dda..ed947db 100644 --- a/pages/shopList/shopPage.vue +++ b/pages/shopList/shopPage.vue @@ -582,7 +582,7 @@ transform: translateY(-50%); left: 0; width: 4rpx; - height: calc(100% - 60rpx); + height: calc(100% - 40rpx); background: #F34A40; } }