<template>
	<view class="app" v-if='Aftersalesorder'>
		<view class="elderly">
			<view class="wait">
				请等待商家处理
			</view>
		</view>
		<view class="content">
			<view class="name">
				退款信息
			</view>
			<view class="details">
				<view class="detailslist">
					<image :src="baseurl+Aftersalesorder.attributePitureUrl" mode=""></image>
					<view class="model">
						<view class="top">
							<span v-if="Aftersalesorder.orderType =='HEALTH_CONSULTATION'">健康咨询</span>
							<span v-else>{{Aftersalesorder.goodsName}}</span>
							<span v-if="Aftersalesorder.orderType=='DIRECT_BUY'">￥{{Aftersalesorder.goodsPrice}}</span>
						</view>
						<view class="bottom" v-if="Aftersalesorder.orderType !='HEALTH_CONSULTATION'">
							<span class="box">型号：{{Aftersalesorder.goodsAttributeName}}</span>
							<span class="box">×1</span>
						</view>
					</view>
				</view>
			</view>
			<view class="info">
				<view>订单编号：{{Aftersalesorder.goOrderNo}}</view>
				<view>申请金额：￥{{Aftersalesorder.totalPrice}}</view>
				<view v-if="Aftersalesorder.orderType !='HEALTH_CONSULTATION'">退款原因：{{Aftersalesorder.dictLabel}}</view>
				<view v-if="Aftersalesorder.appleTime">申请时间：{{Aftersalesorder.appleTime}}</view>
			</view>
		</view>
		<view class="evaluate">
			<!-- <view class="cancelorder">修改申请</view> -->
			<!-- <view class="cancelorder " style="background: #26A888;">撤销申请</view> -->
		</view>
	</view>
</template>

<script>
	import {
		ssgoodsOrder
	} from '@/api/pagesB/CommodityOrder/index.js'
	import baseurl from '@/api/baseurl.js'
	export default {
		data() {
			return {
				baseurl: '',
				Aftersalesorder: null,
				orderTypeList: {
					goodsOrderId: null,
					patientId: '',
					openid: null,
					orderTypeList: [
						'INTEGRAL_EXCHANGE',
						'DIRECT_BUY',
					],
					orderStatus: '',
					pageSize: 15,
					pageNum: 1,
					goodsName: '',
				},
			}
		},
		methods: {
			goodsOrderinfo() {
				ssgoodsOrder(this.orderTypeList).then(
					res => {
						this.Aftersalesorder = res.rows[0]
					})
			},
		},
		onLoad(options) {
			this.orderTypeList.goodsOrderId = options.goodsOrderId
			this.baseurl = baseurl
			let that = this
			const value = uni.getStorageSync('patientId');
			const openid = uni.getStorageSync('openid');
			if (value && openid) {
				that.orderTypeList.patientId = value
				that.orderTypeList.openid = openid
				that.goodsOrderinfo();
			}
		}
	}
</script>

<style lang="scss">
	@import "./Aftersalesdetails.scss";
</style>
