<template>
	<view class="wrapper">
		<view class="info-card">
			<view class="cell">
				<view class="cell-left">
					<image :src="`${$imgUrl}arrears.png`" mode=""></image>
					<text class="plate">{{state.details['vehiclePlate']}}</text>
				</view>
				<view class="cell-right money">¥{{state.details['fee']/100}}</view>
			</view>
			<view class="cell">
				<view class="cell-left">用户姓名：</view>
				<view class="cell-right">{{state.details['userName']}}</view>
			</view>
			<view class="cell">
				<view class="cell-left">补缴状态：</view>
				<view class="cell-right">{{state.details['reimburseStatusStr']}}</view>
			</view>
			<view class="cell">
				<view class="cell-left">支付单号：</view>
				<view class="cell-right">{{state.details['payOrderId']}}</view>
			</view>
			<view class="cell">
				<view class="cell-left">流水编号：</view>
				<view class="cell-right">{{state.details['listNo']}}</view>
			</view>
			<view class="cell">
				<view class="cell-left">入站名称</view>
				<view class="cell-right">{{state.details['enStationName']}}</view>
			</view>
			<view class="cell">
				<view class="cell-left">入站时间</view>
				<view class="cell-right">{{state.details['enTime']}}</view>
			</view>
			<view class="cell">
				<view class="cell-left">出站名称</view>
				<view class="cell-right">{{state.details['exStationName']}}</view>
			</view>
			<view class="cell">
				<view class="cell-left">出站时间</view>
				<view class="cell-right">{{state.details['exTime']}}</view>
			</view>
			<view class="cell">
				<view class="cell-left">通行金额</view>
				<view class="cell-right">¥{{state.details['fee']/100}}</view>
			</view>
			<view class="cell">
				<view class="cell-left">补缴金额</view>
				<view class="cell-right">¥{{state.details['reimburseFee']/100}}</view>
			</view>
		</view>
	</view>
</template>

<script lang="ts" setup>
	import {reactive} from "vue"
	import {onLoad} from "@dcloudio/uni-app";
	import {requestNew} from "@/utils/network/request.js";
	import {reimburseView} from "@/utils/network/api.js";
	const state = reactive({
		details:{}
	})
	onLoad((options) => {
		console.log("options",options)
		getlist(options.id)
	})
	// 获取详情数据
	const getlist = (orderId) => {
		const options = {
			type: 2,
			data: {
				orderId
			},
			method: "POST",
			showLoading: true,
		};
		requestNew(reimburseView, options).then((res) => {
			console.log("res",res.order);
			state.details=res.order
			state.details['vehiclePlate']=state.details['vehicleId'].split("_")[0]
			if(state.details['reimburseStatus']==0){
				state.details['reimburseStatusStr']='未补缴'
			}else if(state.details['reimburseStatus']==1){
				state.details['reimburseStatusStr']='已补缴'
			}else if(state.details['reimburseStatus']==2){
				state.details['reimburseStatusStr']='已关闭'
			}
			
		});
	}
</script>

<style lang="scss">
	.wrapper {
		padding-bottom: 50rpx;
		background: #E9EDF0;
		overflow: hidden;
	}
	
	.info-card {
		margin: 30rpx;
		border-radius: 16rpx;
		padding-bottom: 40rpx;
		background-color: white;
		padding: 0 30rpx;
		box-sizing: border-box;
	}
	
	.info-card .title {
		padding: 30rpx 0;
		font-size: 36rpx;
		text-align: center;
		color: #01243A;
	}
	
	.info-card .cell {
		display: flex;
		flex-direction: row;
		padding: 18rpx 0rpx;
		font-size: 30rpx;
		border-bottom: 1rpx solid #E6E9EB;
	}
	
	.cell-left {
		flex: 1;
		text-align: left;
		color: #6C6C6C;
		display: flex;
		align-items: center;
	}
	
	.cell-right {
		margin-left: 30rpx;
		text-align: right;
		color: #111111;
		overflow: hidden;
	}
	image{
		width: 50rpx;
		height: 50rpx;
		margin-right: 10rpx;
	}
	.plate{
		font-size: 30rpx;
		color: #01243A;
	}
	.money{
		color: #CE1717;
	}
</style>