Commit 1714dc04 by mamingqun

添加了百度统计 注释了没有更多

parent 5f395a22
......@@ -510,7 +510,7 @@ export default {
this.ruweidot = { backgroundColor: 'transparent' };
Toast({
message: '没有更多'
// message: '没有更多'
});
return
......
......@@ -42,7 +42,7 @@ Vue.component(Actionsheet.name, Actionsheet);
var _hmt = _hmt || [];
(function () {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?9e7d7b9d4d2ff4da5330771a1b957aa1";
hm.src = "https://hm.baidu.com/hm.js?9d8ec2aaf5ef1d1f6eb8e977e4731950";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
......
......@@ -28,72 +28,72 @@ import store from '../../modules/store';
var _hmt = _hmt || [];
(function () {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?9e7d7b9d4d2ff4da5330771a1b957aa1";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?9d8ec2aaf5ef1d1f6eb8e977e4731950";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
router.beforeEach((to, from, next) => {
const list = ['/', '/detail', '/address'] // 将需要切换效果的路由名称组成一个数组
const toName = to.path // 即将进入的路由名字
const fromName = from.path // 即将离开的路由名字
const toIndex = list.indexOf(toName) // 进入下标
const fromIndex = list.indexOf(fromName) // 离开下标
let direction = ''
if (toIndex > -1 && fromIndex > -1) { // 如果下标都存在
if (toIndex < fromIndex) { // 如果进入的下标小于离开的下标,那么是左滑
direction = 'left'
} else {
direction = 'right' // 如果进入的下标大于离开的下标,那么是右滑
}
const list = ['/', '/detail', '/address'] // 将需要切换效果的路由名称组成一个数组
const toName = to.path // 即将进入的路由名字
const fromName = from.path // 即将离开的路由名字
const toIndex = list.indexOf(toName) // 进入下标
const fromIndex = list.indexOf(fromName) // 离开下标
let direction = ''
if (toIndex > -1 && fromIndex > -1) { // 如果下标都存在
if (toIndex < fromIndex) { // 如果进入的下标小于离开的下标,那么是左滑
direction = 'left'
} else {
direction = 'right' // 如果进入的下标大于离开的下标,那么是右滑
}
store.state.viewDirection = direction //这里使用vuex进行赋值
}
store.state.viewDirection = direction //这里使用vuex进行赋值
if (_hmt) {
if (to.path) {
_hmt.push(['_trackPageview', '/#' + to.fullPath]);
}
if (_hmt) {
if (to.path) {
_hmt.push(['_trackPageview', '/#' + to.fullPath]);
}
}
return next()
return next()
})
Vue.prototype.$randomText = function() {
function RandomNumBoth(Min, Max) {
var Range = Max - Min;
var Rand = Math.random();
var num = Min + Math.round(Rand * Range);
return num;
}
var num = RandomNumBoth(1,11);
var str = null;
switch (num) {
case 2:
str = '因为有家,我们幸福。';
break;
case 3:
str = '因为有家,我们幸福。';
break;
case 7:
str = '因为有家,我们幸福。';
break;
case 10:
str = '因为有家,我们幸福。';
break;
case 11:
str = '因为有家,我们幸福。';
break;
default:
str = '因为有家,我们幸福。';
break;
}
return str;
Vue.prototype.$randomText = function () {
function RandomNumBoth(Min, Max) {
var Range = Max - Min;
var Rand = Math.random();
var num = Min + Math.round(Rand * Range);
return num;
}
var num = RandomNumBoth(1, 11);
var str = null;
switch (num) {
case 2:
str = '因为有家,我们幸福。';
break;
case 3:
str = '因为有家,我们幸福。';
break;
case 7:
str = '因为有家,我们幸福。';
break;
case 10:
str = '因为有家,我们幸福。';
break;
case 11:
str = '因为有家,我们幸福。';
break;
default:
str = '因为有家,我们幸福。';
break;
}
return str;
}
......@@ -101,8 +101,10 @@ Vue.prototype.$randomText = function() {
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
components: { App },
template: '<App/>'
})
\ No newline at end of file
el: '#app',
router,
components: {
App
},
template: '<App/>'
})
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 sign in to comment