<template>
	<view class="container">
		<image class="cbg" src="../../static/common_bg.png"></image>
		<view class="wrap">
			<view>预约时间：{{info.date}} {{formatTime(info.start_time)}}-{{formatTime(info.end_time)}}</view>
			<view>预约地点：{{info.appointment_config.name}}</view>
			<view>预约事项：{{info.content}}</view>
			<view>预约状态：{{info.status_text}}</view>
			<view>车牌：{{info.plate}}</view>
			<view>同行人数：{{info.accompany_total}}</view>	
			<view>同行人员：
				<block v-if="info.appointment_accompany && info.appointment_accompany.length>0">
					<text v-for="appo in info.appointment_accompany">{{appo.name}}、</text>
				</block>
			</view>
			<view>状态：{{info.status_text}}</view>	
			<view v-if="info.reason">审核意见：{{info.reason}}</view>
		</view>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				info:{}
			}
		},
		onLoad(options) {
			this.getBookDetail(options.id)
		},
		methods:{
			async getBookDetail(id){
				const res = await this.$u.api.scheduleDetail({
					id:id
				})
				this.info = res
			},
			formatTime(val){
				if(val){
					return this.$moment(val).format("HH:mm")
				}else{
					return ''
				}
			},
		}
	}
</script>

<style scoped lang="scss">
	.container{
		padding: 30rpx;
		width:100%;
		height:100vh;
		.cbg {
			position: absolute;
			top: 0;
			left: 0;
			width: 100%;
			height: 100vh;
		}
		.wrap{
			position: relative;
			background-color: #fff;
			padding:30rpx;
			border-radius: 20rpx;
		}
	}
		

</style>