<template>
	<view class="details">
		<view class="details-header">
			<view class="details-header-text">
				<view class="details-header-text-neishi">
					<view class="details-header-text-icon" @click="topgi">
						<image src="https://cdn.bjtdba.com/vod/image/2022-08-11/20220811133828415.png" mode="widthFix">
						</image>
					</view>
				</view>

				<view class="details-header-text-title">
					订单详情
				</view>
			</view>
		</view>
		<view class="details-back">
			<image src="https://cdn.bjtdba.com/vod/image/2022-08-13/20220813171413571.png" mode="widthFix"></image>
			<view class="details-back-biaohsi">
				<view class="details-back-biaohsi-kuan">
					<image src="https://cdn.bjtdba.com/vod/image/2022-08-15/20220815143421834.png" mode="widthFix">
					</image>
				</view>
				<view class="details-back-biaohsi-zhuanbgtia">
					<view class="details-back-biaohsi-zhuanbgtia-top">
						{{orderList.status}}
					</view>
					<view class="details-back-biaohsi-zhuanbgtia-bot">
						等待卖家付款
					</view>
				</view>
			</view>
			<view class="details-back-url">
				<view class="order-list-yi-bot-xiangxi">
					<view class="order-list-yi-bot-xiangxier">
						<image src="https://cdn.bjtdba.com/vod/image/2022-08-13/20220813164638215.png" mode="widthFix">
						</image>
					</view>
					<view class="order-list-yi-bot-xadasrfe">
						<view class="order-list-yi-bot-xadasrfe-top">
							{{orderList.user_address}}
						</view>
						<view class="order-list-yi-bot-xadasrfe-bot">
							<view class="">
								{{orderList.real_name}}
							</view>
							<view class="" style="margin-left: 32rpx;">
								{{orderList.user_phone!=undefined?orderList.user_phone.substr(0, 3) + '****' + orderList.user_phone.substr(7):"..."}}
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<!-- details-xiangqing -->
		<view :class="orderList.status=='待发货'?downP:incrseP">
			<view class="details-xiangqing-top">
				<view class="details-xiangqing-top-let">
					<image :src="orderList.mer_avatar" mode="widthFix"></image>
				</view>
				<view class="details-xiangqing-top-in">
					{{orderList.mer_name}}
				</view>
				<view class="details-xiangqing-top-rigt">
					<image src="https://cdn.bjtdba.com/vod/image/2022-08-15/20220815143434822.png" mode="widthFix">
					</image>
				</view>
			</view>
			<view class="details-xiangqing-niri">
				<view class="order-list-yi-in-neibu"  v-for="(item,index) in orderList.procductList" :key="index">
					<view class="order-list-yi-in-neibu-left">
						<view class="order-list-yi-in-neibu-left-img">
							<image :src="item.image" mode="widthFix"></image>
						</view>
						<view class="order-list-yi-in-neibu-left-url">
							<view class="order-list-yi-in-neibu-left-url-top">
								{{item.store_name}}
							</view>
						</view>
					</view>
					<view class="order-list-yi-in-neibu-right">
						<view class="order-list-yi-in-neibu-right-im">
							¥{{item.pay_price}}
						</view>
						<view class="order-list-yi-in-neibu-right-in">
							共{{item.cart_num}}件
						</view>
					</view>
				</view>
				<view v-if="orderList.status=='待发货'?true:false"
					style="margin-top: 26rpx; width: 142rpx;height: 58rpx;border-radius: 30rpx;border: 1rpx solid #999999;font-size: 24rpx;font-weight: 400;color: #333333;text-align: center;line-height: 58rpx;">
					立即发货
				</view>
				<view class="details-xiangqing-shujussss">
					<view class="details-xiangqing-shujussss-yis">
						<view class="">
							商品总额
						</view>
						<view class="">
							+¥{{orderList.pay_price}}
						</view>
					</view>
					<view class="details-xiangqing-shujussss-yis">
						<view class="">
							优惠金额
						</view>
						<view class="">
							-¥0.00
						</view>
					</view>
					<view class="details-xiangqing-shujussss-yis">
						<view class="">
							订单编号
						</view>
						<view class="" @click="copy(orderList.order_id)">
							{{orderList.order_id}} | 复制
						</view>
					</view>
					<view class="details-xiangqing-shujussss-yis">
						<view class="">
							下单时间
						</view>
						<view class="">
							{{orderList.pay_time}}
						</view>
					</view>
					<view class="details-xiangqing-shujussss-yis">
						<view class="">
							支付方式
						</view>
						<view class="">
							{{orderList.pay_type}}
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		getOrderDetails
	} from '@/commit/order.js'
	export default {
		data() {
			return {
				order_id: '', //订单ID
				is_limin: true,
				incrseP: 'details-xiangqing',
				downP: 'details-xiangqingsssss',
				orderList: [],
				indexs: '',
				status: ''
			}
		},
		onLoad(e) {
			this.order_id = e.order_id
			this.indexs = e.indexs
			this.status = e.status
			this.getOrderDetails()
		},
		methods: {
			copy(value) {
				uni.setClipboardData({
					data: value,
					success: function() {
						console.log('success');
					}
				})
			},
			// 订单详情页面
			getOrderDetails() {
				getOrderDetails({
					order_id: this.order_id
				}).then(res => {
					if (res.data.status == 200) {
						this.orderList = res.data.data.order
					}
				}, fail => {
					console.log(fail)
				})
			},
			topgi() {
				uni.redirectTo({
					url: './order?status=' + this.status + '&index=' + this.indexs
					// url: './order'
				});
			}
		}
	}
</script>

<style>
	page {
		background-color: #F7F8FC;
	}
</style>
<style lang="scss" scoped>
	.details {
		width: 100%;
		height: 100%;
		display: flex;
		flex-direction: column;
		align-items: center;

		.details-header {
			position: fixed;
			top: 0;
			left: 0;
			z-index: 111;
			width: 100%;
			height: 176rpx;
			background: #FFFFFF;
			display: flex;
			justify-content: center;

			.details-header-text {
				width: 686rpx;
				font-size: 36rpx;
				font-weight: 500;
				color: #333333;
				display: flex;
				margin-top: 107rpx;
				align-items: center;

				.details-header-text-neishi {
					width: 45rpx;
					height: 45rpx;
					margin-right: 17rpx;

					.details-header-text-icon {
						width: 36rpx;
						height: 36rpx;
						margin-top: 2rpx;

						image {
							width: 100%;
							height: 100%;
						}
					}
				}
			}
		}

		.details-back {
			width: 100%;
			height: 277rpx;
			margin-top: 176rpx;
			display: flex;
			justify-content: center;
			position: relative;

			image {
				width: 100%;
				height: 100%;
			}

			.details-back-biaohsi {
				position: absolute;
				height: 80rpx;
				top: 55rpx;
				left: 43rpx;
				display: flex;
				align-items: flex-start;

				.details-back-biaohsi-kuan {
					width: 38rpx;
					height: 38rpx;
					margin-top: 6rpx;

					image {
						width: 100%;
						height: 100%;
					}
				}

				.details-back-biaohsi-zhuanbgtia {
					display: flex;
					flex-direction: column;
					justify-content: space-between;
					align-items: flex-start;
					margin-left: 8rpx;

					.details-back-biaohsi-zhuanbgtia-top {
						font-size: 36rpx;
						font-weight: 600;
						color: #FFFFFF;
					}

					.details-back-biaohsi-zhuanbgtia-bot {
						font-size: 26rpx;
						font-weight: 400;
						color: #FFFFFF;
					}
				}
			}

			.details-back-url {
				width: 686rpx;
				height: 176rpx;
				background: #FFFFFF;
				border-radius: 16rpx;
				position: absolute;
				top: 189rpx;
				display: flex;
				align-items: center;
				justify-content: center;

				.order-list-yi-bot-xiangxi {
					width: 634rpx;
					height: 112rpx;
					display: flex;
					align-items: flex-start;

					.order-list-yi-bot-xiangxier {
						width: 38rpx;
						height: 38rpx;

						image {
							width: 100%;
							height: 100%;
						}
					}

					.order-list-yi-bot-xadasrfe {
						width: 544rpx;
						height: 100%;
						margin-left: 16rpx;
						display: flex;
						flex-direction: column;
						justify-content: space-between;
						align-items: flex-start;

						.order-list-yi-bot-xadasrfe-top {
							width: 100%;
							font-size: 26rpx;
							font-weight: 400;
							color: #333333;
							display: -webkit-box;
							-webkit-box-orient: vertical;
							-webkit-line-clamp: 2;
							overflow: hidden;
						}

						.order-list-yi-bot-xadasrfe-bot {
							font-size: 28rpx;
							font-weight: 400;
							color: #999999;
							display: flex;
						}
					}
				}
			}
		}

		.details-xiangqing {
			width: 686rpx;
			// height: 719rpx;
			background: #FFFFFF;
			border-radius: 16px;
			margin-top: 114rpx;
			display: flex;
			flex-direction: column;
			align-items: center;
			margin-bottom: 50rpx;

			.details-xiangqing-top {
				width: 100%;
				// height: 90rpx;
				padding: 32rpx 0 32rpx 0;
				border-bottom: 1rpx solid #E5E5E5;
				display: flex;
				align-items: center;
				color: #333333;

				.details-xiangqing-top-let {
					width: 32rpx;
					height: 32rpx;
					font-size: 11rpx;
					font-weight: 400;
					margin-left: 28rpx;

					image {
						width: 100%;
						height: 100%;
					}
				}

				.details-xiangqing-top-in {
					width: 364rpx;
					font-size: 28rpx;
					font-weight: 600;
					overflow: hidden;
					text-overflow: ellipsis;
					white-space: nowrap;
					margin-left: 6rpx;
				}

				.details-xiangqing-top-rigt {
					width: 36rpx;
					height: 36rpx;
					margin-left: 8rpx;

					image {
						width: 100%;
						height: 100%;
					}
				}
			}

			.details-xiangqing-niri {
				width: 634rpx;
				// height: 548rpx;
				margin: 26rpx 0 50rpx 0;
				display: flex;
				flex-direction: column;

				// background-color: orangered;
				.order-list-yi-in-neibu {
					width: 634rpx;
					height: 158rpx;
					display: flex;
					justify-content: space-between;
					align-items: flex-start;
					// background-color: aqua;
					margin: 10rpx 0 10rpx 0;

					.order-list-yi-in-neibu-left {
						width: 474rpx;
						height: 100%;
						display: flex;
						align-items: flex-start;
						justify-content: space-between;

						.order-list-yi-in-neibu-left-img {
							width: 158rpx;
							height: 158rpx;
							overflow: hidden;

							image {
								width: 100%;
								height: 100%;
							}
						}

						.order-list-yi-in-neibu-left-url {
							width: 290rpx;
							display: flex;

							.order-list-yi-in-neibu-left-url-top {
								width: 100%;
								font-weight: 400;
								color: #333333;
								font-size: 28rpx;
								display: -webkit-box;
								-webkit-box-orient: vertical;
								-webkit-line-clamp: 2;
								overflow: hidden;
								justify-content: space-between;
							}

							.order-list-yi-in-neibu-left-url-top-bot {
								width: 100%;
								font-size: 24rpx;
								font-weight: 400;
								color: #666666;
								display: inline-block;
								overflow: hidden;
								text-overflow: ellipsis;
								white-space: nowrap;
							}
						}
					}

					.order-list-yi-in-neibu-right {
						height: 73rpx;
						font-size: 28rpx;
						font-weight: 500;
						color: #333333;
						display: flex;
						flex-direction: column;
						justify-content: space-between;
						align-items: flex-end;

						.order-list-yi-in-neibu-right-im {
							font-size: 28rpx;
							font-weight: 500;
							color: #333333;
						}

						.order-list-yi-in-neibu-right-in {
							font-size: 24rpx;
							font-weight: 400;
							color: #666666;
						}
					}
				}

				.details-xiangqing-shujussss {
					width: 634rpx;
					height: 340rpx;
					margin-top: 50rpx;
					display: flex;
					flex-direction: column;
					justify-content: space-between;

					.details-xiangqing-shujussss-yis {
						width: 100%;
						display: flex;
						align-items: center;
						justify-content: space-between;
						font-size: 28rpx;
						font-weight: 400;
						color: #333333;
					}
				}
			}
		}

		.details-xiangqingsssss {
			width: 686rpx;
			// height: 779rpx;
			background: #FFFFFF;
			border-radius: 16px;
			margin-top: 114rpx;
			display: flex;
			flex-direction: column;
			align-items: center;
			margin-bottom: 50rpx;

			.details-xiangqing-top {
				width: 100%;
				// height: 90rpx;
				padding: 32rpx 0 32rpx 0;
				border-bottom: 1rpx solid #E5E5E5;
				display: flex;
				align-items: center;
				color: #333333;

				.details-xiangqing-top-let {
					width: 32rpx;
					height: 32rpx;
					font-size: 11rpx;
					font-weight: 400;
					margin-left: 28rpx;

					image {
						width: 100%;
						height: 100%;
					}
				}

				.details-xiangqing-top-in {
					width: 364rpx;
					font-size: 28rpx;
					font-weight: 600;
					overflow: hidden;
					text-overflow: ellipsis;
					white-space: nowrap;
					margin-left: 6rpx;
				}

				.details-xiangqing-top-rigt {
					width: 36rpx;
					height: 36rpx;
					margin-left: 8rpx;

					image {
						width: 100%;
						height: 100%;
					}
				}
			}

			.details-xiangqing-niri {
				width: 634rpx;
				// height: 548rpx;
				margin-top: 26rpx;
				display: flex;
				flex-direction: column;
				align-items: flex-end;
				margin: 26rpx 0 50rpx 0;

				.order-list-yi-in-neibu {
					width: 634rpx;
					height: 158rpx;
					display: flex;
					justify-content: space-between;
					align-items: flex-start;
					margin: 10rpx 0 10rpx 0;

					.order-list-yi-in-neibu-left {
						width: 474rpx;
						height: 100%;
						display: flex;
						align-items: flex-start;
						justify-content: space-between;

						.order-list-yi-in-neibu-left-img {
							width: 158rpx;
							height: 158rpx;
							overflow: hidden;

							image {
								width: 100%;
								height: 100%;
							}
						}

						.order-list-yi-in-neibu-left-url {
							width: 290rpx;
							display: flex;

							.order-list-yi-in-neibu-left-url-top {
								width: 100%;
								font-weight: 400;
								color: #333333;
								font-size: 28rpx;
								display: -webkit-box;
								-webkit-box-orient: vertical;
								-webkit-line-clamp: 2;
								overflow: hidden;
								justify-content: space-between;
							}

							.order-list-yi-in-neibu-left-url-top-bot {
								width: 100%;
								font-size: 24rpx;
								font-weight: 400;
								color: #666666;
								display: inline-block;
								overflow: hidden;
								text-overflow: ellipsis;
								white-space: nowrap;
							}
						}
					}

					.order-list-yi-in-neibu-right {
						height: 73rpx;
						font-size: 28rpx;
						font-weight: 500;
						color: #333333;
						display: flex;
						flex-direction: column;
						justify-content: space-between;
						align-items: flex-end;

						.order-list-yi-in-neibu-right-im {
							font-size: 28rpx;
							font-weight: 500;
							color: #333333;
						}

						.order-list-yi-in-neibu-right-in {
							font-size: 24rpx;
							font-weight: 400;
							color: #666666;
						}
					}
				}

				.details-xiangqing-shujussss {
					width: 634rpx;
					height: 340rpx;
					margin-top: 50rpx;
					display: flex;
					flex-direction: column;
					justify-content: space-between;

					.details-xiangqing-shujussss-yis {
						width: 100%;
						display: flex;
						align-items: center;
						justify-content: space-between;
						font-size: 28rpx;
						font-weight: 400;
						color: #333333;
					}
				}
			}
		}
	}
</style>
