<template>
	<view class="partner">
		<!-- 表单组件 -->
		<view v-if="userInfo" class="form-wrapper">
			<u-form label-width="240rpx">
				<u-form-item label="会员ID" prop="name">
					{{userInfo.user_id}}
				</u-form-item>
				<u-form-item label="头像" prop="name">
					<image :src="userInfo.avatar_url" mode="widthFix" class="logo"></image>
				</u-form-item>
				<u-form-item label="昵称" prop="name">
					{{userInfo.nick_name}}
				</u-form-item>
				<u-form-item label="手机号码" prop="name">
					{{userInfo.mobile}}
				</u-form-item>
			</u-form>
		</view>
		<!-- 操作按钮 -->
		<!-- <view class="footer">
			<view class="btn">
				<u-button type="primary" shape="circle">更新资料</u-button>
			</view>
		</view> -->
	</view>
</template>

<script>
	import * as UserApi from '@/api/user'
	import SelectRegion from '@/components/select-region/select-region'
	export default {
		components: {
			SelectRegion
		},
		data() {
			return {
				disabled: false,
				userInfo: null,
			}
		},
		onLoad() {
			this.getUserInfo()
		},
		methods: {
			// 获取当前用户信息
			getUserInfo() {
				const app = this
				const userInfo = uni.getStorageSync('userInfo')
				if(userInfo){
					app.userInfo = userInfo
					return
				}
				UserApi.info().then(result => {
					app.userInfo = result.data.userInfo
				})
			},
			groupChange(){
				
			}
		}
	}
</script>

<style lang="less">
	.partner {
		
		.banner {
			width: 100%;
		}
		.form-wrapper {
			margin: 20rpx auto 20rpx auto;
			padding: 0 40rpx;
			width: 94%;
			box-shadow: 0 1rpx 5rpx 0px rgba(0, 0, 0, 0.05);
			border-radius: 16rpx;
			background: #fff;
			.logo{
				width: 100rpx;
			}
			.shipin{
				width: 400rpx;
			}
		}
		.footer{
			width: 500rpx;
			margin: 20rpx auto;
		}
	}
</style>
