<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="bgMain">
			<view class="afterSalesInfo">
				<view class="shopName">{{data.storeName}}</view>
				<view class="goodsinfo">
					<view>
						<image class="img" :src="data.goodsImage"></image>
					</view>
					<view class="info">
						<view class="afterSalesName">{{data.goodsName}}</view>
						<view class="afterSalesType">{{data.goodsType}}</view>
						<view class="price">
							<view class="afterPrice">￥{{data.goodsPrice}}</view>
							<view class="inventory">×1</view>
						</view>
					</view>
				</view>
			</view>

			<view class="applyAfteSales">
				<view class="verificationInfo">
					<view class="bg"></view>
					<view class="verifi">申请原因</view>
				</view>
				<u--textarea border="none" placeholder="请输入申请原因" v-model="data.applyContent"></u--textarea>

				<view class="imgList">
					<view style="display: flex; padding-left: 10rpx;"v-for="(item,index) in data.afterSalesPictureList">
						<image class="applyPictures" :src="item"></image>
					</view>
				</view>
			</view>

			<view class="refundInfo">
				<view class="refundMethod">
					<view style="font-size: 28rpx;">退款方式</view>
					<view style="font-size: 26rpx; color: #999999;">{{this.data.refundMethod==1?"微信退款（原路返回)":""}}</view>
				</view>
				<view class="refundAmount">
					<view style="font-size: 28rpx;">预估退款金额(以实际金额为准)</view>
					<view style="font-size: 32rpx; color:#FF4502;; font-weight: 800;">
						￥{{this.data.estimatedRefundAmount}}</view>
				</view>
			</view>

			<view class="handle" @click="goDown">去处理</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: "",
				data: {}
			}
		},
		onLoad(options) {
			this.id = options.id
			console.log(options.id)
			this.getafterSalesOrderDetails()
		},
		methods: {
			getafterSalesOrderDetails() {
				this.$http.get("/api/store/personalCenter/afterSalesOrderDetails", {
					id: this.id,

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

				})
			},
			goDown() {
				uni.navigateTo({
					url: '/pages/afterSalesProcessing/afterSalesProcessing?id=' + this.id
				})
			}
		}

	}
</script>

<style lang="scss">
	.handle {
		color: white;
		font-weight: 800;
		padding-top: 23rpx;
		margin-top: 80rpx;
		padding-bottom: 23rpx;
		text-align: center;
		background: linear-gradient(90deg, #FF4502 0%, #FF8903 100%);
		border-radius: 41rpx 41rpx 41rpx 41rpx;
	}

	.refundInfo {
		margin-top: 20rpx;
		padding: 24rpx;
		background: #FFFFFF;
		border-radius: 18rpx 18rpx 18rpx 18rpx;

		.refundMethod {
			display: flex;
			justify-content: space-between;
		}

		.refundAmount {
			padding-top: 20rpx;
			display: flex;
			justify-content: space-between;
		}
	}

	.applyAfteSales {
		margin-top: 20rpx;
		background: #FFFFFF;
		padding: 24rpx;
		border-radius: 18rpx 18rpx 18rpx 18rpx;

		.imgList {
			display: flex;
			overflow-x: auto;
			width: 100%;

			.applyPictures {
				display: flex;
				margin-top: 10rpx;
				width: 244rpx;
				height: 244rpx;
			}
		}

	}

	.afterSalesInfo {
		padding: 24rpx;
		background: #FFFFFF;
		border-radius: 18rpx 18rpx 18rpx 18rpx;

		.shopName {
			font-size: 24rpx;
			color: #333333;
		}

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

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

		.afterSalesName {
			padding-top: 10rpx;
			font-size: 28rpx;
			color: #333333;
		}

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

		.goodsinfo {
			margin-top: 10rpx;
			display: flex;

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

			.info {
				padding-left: 10rpx;
			}
		}

		.img {
			width: 156rpx;
			height: 156rpx;
		}

	}

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

		.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;
		}
	}
</style>