oneSetting - 副本.vue
3.0 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
<template>
<view class="oneSetting">
<!-- 资料 设置 -->
<view class="header-wrap"></view>
<view class="content-wrap area">
<view class="content-head-wrap flex">
<view class="content-head-img">
<!-- <image :src="imgUrl" mode="aspectFill"></image> -->
<avatar selWidth="250rpx" selHeight="250rpx" @upload="myUpload"
:avatarSrc="userdata.head_portrait?$service.getimg(userdata.head_portrait):imgUrl"
avatarStyle="width: 164rpx;height: 164rpx;border-radius: 50%;" inner=true></avatar>
</view>
</view>
<view class="content-item flex">
<view>
姓名
</view>
<view v-if="identity==1" class="user-name">
李老师
</view>
<view v-else class="user-name">
{{userName}}
</view>
</view>
<view class="content-item flex">
<view>
性别
</view>
<view class="user-name">
{{gender}}
</view>
</view>
<view v-if="identity==1" class="content-item flex">
<view>
手机号
</view>
<view class="user-name">
{{'16612345678'}}
</view>
</view>
<view v-else class="content-item flex">
<view>
学号
</view>
<view class="user-name">
{{studentNum}}
</view>
</view>
<view class="sign-out" @click="logout_fuc">
退出登录
</view>
</view>
</view>
</template>
<script>
import Vue from 'vue'
import {
mapState,
mapMutations
} from 'vuex'
var that
export default {
data() {
return {
imgUrl: '/static/images/tx.png',
userName: "学员01",
gender: "男",
studentNum: "ZZ202012058",
identity:0,
userdata:{
head_portrait:''
}
}
},
onLoad(option) {
console.log(option);
this.identity=uni.getStorageSync('identity')
},
methods: {
getimg(img){
return this.$service.getimg(img)
},
logout_fuc(){
uni.reLaunch({
url:'/pages/login/login'
})
}
}
}
</script>
<style lang="scss" scoped>
.oneSetting {
position: relative;
}
.content-wrap {
height: auto;
background: #FFFFFF;
border-radius: 20rpx;
position: absolute;
top: 16rpx;
left: 50%;
transform: translate(-50%, 0);
.content-head-wrap {
width: 100%;
height: 340rpx;
justify-content: center;
align-items: center;
border-bottom: #eeeeee 1px solid;
.content-head-img {
width: 164rpx;
height: 164rpx;
border-radius: 50%;
image {
width: 164rpx;
height: 164rpx;
border-radius: 50%;
}
}
}
.content-item {
width: 100%;
height: 90rpx;
border-bottom: #eeeeee 1px solid;
padding: 0 28rpx;
justify-content: space-between;
align-items: center;
font-size: 30rpx;
font-family: PingFang SC;
font-weight: 400;
color: #5B6476;
.user-name {
font-size: 30rpx;
font-family: PingFang SC;
font-weight: 400;
color: #A9B1C0;
}
}
.sign-out{
width: 100%;
height: 112rpx;
line-height: 112rpx;
text-align: center;
font-size: 30rpx;
font-family: PingFang SC;
font-weight: 400;
color: #2D81FF;
}
}
</style>