<!-- 订单详情 -->
<template>
	<view>
		<view>
			<view class="content" style="padding-bottom:200upx;">
				<view class="order-details-info-box">

					<view class="order-list-box">
						<view class="item">
							<view class="order-list-top">
								<view class="top-l" >
									<image
										src="https://jy.scjysm.asia:18086/cdwlMall/questionnaire/file/static/images/orderStoreIcon.png"
										class="shop-img"></image>
									<text class="shop-name">{{ dataList.shopName }}</text>
								</view>

							</view>
							<view class="order-info-box">
								<view class="order-info">
									<view class="order-info-item" v-for="proItem in dataList.products"
										:key="proItem.productId">
										<image :src="imgurl+proItem.image" class="product-img default-img"></image>
										<view class="info-box">
											<text class="product-name">{{ proItem.productName }}</text>
											<view class="price-sku-box">
												<view class="product-sku">
													<view class="mar-left-20" v-for="vItem in proItem.values">
														<text>规格：{{ vItem }}</text>
													</view>
												</view>
												<view class="product-num">x {{ proItem.number }}</view>
											</view>
										</view>
									</view>
									<view class="delivery-way-box">
										<view class="item">
											<text class="way">商品总价</text>
											<text class="way">¥{{ dataList.orderPrice }}</text>
										</view>
										<view class="item">
											<text class="way">快递运费</text>
											<text class="way">¥{{ dataList.logisticsPrice }}</text>
										</view>
									</view>
								</view>
								<!-- 待发货 待收货 已完成 -->
								<view class="order-total-box"
									v-if='dataList.state==2||dataList.state==3||dataList.state==4'>
									<text>实付款</text>
									<text class="way-color">¥{{ dataList.price }}</text>
								</view>
								<!-- 待付款 价格是橙色-->
								<view class="order-total-box" v-else-if="dataList.state==1">
									<text>需付款</text>
									<text class="way-color">¥{{ dataList.price }}</text>
								</view>
								<!-- 退款成功 交易关闭 -->
								<view class="order-total-box"
									v-else-if="(dataList.returnType==1 && dataList.moneyReturnList.status==4) || (dataList.returnType==2 && dataList.goodsReturn.status==6) || (dataList.state==5)">
									<text>需付款</text>
									<text>¥{{ dataList.price }}</text>
								</view>
							</view>
						</view>
					</view>
				</view>
				<view class="order-details-information padd">
					<view class="order-title">
						<text>订单信息</text>
					</view>
					<view class="info-box">
						<!--都有  但是：待付款  待发货  退款成功 交易关闭  只有前两个item-->
						<view class="item">
							<text>订单编号：{{ dataList.orderFormid }}</text>
							<text class="copy-color" :data-clipboard-text="dataList.orderFormid" @click="copy">复制</text>
						</view>
						<view class="item">
							<text>创建时间：{{ dataList.createTime }}</text>
						</view>
						<!-- 待收货  有付款时间和发货时间 -->
						<view class="item" v-if="dataList.state==3">
							<text>付款时间：{{ dataList.paymentTime }}</text>
						</view>
					<!-- 	<view class="item" v-if="dataList.state == 3 || dataList.state == 4">
							<text>发货时间：{{ dataList.dileveryTime }}</text>
						</view> -->
						<!-- 交易成功 有成交时间-->
					<!-- 	<view class="item" v-if="dataList.state == 4">
							<text>成交时间：{{ dataList.receiveTime }}</text>
						</view> -->
					</view>
				</view>


			</view>



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

<script>
	export default {

		data() {
			return {
				dataList: {
					orderFormid: null,
					createTime: null,
					orderPrice: 0,
					logisticsPrice: 0,
					discountPrice: 0
				},
				imgurl: '',




			}
		},

		onShow() {

		},
		onLoad(options) {
			this.imgurl = this.$img
			console.log(options)
			this.$http.sendRequest('/product/getById', 'POST', {
				orderId: options.id
			}, 1).then(res => {
				this.dataList = res.data.data
			})
			return

		},

		methods: {
			copy() {
				// #ifdef H5
				let clipboard = new ClipboardJS('.copy-color');
				clipboard.on('success', function(e) {
					uni.showToast({
						title: '复制成功',
						icon: 'success'
					})
					clipboard.destroy();
				})
				clipboard.on('error', function(e) {
					uni.showToast({
						title: '复制失败',
						icon: 'success'
					})
					clipboard.destroy();
				})
				// #endif
				// #ifndef H5
				uni.setClipboardData({
					data: this.dataList.orderFormid,
					success: function() {
						uni.showToast({
							title: '复制成功',
							icon: 'success'
						})
					}
				});
				// #endif
			},


		},

	}
</script>

<style lang="scss" scoped>
	page {
		background: #f7f7f7;
	}

	.logistics {
		padding: 20upx 20upx;
	}

	.content {
		padding: 0 0 160upx 0;
	}

	.order-details-status {
		width: 750upx;
		height: 250upx;
		background: #333333;
	}

	.status-title-box {
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: center;
		padding: 40upx 30upx 0;
		box-sizing: border-box;
		text-align: center;
	}

	.status-title-box2 {
		display: flex;
		flex-direction: column;
		align-items: center;
		padding: 40upx 30upx 0;
		box-sizing: border-box;
	}

	.status-title-box .l {
		display: flex;
		flex-direction: column;
	}

	.status-title-box .l .status,
	.status-title-box2 .status {
		font-size: 30upx;
		color: #fff;
	}

	.status-title-box .l .label,
	.status-title-box2 .label {
		font-size: 24upx;
		color: #fff;
		margin-top: 14upx;
	}

	.status-title-box .r {
		width: 80upx;
		height: 80upx;
	}

	.order-details-info-box {
		padding: 0 30upx;
		box-sizing: border-box;
		// margin-top: -80upx;
	}

	.address-box {
		margin-top: 20upx;
		background: #fff;
		width: 100%;
		padding: 30upx;
		box-sizing: border-box;
		display: flex;
		flex-direction: row;
		align-items: center;
	}

	.address-box .address-img {
		width: 70upx;
		height: 70upx;
		margin-right: 20upx;
	}

	.address-box .address-r {
		flex: 1;
		display: flex;
		flex-direction: column;
		font-size: 28upx;
		color: #333;
	}

	.arrow-right-img {
		width: 24upx;
		height: 24upx;
		margin-left: 20upx;
	}

	.address-name-box {
		font-size: 30upx;
		color: #333;
	}

	.phone {
		font-size: 24upx;
		color: #999;
		margin-left: 20upx;
	}

	.address-info {
		font-size: 28upx;
		color: #333;
		margin-top: 15upx;
	}

	.order-list-box {
		margin-top: 20upx;

		.toService {
			line-height: 40rpx;
			padding: 0 8rpx;
			border: 1rpx solid #FAF6ED;
			cursor: pointer;
			display: flex;
			align-items: center;

			.service-img {
				width: 60upx;
				height: 60upx;
				margin-right: 12rpx;
			}

			text {
				line-height: 40rpx;
			}
		}
	}

	.order-list-box .item {
		margin-bottom: 20upx;
		background: #fff;
	}

	.order-list-top {
		height: 96upx;
		padding: 0 30upx;
		box-sizing: border-box;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		border-bottom: 1px solid #eee;
	}

	.top-l {
		display: flex;
		flex-direction: row;
		align-items: center;
	}

	.shop-img {
		width: 34upx;
		height: 34upx;
		margin-right: 10upx;
	}

	.shop-name {
		font-size: 30upx;
		color: #333;
		font-weight: bold;
	}

	.arrow-img {
		margin-left: 15upx;
		width: 24upx;
		height: 24upx;
	}

	.order-info-box {
		padding: 0 30upx;
		box-sizing: border-box;
	}

	.order-info {
		border-bottom: 1px solid #eee;
	}

	.order-info-item {
		display: flex;
		flex-direction: row;
		padding: 20upx 0;
	}

	.product-img {
		width: 180upx;
		height: 180upx;
		border-radius: 10upx;
		margin-right: 30upx;
	}

	.info-box {
		flex: 1;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
	}

	.product-name {
		font-size: 26upx;
		color: #333;
		height: 68upx;
		line-height: 34upx;
		display: -webkit-box;
		overflow: hidden;
		text-overflow: ellipsis;
		word-break: break-all;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
	}

	.price-sku-box {
		width: 100%;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}

	.product-sku {
		font-size: 24upx;
		color: #999;
		display: inline-block;
		margin-left: -20upx;
		display: flex;
		flex-direction: row;
	}

	.price-box {
		display: flex;
		flex-direction: column;
	}

	.product-price1 {
		font-size: 24upx;
		color: #333;
		font-weight: 400;
	}

	.product-price2 {
		font-size: 24upx;
		color: #999;
		text-decoration: line-through;
		font-weight: 400;
	}

	.product-price .fuhao {
		font-size: 28upx;
	}

	.item-applay-btn {
		height: 50upx;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: center;
		padding: 0 30upx;
		background: rgba(255, 255, 255, 1);
		border: 1px solid rgba(187, 187, 187, 1);
		border-radius: 25upx;
		font-size: 24upx;
		font-weight: 400;
		color: rgba(51, 51, 51, 1);
	}

	.product-num {
		font-size: 28upx;
		color: #999;
		display: inline-block;
	}

	.delivery-way-box {
		display: flex;
		flex-direction: column;
		margin: 30upx 0 10upx;
	}

	.delivery-way-box .item {
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		font-size: 26upx;
		color: #333;
	}

	.delivery-way-box .item .way {
		color: #999;
	}

	.order-total-box {
		padding: 30upx 0;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		font-size: 26upx;
		color: #333;
	}

	.order-total-box .way-color {
		color: #333333;
		font-size: 32rpx;
	}

	.order-details-information {
		background: #fff;
	}

	.order-details-information.padd {
		padding: 30upx;
		margin: 0 30upx;
		box-sizing: border-box;
	}

	.order-details-information .order-title {
		font-size: 30upx;
		color: #333;
		font-weight: 500;
		display: flex;
		flex-direction: row;
		align-items: center;
	}

	.order-details-information .info-box {
		margin-top: 30upx;
	}

	.order-details-information .info-box .item {
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		font-size: 24upx;
		color: #666;
		margin-bottom: 20upx;
	}

	.order-details-information .info-box .item .copy-color {
		font-size: 24upx;
		color: #C5AA7B;
	}

	.order-details-btn {
		position: fixed;
		bottom: 0;
		left: 0;
		width: 100%;
		min-height: 160upx;
		background: #fff;
		box-shadow: 0px 0px 10px 0px rgba(51, 51, 51, 0.1);
		box-sizing: border-box;
		display: flex;
		padding: 0 30upx;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		z-index: 10;
	}

	.order-details-btn .btn {
		width: 100%;
		height: 100upx;
		background: #333333;
		font-size: 28upx;
		color: #FFEBC4;
		text-align: center;
		line-height: 100upx;
		font-weight: 500upx;
	}

	.order-details-btn .btn-l {
		width: 50%;
		height: 100upx;
		border: 2rpx solid #333333;
		font-size: 28upx;
		color: #333;
		text-align: center;
		line-height: 100upx;
		box-sizing: border-box;
		margin-right: 10rpx;
	}

	.order-details-btn .btn-r {
		width: 50%;
		margin-left: 10rpx;
	}

	.mt20 {
		margin-top: 20upx;
	}

	.order-title-box {
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}

	.order-details-information .order-title-box .order-title.padd-l {
		padding-left: 30upx;
	}

	.arrow-down-img {
		width: 40upx;
		height: 40upx;
		margin: 30upx;
		box-sizing: border-box;
	}

	.evaluate {
		height: 56upx;
		border-radius: 28upx;
		text-align: center;
		line-height: 56upx;
		font-size: 26upx;
		padding: 0 30upx;
		border: 1px solid #C5AA7B;
		color: #C5AA7B;
	}

	.evaluate2 {
		height: 56upx;
		border-radius: 28upx;
		text-align: center;
		line-height: 56upx;
		font-size: 26upx;
		padding: 0 30upx;
		border: 1px solid #BBBBBB;
		color: #333;
	}

	.emptyOrder-box {
		padding: 70upx 0;

		.emptyOrder-img {
			width: 200upx;
			height: 200upx;
		}
	}

	.pay-type-item {
		.pay-type-radio {
			background-color: white;
			border-bottom: 1upx solid #EDEDED;
			margin-bottom: 20upx;
			padding: 24upx 20upx 24upx 20upx;

			.pay-type-img {
				display: inline-block;

				.pay-type-img-inner {
					width: 50upx;
					height: 50upx;
					vertical-align: middle;
				}
			}

			.pay-type-label {
				vertical-align: middle;
				margin-left: 30upx;
			}

			.pay-type-radio-item {
				float: right;
				margin-right: 20upx;
				width: 50upx;
				height: 50upx;
			}
		}

		.huabei-detail {
			margin-top: 20upx;

			.fenqi-wenzi {
				display: inline-block;
				margin-left: 64upx;
			}

			.fenqi-amount {
				display: block;
				margin-left: 64upx;
				margin-top: 14upx;
				color: #BABBBC;
			}

			.fenqi-charge-fee {
				float: right;
				margin-right: 68upx;
				color: #BABBBC;
			}

			.fenqi-modal {
				width: 40upx;
				height: 40upx;
				margin-left: 20upx;
				float: right;
				position: relative;
				top: -80upx;
			}
		}
	}

	.paytype-confirm {
		height: 120upx;
		padding: 0upx 108upx 0upx 32upx;

		.fenqi-all {
			display: inline-block;
			width: 100%;
		}

		.fenqi-total-amount {
			width: 65%;
			float: left;
		}

		.fenqi-confirm {
			float: right;
			width: 160upx;
			padding: 0upx 20upx;

			.btn {
				width: 216upx;
				height: 80upx;
				line-height: 80upx;
				border-radius: 40upx;
				font-size: 28upx;
				text-align: center;
				background: linear-gradient(90deg, rgba(255, 162, 0, 1), rgba(255, 121, 17, 1));
				color: #fff;
				display: inline-block;
				margin-right: 66upx;
			}
		}
	}

	.period-radio {
		margin: 30upx;
		padding-right: 100upx;
		width: 95%;
		border-bottom: 1px solid #EFEFEF;

		.period-amount {
			display: inline-block;

			.period-each-charge {
				display: inline-block;
				margin-top: 12upx;
				margin-left: 6upx;
				font-size: 26upx;
				color: #b7b7b7;
				margin-bottom: 13upx;
			}
		}

		.period-each {
			display: block;
		}

		.period-type-radio-item {
			float: right;
		}
	}
</style>