<template>
	<view class="content">
		<view class="cell-group">
			<view class="hflex acenter jbetween cell">
				<view class="left">手机号码</view>
				<view class="hflex acenter">
					<view class="right">{{user.contact_phone}}</view>
					<!-- <u-icon name="arrow-right" color="#000" size="10"></u-icon> -->
				</view>
			</view>
			<view class="hflex acenter jbetween cell" @click="bindEmail">
				<view class="left">邮箱</view>
				<view class="hflex acenter">
					<view class="right">{{user.contact_mail?user.contact_mail:'去绑定'}}</view>
					<u-icon name="arrow-right" color="#000" size="10"></u-icon>
				</view>
			</view>
		</view>
		<view class="cell-group">
			<view class="hflex acenter jbetween cell" @click="editPwd">
				<view class="left">密码</view>
				<view class="hflex acenter">
					<view class="right">修改密码</view>
					<u-icon name="arrow-right" color="#000" size="10"></u-icon>
				</view>
			</view>
			<!-- <view class="hflex acenter jbetween cell">
				<view class="left">账号注销</view>
				<view class="hflex acenter">
					<u-icon name="arrow-right" color="#000" size="10"></u-icon>
				</view>
			</view> -->
		</view>
	</view>
</template>

<script>
	import $api from '@/static/js/api.js'
	var that = ''
	export default {
		data() {
			return {
				user: {}
			}
		},
		onLoad() {
			that = this
		},
		onShow() {
			that.getUser()
		},
		methods: {
			// 获取账户信息
			getUser() {
				$api.req({
					url: '/data/api.business.User/user_info',
					method: 'POST'
				}, function(res) {
					if(res.code == 1) {
						that.user = res.data
					}
				})
			},
			// 绑定邮箱
			bindEmail() {
				$api.jump('/pages/mine/service/setting/bind_eMail?type=email')
			},
			// 修改密码
			editPwd() {
				$api.jump('/pages/mine/service/setting/edit_pwd')
			}
		},
	}
</script>

<style lang="scss" scoped>
	.content {
		background-color: #f5f5f5;
		.cell-group {
			width: 100%;
			background-color: #fff;
			margin-top: 20rpx;
			padding: 0 30rpx;
			box-sizing: border-box;
			.cell {
				box-sizing: border-box;
				padding: 36rpx 0;
				border-bottom: 1rpx solid #f5f5f5;
				.left {
					font-size: 30rpx;
					color: #222;
				}
				.right {
					padding: 0 5rpx;
					font-size: 30rpx;
					color: #444;
				}
				.red {
					width: 12rpx;
					height: 12rpx;
					border-radius: 50%;
					background-color: #fb3e32;
				}
				.avatar {
					width: 88rpx;
					height: 88rpx;
					border-radius: 50%;
				}
			}
			.button {
				font-size: 36rpx;
				color: #506dff;
				padding: 20rpx 0;
			}
		}
	}
</style>