You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

133 lines
3.0 KiB

<template>
5 years ago
<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>
5 years ago
<div class="ant-back-top-inner"></div>
5 years ago
</a-back-top>
</div>
</div>
</a-config-provider>
</template>
<script>
5 years ago
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 {
5 years ago
name: 'App',
components: { HeadNav, FooterPage, FriendShip },
data() {
return { zh_CN };
},
5 years ago
computed: mapState('user', ['anyringToken']),
5 years ago
updated() {
window.scroll(0, 0);
},
created() {
4 years ago
console.log("this._isMobile();")
4 years ago
this._isMobile();
5 years ago
// 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));
// });
},
4 years ago
methods: {
4 years ago
4 years ago
...mapActions('user', ['getUserId']),
_isMobile(){
4 years ago
console.log("是否走到了_isMobile")
4 years ago
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();
// }
4 years ago
window.location.href = "http://www.sxgreenvalley.com/green-phone"
4 years ago
}
},
},
5 years ago
};
</script>
<style>
5 years ago
html,
body,
#app {
min-height: 100%;
}
#app {
background: transparent;
}
body {
5 years ago
background: #f5f5f5 !important;
5 years ago
padding-top: 70px;
5 years ago
}
body::-webkit-scrollbar {
width: 0;
}
.head-nav {
5 years ago
height: 70px;
5 years ago
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;
5 years ago
right: 70px;
5 years ago
}
#components-back-top-demo-custom .ant-back-top-inner {
5 years ago
height: 60px;
width: 60px;
line-height: 60px;
5 years ago
background: url('assets/t-top.png') center no-repeat;
background-size: contain;
}
.BMap_cpyCtrl {
display: none;
}
.anchorBL {
display: none;
}
</style>