Commit 9209fbdc authored by 夏彬's avatar 夏彬

Merge remote-tracking branch 'origin/test' into test

parents fe3cd4b3 1e22ba1e
......@@ -20,4 +20,35 @@ var router = new VueRouter({
new Vue({router:router}).$mount('#app');
//统计代码
if (process.env.NODE_ENV == 'production') {
var statsCode = [
//Baidu
'<div style="display:none;"><script src="https://s11.cnzz.com/z_stat.php?id=1261935488&web_id=1261935488" language="JavaScript"></script></div>',
//CNZZ
'<script>var _hmt = _hmt || [];\
(function() {\
var hm = document.createElement("script");\
hm.src = "https://hm.baidu.com/hm.js?855e4edbc305d4a2a1f770c17fd15ef0";\
var s = document.getElementsByTagName("script")[0];\
s.parentNode.insertBefore(hm, s);\
})();</script>'
];
document.write(statsCode.join(''));
router.afterEach(function(to, from) {
var contentUrl = location.pathname + '#' + to.path;
var refererUrl = location.pathname + '#' + from.path;
if (typeof(_hmt) != 'undefined') {
_hmt.push(['_trackPageview', contentUrl]);
}
if (typeof(_czc) != 'undefined') {
_czc.push(["_trackPageview", contentUrl, refererUrl]);
}
console.log("from %s to %s", refererUrl, contentUrl);
});
}
......@@ -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();
}
}
});
......
......@@ -28,12 +28,9 @@ import api from '../utils/api';
};
},
mounted() {
document.title = "故障现象查询";
let self = this;
common.checkLoginCllback(function () {
self.checkHasInvite();
});
//加载品类列表
api.get("brand/get-category-trouble-list").done(res => {
if (res.status) {
......
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