|
@@ -1,16 +1,27 @@
|
|
<template>
|
|
<template>
|
|
<div id="app">
|
|
<div id="app">
|
|
|
|
+ <NoticeDialog :show.sync="noticeVisible" />
|
|
|
|
+
|
|
<Router-view />
|
|
<Router-view />
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+import NoticeDialog from './components/NoticeDialog/index.vue';
|
|
|
|
|
|
-export default {
|
|
|
|
|
|
+const NOTICE_KEY = 'notice1'
|
|
|
|
|
|
|
|
+export default {
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ noticeVisible: false
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ components: {
|
|
|
|
+ NoticeDialog
|
|
|
|
+ },
|
|
created() {
|
|
created() {
|
|
-
|
|
|
|
// 移动端和pc端的切换
|
|
// 移动端和pc端的切换
|
|
if (
|
|
if (
|
|
window.navigator.userAgent.match(
|
|
window.navigator.userAgent.match(
|
|
@@ -22,8 +33,24 @@ export default {
|
|
window.location.href = window.location.origin + '/mobile/index.html#/Layout/Home'
|
|
window.location.href = window.location.origin + '/mobile/index.html#/Layout/Home'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ mounted() {
|
|
|
|
+ if (this.checkDailyDialog()) {
|
|
|
|
+ this.noticeVisible = true
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ checkDailyDialog() {
|
|
|
|
+ const lastShown = localStorage.getItem(NOTICE_KEY)
|
|
|
|
+ const today = new Date().toDateString()
|
|
|
|
|
|
|
|
+ if (lastShown !== today) {
|
|
|
|
+ localStorage.setItem(NOTICE_KEY, today)
|
|
|
|
+ return true
|
|
|
|
+ }
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|