<template>
	<view class="refund">
		<view class="refund-hd">
			<view class="a">
				<image class="pic" :src="order.goods_image"></image>
				<view class="n">出柜：已签收，签收人凭取取件码..</view>
				<image class="arrow" src="/static/news/icon-arrow.png"></image>
			</view>
			<view class="b" @click="openPage(4)">
				退货运费规则
				<image class="arrow" src="/static/news/icon-arrow.png"></image>
			</view>
		</view>
		<view class="refund-bd">
			<view class="item" @click="openPage(1)">
				<image class="icon" :src="$picUrl+'/static/news/icon-refund-01.png'"></image>
				<view class="info">
					<view class="a">我要退货退款</view>已收到货，需要退还已收到的货物
				</view>
				<image class="arrow" src="/static/news/icon-arrow.png"></image>
			</view>
			<view class="item" @click="openPage(2)">
			<image class="icon" :src="$picUrl+'/static/news/icon-refund-03.png'"></image>
				<view class="info">
					<view class="a">我要退款（无需退货）</view>未收到货，或与商家协商之后申请
				</view>
				<image class="arrow" src="/static/news/icon-arrow.png"></image>
			</view>
			<view class="item" @click="openPage(3)">
				<image class="icon" :src="$picUrl+'/static/news/icon-refund-03.png'"></image>
				<view class="info">
					<view class="a">我要换货</view>对收到的商品不满意，可与商家协商换货
				</view>
				<image class="arrow" src="/static/news/icon-arrow.png"></image>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				orderId: '',
				order: '',
				deliveryStatus: '',
				receiptStatus: '',
			};
		},
		onLoad(op) {
			console.log(JSON.parse(op.order))
			this.orderId = op.orderId;
			this.order = op.order ? JSON.parse(op.order) : ''
			this.deliveryStatus = op.deliveryStatus;
			this.receiptStatus = op.receiptStatus
		},
		methods: {
			openPage(index) {
				if (index == 4) {
					uni.navigateTo({
						url: '/pages/order/refund/freight?orderId=' + this.orderId + '&order=' + JSON.stringify(this
								.order) +
							"&deliveryStatus=" + this.deliveryStatus + '&receiptStatus=' + this.deliveryStatus
					})
				} else {
					uni.navigateTo({
						url: '/pages/order/refund/refund?orderId=' + this.orderId + '&order=' + JSON.stringify(this
								.order) +
							"&deliveryStatus=" + this.deliveryStatus + '&receiptStatus=' + this.deliveryStatus
					})
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.refund {
		overflow: hidden;

		.arrow {
			width: 30rpx;
			height: 30rpx;
		}

		&-hd {
			padding: 20rpx 25rpx 20rpx 45rpx;
			overflow: hidden;
			background-color: #FFF;

			.a {
				display: flex;
				align-items: center;
				padding-bottom: 20rpx;
				border-bottom: 1px solid #F3F3F3;

				.pic {
					width: 146rpx;
					height: 134rpx;
					border-radius: 6rpx;
					margin-right: 10rpx;
				}

				.n {
					width: 480rpx;
					font-size: 28rpx;
					font-weight: 400;
					color: #838383;
					white-space: nowrap;
					text-overflow: ellipsis;
					overflow: hidden;
					margin-right: 10rpx;
				}
			}

			.b {
				display: flex;
				align-items: center;
				justify-content: space-between;
				padding-top: 20rpx;
				font-size: 28rpx;
				font-family: PingFang SC, PingFang SC;
				font-weight: 400;
				color: #838383;
			}
		}

		&-bd {
			padding: 0 35rpx;
			overflow: hidden;

			.item {
				padding: 68rpx 50rpx;
				overflow: hidden;
				background: #FFFFFF;
				border-radius: 16rpx;
				box-sizing: border-box;
				display: flex;
				align-items: center;
				margin-top: 20rpx;

				.icon {
					width: 60rpx;
					height: 60rpx;
					margin-right: 35rpx;
				}

				.info {
					flex: 1;
					font-size: 24rpx;
					font-weight: 400;
					color: #8B8B8B;
					margin-right: 35rpx;

					.a {
						font-size: 32rpx;
						font-weight: 400;
						color: #000000;
						margin-bottom: 20rpx;
					}

				}
			}
		}
	}
</style>
