<template>
	<view class="container">
		<Navbar :title="title"></Navbar>
		<!-- 顶部卡片 -->
		<view class="topBarCss">
			<view class="flex justify-between align-center" style="padding: 0 25px;">
				<view class="flex align-center">
					<u-icon name="checkmark-circle-fill" color="#EA5504" size="25"></u-icon>
					<view class="text-lg margin-left-xs">
						{{type?'安检完成':'配送完成'}}
					</view>
				</view>
				<view class="">
					<u-image src="@/static/lpg-logo.png" width="100px" height="100px"></u-image>
				</view>
			</view>
		</view>
		<!-- 订单编号 -->
		<view class="usuallyCard flex justify-between align-center padding" style="margin: 10px 12px"
			v-show="type === 0">
			<view class="text-lg">
				订单编号
			</view>
			<view class="text-gray">
				{{successData.fddbh || ""}}
			</view>
		</view>
		<!-- 客户信息 -->
		<view class="usuallyCard  padding" style="margin: 10px 12px">
			<view class="text-lg">
				客户信息
			</view>
			<view class="flex justify-between align-center margin-top">
				<view class="text-gray w30">
					客户姓名
				</view>
				<view class="w70 flex justify-end">
					{{successData.fkhxm || ""}}
				</view>
			</view>
			<view class="flex justify-between align-center margin-top">
				<view class="text-gray w30">
					{{type?'安检地址':'配送地址'}}
				</view>
				<view class="w70 flex justify-end">
					{{type?successData.fajdz || "" :successData.fpsdz || ""}}
				</view>
			</view>
		</view>

		<!-- 安检信息 -->
		<view class="usuallyCard  padding" style="margin: 10px 12px">
			<view class="text-lg">
				安检信息
			</view>
			<view class="flex justify-between align-center margin-top">
				<view class="text-gray w30">
					安检人
				</view>
				<view class="w70 flex justify-end">
					{{successData.fajr || ""}}
				</view>
			</view>
			<view class="flex justify-between align-center margin-top">
				<view class="text-gray w30">
					安检结果
				</view>
				<view class="w70 flex justify-end">
					{{successData.fajjg || ""}}
				</view>
			</view>
			<view class="flex justify-between align-center margin-top">
				<view class="text-gray w30">
					完成时间
				</view>
				<view class="w70 flex justify-end">
					{{successData.fwcsj || ""}}
				</view>
			</view>
		</view>

		<!-- 气瓶信息 -->
		<view class="usuallyCard  padding" style="margin: 10px 12px" v-show="type === 0">
			<view class="text-lg">
				气瓶信息
			</view>
			<view class="flex justify-between align-center margin-top" v-show="successData.fmpfcqptm">
				<view class="text-gray w40">
					满瓶发出气瓶条码
				</view>
				<view class="w60 flex justify-end">
					<view class="overflow-one-lines">
						{{successData.fmpfcqptm || ""}}
					</view>
				</view>
			</view>
			<view class="flex justify-between align-center margin-top" v-show="successData.fmpfcqpgg">
				<view class="text-gray w40">
					满瓶发出气瓶规格
				</view>
				<view class="w60 flex justify-end">
					<view class="overflow-one-lines">
						{{successData.fmpfcqpgg || ""}}
					</view>
				</view>
			</view>
			<view class="flex justify-between align-center margin-top" v-show="successData.fkphsqptm">
				<view class="text-gray w40">
					空瓶回收气瓶条码
				</view>
				<view class="w60 flex justify-end">
					<view class="overflow-one-lines">
						{{successData.fkphsqptm || ""}}
					</view>
				</view>
			</view>
			<view class="flex justify-between align-center margin-top" v-show="successData.fkphsqpgg">
				<view class="text-gray w40">
					空瓶回收气瓶规格
				</view>
				<view class="w60 flex justify-end">
					<view class="overflow-one-lines">
						{{successData.fkphsqpgg || ""}}
					</view>
				</view>
			</view>
			<view class="flex justify-between align-center margin-top" v-show="successData.fmphsqptm">
				<view class="text-gray w40">
					满瓶回收气瓶条码
				</view>
				<view class="w60 flex justify-end">
					<view class="overflow-one-lines">
						{{successData.fmphsqptm || ""}}
					</view>
				</view>
			</view>
			<view class="flex justify-between align-center margin-top" v-show="successData.fmphsqpgg">
				<view class="text-gray w40">
					满瓶回收气瓶规格
				</view>
				<view class="w60 flex justify-end">
					<view class="overflow-one-lines">
						{{successData.fmphsqpgg || ""}}
					</view>
				</view>
			</view>
		</view>
		<view class="fixBtnAreaCss" @click="goToHome()">
			<u-button color="#EA5504">返回主页</u-button>
		</view>
	</view>
</template>

<script>
	export default {
		components: {},
		props: {

		},
		data() {
			return {
				type: null, //打开类型
				successData: {},
				title: "完成配送"
			}
		},
		computed: {

		},
		onLoad(data) {
			if (data.type) {
				this.type = parseInt(data.type);
				this.title = this.type ? '完成安检' : '完成配送'
			}
			if (data.successData) {
				this.successData = JSON.parse(data.successData)
			}
		},
		methods: {
			goToHome() {
				uni.reLaunch({
					url: '/pages/home/home'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.container {
		padding-bottom: 50px;
	}

	.usuallyCard {
		border-radius: 8px;
	}

	.topBarCss {
		height: 100px;
		background: #FAF3EF;
	}

	.fixBtnAreaCss {
		position: fixed;
		background: #fff;
		font-size: 16px;
		width: 100%;
		padding: 5px 10px;
		height: 50px;
		bottom: 0;
	}
</style>