my.vue
3.37 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
<template>
<view class="my-info">
<view class="header u-f u-f-jcsb u-f-aic" @tap='goProfile'>
<view class="hl">
<view class="u-f u-f-jcfs ">
<image style="width: 50px; height: 50px;border-radius: 50%; background-color: #eeeeee;" :src="src"
mode="aspectFit">
</image>
<view class="hl-r">
<view class="name">
{{info.nickName}}
</view>
<view class="company">
{{leader}}
</view>
</view>
</view>
</view>
<view>
<uni-icons type="arrowright" size="20" color="gray"></uni-icons>
</view>
</view>
<view class="divider"></view>
<view class="center">
<view class="u-f pass" @tap="resetPwd">
<view class="common-mr">
<text class="iconfont icon-mima"></text>
</view>
<view class="u-f1 common-b">
修改密码
</view>
<view>
<uni-icons type="arrowright" size="20" color="gray"></uni-icons>
</view>
</view>
<view class="u-f about" @tap="aboutUs">
<view class="common-mr">
<text class="iconfont icon-guanyuwomen"></text>
</view>
<view class="u-f1 common-b">
关于我们
</view>
<view>
<uni-icons type="arrowright" size="20" color="gray"></uni-icons>
</view>
</view>
</view>
<view class="footer">
<button class="btn" type="warn" @tap="logOut">退出系统</button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
version: this.$conf.version,
src: '',
info: {},
leader: ''
}
},
onLoad() {
this.$api.user.getProfile().then(res => {
this.leader = res.data.data.dept.leader;
this.src = res.data.data.avatar;
this.info = res.data.data;
try {
uni.setStorageSync('my_profile', res.data.data);
} catch (e) {
// error
}
})
},
methods: {
goProfile() {
uni.navigateTo({
url: 'profile'
})
},
resetPwd() {
uni.navigateTo({
url: 'reset-pwd'
})
},
aboutUs() {
uni.navigateTo({
url: 'about-us'
})
},
logOut() {
const self = this;
uni.showModal({
title: '提示',
content: '确定要退出系统吗?',
success: function(res) {
if (res.confirm) {
self.$store.dispatch("logout");
try {
uni.clearStorageSync();
} catch (e) {
// error
};
uni.redirectTo({
url: '/pages/login/login'
})
}
}
})
}
},
}
</script>
<style lang="scss" scoped>
.my-info {
position: fixed;
width: 100%;
height: 100%;
background-color: #FFFFFF;
.header {
height: 200rpx;
padding: 0 50rpx;
.hl {
.hl-r {
height: 60rpx;
margin: 5rpx 0 0 $uni-spacing-row-base;
.name {
margin-bottom: $uni-spacing-col-sm;
font-weight: bold;
}
.company {
font-size: $uni-font-size-sm;
}
}
}
}
.divider {
height: $uni-spacing-col-sm;
margin: 0 50rpx;
background-color: #f8f8f8;
}
.center {
padding: 0 50rpx;
.pass {
height: 110rpx;
line-height: 120rpx;
}
.about {
height: 100rpx;
line-height: 100rpx;
}
}
.footer {
margin-top: 80rpx;
padding: 0 50rpx;
.btn {
height: 80rpx;
line-height: 80rpx;
border-radius: 50rpx;
font-size: $uni-font-size-lg;
}
}
}
.common-mr {
margin-right: $uni-spacing-row-base;
}
.common-b {
border-bottom: 2rpx solid $uni-border-color;
}
</style>