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.

107 lines
3.0 KiB
Vue

2 years ago
<template>
<view class="content">
<view class="mine-header">
2 years ago
<!-- <image class="header-bg" src="https://img.zcool.cn/community/0187c358fd6e72a8012160f71b0715.gif"></image> -->
2 years ago
<view class="header">
<view class="left">
2 years ago
<!-- <image class="header-img"
2 years ago
src="https://img2.baidu.com/it/u=3973855039,4170930478&fm=253&app=138&size=w931&n=0&f=PNG&fmt=auto&maxorilen2heic=2000000">
2 years ago
</image> -->
<image class="header-img"
src="@/static/image/header.png">
2 years ago
</image>
</view>
2 years ago
<view class="center" v-if="!isLogin">
2 years ago
<view class="user-name">用户名暂未登录 </view>
<view class="user-type">公司暂未登录 </view>
</view>
2 years ago
<view class="center" v-else>
<view class="user-name">用户名{{userInfo.showname}}</view>
<view class="user-type">公司{{userInfo.comname}}</view>
</view>
2 years ago
</view>
</view>
<view class="mine-list">
<view class="mine-tab">
2 years ago
<view><text class="iconfont icon-fuzhi"></text><text>按钮</text></view>
<view><text class="iconfont icon-yunshuche"></text><text>按钮</text></view>
<view><text class="iconfont icon-mianxingjizhuangxiang"></text><text>按钮</text></view>
<view><text class="iconfont icon-cangdan"></text><text>按钮</text></view>
2 years ago
</view>
2 years ago
<view class="login-btn" v-if="!isLogin">
2 years ago
<text class="login-img iconfont icon-yunshuche"></text>
<button @click="goLogin"></button>
</view>
2 years ago
<template v-else>
<view class="mine-content" >
<view class="tab">
<view class="left"><text class="iconfont icon-fuzhi"></text><text class="tip">设置</text></view>
<view class="right iconfont icon-daoda"></view>
</view>
<view class="tab">
<view class="left"><text class="iconfont icon-fuzhi"></text><text class="tip">设置</text></view>
<view class="right iconfont icon-daoda"></view>
</view>
<view class="tab">
<view class="left"><text class="iconfont icon-fuzhi"></text><text class="tip">设置</text></view>
<view class="right iconfont icon-daoda"></view>
</view>
</view>
2 years ago
<view class="sign-out" @click="signOut">退</view>
2 years ago
</template>
2 years ago
</view>
</view>
</template>
<script>
2 years ago
import {
mapState,
mapActions
} from 'vuex';
2 years ago
export default {
2 years ago
computed: {
...mapState([
'userInfo'
]),
},
2 years ago
data() {
return {
2 years ago
isLogin: null,
2 years ago
}
},
watch:{
isLogin(){
console.log('----', this.isLogin)
}
},
2 years ago
mounted() {
2 years ago
this.isLogin = getApp().globalData.isLogin;
2 years ago
},
2 years ago
methods: {
goLogin(){
uni.navigateTo({
url:'/pages/homePage/login/login'
})
2 years ago
},
signOut(){
this.$util.showModal('退出','确定退出登录?',()=>{
this.$util.Tips({title: '退出登录成功'})
getApp().globalData.isLogin = false;
this.isLogin = false;
uni.removeStorageSync('userToken')
uni.removeStorageSync('tokenStartTime');
this.$forceUpdate();
},()=>{
console.log('== 取消退出 ==')
})
2 years ago
}
}
}
</script>
<style lang="less">
@import url("./mine.less");
</style>