Commit 1714dc04 by mamingqun

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

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