<template>
	<view>
		<u-navbar
		 title="历史欠费" 
		 title-color="#fff" 
		 :custom-back="customBack" 
		 :border-bottom="false" 
		 back-icon-color="#CCE8FF" 
		 :background="{background: 'linear-gradient(145deg, #41AFF9 0%, #2D8CFB 100%)' }"></u-navbar>
		 
		 <view class="owelist">
		 	<view class="owelist-item" v-for="(item,index) in owelist" :key="item.id">
		 		<view class="item-header u-flex u-row-between">
		 			<view class="vehicle-no">{{item.vehicleNo}}</view>
					<view class="space-name">{{item.spaceName}}</view>
		 		</view>
				<view class="road-name u-flex">
					<u-icon name="map-fill" color="#3397FA" size="36"></u-icon>
					{{item.roadName}}
				</view>
				<view class="info-item">进场时间：{{item.inTime}}</view>
				<view class="info-item">出场时间：{{item.outTime}}</view>
				<view class="info-item">停车时长：{{item.duration}}</view>
				<view class="info-item">欠费金额：<span class="u-type-warning">{{item.payAmount}}元</span></view>
		 	</view>
		 </view>
		 <u-toast ref="uToast" />
	</view>
</template>

<script>
	export default{
		data(){
			return{
				orderID:'',
				leaveDetail:[],
				owelist:[],
			}
		},
		onLoad(page){
			this.orderID = page.orderID;
			console.log('this.orderID',this.orderID)
		},
		onShow(){
			this.handleEntranceOutDetail();
		},
		methods:{
			customBack(){
				this.$u.route({
					// type:'switchTab',
					url: 'pages/index/index'
				});
			},
			handleEntranceOutDetail(){
				this.$u.api.entranceOutDetail({spaceId:this.orderID})
				.then(res=>{
					// this.$refs.uToast.show({
					// 	title: res.msg,
					// 	type: 'success',
					// });
					this.leaveDetail = res.data;
					this.owelist = res.data.oweList;
				
					console.log('entranceOutDetail',res)
				}).catch(err=>{
					this.$refs.uToast.show({
						title: err.msg,
						type: 'error',
					});
					console.log('entranceOutDetail ',err)
				});
				
			},
			
		}
	}
</script>

<style lang="scss" scoped>
	@import  './owelist.scss'
</style>
