...
|
...
|
@@ -3,7 +3,7 @@ |
|
|
<form action="javascript:void(0)">
|
|
|
<div class="search-header middle">
|
|
|
<div class="search-img"></div>
|
|
|
<input class="search-input" type="search" v-model="query" placeholder="Search" @input="suggest"
|
|
|
<input class="search-input" type="search" v-model="query" placeholder="Search" @input="suggest" @focus="yasFocus"
|
|
|
@keyup.13="searchGoods"/>
|
|
|
<div class="search-clear" :class="query && 'search-clear-img'" @click="clear()"></div>
|
|
|
</div>
|
...
|
...
|
@@ -11,7 +11,7 @@ |
|
|
<Scroll v-show="!query.length" :options="scrollOptions">
|
|
|
<div class="recent title middle" v-if="searchWord && searchWord.length">热门推荐</div>
|
|
|
<div class="content middle">
|
|
|
<div class="item" v-if="searchWord && searchWord.length" v-for="item of searchWord" @click="goSearch({query : item.search_word})">
|
|
|
<div class="item" v-if="searchWord && searchWord.length" v-for="item of searchWord" @click="goSearch({query : item.search_word} ,2)">
|
|
|
{{item.search_word}}
|
|
|
</div>
|
|
|
</div>
|
...
|
...
|
@@ -20,12 +20,12 @@ |
|
|
<div class="search-clear search-clear-img" @click="clearLocalHistory()"></div>
|
|
|
</div>
|
|
|
<div class="content middle">
|
|
|
<div class="item" v-if="localHistory && localHistory.length" v-for="item of localHistory" @click="goSearch({query : item})">{{item}}
|
|
|
<div class="item" v-if="localHistory && localHistory.length" v-for="item of localHistory" @click="goSearch({query : item} ,1)">{{item}}
|
|
|
</div>
|
|
|
</div>
|
|
|
</Scroll>
|
|
|
<Scroll v-show="query.length" :options="scrollOptions" :data="searchSuggestList">
|
|
|
<div class="item-line middle" v-if="searchSuggestList.length" v-for="item of searchSuggestList" @click="goSearch({query : item.item})">
|
|
|
<div class="item-line middle" v-if="searchSuggestList.length" v-for="item of searchSuggestList" @click="goSearch({query : item.item} ,0)">
|
|
|
{{item.item}}
|
|
|
</div>
|
|
|
</Scroll>
|
...
|
...
|
@@ -70,6 +70,7 @@ export default { |
|
|
},
|
|
|
searchGoods: function() {
|
|
|
this.addLocalWord();
|
|
|
this.yasInput(0);
|
|
|
this.$router.push({
|
|
|
name: 'List',
|
|
|
query: {
|
...
|
...
|
@@ -81,9 +82,10 @@ export default { |
|
|
suggest: function() {
|
|
|
this.fetchSearchSuggest(this.query);
|
|
|
},
|
|
|
goSearch: function(parameters) {
|
|
|
goSearch: function(parameters, type) {
|
|
|
let query = parameters.query;
|
|
|
|
|
|
this.yasInput(type);
|
|
|
this.$router.push({
|
|
|
name: 'List',
|
|
|
query: {
|
...
|
...
|
@@ -118,6 +120,28 @@ export default { |
|
|
localStorage.setItem('@YohoUFOStore:searchHistory', this.query);
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
yasFocus() {
|
|
|
this.$store.dispatch('reportYas', {
|
|
|
params: {
|
|
|
param: {SEARCH_POS: 3},
|
|
|
appop: 'XY_UFO_SEARCH_CLICK'
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
yasInput: function(type) {
|
|
|
this.$store.dispatch('reportYas', {
|
|
|
params: {
|
|
|
param: {
|
|
|
SEARCH_POS: 3,
|
|
|
KEYWORD: this.query,
|
|
|
POS_ID: type,
|
|
|
TYPE_ID: type,
|
|
|
FLR_INDEX: type,
|
|
|
},
|
|
|
appop: 'XY_UFO_HOME_KEYWORD_SEARCH_C'
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
};
|
...
|
...
|
|