<!-- 退款/售后 -->
<!--pages/afterSales/afterSales.wxml-->
<view class="afterSales">
  <view class="goods-list">

    <view class="goods-item" wx:for="{{list}}" wx:key="item.refundId">
      <!-- 店铺 -->
      <view class="shop-box clearfix">
        <view class="shop-img"><image src="../../images/icon/shop.png"></image></view>
        <view class="shopname">店铺：{{item.shopName}}</view>
      </view>
      <view class="goods-msg-box" wx:if="{{item.orderItems.length==1}}">
        <!-- 图片 -->
        <view class="img-box">
          <image src="{{item.orderItems[0].pic}}"></image>
        </view>
        <!-- 信息 -->
        <view class="goods-text">
          <view class="goods-title">{{item.orderItems[0].prodName}}</view>
          <view class="goods-quantity">数量 ：{{item.orderItems[0].prodCount}}件</view>
          <!-- 查看详情btn -->
          <view class="item-bottom clearfix" data-refundsn="{{item.refundSn}}" bindtap="toRefundDetails">
            <text class="view-details">查看详情</text>
          </view>
        </view>
      </view>
      <view class="goods-msg-box" wx:else>
        <block>
          <view class='item-cont' bindtap='toRefundDetails' data-refundsn="{{item.refundSn}}">
            <scroll-view scroll-x="true" scroll-left='0' scroll-with-animation="false" class="categories">
              <block wx:for="{{item.orderItems}}" wx:for-item="prod" wx:key='prod.prodName'>
                <view class='prod-pic'>
                  <image src="{{prod.pic}}"></image>
                </view>
              </block>
            </scroll-view>
          </view>
        </block>
      </view>

      <!-- 退款进度提示 -->
      <view class="goods-item-tips">
        <view class="rmb-icon">
          <!-- 仅退款 -->
          <image src="../../images/icon/rmb-icon.png" wx:if="{{item.applyType == 1}}"></image>
          <!-- 退货退款 -->
          <image src="../../images/icon/refunds.png" wx:if="{{item.applyType == 2}}"></image>
        </view>
        <!-- applyType  申请类型:1,仅退款,2退款退货 -->
        <!-- 处理退款状态:(1.买家申请 2.卖家接受 3.买家发货 4.卖家收货 5.退款成功 6.买家撤回申请 7.商家拒绝 -1.退款关闭) -->
        <view class="refund-type" wx:if="{{item.applyType == 1}}">仅退款</view>
        <view class="refund-type" wx:if="{{item.applyType == 2}}">退货退款</view>
        <view class="refund-process" wx:if="{{item.returnMoneySts == 10}}">你已提交退款申请，等待商家处理</view>
        <view class="refund-process" wx:if="{{item.returnMoneySts == 20}}">处理中</view>
        <view class="refund-process" wx:if="{{item.returnMoneySts == 60}}">商家已同意，请按照给出地址寄回商品</view>
        <view class="refund-process" wx:if="{{item.returnMoneySts == 65}}">等待商家确认收货并退款</view>
        <!-- <view class="refund-process" wx:if="{{item.returnMoneySts == 4 && item.applyType == 2}}">商家已确认收货，等待退款到账</view> -->
        <view class="refund-process" wx:if='{{item.returnMoneySts == 70}}'>退款成功！</view>
        <view class="refund-process" wx:if='{{item.returnMoneySts == 40}}'>退款申请已撤销</view>
        <view class="refund-process" wx:if="{{item.returnMoneySts == 30}}">商家拒绝，可修改退款申请或申请客服介入处理</view>
        <view class="refund-process" wx:if='{{item.returnMoneySts == -1}}'>退款申请已关闭</view>  
      </view>

      <!-- <view class="btn-box" wx:if="{{item.returnMoneySts == 10}}"> -->
      <view class="btn-box" wx:if="{{item.returnMoneySts == 10}}">
        <view class="cancel-btn" data-refundSn="{{item.refundSn}}" bindtap="cancelApplication">取消申请</view>
      </view>
      <!-- <view class="btn-box" wx:if="{{item.returnMoneySts == 40}}">
        <view class="cancel-btn" data-refundId="{{item.refundId}}" bindtap="applyAgain">再次申请</view>
      </view> -->
      
    </view>

    <!-- <view class="empty" wx:if="{{!list.length}}">您还没有退款/售后订单哦~</view> -->
    <!-- 空 -->
    <view class="empty" wx:if="{{!list.length}}">
      <view class="empty-icon">
        <image src="../../images/icon/empty.png"></image>
      </view>
      <view class="empty-text">还没有退款/售后相关订单~</view>
    </view>
    
  </view>
</view>
