main.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <template>
  2. <div class="main">
  3. <div class="footer">
  4. <van-tabbar v-model="tabType">
  5. <van-tabbar-item icon="home-o" to="/main/message">消息</van-tabbar-item>
  6. <van-tabbar-item icon="search" to="/main/working">工作台</van-tabbar-item>
  7. <van-tabbar-item
  8. icon="friends-o"
  9. :to="tenantId == 'xmhjc' ? '/main/xiamenList' : '/main/equipment'"
  10. >物联网</van-tabbar-item>
  11. <van-tabbar-item
  12. icon="setting-o"
  13. to="/main/home"
  14. >我的</van-tabbar-item>
  15. </van-tabbar>
  16. </div>
  17. </div>
  18. <router-view/>
  19. </template>
  20. <script setup>
  21. import { ref, getCurrentInstance } from 'vue'
  22. import { getUserInfo } from '@/utils/auth';
  23. import {lang} from '@/lang/cn'
  24. import '@/assets/icon/iconfont.css'
  25. import 'vant/lib/index.css';
  26. import axios from 'axios'
  27. const tenantId = getUserInfo().tenantId
  28. const proxy = getCurrentInstance().proxy
  29. const tabType = ref('home')
  30. //判断是否为开发环境.如果是开发环境,则同步前后台中文配置表
  31. const isDev = process.env.NODE_ENV === 'development'
  32. if(isDev) {
  33. let networkLang = window.localStorage.getItem('lang')
  34. if(networkLang || networkLang != JSON.stringify(lang)){
  35. try {
  36. networkLang = JSON.parse(networkLang)
  37. networkLang.app.cn = lang
  38. proxy.post('/open/multilingual/setJson',{configValue:JSON.stringify(networkLang)}).then(res=>{
  39. console.log(res)
  40. })
  41. } catch (error) {
  42. }
  43. }
  44. }
  45. </script>