<template>
	<view>
		<u-navbar autoBack placeholder bgColor="#FFFFFF">
			<view class="navSlot" slot="center">
				<!-- <u-icon name="arrow-left" size="19"></u-icon> -->
				<view class="title">订单详情</view>
			</view>
		</u-navbar>

		<view class="bgMains">
			<view>
				<view class="orderList" @click="clickItem">
					<view class="order">
						<view class="orderId">订单号：{{data.orderNo}}</view>
						<view class="orderStatus">{{data.orderStatus==2?'待核销':'已核销'}}</view>
					</view>
					<view class="orderItem">
						<view>
							<image class="img" :src="data.goodsImage"></image>
						</view>
						<view class="goodsInfo">
							<view class="orderGoodsName">{{data.goodsName}}</view>
							<view class="orderGoodsType">{{data.goodsType}}</view>
							<view class="price">
								<view class="orderPrice">￥{{data.goodsPrice}}</view>
								<view class="goodsNum">×{{data.goodsNum}}</view>
							</view>
						</view>
					</view>

				</view>
				<view>
					<view class="verificationInfo">
						<view class="bg"></view>
						<view class="verifi">核销信息</view>
					</view>
					<view class="qr">
						<view class="qrImg" v-if="data.status==1">
							<image class="qrCode" :src="data.verificationCode"></image>
						</view>
						<view class="qrInfo">
							<view class="verifQr">核销劵码：{{data.couponCode}}</view>
							<view class="verifiedoff">{{data.status==1?"未核销":"已核销"}}</view>
						</view>
						<view class="verificationTime">核销时间：{{data.verificationDate}}</view>
					</view>
				</view>


				<view class="verificationInfo">
					<view class="bg"></view>
					<view class="verifi">订单信息</view>
				</view>

				<view class="orderInfo">
					<view class="orderId">
						<view class="orderTitle">留言</view>
						<view>{{this.data.remark==null?"无":this.data.remark}}</view>
					</view>
					<view class="orderId">
						<view class="orderTitle">订单号</view>
						<view>{{this.data.orderNo}}</view>
					</view>
					<view class="orderId">
						<view class="orderTitle">手机号</view>
						<view>{{this.data.phoneNumber}}</view>
					</view>
					<view class="orderId">
						<view class="orderTitle">交易方式</view>
						<view>{{this.data.transactions==1? "微信交易":"支付宝"}}</view>
					</view>
					<view class="orderId">
						<view class="orderTitle">下单时间</view>
						<view>{{this.data.orderTime}}</view>
					</view>
					<view class="orderId" v-if="this.data.reservationTime!=null">
						<view class="orderTitle">预约时间</view>
						<view>{{this.data.reservationTime}}</view>
					</view>
					<view class="orderId">
						<view class="orderTitle">付款时间</view>
						<view>{{this.data.paymentTime}}</view>
					</view>

				</view>

				<view class="vehicleInfo" v-if="data.plateNo">
					<view class="infoleft">
						<view>
							<view class="vehicle">
								<view style="display: flex;">
									<view>
										<image class="brandLogo" :src="data.brandLogo"></image>
									</view>
									<view>{{data.vehicleBrand+data.vehicleModel}}</view>
								</view>
								<view class="plate">
									<view class="economize">豫</view>
									<view class="licensePlate">{{data.plateNo}} </view>
								</view>
							</view>
							<view>
								<view class="goodType">{{data.vehicleConfig}}</view>
							</view>
						</view>

					</view>

					<view class="left">
						<image class="img" src="../../static/tabar/ic_left.png"></image>
					</view>
				</view>
			</view>

		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				goodsId: "",
				orderId: "",

				data: {}
			}
		},
		onLoad(options) {
			console.log(options)
			this.goodsId = options.goodsId
			this.orderId = options.orderId
			this.getOrderDetails();
		},
		methods: {
			getOrderDetails() {
				this.$http.get("/api/store/personalCenter/orderDetails", {
					goodsId: this.goodsId,
					orderId: this.orderId

				}).then(res => {
					if (res.code == 200)
						console.log(res.data)
					this.data = res.data

				})
			},
		}
	}
</script>

<style lang="scss">
	.bgMains {
		padding: 20rpx;
		background: #f9f6f4;
	}

	.left {}

	.infoleft {
		flex: 1;
	}

	.brandLogo {
		width: 60rpx;
		height: 52rpx;
	}

	.goodType {
		font-size: 24rpx;
		color: #999999;
	}

	.vehicleInfo {
		margin-top: 20rpx;
		display: flex;
		align-items: center;
		padding: 24rpx;
		background: #FFFFFF;
		border-radius: 18rpx 18rpx 18rpx 18rpx;

		.img {
			width: 11rpx;
			height: 23rpx;
		}

		.vehicle {
			display: flex;
			justify-content: space-between;

			.plate {
				display: flex;
				color: #FFFFFF;
				padding-right: 40rpx;

			}

		}

		.economize {
			background: #0087EF;
			border-radius: 8rpx 0rpx 0rpx 8rpx;
			font-size: 24rpx;
			padding: 12rpx 20rpx 12rpx 20rpx;
			border: 1rpx solid #0087EF;
		}

		.licensePlate {
			background: #E5EEF5;
			border-radius: 0rpx 8rpx 8rpx 0rpx;
			border: 1rpx solid #0087EF;
			font-size: 24rpx;
			padding: 12rpx 20rpx 12rpx 20rpx;
			color: #0087EF;
		}
	}

	.orderInfo {
		margin-top: 20rpx;
		padding: 24rpx;
		background: #FFFFFF;
		border-radius: 14rpx 14rpx 14rpx 14rpx;
		font-size: 28rpx;
		color: #333333;

		.orderTitle {
			font-size: 28rpx;
			color: #666666;
		}
	}

	.orderId {
		padding-top: 37rpx;
		display: flex;
		justify-content: space-between;
	}

	.qr {
		margin-top: 20rpx;
		background: #FFFFFF;
		border-radius: 14rpx 14rpx 14rpx 14rpx;

		.verificationTime {
			padding-left: 20rpx;
			padding-top: 5rpx;
			font-size: 28rpx;
			padding-bottom: 20rpx;
			color: #333333;
		}

		.verifQr {
			font-size: 28rpx;
			color: #333333;
		}

		.qrInfo {
			padding: 20rpx;
			justify-content: space-between;
			display: flex;

			.verifiedoff {
				font-size: 28rpx;
				color: #999999;
			}
		}

		.qrImg {
			text-align: center;
		}
	}

	.qrCode {
		padding-top: 20rpx;
		width: 493rpx;
		height: 493rpx;
	}

	.verificationInfo {
		display: flex;
		padding-top: 37rpx;

		.verifi {
			margin-left: 15rpx;
			font-size: 28rpx;
			color: #333333;
		}

		.bg {
			padding-top: 10rpx;
			width: 6rpx;
			height: 37rpx;
			background: #FF4502;
			border-radius: 0rpx 0rpx 0rpx 0rpx;
		}
	}

	.orderList {
		padding: 24rpx;
		background: #FFFFFF;
		border-radius: 14rpx 14rpx 14rpx 14rpx;

		.orderItem {
			display: flex;
			padding-top: 10rpx;

			.orderGoodsName {
				font-size: 28rpx;
				color: #333333;
			}

			.goodsInfo {
				padding-left: 10rpx;
				flex: 1
			}

			.orderGoodsType {
				padding-top: 10rpx;
				font-size: 24rpx;
				color: #999999;
			}

			.price {
				display: flex;
				justify-content: space-between;
				padding-top: 30rpx;

				.orderPrice {
					font-size: 32rpx;
					color: #FF4502;
					font-weight: 800;
				}

				.goodsNum {
					font-size: 24rpx;
					color: #999999;
				}
			}
		}

		.order {
			justify-content: space-between;
			display: flex;

			.orderId {
				font-size: 24rpx;
				color: #999999;
			}

			.orderStatus {
				font-size: 24rpx;
				color: #FF4502;
			}
		}

		.img {
			width: 156rpx;
			height: 156rpx;
		}
	}
</style>