<template>
	<view class="content">
		<view class="express-item" v-for="(item, index) in express" :key="index" @click="onNav('WorkExpressInfo', {id: item.business_order_express_id})">
			<view class="express-text">
				<view class="express-flex">
					<label>邮寄物品</label>
					<view class="express-value">{{item.type}}</view>
				</view>
				<view class="express-flex">
					<label>快递公司</label>
					<view class="express-value">{{item.express}}</view>
				</view>
				<view class="express-flex">
					<label>快递单号</label>
					<view class="express-value">{{item.number}}</view>
				</view>
				<view class="express-flex">
					<label>快递状态</label>
					<view class="express-value">{{item.status}}</view>
				</view>
			</view>
			<uni-icons type="right" color="gray"></uni-icons>
		</view>
	</view>
</template>

<script>
	import { getExpresses } from '@/apis/interfaces/mailed.js'
	export default {
		data() {
			return {
				express: []
			};
		},
		created() {
			getExpresses(this.$Route.query.orderId).then(res => {
				this.express = res;
			}).catch(err => {
				uni.showToast({
					title: err.message,
					icon : 'none'
				})
			})
		},
		methods: {
			onNav(name, params){
				this.$Router.push({
					name,
					params
				})
			}
		}
	}
</script>

<style lang="scss">
	.content{
		padding-top: 1rpx;
		box-sizing: border-box;
	}
	.express-item{
		display: flex;
		background: white;
		padding: 20rpx 30rpx;
		margin-top: 30rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
		.express-text{
			width: calc(100% - 50rpx);
		}
		.express-flex{
			line-height: 50rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			font-size: 30rpx;
			label{
				color: gray;
				width: 150rpx;
			}
			.express-value{
				width: calc(100% - 150rpx);
			}
		}
	}
</style>
