From 744e6d98f9c7c183aa23294bd18e1cf7299e7132 Mon Sep 17 00:00:00 2001 From: linxi Date: Mon, 24 Feb 2025 18:06:49 +0800 Subject: [PATCH] =?UTF-8?q?Fix=EF=BC=9A3246=20=E3=80=90=E5=95=86=E5=9F=8E?= =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E3=80=91=E7=82=B9=E5=87=BB=E6=B5=AE?= =?UTF-8?q?=E5=8A=A8=E5=85=B3=E9=94=AE=E8=AF=8D=E8=BF=9B=E5=85=A5=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E9=A1=B5=E9=9D=A2=EF=BC=8C=E6=90=9C=E7=B4=A2=E6=A1=86?= =?UTF-8?q?=E6=9C=AA=E5=9B=BA=E5=AE=9A=E6=98=BE=E7=A4=BA=E8=AF=A5=E5=85=B3?= =?UTF-8?q?=E9=94=AE=E8=AF=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/home/index.vue | 19 ++++++++++++++++--- pages/shop/GoodSearch/index.vue | 8 +++++++- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/pages/home/index.vue b/pages/home/index.vue index d369579..b99c3c1 100644 --- a/pages/home/index.vue +++ b/pages/home/index.vue @@ -23,7 +23,16 @@ /> - + + @@ -418,7 +427,8 @@ export default { isPlay: true, tabIconPostion: {}, messageIcon: {}, - recommendKeyword: [] + recommendKeyword: [], + keywordIndex: 0 } }, onLoad() { @@ -454,6 +464,9 @@ export default { this.scrollTop = e.scrollTop }, methods: { + changeRecommendKeyword(e) { + this.keywordIndex = e + }, getSearch() { getSearchPageConfig().then(res => { const { success, data } = res @@ -1376,7 +1389,7 @@ export default { } }, goGoodSearch() { - this.$yrouter.push('/pages/shop/GoodSearch/index') + this.$yrouter.push('/pages/shop/GoodSearch/index?keywords=' + this.recommendKeyword[this.keywordIndex] ) }, goGoodsCon(item) { if(item.isFarmerShop) { diff --git a/pages/shop/GoodSearch/index.vue b/pages/shop/GoodSearch/index.vue index 1ba30f5..0c38267 100644 --- a/pages/shop/GoodSearch/index.vue +++ b/pages/shop/GoodSearch/index.vue @@ -133,7 +133,8 @@ export default { historyKey: [], rankingArr: [], recommendKeyword: [], - CartCount: 0 + CartCount: 0, + keywords1: '' } }, computed: mapGetters(['isLogin', 'location', 'userInfo']), @@ -141,6 +142,9 @@ export default { this.getData() this.getCartCount() }, + onLoad(opts){ + this.keywords1 = opts.keywords + }, onShow() { this.getHistory() }, @@ -206,6 +210,8 @@ export default { this.rankingArr.push(data.ranking1) this.rankingArr.push(data.ranking2) this.recommendKeyword = data.recommendKeyword.split(',') + const index = this.recommendKeyword.indexOf(this.keywords1) + [this.recommendKeyword[0], this.recommendKeyword[index]] = [this.recommendKeyword[index], this.recommendKeyword[0]]; } }) },