<template>
	<view class="page flex-col">

		<view class="block_4 flex-col">

			<view v-if="userAfterSales.status ===1" class="group_1 flex-row">
				<view class="image-text_10 flex-row justify-center">
<!--					<image class="icon_2" src="/static/images/已完成@2x.png"/>-->
					<text class="text-group_1_1">{{userAfterSales.statusDesc}}</text>
				</view>
			</view>

			<view v-else class="group_1 flex-row">
				<view class="image-text_10 flex-row justify-center">
<!--					<image class="icon_2" src="/static/images/退款中.png"/>-->
					<text class="text-group_1">{{userAfterSales.statusDesc}}</text>
				</view>
			</view>

			<view class="group_2 flex-col">
				<view class="image-text_11 flex-row justify-between" v-for="(item,index) in userAfterSales.goodsList " :key="index">
					<view class="group_3 flex-col">
						<image :src="item.goodsImage"></image>
					</view>
					<view class="text-group_8 flex-col">
						<text class="text_4">
							{{item.goodsName}}
						</text>
						<view class="text-wrapper_26 flex-row justify-between">
							<text class="text_5">¥{{item.goodsPrice}}</text>
							<text class="text_6">x&nbsp;{{item.goodsNum}}</text>
						</view>
					</view>
				</view>
			</view>
		</view>

    <view class="box_7 flex-col">
      <view class="text-wrapper_27 flex-row">
        <text class="text_10">订单信息</text>
      </view>
      <view class="text-wrapper_28 flex-row justify-between">
        <text class="text_11">订单编号</text>
        <text class="text_12">{{userAfterSales.order.orderNo}}</text>
      </view>
      <view class="text-wrapper_29 flex-row justify-between">
        <text class="text_13">下单时间</text>
        <text class="text_14">{{userAfterSales.order.createTime}}</text>
      </view>
      <view class="text-wrapper_30 flex-row justify-between">
        <text class="text_15">支付方式</text>
        <text class="text_16">{{userAfterSales.order.payModeDesc}}</text>
      </view>
      <view class="text-wrapper_33 flex-row justify-between">
        <text class="text_21">订单金额</text>
        <text class="text_22">¥ {{userAfterSales.order.paymentAmount}}</text>
      </view>
    </view>

		<view class="box_7 flex-col">
			<view class="text-wrapper_27 flex-row">
				<text class="text_10">售后信息</text>
			</view>
			<view class="text-wrapper_28 flex-row justify-between">
				<text class="text_11">售后编号</text>
				<text class="text_12">{{userAfterSales.afterSalesNo}}</text>
			</view>
			<view class="text-wrapper_29 flex-row justify-between">
				<text class="text_13">售后原因</text>
				<text class="text_14">{{userAfterSales.reason}}</text>
			</view>
			<view class="text-wrapper_30 flex-row justify-between">
				<text class="text_15">申请时间</text>
				<text class="text_16">{{userAfterSales.createTime}}</text>
			</view>

		</view>

		<view class="box_7 flex-col" v-if="userAfterSales.refundState == 1">
		  <view class="text-wrapper_27 flex-row">
			<text class="text_10">退款信息</text>
		  </view>
		  <view class="text-wrapper_31 flex-row justify-between">
			<text class="text_17">退款单号</text>
			<text class="text_18">{{userAfterSales.refund.refundNo}}</text>
		  </view>
		  <view class="text-wrapper_32 flex-row justify-between">
			<text class="text_19">退款方式</text>
			<text class="text_20">原路返还</text>
		  </view>
		  <view class="text-wrapper_33 flex-row justify-between">
			<text class="text_21">退款金额</text>
			<text class="text_22">¥ {{userAfterSales.refund.refuseAmount}}</text>
		  </view>
		  <view class="text-wrapper_33 flex-row justify-between">
			<text class="text_21">退款时间</text>
			<text class="text_22">¥ {{userAfterSales.refund.refundTime}}</text>
		  </view>
		</view>

		<view class="box_7 flex-col" v-if="userAfterSales.store">
			<view class="text-wrapper_27 flex-row">
				<text class="text_10">供应商信息</text>
			</view>
			<view class="text-wrapper_31 flex-row justify-between">
				<text class="text_17">供应商名称</text>
				<text class="text_18">{{userAfterSales.store.name}}</text>
			</view>
			<view class="text-wrapper_32 flex-row justify-between">
				<text class="text_19">电话</text>
				<text class="text_20">{{userAfterSales.store.tel}}</text>
			</view>
			<view class="text-wrapper_32 flex-row justify-between">
				<text class="text_19">地址</text>
				<text class="text_20">{{userAfterSales.store.storeAddress}}</text>
			</view>
		</view>

		<!--这里是广告-->
		<view class="ads">
			<my-swiper :type=4 ></my-swiper>

		</view>
		<!--广告结束-->
	</view>
</template>
<script>
	import {getUserAfterSalesDetail} from '@/api/groupon.js'
	export default {
		data() {
			return {
				money:0,
				userAfterSales:{},
				constants: {},
			};
		},

		onLoad(e){
			console.log("++++++++++++++++++++++",e)
			this.getDetail(e.id);
		},

		methods: {
			getDetail(id){
				getUserAfterSalesDetail(id).then(res =>{
					this.userAfterSales = res.data;

					this.userAfterSales.goodsList.forEach(item =>{
						this.money += item.goodsPrice * item.goodsNum;
					})
					console.log("++++++++getUserAfterSalesDetail++++++++++++",res.data)
				})

			},

		},
	};
</script>
<style lang="scss" scoped>
	@import '/static/css/common.css';
	@import './index.rpx.css';
</style>
