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

去登录,优化搜索

parent 21dbacf0
......@@ -193,14 +193,11 @@ export default {
},
searchable() {
return !(this.categoryId == 0 || this.code == '' || (this.isUseCaptcha && !this.isCheckCaptcha));
},
targetUrl() {
return {path: '/code/' + this.brandId + '/' + this.categoryId, query: {code: this.code}};
},
}
},
mounted() {
this.isBanshou = common.isBanshou();
// this.checkLogin();
var self = this;
document.title = '松下快查';
......@@ -316,8 +313,11 @@ export default {
searchCode() {
var self = this;
if (!self.searchable) {
if (self.blurSearch) {
self.blurSearch = false;
}
if (!self.searchable) {
return false;
}
......@@ -347,20 +347,13 @@ export default {
return;
}
var url = common.getUrl('#/code/' + self.brandId + '/' + self.categoryId)
+ "?code=" + encodeURIComponent(code) + "&t=" + res.data.tk;
var invite = common.getParameterByName('invite');
if (invite) {
url = url + '&invite=' + invite
}
if (!self.isLogin) {
common.requestLogin(url);
return false;
}
self.$router.push(self.targetUrl);
self.$router.push({
path: '/code/' + self.brandId + '/' + self.categoryId,
query: {
code: code,
tk: res.data.tk
}
});
});
return false;
......@@ -428,12 +421,7 @@ export default {
onSelect: function (item) {
if (self.code != item.data) {
self.code = item.data;
if (!self.searchable) {
self.blurSearch = false;
} else {
self.searchCode();
}
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