<template>
	<view class="detail">
		
		<view class="dnlist" >
			<view class="dnlist_tit">基本信息</view>
			<view class="dnlist_box">
				
				<!-- 阴性 -->
				<!-- <image :src="nuysimg" class="dnlist_yimg" v-if="nucStatus=='Yi'"></image> -->
				<!-- 阳性 -->
				<!-- <image :src="nuyimg" class="dnlist_yimg" v-else></image> -->
				<view class="dnlist_flex">
					<view class="dnlist_fa">身份证号</view>
					<view class="dnlist_fb">{{formData.zjhm||""}}</view>
				</view>
				<view class="dnlist_flex">
					<view class="dnlist_fa">姓名</view>
					<view class="dnlist_fb">{{formData.xm||""}}</view>
				</view>
				<view class="dnlist_flex"v-if='type==1'>
					<view class="dnlist_fa">联系电话(人口信息登记)</view>
					<view class="dnlist_fb">{{formData.phoneNum||""}}</view>
				</view>
				<view class="dnlist_flex">
					<view class="dnlist_fa">联系电话(核酸检测登记)</view>
					<view class="dnlist_fb">{{formData.lxdh||""}}</view>
				</view>
			</view>
		</view>
		<view v-if="type==1">
			<view class="dnlist" v-if="navidx==1">
				<view class="dnlist_tit">户籍信息</view>
				<view class="dnlist_box">
					<view class="dnlist_flex">
						<view class="dnlist_fa">户籍地址</view>
						<view class="dnlist_fb">{{formData.domicileSelect||""}}</view>
					</view>
					<view class="dnlist_flex">
						<view class="dnlist_fa">详细地址</view>
						<view class="dnlist_fb">{{formData.nowIn||""}}</view>
					</view>
				</view>
			</view>
			<!-- 常住 -->
			<view class="dnlist" v-else>
				<view class="dnlist_tit">居住信息</view>
				<view class="dnlist_box">
					<view class="dnlist_flex">
						<view class="dnlist_fa">居住地址</view>
						<view class="dnlist_fb">{{formData.nowInSelect||""}}</view>
					</view>
					<view class="dnlist_flex">
						<view class="dnlist_fa">详细地址</view>
						<view class="dnlist_fb">{{formData.nowXjd||""}}</view>
					</view>
				</view>
			</view>
		</view>
		
		<view class="dnlist">
			<view class="dnlist_tit">核酸信息</view>
			<view class="dnlist_box">
				<view class="dnlist_flex" v-if="type!=1">
					<view class="dnlist_fa">采集乡镇</view>
					<view class="dnlist_fb">{{formData.cjssxq||''}}</view>
				</view>
				<view class="dnlist_flex">
					<view class="dnlist_fa">采集时间</view>
					<view class="dnlist_fb">{{formData.cjsj||''}}</view>
				</view>
				<view class="dnlist_flex">
					<view class="dnlist_fa">采集地点</view>
					<view class="dnlist_fb">{{formData.cjdd||''}}</view>
				</view>
				<view class="dnlist_flex">
					<view class="dnlist_fa">审核时间</view>
					<view class="dnlist_fb">{{formData.jcsj||''}}</view>
				</view>
				<view class="dnlist_flex">
					<view class="dnlist_fa">检验点名称</view>
					<view class="dnlist_fb">{{formData.jcdd||''}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				nuyimg:require("@/static/image/nuy.png"),
				nuysimg:require("@/static/image/nuyi.png"),
				show:false,
				formData:{},
				params:{
					zjhm:'',
					cjsj:'',
				},
				navidx:"",//1户籍 0 常住
				nucStatus:'Yi',
				nucleicAcidStatus:'',
				nucstatuslist:[],
				type:'0'
			}
		},
		onLoad(option) {
			this.type=option.type
			if(option.type==1){
				this.params.zjhm = option.zjhm;
				this.params.cjsj = option.cjsj;
				this.navidx=option.navidx;
				this.getDetail();
				
			}else{
				var id=option.id;
				this.getDetailId(id);
			}
		},
		methods:{
			nucstatusFn(ite){
				 return this.selectDictLabel(this.nucstatuslist,ite)	
			},
			// 回显数据字典
			selectDictLabel(datas, value) {
				var actions = [];
				Object.keys(datas).some((key) => {
					if (datas[key].dictValue == ('' + value)) {
						actions.push(datas[key].dictLabel);
						return true;
					}
				})
				return actions.join('');
			},
			init(){
				this.nucleicAcidStatusFn()
				// this.frequencyFn()
			},
			getDetailId(e){
				this.$http.get('boman-web-core/core/account/nucleicAcid/detailedJcd/'+e).then(res => {
					if(res.code==200){
						this.formData=res.data;
					}else{
						uni.showToast({
							title: res.msg,
							duration: 1000,
							icon: 'none'
						});
					}
				})
			},
			getDetail(){
				// console.log(this.params)
				this.$http.get('boman-web-core/core/account/nucleicAcid/detailedInfo',this.params).then(res => {
					if(res.code==200){
						this.formData=res.data;
					}else{
						uni.showToast({
							title: res.msg,
							duration: 1000,
							icon: 'none'
						});
					}
				})
			},
			// 核酸状态的字典值
			nucleicAcidStatusFn(){
				var that = this;
				this.$http.get('system/dict/data/type/sys_hsjl_nucleicAcidStatus').then(res => {
					if (res.code == 200) {
						that.nucstatuslist = res.data;
						// this.nucstatusclass = res.data.map(v => {
						// 	return {
						// 		label: v.dictLabel,
						// 		value: v.dictValue
						// 	}
						// })
					}
				})
			},
			//次数字典值
			// frequencyFn(){
			// 	var that = this;
			// 	this.$http.get('system/dict/data/type/sys_hsjl_frequency').then(res => {
			// 		if (res.code == 200) {
			// 			if (that.formData.hsjlCount) {
			// 				that.hsjlCount = that.selectDictLabel(res.data, that.formData.hsjlCount)
			// 			}
			// 			that.hsjlCountlist = res.data;
			// 			this.hsjlCountclass = res.data.map(v => {
			// 				return {
			// 					label: v.dictLabel,
			// 					value: v.dictValue
			// 				}
			// 			})
			// 		}
			// 	})
			// },
			
		}
	}
</script>

<style scoped>
	.detail{min-height: 100vh;background: #F2F2F2;}
.dnlist_tit{width: 100%;background: #F2F2F2;padding: 14rpx 32rpx;box-sizing: border-box;font-size: 24rpx;font-weight: 500;color: #666666;line-height: 40rpx;}
.dnlist_box{background: #FFFFFF;padding:2rpx 32rpx;position: relative;}	
.dnlist_flex{display: flex;align-items: flex-start;line-height: 40rpx;padding: 24rpx 0;}
.dnlist_fa{flex: 0 0 auto;font-size: 28rpx;font-weight: 500;color: #343434;min-width:160rpx ;}
.dnlist_fb{flex: 1;font-size: 28rpx;color: #343434;margin-left: 16rpx;text-align: right;}
.dnlist_fb.col0{color:#00B034;}
.dnlist_fb.colf{color:#FF0000;}
.dnlist_yimg{width: 136rpx;height: 118rpx;position: absolute;right: 74rpx;top: 46rpx;}
</style>
