<template>
	<view class="phone-jianli-page">
		<view class="icon-title-navBar-box">
			<text class="nav-bar-title">家政人员信息</text>
		</view>
		<view class="jianli-wrap-box">
			<view class="jianli-head-box">
				<view class="head-img-box">
					<img class="head-img" :src="jianliInfo.icon" v-if="jianliInfo.icon">
					<icon class="phone-default-userImg" v-else></icon>
					<view class="head-status" v-if="jianliInfo.zhuangtai">{{jianliInfo.zhuangtai}}</view>
				</view>
				<view class="head-content-box">
					<view class="name-row">{{jianliInfo.realName}}</view>
					<view>
						{{jianliInfo.jiguanShengName === jianliInfo.jiguanShiName ? jianliInfo.jiguanShengName  : `${jianliInfo.jiguanShengName} ${jianliInfo.jiguanShiName}`}}人
					</view>
					<view>
						<text>{{jianliInfo.nianling}}岁</text>
						<text v-if="jianliInfo.jingyan"> | {{jianliInfo.jingyan}}</text>
					</view>
				</view>
			</view>

			<view class="jianli-body-box">
				<view v-if="jianliInfo.zyNames" class="leixing-row">
					<view class="jbxx-label">职 业：</view>
					<text class="leixing-content">{{jianliInfo.zyNames}}</text>
				</view>
				<view class="body-jbxx-box">
					<view class="jbxx-title">基本信息</view>
					<view>
						<view class="jbxx-label">学 历：</view>{{jianliInfo.xueli}}
					</view>
					<view>
						<view class="jbxx-label">民 族：</view>{{jianliInfo.minzu}}
					</view>
					<view v-if="jianliInfo.xingzuoFla =='true'">
						<view class="jbxx-label">属 相：</view>{{jianliInfo.shuxiang}}
					</view>
					<view v-if="jianliInfo.xingzuoFla =='true'">
						<view class="jbxx-label">星 座：</view>{{jianliInfo.xingzuo}}
					</view>
					<view>
						<view class="jbxx-label">性 别：</view>{{jianliInfo.gender}}
					</view>
					<view>
						<view class="jbxx-label">技能：</view>{{jianliInfo.jineng}}
					</view>
					<view>
						<view class="jbxx-label">出生日期：</view>{{jianliInfo.birthday}}
					</view>
					<view>
						<view class="jbxx-label">求职类型：</view>{{jianliInfo.leixing}}
					</view>
					<view>
						<view class="jbxx-label">婚姻状况：</view>{{jianliInfo.hunyin}}
					</view>
					<view>
						<view class="jbxx-label">现住地址：</view>{{jianliInfo.juzhuDizhi}}
					</view>
					<view>
						<view class="jbxx-label">家政公司：</view>{{jianliInfo.jzName}}
					</view>
					<view>
						<view class="jbxx-label">工作经历：</view>{{jianliInfo.jingli}}
					</view>
					<view>
						<view class="jbxx-label">级别薪资：</view>{{jianliInfo.jibiexinzi}}
					</view>
				</view>
			</view>
			<view class="jbxx-tip">{{jianliInfo.tips}} </view>
			<button type="default" @click="callPhone" class="phone-green-btn jbxx-tel-btn">联系电话</button>
			
		</view>
	</view>
</template>
<script>
	import {
		ref
	} from "vue";
	import {
		commonShare
	} from "@/api/jiazheng.js";
	export default {
		data() {
			return {
				pageInfo: {},
				jianliInfo: {}
			}
		},
		components: {

		},
		onLoad(options) {
			this.pageInfo.uuid = options.uuid;
			if(this.pageInfo.uuid){
							this.getJianliInfo()
			}else{
				uni.showToast({
					title: '获取内容失败',
					icon: 'none',
					duration: 2000
				})
				return false
			}

		},
		methods: {
			getJianliInfo() {
				let req = {
					uuid: this.pageInfo.uuid,
				}
				commonShare(req).then(res => {
					console.log('res', res);
					if (res.code == 0) {
						this.jianliInfo = {
							...res.data
						};
					}
				})
			},
			callPhone() {
				if (this.jianliInfo.userName) {
					uni.makePhoneCall({
						phoneNumber: this.jianliInfo.userName
					});
				} else {
					uni.showToast({
						title: `无电话号`,
						icon: 'none',
						duration: 2000
					})
					return false
				}

			},

		}
	}
</script>