<template>
	<view class="viewArrivalDeparture content_box">
		<!-- <shipmentBriefInfo /> -->
		<bs-pageHeader-orderNo :shipmentNo="shipmentNo" />
		<view class="routine_radius_card">
			<bs-customRowCell leftIcon="current-location" :title="data.address" />
		</view>
		<view class="ArrivalDeparture routine_radius_card">
			<bs-customCell :label="`${action==='Arrival' ? '到' : '离'}站时间:`" :value="data.eventTime" labelCol="3" wrapCol="9" />
		</view>
	</view>
</template>

<script>
	import { formatGMT } from '../../utils/util'
	const appInstance = getApp()
	export default {
		data() {
			return {
				data: {},
				action: "", //当前事件类型
				shipmentNo: '' //运单号
			}
		},
		onLoad(options) {
			const data = JSON.parse(options.data)
			const action = data.eventType
			const { shipmentNo } = appInstance.globalData.shipmentInfo
			data.eventTime = formatGMT(data.eventTime) //格式化时间
			const actionMode = { //事件类型
				Arrival: "到达站点",
				Departure: "离开站点",
			}
			this.setNavTitle(actionMode[action])
			this.data = data
			this.action = action
			this.shipmentNo = shipmentNo
		},
		methods: {
			//设置页面头部标题
			setNavTitle(title) {
				uni.setNavigationBarTitle({
					title: title,
				})
			},
		}
	}
</script>

<style lang="scss">
	.viewArrivalDeparture {
		/deep/.custom-cell-row {
			margin: 20rpx 0;

			.custom-cell-label {
				color: #8C8C8C;
			}

			.u-cell__right-icon-wrap {
				width: 0;
			}
		}
	}
</style>
