From 00012f2e07cedb80f74f99091a4530bc09f4f5de Mon Sep 17 00:00:00 2001 From: syt <854400391@qq.com> Date: Thu, 14 Mar 2024 23:24:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=97=E8=A1=A8=E7=80=91=E5=B8=83=E6=B5=81?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E6=B8=85=E7=A9=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/goods/list.vue | 36 +++++++++++++++++++++++++++++------- pages/invite/index.vue | 16 ++++++++++------ 2 files changed, 39 insertions(+), 13 deletions(-) diff --git a/pages/goods/list.vue b/pages/goods/list.vue index 0971875..330ef19 100644 --- a/pages/goods/list.vue +++ b/pages/goods/list.vue @@ -177,7 +177,7 @@ - + @@ -202,7 +202,8 @@ }, mixins: [MescrollMixin, WxofficialMixin], data() { - return { + return { + total: 1, searchText: '', banrdType: [], keyName1: '', @@ -286,7 +287,8 @@ this.keyName2 = item.name } } - + this.list.data = [] + this.$refs.uWaterfall1.clear(); this.getGoodsList() }, /** @@ -310,7 +312,16 @@ setShowView() { this.showView = uni.getStorageSync(showViewKey) || false }, - + //数组对象去重 + arrayUnique(arr, name) { +     var hash = {}; +     return arr.reduce(function (item, next) { +         hash[next[name]] +             ? "" +             : (hash[next[name]] = true && item.push(next)); +         return item; +     }, []); + }, /** * 获取商品列表 * @param {number} pageNo 页码 @@ -337,8 +348,17 @@ GoodsApi.list(param) .then(result => { // 合并新数据 - const newList = result.data.list - app.list.data = getMoreListData(newList, app.list, pageNo) + const newList = result.data.list + console.log(newList) + let arr = getMoreListData(newList, app.list, pageNo); + + console.log("arr",arr) + app.list.data = app.arrayUnique(arr,'goods_id') + app.total = result.data.list.total; + console.log("app.total",app.total) + console.log("app.list.data",app.list.data) + // console.log("app.list.data",app.list.data) + // console.log("newList",newList) resolve(newList) }) .catch(reject) @@ -350,7 +370,9 @@ const app = this const newSortPrice = newSortType === 'price' ? !app.sortPrice : true app.sortType = newSortType - app.sortPrice = newSortPrice + app.sortPrice = newSortPrice + app.$refs.uWaterfall1.clear(); + app.list.data = [] // 刷新列表数据 app.list = getEmptyPaginateObj() app.mescroll.resetUpScroll() diff --git a/pages/invite/index.vue b/pages/invite/index.vue index ba5c4ee..d2ff2e2 100644 --- a/pages/invite/index.vue +++ b/pages/invite/index.vue @@ -286,7 +286,7 @@ left: 50%; margin-left: -336rpx; top: 50%; - margin-top: -456rpx; + margin-top: -556rpx; z-index: 2; .bg { @@ -307,15 +307,19 @@ } .tips { - width: 100%; - height: 30rpx; + width: 600rpx; + height: 80rpx; position: absolute; text-align: center; font-size: 30rpx; - color: #FFFFFF; - left: 0; - bottom: -50rpx; + line-height: 80rpx; + border-radius: 10rpx; + color: #212121; + left: 50%; + margin-left: -300rpx; + bottom: -120rpx; z-index: 2; + background-color: #FFFFFF; } .close {