<template>
	<view style="background-color: #FFFFFF;min-height: 100vh;">
		<view style="padding: 20rpx;">
			<view style="position: relative;">
				<image v-if="current==0" @click="$util.preview(detailData.enterImgPath)" :src="detailData.enterImgPath?detailData.enterImgPath:'/static/index/noimg3.png'"  style="width: 100%;height: 400rpx;"></image>
				<image v-if="current==1" @click="$util.preview(detailData.outImgPath)" :src="detailData.outImgPath?detailData.outImgPath:'/static/index/noimg3.png'"  style="width: 100%;height: 400rpx;"></image>
				<text style="font-size: 32rpx;color: #FFFFFF;position: absolute;bottom: 20rpx;left: 20rpx;">{{detailData.carNo}}</text>
			</view>
			<u-cell-group >
				<u-cell-item :icon-style="iconStyle"  :arrow="false"  icon="bookmark-fill"  title="车牌号:" :value="detailData.carNo"></u-cell-item>
				<u-cell-item :icon-style="iconStyle"  :arrow="false"  icon="map-fill"  title="入场车道:" :value="detailData.enterGateName"></u-cell-item>
				<u-cell-item :icon-style="iconStyle"  :arrow="false"  icon="clock-fill"  title="入场时间:" :value="detailData.enterTime"></u-cell-item>
				<u-cell-item v-if="current==1" :icon-style="iconStyle"  :arrow="false"  icon="map-fill"  title="出口车道:" :value="detailData.outGateName"></u-cell-item>
				<u-cell-item v-if="current==1" :icon-style="iconStyle"  :arrow="false"  icon="clock-fill"  title="出场时间:" :value="detailData.outTime"></u-cell-item>
				<u-cell-item :icon-style="iconStyle" :border-bottom="false"  :arrow="false"  icon="rmb-circle-fill"  title="进出费用:" :value="detailData.totalAmount?'￥'+detailData.totalAmount:'￥0'"></u-cell-item>
			</u-cell-group>
		</view>
	</view>
</template>

<script>
export default {
	name: '',
	data() {
		return {
			id:'',
			current:0,
			detailData:{},
			iconStyle:{
				color:"#5064eb"
			},
		};
	},
	onLoad(options) {
		this.id=options.id
		this.current=options.current
		this.fetchDetail()
	},
	methods:{
		fetchDetail(id,current){
			if (this.current==0) {
				//入场
				this.$api.car.enterPage({id:this.id}).then(res=>{
					this.detailData=res.data.records[0]
				})
			}else if (this.current==1) {
				//出场
				this.$api.car.outPage({id:this.id}).then(res=>{
					this.detailData=res.data.records[0]
				})
			}
			
		},
	}
};
</script>

<style lang="scss" scoped>
	
</style>