<template>
  <view>
	<view class="boxt">
		<view class="tit">
			<image :src="titimg"></image>基本信息
		</view>
		<view class="flexcw">
			<view class="txt">法人姓名：<text>{{datainfo.corporationName}}</text></view>
			<view class="txt">用户类型：<text>{{kaType(datainfo.customerType,yhlxlist)}}</text></view>
		</view>
		<view class="txt">身份证号：<text>{{datainfo.corporationIdCard}}</text>
			<text class="txta ml8" v-if="datainfo.corporationFront||datainfo.corporationBack" @click="getDownGd(datainfo,'fasfz')">查看照片</text>
		</view>
		<view class="txt">居住地址：<text>{{datainfo.corporationAddress}}</text></view>
		<view class="txt">证件有效期：<text>{{datainfo.corporationExpirationDate}}</text></view>
		<view class="flexcw">
			<view class="txt">手机号码：<text>{{datainfo.corporationPhone}}</text></view>
			<view class="txt">家庭人口：<text>{{datainfo.familyPopulation}}人</text></view>
		</view>
		<view class="flexcw">
			<!-- <view class="txt">法人职业：<text>{{datainfo.corporationJob}}</text></view> -->
			<view class="txt">有无贷款：<text>{{datainfo.isLoan=='Y'?'有':'无'}}</text></view>
		</view>
		<!-- <view class="flexcw">
			<view class="txt">应收应付款：<text>10万元</text></view>
			<view class="txt">经营情况：<text class="txta" @click="getDown(a)">在线查看</text></view>
		</view>
		<view class="txt">经营效益：<text class="txta" @click="getDown(a)">在线查看</text></view> -->
	</view>
	<view class="boxt">
		<view class="tit">
			<image :src="titimg"></image>家庭婚姻信息
		</view>
		<view class="flexcw">
			<view class="txt">婚姻状态：<text>{{kaType(datainfo.corporationMaritalStatus,hyztlist)}}</text></view>
			<view class="txt">配偶姓名：<text>{{datainfo.spouseName}}</text></view>
		</view>
		<view class="txt">配偶身份证号：<text>{{datainfo.spouseIdCard}}</text>
			<text class="txta ml8" v-if="datainfo.spouseFront||datainfo.spouseBack" @click="getDownGd(datainfo,'posfz')">查看照片</text>
		</view>
		<view class="txt flext">结婚证：
			<view class="flex1 over">
				<block v-if="basicFj.frjhz&&basicFj.frjhz.length">
					<block v-if="basicFj.frjhz.length>1">
						<view v-for="(ite,idx) in basicFj.frjhz" class="filist over" @click="getDown(ite.url)" :key="idx">{{ite.name}}</view>
					</block>
					<text v-else class="txta" @click="getDown(basicFj.frjhz[0].url)">在线查看</text>
				</block>
			</view>
		</view>
		<view class="txt flext">离婚证：
			<view class="flex1 over">
				<block v-if="basicFj.frlhz&&basicFj.frlhz.length">
					<block v-if="basicFj.frlhz.length>1">
						<view v-for="(ite,idx) in basicFj.frlhz" class="filist over" @click="getDown(ite.url)" :key="idx">{{ite.name}}</view>
					</block>
					<text v-else class="txta" @click="getDown(basicFj.frlhz[0].url)">在线查看</text>
				</block>
			</view>
		</view>
	</view>
	<view class="boxt">
		<view class="tit">
			<image :src="titimg"></image>户籍信息
		</view>
		<view class="txt flext">户口簿首页：
			<view class="flex1 over">
				<block v-if="basicFj.frhkbsy&&basicFj.frhkbsy.length">
					<block v-if="basicFj.frhkbsy.length>1">
						<view v-for="(ite,idx) in basicFj.frhkbsy" class="filist over" @click="getDown(ite.url)" :key="idx">{{ite.name}}</view>
					</block>
					<text v-else class="txta" @click="getDown(basicFj.frhkbsy[0].url)">在线查看</text>
				</block>
			</view>
		</view>
		<view class="txt flext">户口簿(单页)：
			<view class="flex1 over">
				<block v-if="basicFj.frhkbbry&&basicFj.frhkbbry.length">
					<block v-if="basicFj.frhkbbry.length>1">
						<view v-for="(ite,idx) in basicFj.frhkbbry" class="filist over" @click="getDown(ite.url)" :key="idx">{{ite.name}}</view>
					</block>
					<text v-else class="txta" @click="getDown(basicFj.frhkbbry[0].url)">在线查看</text>
				</block>
			</view>
		</view>
	</view>
  </view>
</template>

<script>
	import config from '@/config'
	const baseUrl = config.baseUrl
	import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
	import { selectValue } from '@/utils/common.js';
	import noData from "@/components/nodata/nodata.vue"
  export default {
	props:{
		datainfo: {
			type: Object,
			default () {
				return {}
			}
		},
		yhlxlist:{
			type: Array,
			default () {
				return []
			}
		},
		hyztlist:{
			type: Array,
			default () {
				return []
			}
		},
		basicFj:{
			type: Object,
			default () {
				return {}
			}
		}
	},
	components:{
		noData
	},
	data(){
		return{
			titimg:require('@/work/static/images/infotit.png'),
		}
	},
	onLoad: function() {
	},
	methods:{
		checkPermi, checkRole,
		kaType(ite,list){
			return selectValue(list, ite);
		},
		getDown(url){
			this.$emit('getDown',url)
		},
		getPreview(url){
			this.$emit('getPreview',url)
		},
		getDownGd(ite,type){
			var url=[]
			if(type=='fasfz'){
				if(ite.corporationFront){
					var urla=baseUrl+ite.corporationFront;
					url.push(urla)
				}
				if(ite.corporationBack){
					var urlb=baseUrl+ite.corporationBack;
					url.push(urlb)
				}
			}else if(type=='posfz'){
				if(ite.spouseFront){
					var urla=baseUrl+ite.spouseFront;
					url.push(urla)
				}
				if(ite.spouseBack){
					var urlb=baseUrl+ite.spouseBack;
					url.push(urlb)
				}
			}
			uni.previewImage({
				current: 0,
				urls: url,
			});
		},
	},
	
  }
</script>

<style lang="scss" scoped>
.boxt{padding: 0 16rpx;border-top: 2rpx solid #E6E6E6;}
.tit{font-weight: bold;font-size: 30rpx;color: $com-cd3;display: flex;align-items: center;padding-top: 44rpx;margin-bottom: 50rpx;padding-left: 20rpx;
	image{width: 30rpx;height: 30rpx;margin-right: 14rpx;}
}
.txt{font-weight: bold;font-size: 30rpx;color: #222327;margin-bottom: 44rpx;padding-left: 20rpx;
	text{color: #666666;font-weight: 500;
		&.txta{color: #28C529;}
	}
	.filist{font-weight: 500;
		color: #28C529;margin-bottom: 8rpx;
	}
}
.flexcw{display: flex;
	.txt{min-width: 50%;}
}
</style>
