Commit 04ba505a authored by 杨培's avatar 杨培

去登录,优化搜索

parent 21dbacf0
...@@ -193,14 +193,11 @@ export default { ...@@ -193,14 +193,11 @@ export default {
}, },
searchable() { searchable() {
return !(this.categoryId == 0 || this.code == '' || (this.isUseCaptcha && !this.isCheckCaptcha)); return !(this.categoryId == 0 || this.code == '' || (this.isUseCaptcha && !this.isCheckCaptcha));
}, }
targetUrl() {
return {path: '/code/' + this.brandId + '/' + this.categoryId, query: {code: this.code}};
},
}, },
mounted() { mounted() {
this.isBanshou = common.isBanshou(); this.isBanshou = common.isBanshou();
// this.checkLogin();
var self = this; var self = this;
document.title = '松下快查'; document.title = '松下快查';
...@@ -316,8 +313,11 @@ export default { ...@@ -316,8 +313,11 @@ export default {
searchCode() { searchCode() {
var self = this; var self = this;
if (!self.searchable) { if (self.blurSearch) {
self.blurSearch = false; self.blurSearch = false;
}
if (!self.searchable) {
return false; return false;
} }
...@@ -347,20 +347,13 @@ export default { ...@@ -347,20 +347,13 @@ export default {
return; return;
} }
var url = common.getUrl('#/code/' + self.brandId + '/' + self.categoryId) self.$router.push({
+ "?code=" + encodeURIComponent(code) + "&t=" + res.data.tk; path: '/code/' + self.brandId + '/' + self.categoryId,
var invite = common.getParameterByName('invite'); query: {
code: code,
if (invite) { tk: res.data.tk
url = url + '&invite=' + invite }
} });
if (!self.isLogin) {
common.requestLogin(url);
return false;
}
self.$router.push(self.targetUrl);
}); });
return false; return false;
...@@ -428,12 +421,7 @@ export default { ...@@ -428,12 +421,7 @@ export default {
onSelect: function (item) { onSelect: function (item) {
if (self.code != item.data) { if (self.code != item.data) {
self.code = item.data; self.code = item.data;
self.searchCode();
if (!self.searchable) {
self.blurSearch = false;
} else {
self.searchCode();
}
} }
} }
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment