index.vue
4.8 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<template>
<view>
<!--#ifdef MP-WEIXIN-->
<view class="my-head">
</view>
<!--#endif-->
<view class="my-top">
<image src="/static/img/tx.png" class="my-top-img"></image>
<view class="my-top-flex">
<view class="my-top-title">{{contact_info.staff_name}}</view>
<view>{{contact_info.staff_code}}</view>
</view>
</view>
<view class="my-content">
<view class="my-content-flex">
<view class="my-content-about">部门</view>
<view>{{contact_info.depart_name}}</view>
</view>
<view class="my-content-flex">
<view class="my-content-about">职务</view>
<view>{{contact_info.duty}}</view>
</view>
</view>
<view class="my-b">
<uni-list>
<uni-list-item title="电话信息" :showArrow="false" :thumb="static_media.img01" :show-badge="true"
:badge-text="contact_info.mobile"></uni-list-item>
<navigator open-type="navigate" url="/pages/login/changePwd" hover-class="none">
<uni-list-item title="修改密码" :thumb="static_media.img02"></uni-list-item>
</navigator>
</uni-list>
<view class="my-tc" @tap="get_logout">退出登录</view>
</view>
</view>
</template>
<script>
import {mapState} from 'vuex'
import uniList from '@/components/uni-list/uni-list.vue'
import uniListItem from '@/components/uni-list-item/uni-list-item.vue'
export default {
data() {
return {
contact_info: []
}
},
onShow() {
this.get_contact_info()
},
mounted() {
},
computed: {
...mapState(['userInfo', 'loginStatus', 'loginInfo']),
static_media() {
return {
img01: '/static/img/user-icon1.png',
img02: '/static/img/user-icon2.png'
}
}
},
components: {
uniList,
uniListItem
},
methods: {
// loginOut() {
// this.$lib.$store.commit('clearUserInfo')
// uni.reLaunch({
// url: '/pages/login/index'
// })
// },
//获取个人信息
async get_contact_info() {
let res = await this.$lib.$http.post({
url: this.$lib.$urlMap.staffInfo,
data: {},
needLogin: true
})
if (res.code == 1) {
this.contact_info = res.data;
}
},
async get_logout() {
let res = await this.$lib.$http.post({
url: this.$lib.$urlMap.logout,
data: {},
needLogin: true
})
if (res.code == 1) {
uni.navigateTo({
url: '/pages/login/index'
});
this.$lib.$store.commit('clearUserInfo')
}
},
}
}
</script>
<style>
page {
background: #f8f8f8;
}
.lz-status_bar {
background-color: #1172fd;
}
.my-top {
background: #1172fd;
display: flex;
align-items: flex-start;
padding: 22px;
color: #fff;
font-size: 14px;
height: 92px;
}
.my-top-img {
width: 67px;
height: 67px;
border-radius: 50%;
margin-right: 10px;
}
.my-top-title {
font-size: 16px;
margin-top: 12px;
margin-bottom: 3px;
}
.my-top-flex {
display: flex;
align-items: flex-start;
flex-direction: column;
height: 67px;
}
.my-content {
background: #fff;
width: 86%;
margin: 0 auto;
margin-top: -22px;
padding: 17px 13px;
border-radius: 7px;
display: flex;
align-items: center;
justify-content: center;
}
.my-content-flex {
flex: 1;
display: flex;
align-items: center;
flex-direction: column;
justify-content: center;
border-right: solid 2px #f3f3f3;
font-size: 16px;
}
.my-content .my-content-flex:last-child {
border-right: none
}
.my-content-about {
font-size: 14px;
color: #9b9b9c;
margin-bottom: 4px;
}
.my-b {
background: #fff;
width: 93%;
margin: 0 auto;
border-radius: 7px;
margin-top: 13px;
}
.my-tc{
background: #fff;
width: 86%;
margin: 0 auto;
padding: 13px 13px;
text-align: center;
font-size: 15px;
color: #1172fd;
}
.my-head {
background: #1172fd;
height: 50px;
}
</style>