<template>
	<view>
		<view class="con">
			<view class="flex item">
				<view>用户名：</view>
				<input v-model="person.name" />
			</view>
			<view class="flex item">
				<view>手机号：</view>
				<input v-model="person.phone" />
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				person: {}
			}
		},
		onLoad() {
			this.getSelfInfo()
		},
		methods: {
			// 查看个人信息
			getSelfInfo() {
				this.http.request({
					url: '/sp-admin/app/AppUser/getSelfInfo',
					success: res => {
						this.person = res.data.data
					}
				});
			},
			// 修改个人信息
			updateUser(){
				this.http.request({
					url: '/sp-admin/app/AppUser/update',
					success: res => {
						uni.showModal({
							content: '修改成功',
							showCancel: false
						}),
						this.getSelfInfo()
					}
				});
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: $pg;
	}
	
	.con{
		background-color: #fff;
		margin: 20px;
		padding: 10px;
		border-radius: 10px;
		height: 200px;
		border: 1px #fff solid;
	}
	.item{
		height: 50px;
		display: flex;
		align-items: center;
		border-bottom: 1px #dcdcdc solid;
	}
</style>
