|
1
|
1
|
<template>
|
|
2
|
2
|
<view class="container">
|
|
3
|
3
|
<uni-list>
|
|
4
|
|
- <uni-list-item showExtraIcon="true" :extraIcon="{type: 'person-filled'}" title="昵称" :rightText="user.username" />
|
|
|
4
|
+ <uni-list-item showExtraIcon="true" :extraIcon="{type: 'person-filled'}" title="昵称" :rightText="user.name" />
|
|
5
|
5
|
<uni-list-item showExtraIcon="true" :extraIcon="{type: 'phone-filled'}" title="手机号码" :rightText="user.telephone" />
|
|
6
|
|
- <uni-list-item showExtraIcon="true" :extraIcon="{type: 'email-filled'}" title="邮箱" :rightText="user.email" />
|
|
7
|
|
- <uni-list-item showExtraIcon="true" :extraIcon="{type: 'auth-filled'}" title="岗位" :rightText="postGroup" />
|
|
8
|
|
- <uni-list-item showExtraIcon="true" :extraIcon="{type: 'staff-filled'}" title="角色" :rightText="roleGroup" />
|
|
9
|
|
- <!-- <uni-list-item showExtraIcon="true" :extraIcon="{type: 'calendar-filled'}" title="创建日期" :rightText="user.createTime" /> -->
|
|
|
6
|
+ <uni-list-item showExtraIcon="true" :extraIcon="{type: 'auth-filled'}" title="部门" :rightText="user.deptPathsText" />
|
|
10
|
7
|
</uni-list>
|
|
11
|
8
|
</view>
|
|
12
|
9
|
</template>
|
|
13
|
10
|
|
|
14
|
11
|
<script>
|
|
15
|
|
- import { getUserProfile } from "@/api/system/user"
|
|
16
|
|
-
|
|
17
|
12
|
export default {
|
|
18
|
13
|
data() {
|
|
19
|
14
|
return {
|
|
20
|
15
|
user: {},
|
|
21
|
|
- // roleGroup: "",
|
|
22
|
|
- // postGroup: ""
|
|
23
|
16
|
}
|
|
24
|
17
|
},
|
|
25
|
18
|
onShow() {
|
|
...
|
...
|
@@ -30,18 +23,17 @@ |
|
30
|
23
|
})
|
|
31
|
24
|
},
|
|
32
|
25
|
onLoad() {
|
|
33
|
|
- this.getUser()
|
|
|
26
|
+ },
|
|
|
27
|
+ created() {
|
|
|
28
|
+ console.log('this.$store.state.user', this.$store.state.user)
|
|
|
29
|
+ this.user = {
|
|
|
30
|
+ name : this.$store.state.user.name || '',
|
|
|
31
|
+ deptPathsText : this.$store.state.user.deptPaths.length ? this.$store.state.user.deptPaths.join(',') : '',
|
|
|
32
|
+ telephone: this.$store.state.user.telephone || ''
|
|
|
33
|
+ }
|
|
34
|
34
|
},
|
|
35
|
35
|
methods: {
|
|
36
|
|
- getUser() {
|
|
37
|
|
- getUserProfile().then(response => {
|
|
38
|
|
- // console.log("结果:"+response.data)
|
|
39
|
|
- this.user = response.data
|
|
40
|
|
-
|
|
41
|
|
- // this.roleGroup = response.roleGroup
|
|
42
|
|
- // this.postGroup = response.postGroup
|
|
43
|
|
- })
|
|
44
|
|
- }
|
|
|
36
|
+
|
|
45
|
37
|
}
|
|
46
|
38
|
}
|
|
47
|
39
|
</script>
|
...
|
...
|
|