|
|
|
<template>
|
|
|
|
<a-config-provider :locale="zh_CN">
|
|
|
|
<div id="app">
|
|
|
|
<head-nav class="head-nav" />
|
|
|
|
<router-view></router-view>
|
|
|
|
<friend-ship class="friend" />
|
|
|
|
<footer-page class="footer" />
|
|
|
|
<div id="components-back-top-demo-custom">
|
|
|
|
<a-back-top>
|
|
|
|
<div class="ant-back-top-inner"></div>
|
|
|
|
</a-back-top>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</a-config-provider>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import { mapState, mapActions, mapMutations } from 'vuex';
|
|
|
|
import zh_CN from 'ant-design-vue/lib/locale-provider/zh_CN';
|
|
|
|
import HeadNav from './components/HeadNav/HeadNav.vue';
|
|
|
|
import FooterPage from './components/FooterPage/FooterPage.vue';
|
|
|
|
import FriendShip from './components/FooterPage/FriendShip.vue';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'App',
|
|
|
|
components: { HeadNav, FooterPage, FriendShip },
|
|
|
|
data() {
|
|
|
|
return { zh_CN };
|
|
|
|
},
|
|
|
|
|
|
|
|
computed: mapState('user', ['anyringToken']),
|
|
|
|
updated() {
|
|
|
|
window.scroll(0, 0);
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
console.log("this._isMobile();")
|
|
|
|
this._isMobile();
|
|
|
|
|
|
|
|
// const userId = '1218763410024566784';
|
|
|
|
// const params = { userId };
|
|
|
|
// this.getUserId(params);
|
|
|
|
// if (sessionStorage.getItem('store')) {
|
|
|
|
// this.$store.replaceState(Object.assign({}, this.$store.state, JSON.parse(sessionStorage.getItem('store'))));
|
|
|
|
// }
|
|
|
|
// window.addEventListener('beforeunload', () => {
|
|
|
|
// sessionStorage.setItem('store', JSON.stringify(this.$store.state));
|
|
|
|
// });
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
|
|
...mapActions('user', ['getUserId']),
|
|
|
|
_isMobile(){
|
|
|
|
console.log("是否走到了_isMobile")
|
|
|
|
let flag = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)
|
|
|
|
// localStorage.setItem('isiphone',flag)
|
|
|
|
// localStorage.setItem('ismobile',flag?1:0)
|
|
|
|
// return flag;
|
|
|
|
console.log("======>",flag)
|
|
|
|
let ismobile = flag ? 1 : 0
|
|
|
|
// 电脑
|
|
|
|
// 手机
|
|
|
|
if (ismobile == 1) {
|
|
|
|
console.log("ismobile2",flag)
|
|
|
|
// if (to.path == '/') {
|
|
|
|
// next('/home')
|
|
|
|
// } else {
|
|
|
|
// next();
|
|
|
|
// }
|
|
|
|
window.location.href = "http://www.sxgreenvalley.com/green-phone"
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
html,
|
|
|
|
body,
|
|
|
|
#app {
|
|
|
|
min-height: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
#app {
|
|
|
|
background: transparent;
|
|
|
|
}
|
|
|
|
body {
|
|
|
|
background: #f5f5f5 !important;
|
|
|
|
padding-top: 70px;
|
|
|
|
}
|
|
|
|
body::-webkit-scrollbar {
|
|
|
|
width: 0;
|
|
|
|
}
|
|
|
|
.head-nav {
|
|
|
|
height: 70px;
|
|
|
|
width: 100%;
|
|
|
|
top: 0;
|
|
|
|
background: white;
|
|
|
|
box-shadow: 0 0 10px #ccc;
|
|
|
|
position: fixed !important;
|
|
|
|
z-index: 100;
|
|
|
|
}
|
|
|
|
.friend {
|
|
|
|
height: 64px;
|
|
|
|
}
|
|
|
|
.footer {
|
|
|
|
width: 100%;
|
|
|
|
background: #0d1f32;
|
|
|
|
bottom: 0;
|
|
|
|
}
|
|
|
|
#components-back-top-demo-custom .ant-back-top {
|
|
|
|
bottom: 100px;
|
|
|
|
right: 70px;
|
|
|
|
}
|
|
|
|
#components-back-top-demo-custom .ant-back-top-inner {
|
|
|
|
height: 60px;
|
|
|
|
width: 60px;
|
|
|
|
line-height: 60px;
|
|
|
|
background: url('assets/t-top.png') center no-repeat;
|
|
|
|
background-size: contain;
|
|
|
|
}
|
|
|
|
|
|
|
|
.BMap_cpyCtrl {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.anchorBL {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
</style>
|