...
|
...
|
@@ -86,6 +86,7 @@ export default { |
|
|
goSearch: function(parameters, param) {
|
|
|
let query = parameters.query;
|
|
|
|
|
|
this.addLocalWord(query);
|
|
|
this.yasInput(param);
|
|
|
this.$router.push({
|
|
|
name: 'List',
|
...
|
...
|
@@ -112,18 +113,19 @@ export default { |
|
|
this.SEARCH_POS = 3;
|
|
|
}
|
|
|
},
|
|
|
addLocalWord: function() {
|
|
|
if (this.query) {
|
|
|
addLocalWord: function(query) {
|
|
|
if (this.query || query) {
|
|
|
let addQuery = query || this.query;
|
|
|
let localHistory = localStorage.getItem('@YohoUFOStore:searchHistory');
|
|
|
|
|
|
if (localHistory) {
|
|
|
let localArr = localHistory.split(',');
|
|
|
|
|
|
if (!localArr.includes(this.query)) {
|
|
|
localStorage.setItem('@YohoUFOStore:searchHistory', this.query + ',' + localHistory);
|
|
|
if (!localArr.includes(addQuery)) {
|
|
|
localStorage.setItem('@YohoUFOStore:searchHistory', addQuery + ',' + localHistory);
|
|
|
}
|
|
|
} else {
|
|
|
localStorage.setItem('@YohoUFOStore:searchHistory', this.query);
|
|
|
localStorage.setItem('@YohoUFOStore:searchHistory', addQuery);
|
|
|
}
|
|
|
}
|
|
|
},
|
...
|
...
|
|