Fix:3246 【商城小程序】点击浮动关键词进入搜索页面,搜索框未固定显示该关键词

This commit is contained in:
linxi
2025-02-24 18:06:49 +08:00
parent 910991ad69
commit 744e6d98f9
2 changed files with 23 additions and 4 deletions
+7 -1
View File
@@ -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]];
}
})
},