<template>
	<view class="content" v-if="base.name">
		<view class="item-flex">
			<label>姓名</label>
			<view class="value">{{base.name || '-'}}</view>
		</view>
		<view class="item-flex">
			<label>性别</label>
			<view class="value">{{base.sex || '-'}}</view>
		</view>
		<view class="item-flex">
			<label>年龄</label>
			<view class="value">{{base.age || '-'}}</view>
		</view>
		<view class="item-flex">
			<label>属相</label>
			<view class="value">{{base.zodiak || '-'}}</view>
		</view>
		<view class="item-flex">
			<label>婚姻</label>
			<view class="value">{{base.marriages[base.marriage] || '-'}}</view>
		</view>
		<view class="item-flex">
			<label>配偶姓名</label>
			<view class="value">{{base.mate || '-'}}</view>
		</view>
		<view class="item-flex">
			<label>学历</label>
			<view class="value">{{base.educations[base.education] || '-'}}</view>
		</view>
		<view class="item-flex">
			<label>毕业院校</label>
			<view class="value">{{base.school || '-'}}</view>
		</view>
		<view class="item-flex">
			<label>身份证号</label>
			<view class="value">{{base.id_card || '-'}}</view>
		</view>
		<view class="item-flex">
			<label>身份证地址</label>
			<view class="value">{{base.address || '-'}}</view>
		</view>
		<view class="item-flex">
			<label>联系电话</label>
			<view class="value">{{base.mobile || '-'}}</view>
		</view>
		<view class="item-flex">
			<label>联系地址</label>
			<view class="value">{{base.contact_address || '-'}}</view>
		</view>
	</view>
</template>

<script>
	import { perfectBase } from '@/apis/interfaces/order.js'
	export default {
		data() {
			return {
				base: {}
			};
		},
		created() {
			uni.showLoading({
				title: '加载中...',
				mask : true
			})
			perfectBase(this.$Route.query.orderId).then(res => {
				let { base } = res;
				this.base = base
				uni.hideLoading()
			}).catch(err => {
				uni.showToast({
					title: err.message,
					icon : 'none'
				})
			})
		}
	}
</script>

<style lang="scss">
	.content{
		padding: 30rpx 0;
	}
	.item-flex{
		display: flex;
		justify-content: space-between;
		padding: 30rpx;
		position: relative;
		line-height: 40rpx;
		align-items: center;
		background: white;
		label{
			width: 200rpx;
			font-size: 30rpx;
			color: gray;
			@extend .nowrap;
		}
		.value{
			text-align: right;
			width: calc( 100% - 200rpx );
			font-size: 30rpx;
		}
		@extend .border-solid;
		&::after{
			left: 30rpx;
		}
		&:last-child::after{
			display: none;
		}
	}
</style>
