<template>
	<view>
		<view class="cmain">
			<view class="box order_detail" style="padding: 13px">
				<u-steps :current="current">
					<u-steps-item title="订单确认"></u-steps-item>
					<u-steps-item title="互助委托确认"></u-steps-item>
					<u-steps-item title="进口申报确"></u-steps-item>
				</u-steps>
			</view>
			<view class="box order_detail">
				<view v-if="current == 1">
					<view class="item ctt">互助委托书</view>
					<view class="item desc">边民 杨镇生(身份证号：4509231***12)委托代理边民互市（进口/入境）商品交易（进口/入境）商品交易信息如下：</view>
				</view>
				<view class="item">
					<text class="label">订单编号</text>
					<text class="desc omit">45245741587</text>
				</view>
				<view class="item">
					<text class="label">商品名称</text>
					<text class="desc">河虾（活体）（沼虾属Macrobrachium）</text>
				</view>
				<view class="item">
					<text class="label">商品金额</text>
					<text class="desc">¥ 1000</text>
				</view>
				<view class="item">
					<text class="label">车牌号</text>
					<text class="desc">桂A66709</text>
				</view>
			</view>
		</view>
		<view class="mfooter">
			<view class="flex">
				<view class="f">
					<button class="btn" @click="ok()">确定</button>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			current: 0,
			item: {}
		};
	},
	onLoad(e) {
		if (e.orderId) {
			this.http.request({
				url: '/level-two-server/app/TbOrders/getDetailById',
				method: 'POST',
				data: { ids: this.orderIds },
				success: res => {
					this.list = res.data.data;
				}
			});
		}
	},
	methods: {
		ok() {
			//根据不同的步骤提交不同的url或者状态参数
			if (this.current == 0) {
				this.item.state = 0;
			}
			uni.showModal({
				title: '提示',
				content: '我已核对信息无误',
				success: res => {
					if (res.confirm) {
						this.http.request({
							url: '/level-two-server/app/TbOrders/purchaserBuy',
							method: 'POST',
							data: { id: this.item.id },
							success: res => {
								//根据返回的状态进入那个步骤
								if (res.xxx == 1) {
									this.current = 1;
									uni.setNavigationBarTitle({
										title: '互助委托确认'
									});
								}
								if (res.xxx == 2) {
									this.current = 2;
									uni.setNavigationBarTitle({
										title: '进口申报确认'
									});
								}
							}
						});
					}
				}
			});
		}
	}
};
</script>

<style lang="scss">
page {
	background-color: $pg;
}
.ctt {
	text-align: center;
	font-weight: bold;
}
</style>
