<template>
	<view>
		<status-container titlet="基本资料" returnc="#FFFFFF">
			<view slot="content" style="margin-top: -20rpx;">
				<view class="bacf pad-x50 pad-zy20">
					<view class="pad-sx30 pad-zy10 disjbac bbot">
						<view class="fon24 col26">头像</view>
						<view class="disac">
							<image class="radius_100" src="https://s6.jpg.cm/2022/02/14/L4oDhy.jpg" mode="aspectFill" style="width: 92rpx;height: 92rpx;"></image>
							<view class="icon icon-next fon24 mar-z10" style="color: #7f7f7f;"></view>
						</view>
					</view>
					<view class="pad-sx30 fon24 pad-zy10 disjbac bbot">
						<view class="col26">昵称</view>
						<view class="disac">
							<view class="">zhengsnan</view>
							<view class="icon icon-next fon24 mar-z10" style="color: #FFFFFF;"></view>
						</view>
					</view>
					<view class="pad-sx30 fon24 pad-zy10 disjbac bbot" @tap="chooseEv(5)">
						<view class="col26">真实姓名</view>
						<view class="disac">
							<view class="">{{realName || '未填写'}}</view>
							<view class="icon icon-next fon24 mar-z10" style="color: #7f7f7f;"></view>
						</view>
					</view>
					<view class="pad-sx30 fon24 pad-zy10 disjbac bbot mar-x30" @tap="chooseEv(6)">
						<view class="col26">联系电话</view>
						<view class="disac">
							<view class="">{{phone || '未填写'}}</view>
							<view class="icon icon-next fon24 mar-z10" style="color: #7f7f7f;"></view>
						</view>
					</view>
				</view>
			</view>
		</status-container>
		<dynamic-frame ref="refFrame" :showType="showType" :tipsTitle="tipsTitle" @returnEv="returnEv"></dynamic-frame>
	</view>
</template>

<script>
	import dynamicFrame from '@/components/dynamic-frame.vue';
	export default {
		components:{
			dynamicFrame
		},
		data() {
			return {
				showType:5,
				tipsTitle:'真实姓名',
				realName:'',//真实姓名字段
				phone:'',//联系电话
			}
		},
		methods: {
			// 发起修改
			chooseEv(index){
				this.showType = index;
				this.tipsTitle = index==5?'真实姓名':'电话号码';
				this.$refs.refFrame.ifLogistics = true;
				this.$refs.refFrame.ifAnimated = true;
				if(this.showType==5){
					this.$refs.refFrame.dynamicObj.content = this.realName || '';
					this.$refs.refFrame.tempText = JSON.parse(JSON.stringify(this.realName || ''));
				}
				if(this.showType==6){
					this.$refs.refFrame.dynamicObj.content = this.phone || '';
					this.$refs.refFrame.tempText = JSON.parse(JSON.stringify(this.phone || ''));
				}
			},
			
			//确认修改
			returnEv(obj){
				if(this.showType==5){
					this.realName = obj.content;
				}
				if(this.showType==6){
					this.phone = obj.content;
				}
			}
		}
	}
</script>

<style></style>
