index.vue
2.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<template>
<view class="p-c">
<view class="p-c-item">
<view class="p-c-item-title">{{ t('maintenance.monitor.agent.username') }}</view>
<view class="p-c-item-desc">{{ user.loginName }}</view>
<!-- <uv-icon name="arrow-right" size="22rpx" color="#90949D"></uv-icon> -->
</view>
<view class="p-c-item">
<view class="p-c-item-title">{{ t('table.name') }}</view>
<view class="p-c-item-desc">{{ user.realName }}</view>
<!-- <uv-icon name="arrow-right" size="22rpx" color="#90949D"></uv-icon> -->
</view>
<view class="p-c-item">
<view class="p-c-item-title">{{ t('dialog.tel') }}</view>
<view class="p-c-item-desc">{{ user.tel }}</view>
<!-- <uv-icon name="arrow-right" size="22rpx" color="#90949D"></uv-icon> -->
</view>
<view class="p-c-item">
<view class="p-c-item-title">{{ t('dialog.email') }}</view>
<view class="p-c-item-desc">{{ user.email }}</view>
<!-- <uv-icon name="arrow-right" size="22rpx" color="#90949D"></uv-icon> -->
</view>
<!-- <view class="p-c-item">
<view class="p-c-item-title">门店权限</view>
<view class="p-c-item-desc" v-if="userStoreList.length === 0">全部权限</view>
<view class="p-c-item-desc" v-else></view>
</view> -->
<view class="p-c-item">
<view class="p-c-item-title">{{ t('maintenance.common.createTime') }}</view>
<view class="p-c-item-desc">{{ user.createTime }}</view>
</view>
<view class="p-c-item" @tap="handleLinkTo">
<view class="p-c-item-title">{{ t('dialog.changePW') }}</view>
<view class="p-c-item-desc">{{ t('maintenance.common.edit') }}</view>
<uv-icon name="arrow-right" size="22rpx" color="#90949D"></uv-icon>
</view>
</view>
</template>
<script setup>
import {
getStageObj
} from '@/utils'
import {
getUserInfoApi,
getUserStoreListApi
} from '@/api'
import {
ref,
computed,
} from 'vue';
import {
onLoad
} from '@dcloudio/uni-app'
import {
t
} from '@/plugins/index.js'
const user = ref({})
onLoad(() => {
uni.setNavigationBarTitle({
title: t('app.menu.personalInformation')
})
getUserInfo()
getUserStoreList()
})
const getUserInfo = async () => {
try {
const users = await getStageObj('user')
const res = await getUserInfoApi(users.id)
user.value = res.data
} catch (error) {
console.log(error)
}
}
const userStoreList = ref([])
const getUserStoreList = async () => {
try {
const users = await getStageObj('user')
const {
code,
data
} = await getUserStoreListApi({
userId: users.id
})
if(code === 200){
userStoreList.value = data
}
} catch (e) {
console.log(e);
}
}
const handleLinkTo = () => {
uni.navigateTo({
url: '/subPackages/accountGroup/pages/login/resetPassword'
})
}
</script>
<style lang="scss" scoped>
@import '@/styles/col.scss';
</style>