2024-04-24 14:56:16 +08:00

118 lines
2.9 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view class="user-container">
<view class="flex-col page">
<view class="flex-col justify-start relative section">
<view class="shrink-0 section_2"></view>
<u-avatar class="shrink-0 image pos" :showLoading="true" size="64px" :src="avatar"
@click="avatarClick"></u-avatar>
<text class="text pos_2">{{nickName}}</text>
<view class="flex-row justify-between section_4 pos_4">
<text class="font">部门{{deptName}}</text>
<!-- <text class="font">手机号{{userInfo.phonenumber}}</text> -->
</view>
</view>
<!-- <uni-card class="card-box" is-shadow>
<u-grid :border="false" @click="gridClick" col="3">
<u-grid-item v-for="(baseListItem,baseListIndex) in gridList" :key="baseListIndex"
:name="baseListItem.url">
<u-icon :customStyle="{paddingTop:20+'rpx'}" :name="baseListItem.name" :size="48"></u-icon>
<text class="grid-text">{{baseListItem.title}}</text>
</u-grid-item>
</u-grid>
</uni-card> -->
<u-cell-group>
<u-cell :iconStyle="{fontSize:'24px',color:'#2979ff'}" icon="server-man" title="问题反馈" isLink></u-cell>
<u-cell :iconStyle="{fontSize:'24px',color:'#909399'}" icon="setting-fill" title="个人设置" isLink></u-cell>
<u-cell :iconStyle="{fontSize:'24px',color:'#19be6b'}" icon="level" title="版本号" :value="version"></u-cell>
</u-cell-group>
<view class="out-button-box">
<u-modal :show="outLoginShow" title="退出登录" showCancelButton content='是否注销,并退出登录?'
@cancel="outLoginShow = false" @confirm="outLogin"></u-modal>
<u-button type="primary" text="退出登录" @click="outLoginShow = true"></u-button>
</view>
</view>
</view>
</template>
<script>
import {
mapGetters
} from 'vuex'
import {
mapActions
} from 'vuex'
export default {
components: {},
props: {},
computed: {
// 使用对象展开运算符将 getter 混入 computed 对象中
...mapGetters([
'name',
'nickName',
'deptName',
'avatar',
])
},
onLoad() {
this.version = uni.$u.sys().appWgtVersion;
},
onShow() {
this.GetInfo();
},
data() {
return {
version:'V2.1.2',
outLoginShow: false,
gridList: [{
name: 'photo',
title: 'agv',
url: '/pages/agv/agv'
},
// {
// name: 'lock',
// title: '帮助',
// url: ''
// },
// {
// name: 'star',
// title: '客服',
// url: ''
// },
]
};
},
methods: {
...mapActions([
'LogOut',
'GetInfo'
]),
avatarClick() {
},
gridClick(url) {
if (url === '') {
return;
}
uni.navigateTo({
url
});
},
// 退出登录
outLogin() {
this.LogOut();
this.outLoginShow = false;
setTimeout(() => {
uni.reLaunch({
url: '/pages/login/login'
});
}, 500)
}
},
};
</script>
<style scoped>
@import url("user.css");
</style>