You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
<template>
|
|
|
|
<view class="container">
|
|
|
|
<view class="main">
|
|
|
|
<manifest v-if="currentPage == 0"></manifest>
|
|
|
|
<moveTrace v-else-if="currentPage == 1"></moveTrace>
|
|
|
|
<index v-else-if="currentPage == 2" @changeTab="getChangeTab"></index>
|
|
|
|
<vgm v-else-if="currentPage == 3"></vgm>
|
|
|
|
<mine v-else-if="currentPage == 4"></mine>
|
|
|
|
</view>
|
|
|
|
<tabBar :current="currentPage" @change="changePage"></tabBar>
|
|
|
|
</view>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import tabBar from "@/components/tabBar/tabBar.vue"
|
|
|
|
import index from "@/pages/homePage/index/index.vue"
|
|
|
|
import mine from "@/pages/homePage/mine/mine.vue"
|
|
|
|
import manifest from "@/pages/homePage/manifest/manifest.vue" // 航运
|
|
|
|
import moveTrace from "@/pages/homePage/moveTrace/moveTrace.vue" // 运踪
|
|
|
|
import vgm from "@/pages/homePage/vgm/vgm.vue"
|
|
|
|
|
|
|
|
import { getByArea } from '../../../common/js/api/homePage/manifest.js'
|
|
|
|
|
|
|
|
import { getUserInfo } from '@/common/js/api/homePage/login.js'
|
|
|
|
|
|
|
|
import { mapState, mapActions } from 'vuex';
|
|
|
|
export default {
|
|
|
|
components:{
|
|
|
|
tabBar,
|
|
|
|
index,
|
|
|
|
mine,
|
|
|
|
manifest,
|
|
|
|
moveTrace,
|
|
|
|
vgm
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
currentPage: 2,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
...mapState([
|
|
|
|
'userInfo'
|
|
|
|
]),
|
|
|
|
},
|
|
|
|
onLoad() {
|
|
|
|
console.log('userInfo', this.userInfo, getApp().globalData.isLogin)
|
|
|
|
if(!uni.getStorageSync('userToken')){
|
|
|
|
getApp().globalData.isLogin = false;
|
|
|
|
console.log('== 当前登录状态 ==', getApp().globalData.isLogin )
|
|
|
|
}else{
|
|
|
|
this.getUserInfo();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
...mapActions([
|
|
|
|
'setUserInfo'
|
|
|
|
]),
|
|
|
|
changePage(index){
|
|
|
|
this.currentPage = index;
|
|
|
|
},
|
|
|
|
getUserInfo(){
|
|
|
|
getUserInfo().then(res =>{
|
|
|
|
console.log('== 获取到个人信息 ==',res.data);
|
|
|
|
this.setUserInfo(res.data);
|
|
|
|
})
|
|
|
|
},
|
|
|
|
getChangeTab(type){
|
|
|
|
this.currentPage = type;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="less">
|
|
|
|
.container{
|
|
|
|
height: 100vh;
|
|
|
|
padding-bottom: 140rpx;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
.main{
|
|
|
|
flex: 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|