Blame view

pages/my/personalData/index.vue 2.57 KB
290144e9   易尊强   第一次
1
2
3
4
5
6
7
8
  <template>
  	<view class="personalData-v">
  		<u-cell-group>
  			<u-cell-item title="头像" :arrow="false">
  				<u-avatar :src="baseUrl+userInfo.headIcon" size="64" slot="right-icon"></u-avatar>
  			</u-cell-item>
  			<u-cell-item title="姓名" :value="userInfo.userInfo.userAccount" :arrow="false"></u-cell-item>
  			<u-cell-item title="性别" :value="gender" :arrow="false"></u-cell-item>
6c679290   易尊强   3/6a上午
9
  			<u-cell-item title="所属公司" :value="userInfo.userInfo.organizeName" :arrow="false" v-if="userInfo.userInfo.userId !== '360267753694692613'"></u-cell-item>
290144e9   易尊强   第一次
10
11
12
  			<!-- <u-cell-item title="手机号" :value="userInfo.mobilePhone" :arrow="false"></u-cell-item> -->
  			<!-- <u-cell-item title="邮箱" :value="userInfo.email" :arrow="false"></u-cell-item> -->
  		</u-cell-group>
6c679290   易尊强   3/6a上午
13
  		<button type="primary" style="width: 90%;margin: 0 auto;border-radius: 20rpx; background-color: #D32D25;color: white;margin-top: 100rpx;" @click="loginOut">退出登录</button>
290144e9   易尊强   第一次
14
15
16
17
18
19
20
21
22
23
  	</view>
  </template>
  
  <script>
  	export default {
  		data() {
  			return {
  				gender: '',
  				birthday: '',
  				userInfo: {},
9b1c150c   “wangming”   1
24
  				baseUrl:'https://www.dygxq-es.cn',
6c679290   易尊强   3/6a上午
25
  				
290144e9   易尊强   第一次
26
27
28
29
30
31
32
33
34
  			}
  		},
  		computed: {
  			baseURL() {
  				return this.define.baseURL
  			}
  		},
  		onLoad() {
  			this.userInfo = uni.getStorageSync('user') || {};
6c679290   易尊强   3/6a上午
35
  			
290144e9   易尊强   第一次
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
  			console.log(this.userInfo)
  			this.gender = this.userInfo.gender == 1 ? '男' : this.userInfo.gender == 2 ? '女' : '保密'
  			this.birthday = this.userInfo.birthday ? this.$u.timeFormat(this.userInfo.birthday, 'yyyy-mm-dd') : ''
  		},
  		methods:{
  			// 退出登录
  			loginOut(){
  				console.log('1111')
  				
  				uni.showModal({
  					title: '提示',
  					content: '确定退出当前账号吗?',
  					success: res => {
  						if (res.confirm) {
  							uni.removeStorage({
  								key: 'user',
  								// success: function (res) {
  								// 	uni.showToast({
  								// 		icon:'success',
  								// 		title:'已退出登录',
  								// 		duration:'1'
  								// 	})
  								// }
  							});
  							uni.removeStorage({
  								key: 'AuthToken_KEY',
  								success: function (res) {
  									console.log(res)
  									// uni.showToast({
  									// 	icon:'success',
  									// 	title:'已退出登录'
  									// })
  								}
  							});
  							uni.removeStorage({
  								key: 'token',
  								success: function (res) {
  									console.log(res)
  									// uni.showToast({
  									// 	icon:'success',
  									// 	title:'已退出登录'
  									// })
  								}
  							});
  							uni.reLaunch({
  								url:'/pages/home/home'
  							})
  						}
  					}
  				})
  				
  			}
  		}
  	}
  </script>
  
  <style lang="scss">
  	page {
  		background-color: #f0f2f6;
  	}
  </style>