<template>
	<view class="details">
		<view class="status">
			<view class="text">
				<view class="status-text">交易成功</view>
				<view class="time" v-if="current == 2">距离结束22:22:22</view>
			</view>
			<image src="../static/mine/31.png" v-if="current"></image>
		</view>
		<view class="info">
			<view class="info-address">
				<image src="../static/mine/28.png"></image>
				<view class="address-right">
					<view class="user-info">
						<view>胖胖</view>
						<view>18220171014</view>
					</view>
					<view class="address-text u-line-2">山东省泰安市泰山区东岳大街与克山路交汇口银山店四楼橙天影视南邻山东省泰安市泰山区东岳大街与克山路交汇口银山店四楼橙天影视南邻</view>
				</view>
			</view>
			<view class="info-goods">
				<view class="goods-store">
					<view class="stoer-title">
						<image src="../static/mine/23.png" class="store-image"></image>
						<view class="store-name">胖胖的店</view>
						<image src="../static/mine/21.png" class="right-icon"></image>
					</view>
					<view class="store-goods">
						<image src="../static/mine/23.png"></image>
						<view class="goods-info">
							<view class="goods-name u-line-2">木糖少女小紫薯西装领连衣裙夏季新款女装夏收腰格子格纹裙子木糖少女小紫薯西装领连衣裙夏季新款女装夏收腰格子格纹裙子</view>
							<view class="goods-order">
								<view class="price">￥99</view>
								<view class="num">x2</view>
							</view>
						</view>
					</view>
				</view>
				<view class="goods-others">
					<view>
						<view class="title">运费(快递/骑手)</view>
						<view class="price">￥0.00</view>
					</view>
					<view>
						<view class="title">店铺优惠</view>
						<view class="price">￥0.00</view>
					</view>
					<view>
						<view class="title">订单总价</view>
						<view class="price">￥0.00</view>
					</view>
					<view>
						<view class="title">实付费(含运费)</view>
						<view class="price">￥0.00</view>
					</view>
					<view>
						<view class="title">支付方式</view>
						<view class="price">￥0.00</view>
					</view>
				</view>
			</view>
			<view class="info-order">
				<view>订单编号：2222222222222222</view>
				<view>微信交易号：2222222222222222</view>
				<view>创建时间：2020-05-14</view>
			</view>
		</view>
		<view class="btn" v-if="[0, 2, 4].indexOf(current) < 0">
			<view class="logistics" v-if="current == 3" @click="toOtherPage('Logistics')">查看物流</view>
			<view class="comment" v-if="current == 5">立即评价</view>
			<view class="payment" v-if="current == 1">立即支付</view>
			<view class="service" v-if="current == 6">联系官方客服</view>
			<view class="submit" v-if="current == 6">提交官方审核</view>
		</view>
	</view>
</template>
<script>
export default {
	data() {
		return {
			current: 0
		}
	},
	onLoad(option) {
		this.current = option.current;
		console.log(option.current);
		this.setTitle();
	},
	methods: {
		setTitle(){
			let title = ''
			switch (this.current) {
				case '1':
					console.log(title);
					
					title = "支付成功"
					break;
				default:
					title = "订单详情"
					break;
			}
			uni.setNavigationBarTitle({
				title: title
			});
		},
		toOtherPage(url) {
			uni.navigateTo({
				url: '/pageE/order/' + url
			});
		}
	},
};
</script>
<style lang="scss" scoped>
.details {
	min-height: calc(100vh - var(--window-top));
	background-color: #ECECEC;
	.status {
		position: fixed;
		top: 0;
		left: 0;
		display: flex;
		height: calc(180rpx + var(--window-top));
		width: 100%;
		background: rgba(255,120,15,1);
		z-index: 9;
		.text {
			margin: calc(74rpx + var(--window-top)) auto 0 73rpx;
			color: rgba(255,255,255,1);
			.status-text {
				font-size: 36rpx;
				font-weight: 500;
				margin-bottom: 17rpx;
			}
			.time {
				// white-space: nowrap;
				font-size: 26rpx;
				color: rgba(255,255,255,1);
			}
		}
		> image {
			margin: calc(36rpx + var(--window-top)) 70rpx 0 0;
			width: 126rpx;
			height: 109rpx;
			flex-shrink: 0;
		}
	}
	.info {
		padding-top: 180rpx;
		margin-bottom: 10rpx;
		.info-address {
			padding: 30rpx;
			display: flex;
			align-items: center;
			margin-bottom: 10rpx;
			background:rgba(255,255,255,1);
			> image {
				width: 28rpx;
				height: 34rpx;
				margin-right: 31rpx;
				flex-shrink: 0;
			}
			.address-right {
				.user-info {
					display: flex;
					align-items: center;
					font-size: 28rpx;
					color: rgba(51,51,51,1);
					margin-bottom: 20rpx;
					> view:first-child {
						margin-right: 13rpx;
					}
				}
				.address-text {
					font-size: 24rpx;
					color: rgba(102,102,102,1);
					line-height: 42rpx;
				}
			}
		}
		.info-goods {
			margin-bottom: 10rpx;
			.goods-store {
				padding: 30rpx;
				margin-bottom: 2rpx;
				background:rgba(255,255,255,1);
				.stoer-title {
					display: flex;
					align-items: center;
					margin-bottom: 20rpx;
					.store-image {
						width: 60rpx;
						height: 60rpx;
						border-radius: 50%;
						margin-right: 16rpx;
					}
					.store-name {
						font-size: 28rpx;
						color: rgba(51,51,51,1);
						margin-right: 14rpx;
					}
					.right-icon {
						width: 11rpx;
						height: 22rpx;
					}
				}
				.store-goods {
					display: flex;
					> image {
						width: 180rpx;
						height: 160rpx;
						border-radius: 10rpx;
						margin-right: 30rpx;
						flex-shrink: 0;
					}
					.goods-info {
						display: flex;
						flex-direction: column;
						justify-content: space-between;
						.goods-name {
							font-size: 30rpx;
							color: rgba(51,51,51,1);
							line-height: 44rpx;
						}
						.goods-order {
							display: flex;
							align-items: center;
							justify-content: space-between;
							.price {
								font-size: 30rpx;
								font-weight: 500;
								color: rgba(51,51,51,1);
							}
							.num {
								font-size: 28rpx;
								color: rgba(102,102,102,1);
							}
						}
					}
				}
			}
			.goods-others {
				background:rgba(255,255,255,1);
				padding: 30rpx;
				> view {
					display: flex;
					align-items: center;
					justify-content: space-between;
					&:not(:last-child) {
						margin-bottom: 30rpx;
					}
					.title {
						font-size: 28rpx;
						color: rgba(102,102,102,1);
					}
					.price {
						font-size: 30rpx;
						color: rgba(51,51,51,1);
					}
				}
			}
		}
		.info-order {
			background:rgba(255,255,255,1);
			padding: 30rpx;
			font-size: 28rpx;
			color: rgba(102,102,102,1);
			> view:not(:last-child) {
				margin-bottom: 30rpx;
			}
		}
	}
	.btn {
		height: 98rpx;
		background: rgba(255,255,255,1);
		display: flex;
		justify-content: flex-end;
		padding: 19rpx 30rpx;
		@mixin btn-class($width, $color) {
			width: $width;
			height: 60rpx;
			border: 2rpx solid $color;
			color: $color;
			border-radius: 30rpx;
			padding: 15rpx 23rpx;
			font-size: 28rpx;
			&:not(:last-child) {
				margin-right: 30rpx;
			}
		}
		.logistics, .comment, .payment {
			@include btn-class($width: 160rpx, $color: rgba(255,119,15,1));
		}
		.service {
			@include btn-class($width: 216rpx, $color: rgba(155,153,153,1));
		}
		.submit {
			@include btn-class($width: 216rpx, $color: rgba(255,119,15,1));
		}
	}
}
</style>