<template>
	<view class="page" >
		<!-- 订单状态 -->
		<view class="title">
			<view>
				<view class="payment">
					{{title}}
				</view>
			</view>

		</view>
		<!-- 订单状态 -->

		<!-- 地址信息 -->
		<view class="address">
			<view class="name-phone">
				<u-icon name="map" size="22"></u-icon>
				<view style="margin: 0 20rpx;font-size: 32rpx;">陈曦</view>
				<text class="phone">17800000000</text>
			</view>
			<view class="address-detail">
				江苏省淮安市清江浦区北京南路99号（青浦大桥南侧200
				米）淮安恒大名都3号楼一单元1602
			</view>
			
			<view class="logistics" v-if="status == 3||status == 4">
				<text class="_label">物流单号</text>
				<view class="num">
					<text>圆通快递</text>
					<text >{{"&nbsp;"+"|"+"&nbsp;"}}</text>
					<text>123456789</text>
					<image class="cope-icon" src="../../static/mine/349.png" mode=""></image>
				</view>
			</view>
		</view>

		<commodityDetailVue :status="status" />

		<view class="order">
			<view class="order-number">
				<text>
					订单编号
				</text>
				<view>
					8998391920137645 | <text decode @click="cope('111')">{{"&nbsp;"+"复制"}}</text>
				</view>
			</view>
			<view class="order-number">
				<text>
					支付方式
				</text>
				<view>
					微信支付
				</view>
			</view>
			<view class="order-number">
				<text>
					支付时间
				</text>
				<view>
					2023-12-08 22:40:03
				</view>
			</view>
			<view class="order-number">
				<text>
					创建时间
				</text>
				<view>
					2023-12-08 22:40:03
				</view>
			</view>
			<view class="order-number">
				<text>
					运输方式
				</text>
				<view>
					海运
				</view>
			</view>
			<view class="order-number">
				<text>
					包裹数量
				</text>
				<view>
					210
				</view>
			</view>
		</view>
		<view class="footer" v-if="status != 3">
			<button class="status-2" v-if="status == 1">缴纳保证金</button>
			<button class="status-1" v-if="status == 2">备注</button>
			<button class="status-2" v-if="status == 2">立即发货</button>
			<button class="status-1" v-if="status == 4">查看物流</button>
		</view>
	</view>
</template>

<script>
	import commodityDetailVue from './component/commodityDetail.vue'
	export default {
		components: {
			commodityDetailVue
		},
		data() {
			return {
				status: 6,
				show: false,
				title:""
			}
		},
		onLoad(option) {
			this.status = option.orderStatus
			if(option.orderStatus == 1){
				this.title = "待缴纳保证金"
			}else if(option.orderStatus == 2){
				this.title = "待团长发货"
			}else if(option.orderStatus == 3){
				this.title = "待总部发货"
			}else if(option.orderStatus == 4){
				this.title = "总部已发货"
			}
		},

		methods: {
			//复制
			cope(e) {
				uni.setClipboardData({
					data: e,
					success() {
						uni.showToast({
							title: "复制成功",
							icon: "none"
						})
					}
				})
			},

		},
		created() {

			//设置顶部标题栏颜色
			uni.setNavigationBarColor({
				frontColor: '#000000',
				backgroundColor: '#f4f4f4'
			})
		},
	}
</script>

<style scoped lang="scss">
	.page {
		padding: 20rpx 24rpx 180rpx;

		.title {
			.payment {
				font-size: 44rpx;
				font-weight: 600;
				margin-bottom: 20rpx;
			}

			.timer {
				font-size: 28rpx;
				color: #666;
			}
		}

		.address {
			background-color: #fff;
			border-radius: 16rpx;
			padding: 34rpx 24rpx 28rpx;
			margin-top: 24rpx;

			.name-phone {
				display: flex;
				align-items: center;
				align-items: flex-end;

				.phone {
					font-size: 26rpx;
					color: #666;
				}
			}

			.address-detail {
				margin-top: 20rpx;
				font-size: 24rpx;
				color: #444;
				margin-left: 60rpx;
			}
			.logistics{
				display: flex;
				justify-content: space-between;
				align-items: center;
				font-size: 28rpx;
				padding-top: 20rpx;
				border-top: 2rpx solid #F4F4F4;
				margin-top: 20rpx;
				._label{
					color: #222;
				}
				.num{
					color: #555;
					display: flex;
					align-items: center;
				}
				.cope-icon{
					width: 28rpx;
					height: 28rpx;
					margin-left: 6rpx;
				}
			}
		}

		.order {
			background-color: #fff;
			border-radius: 16rpx;
			color: rgba(54, 54, 54, .7);
			font-size: 28rpx;
			margin-top: 20rpx;
			padding: 20rpx 20rpx;

			.order-number {
				display: flex;
				justify-content: space-between;
				margin-bottom: 32rpx;
			}
		}

		.contact {
			padding: 20rpx 0;
			background-color: #fff;
			display: flex;
			justify-content: center;
			align-items: center;
			border-radius: 16rpx;
			margin-top: 20rpx;
			margin-bottom: 160rpx;
		}

		.footer {
			position: fixed;
			bottom: 0;
			left: 0;
			background-color: #fff;
			display: flex;
			justify-content: flex-end;
			align-items: center;
			padding-top: 20rpx;
			padding-bottom: 80rpx;
			height: 66rpx;
			width: 100%;

			.status-1 {
				background-color: #fff;
				border-radius: 34rpx;
				margin: 0;
				padding: 0;
				font-size: 28rpx;
				color: #222;
				width: 168rpx;
				height: 68rpx;
				margin-right: 20rpx;
				border: 2rpx solid #979797;
			}

			.status-2 {
				background-color: #ffffff;
				border-radius: 34rpx;
				margin: 0;
				padding: 0;
				font-size: 28rpx;
				color: #f83224;
				height: 68rpx;
				border: 2rpx solid #f83224;
				margin-right: 24rpx;
				line-height: 68rpx;
				padding: 0 34rpx;
				
			}
		}

		.transition {
			width: 164rpx;
			height: 88rpx;
			background: #FFFFFF;
			box-shadow: 0rpx 0rpx 20rpx -6rpx rgba(0, 0, 0, 0.3);
			position: fixed;
			bottom: 160rpx;
			text-align: center;
			line-height: 88rpx;
			font-size: 26rpx;
			color: #222;
		}
	}
</style>