<template>
	<view class="irecord">
		<view class="ctop flexc">
			<image :src="carc" class="imgs" v-if="datainfo.type==1"></image>
			<image :src="card" class="imgs" v-if="datainfo.type==2"></image>
			<view class="tit">皖A IC520</view>
			<view class="flex1"></view>
			<view class="txt ca" v-if="datainfo.type==1">小区车辆</view>
			<view class="txt cb" v-if="datainfo.type==2">外来车辆</view>
		</view>
		<view class="pdlr12">
			<view class="clists bgef">
				<view class="clist"><view class="tit">关联房号：</view>12#1403</view>
				<view class="clist"><view class="tit">手机号码：</view>13656788668</view>
			</view>
		</view>
		
		<view class="chtop flexc">
			<image :src="line"></image>
			<view>违停记录</view>
			<view class="flex1"></view>
			<view class="num coff">本年度已违停3次</view>
		</view>
		<!-- 步骤条 -->
		<view class="steps">
			<image :src="icoa" class="circle"></image>
			<view class="step">
				<view class="slist">
					<view class="tit">登记时间：</view>2024-11-27 10:03:27
				</view>
				<view class="slist">
					<view class="tit">违停拍照：</view>
					<view class="imgas">
						<image :src="carc" @click="getPreview(idx,carc)"></image>
						<image :src="carc"></image>
						<image :src="carc"></image>
						<image :src="carc"></image>
					</view>
				</view>
			</view>
		</view>
		<view class="steps">
			<!-- <image :src="icoa" class="circle"></image> -->
			<image :src="icob" class="circle"></image>
			<view class="step">
				<view class="slist">
					<view class="tit">登记时间：</view>2024-11-27 10:03:27
				</view>
				<view class="slist">
					<view class="tit">违停拍照：</view>
					<view class="imgas">
						<image :src="carc" @click="getPreview(idx,carc)"></image>
						<image :src="carc"></image>
						<image :src="carc"></image>
						<image :src="carc"></image>
					</view>
				</view>
			</view>
		</view>
		<view class="rfbtn" @click="getNext">解除黑名单</view>
		<loading></loading>
	</view>
</template>

<script>
	import config from '@/config'
	import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
	export default{
		components:{},
		data(){
			return{
				line:require('@/car/static/car/line.png'),
				carc:require('@/car/static/car/carc.png'),
				card:require('@/car/static/car/card.png'),
				icoa:require('@/car/static/car/icoa.png'),
				icob:require('@/car/static/car/icob.png'),
				baseUrl:config.baseUrl,
				datainfo:{
					type:1,heiflag:true
				},
			}
		},
		onLoad: function() {
		
		},
		methods:{
			checkPermi, checkRole,
			getPreview(idx,arr) {
				var newArr=[];
				arr.forEach(ite=>{
					var ds=this.baseUrl+ite
					newArr.push(ds)
				})
				uni.previewImage({
					urls: newArr,
					current:idx,
					success: function(data) {},
					fail: function(err) {}
				});
			},
			getDelFn(){
				var that=this;
				uni.showModal({
					title: '解除黑名单',
					content: "是否确认解除",
					cancelText: '取消',
					confirmText: '确认',
					success: function(res) {
						if (res.confirm) {
							// that.filelist.splice(idx,1)
						} else if (res.cancel) {
						}
					}
				});
			},
			getOcrIdCard(obj){
				var params={
					image:obj.url,
					idCardSide:obj.type
				}
				getOcrIdCard(params).then(res=>{
					if(res.code==200){
						var datainfo=res.data;
						if(obj.type=='front'){
							this.datainfo.realName=datainfo.realName;
							this.datainfo.idCard=datainfo.idCard;
							this.datainfo.address=datainfo.address;
						}else{
							this.datainfo.expirationDate=datainfo.expirationDate
						}
					}
				})
			}
		}
	}
</script>
<style lang="scss" scoped>
.bgef{background: #EFF4FF;}
.irecord{background: #FFFFFF;border-radius: 20rpx;flex: 1;padding-bottom: 110rpx;
	.ctop{padding:20rpx 48rpx;margin-bottom:14rpx;
		.imgs{width: 30rpx;height: 24rpx;margin-right: 12rpx;}
		.tit{font-size: 32rpx;color: #272727;font-weight: bold;margin-right: 14rpx;}
		.txt{font-weight: 500;font-size: 24rpx;
			&.ca{color: #0256FD;}
			&.cb{color: #FE5A0E;}	
		}
	}
	.clists{padding: 22rpx 40rpx 22rpx;border-radius: 20rpx;box-sizing: border-box;
			.clist{font-size: 26rpx;color: #272727;display: flex;line-height: 52rpx;
				.tit{font-size: 26rpx;color: #272727;flex: 0 0 auto;min-width: 108rpx;text-align-last: justify;font-weight: bold;}		
			}
		}
	.chtop{padding-top: 36rpx;margin-bottom: 32rpx;padding-right: 48rpx;
		image{width: 14rpx;height: 48rpx;margin-right: 20rpx;}
		view{font-weight: bold;font-size: 32rpx;color: #272727;}
		.num{font-weight: 500;font-size: 24rpx;color: #AAAAAA;}
	}
	.steps{display: flex;padding: 0 32rpx 12rpx;position: relative;
		&::after{content: '';background: #E6E6E6;width: 2rpx;position: absolute;top: 38rpx;bottom: -14rpx;left: 44rpx;}
		.circle{width: 24rpx;height: 24rpx;margin-right: 24rpx;flex: 0 0 auto;margin-top: 14rpx;}
		.step{
			.slist{font-size: 26rpx;color: #272727;display: flex;line-height: 52rpx;margin-bottom: 6rpx;
				.tit{font-weight: bold;text-align-last: justify;flex: 0 0 auto;min-width: 108rpx;}
				.imgas{display: flex;align-items: center;flex-wrap: wrap;
					image{width: 160rpx;height: 160rpx;margin-right: 30rpx;margin-bottom: 14rpx;}
				}
			}
		}
	}
	
}
</style>