account-center.vue 3.7 KB
<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>