account-center.vue
3.7 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
<template>
<view class="setting">
<view class="cell top">
<u-cell-group :border="false">
<!-- <u-cell-item @click="link('info')" :border-bottom="true" title="账号信息"
:title-style="{padding:'0 0 0 14rpx', color:'rgba(0,0,0,0.9)', fontSize:'34rpx'}" :arrow="true"
arrow-direction="right">
</u-cell-item>
<u-cell-item @click="link('relevance')" :border-bottom="true" title="账号绑定关系"
:title-style="{padding:'0 0 0 14rpx', color:'rgba(0,0,0,0.9)', fontSize:'34rpx'}" :arrow="true"
arrow-direction="right">
</u-cell-item> -->
<u-cell-item :border-bottom="true" title="账号名" :value="vuex_user.name"
:title-style="{padding:'0 0 0 14rpx', color:'rgba(0,0,0,0.9)', fontSize:'34rpx'}" :arrow="false">
</u-cell-item>
<u-cell-item @click="link('mobile')" :border-bottom="true" title="绑定手机" :value="vuex_user.mobile?replaceTextToStar(vuex_user.mobile):''"
:title-style="{padding:'0 0 0 14rpx', color:'rgba(0,0,0,0.9)', fontSize:'34rpx'}" :arrow="true"
arrow-direction="right">
</u-cell-item>
</u-cell-group>
</view>
<view class="cell top">
<u-cell-group :border="false">
<u-cell-item @click="link('cancel')" :border-bottom="true" title="账号注销"
:title-style="{padding:'0 0 0 14rpx', color:'rgba(0,0,0,0.9)', fontSize:'34rpx'}" :arrow="true"
arrow-direction="right">
</u-cell-item>
</u-cell-group>
</view>
<view class="cell top">
<u-cell-group :border="false">
<u-cell-item :border-bottom="true" title="注册时间" :value="getCreatedTime()"
:title-style="{padding:'0 0 0 14rpx', color:'rgba(0,0,0,0.9)', fontSize:'34rpx'}" :arrow="false">
</u-cell-item>
<!--
<u-cell-item :border-bottom="true" title="最近登录时间" :value="getLastLoginTime()"
:title-style="{padding:'0 0 0 14rpx', color:'rgba(0,0,0,0.9)', fontSize:'34rpx'}" :arrow="false">
</u-cell-item> -->
</u-cell-group>
</view>
</view>
</template>
<script>
import {
replaceTextToStar
} from '@/common/commonUtil.js'
import {
mapState,
mapActions
} from 'vuex'
export default {
data() {
return {
replaceTextToStar,
}
},
// computed: {
// ...mapState({
// getCreatedTime(state) {
// let createdTime = this.vuex_user.createdTime;
// return createdTime > 0 ? this.$u.timeFormat(createdTime, 'yyyy年mm月dd日 hh:MM:ss') : '';
// },
// getLastLoginTime(state) {
// let lastLoginTime = this.vuex_user.lastLoginTime;
// return lastLoginTime > 0 ? this.$u.timeFormat(lastLoginTime, 'yyyy年mm月dd日 hh:MM:ss') : '';
// },
// }),
// },
methods: {
getCreatedTime() {
let createdTime = this.vuex_user.created_at;
return createdTime > 0 ? this.$u.timeFormat(createdTime, 'yyyy年mm月dd日 hh:MM:ss') : '';
},
getLastLoginTime() {
let lastLoginTime = this.vuex_user.lastLoginTime;
return lastLoginTime > 0 ? this.$u.timeFormat(lastLoginTime, 'yyyy年mm月dd日 hh:MM:ss') : '';
},
link(type) {
switch (type) {
case 'info':
this.$u.route('/pages/student/my/account-info/account-info');
break;
case 'relevance':
this.$u.route('/pages/student/my/account-relevance/account-relevance');
break;
// case 'mobile':
// this.$u.route('/pages/student/my/edit-mobile/edit-mobile');
// break;
case 'cancel':
this.$u.route('/pages/student/my/remove-account/remove-account');
break;
}
},
}
}
</script>
<style lang="scss" scoped>
.setting {
width: 100%;
height: 100%;
background-color: #F7F7F7;
.top {
margin: 32rpx 0;
}
.cell /deep/ .u-cell {
padding: 56rpx 32rpx;
}
}
</style>