123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- <template>
- <div style="max-width: 1200px;" :style="{margin:width==1200+'px'?'10px auto':'10px 0 '}" id="app">
-
-
- <keep-alive :include="catchRoutes">
- <router-view :key="$route.fullPath" />
- </keep-alive>
-
- <tab-bar v-show="isShowtabbar"></tab-bar>
- </div>
- </template>
- <script>
- import TabBar from '@/components/TabBar'
- import { platform } from '@/utils/dingtalk.js'
- import { mapState } from 'vuex'
- export default {
- components: {
- TabBar,
- },
- data() {
- return {
- allowPath: ['/', '/approve', '/my'],
- tabbarList: [
- {
- title: '首页',
- to: '/',
- icon: require("@/assets/icons-index.png"),
- iconSel: require("@/assets/icons-index-sel.png"),
- },
- {
- title: '审批',
- to: '/about',
- icon: require("@/assets/icons-approve.png"),
- iconSel: require("@/assets/icons-approve-sel.png"),
- },
- {
- title: '我的',
- to: '/my',
- icon: require("@/assets/icons-my.png"),
- iconSel: require("@/assets/icons-my-sel.png"),
- },
- ],
- tabbarActive: 0,
- };
- },
- computed: {
- ...mapState('app', [
- 'catchRoutes'
- ]),
- isShowtabbar() {
- const { path } = this.$route
- return this.allowPath.includes(path)
- }
- },
- async created() {
- try {
-
- let list = this.$store.state.enum.evectionTypeList
- if (!list.length) {
- this.$store.dispatch('enum/getTypeList')
- }
- console.log('%c Current Environment >>>', 'background: blue; color: #fff', platform);
-
- if (platform !== 'notInDingTalk') {
-
- console.log(111);
- await this.$store.dispatch('user/login')
-
- this.$store.dispatch('ddtalk/postWaitAuthentication')
- }
- } catch (e) { }
- }
- }
- </script>
|