<template>
	<view class="information">
		<view class="info-avatar">
			<u-avatar :src="userInfo.member_avatar + '?' + new Date().getTime()" :size="120"></u-avatar>
		</view>
		<view class="info-item">
			<view class="title">昵称</view>
			<view class="value">{{ userInfo.member_nickname }}</view>
		</view>
		<view class="info-item">
			<view class="title">性别</view>
			<view class="value">{{ userInfo.member_sex == 1 ? '男' : '女' }}</view>
		</view>
		<view class="info-item">
			<view class="title">生日</view>
			<view class="value">{{ userInfo.member_birthday }}</view>
		</view>
		<view class="info-item">
			<view class="title">手机号</view>
			<view class="value">{{ userInfo.member_mobile }}</view>
		</view>
		<view class="info-item">
			<view class="title">等级</view>
			<view class="value">{{ userInfo.member_level }}</view>
		</view>
		<view class="info-item">
			<view class="title">积分数</view>
			<view class="value">{{ userInfo.member_points }}</view>
		</view>
		<view class="info-item">
			<view class="title">经验值</view>
			<view class="value">{{ userInfo.member_exppoints }}</view>
		</view>
	</view>
</template>
<script>
import common from '@/static/js/common.js'
export default {
	data() {
		return {
			userInfo: {}
		}
	},
	onShow() {
		this.getUserInfo();
	},
	onNavigationBarButtonTap() {
		this.toEditPage();
	},
	methods: {
		getUserInfo() {
			this.$u.api.getMemberInfo().then(res => {
				if (res.errCode == 0) {
					// this.userInfo = res.data.MemberArray;
					this.$set(this, 'userInfo', res.data.MemberArray);
				}
			})
		},
		toEditPage() {
			uni.navigateTo({
				url: '/pageE/mine/EditUserInfo'
			});
		}
	},
};
</script>
<style lang="scss" scoped>
.information {
	min-height: calc(100vh - var(--window-top));
	background-color: #ECECEC;
	padding-top: 1rpx;
	.info-avatar {
		display: flex;
		align-items: center;
		justify-content: center;
		height: 160rpx;
		background: rgba(255,255,255,1);
	}
	.info-item {
		display: flex;
		align-items: center;
		padding: 35rpx 30rpx;
		border-top: 2rpx solid #ECECEC;
		font-size: 30rpx;
		height: 98rpx;
		background: rgba(255,255,255,1);
		.title {
			width: 240rpx;
			color: rgba(51,51,51,1);
		}
		.value {
			color: rgba(102,102,102,1);
		}
	}
}
</style>