Fix:3246 【商城小程序】点击浮动关键词进入搜索页面,搜索框未固定显示该关键词
This commit is contained in:
@@ -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]];
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user