<template>
  <view>
    <home v-if="PageCur=='home'"></home>
    <my v-if="PageCur=='my'"></my>
    <view class="cu-bar tabbar bg-white shadow foot">
      <view class="action" @click="NavChange" data-cur="home">
        <view class="cuIcon-cu-image">
          <image :src="'/static/icons/home' + [PageCur=='home'?'_cur':''] + '.png'"></image>
        </view>
        <view :class="PageCur=='home'?'text-green':'text-gray'">首页</view>
      </view>
      <view class="action" @click="NavChange" data-cur="my">
        <view class="cuIcon-cu-image">
          <image :src="'/static/icons/my' + [PageCur == 'my'?'_cur':''] + '.png'"></image>
        </view>
        <view :class="PageCur=='my'?'text-green':'text-gray'">我的</view>
      </view>
    </view>
    <!-- 	<view style="position: absolute;bottom:80px;right:40px;">aaa</view> -->
  </view>
</template>

<script>
  import { _login } from "../login/login-model";

  export default {
    data() {
      return {
        PageCur: "home"
      };
    },
    created() {
      this.loadUserInfo();
    },
    methods: {
      NavChange: function(e) {
        this.PageCur = e.currentTarget.dataset.cur;
      },
      loadUserInfo() {
        /* _login.userInfo(res => {
          const { data: { code,data: { user } } } = res;
          uni.setStorageSync("userInfo", user);
		  if(code === 401){
			  this.$msg("登录已过期，请重新登录");
			  uni.removeStorageSync("userinfo");
			  uni.removeStorageSync("token");
			  setTimeout(()=>{
				  wx.redirectTo({
					  url: "/pages/login/index"
				  });
			  },1500)
		  }
        }); */
      }
    }
  };
</script>

<style>
</style>