<!--pages/applyRefund/applyRefund.wxml-->
<view class="applyRefund">

  <view class="notice">
  <image class="icon" src="../../images/icon/warn.png" mode=""/>
    部分退款时，有积分消费的，优先返还积分。
  </view>

  <view class="apply-type box">
    <view class="title">售后类型</view>
    <radio-group bindchange="radioChange">
      <view class="item">
          <radio class="radio" checked="{{applyType == 1}}" value="1" color="#FF941A" />
          <view class="info">
            <view class="title">我要退款</view>
            <view class="desc">没收到货，货已收到货与商家协商后无需退货只退款</view>
          </view>
      </view>
      <view class="item">
          <radio class="radio" value="2" checked="{{applyType == 2}}" color="#FF941A"/>
          <view class="info">
            <view class="title">我要退货退款</view>
            <view class="desc">已收到货，需要退还已收到的商品</view>
          </view>
      </view>

    </radio-group>
  </view>

  <view class="refund-goods box">
      <view class="title-box">
        <view class="title">退款商品</view>
        <view class="price">退款金额：￥{{total}}</view>
      </view>
      <view class="good-list">
        <view class="all">
          <checkbox bindtap='onSelectedAll'  checked="{{isAll}}" color="#105c3e" />全选
        </view>
        <view class="good-item" wx:for="{{refundItem.orderItemDtos}}">
        	<checkbox bindtap='onSelectedItem' data-index="{{index}}" value="{{index}}" checked="{{item.checked}}" color="#105c3e" />
          <image src="{{item.pic}}" mode="" class="img"/>
          <view class="info">
            <view class="good-name">{{item.prodName}}</view>
            <view class="desc">{{item.skuName}}</view>
            <view class="price">单价：￥{{item.price}}</view>
          </view>
          <view class="price-box">
            <view class="price">￥{{item.price*item.num}}</view>
            <view class="num-box">
              <view class="btn" bind:tap="changeNum" data-index="{{index}}" data-num="{{-1}}">-</view>
              <view class="num">{{item.num}}</view>
              <view class="btn" bind:tap="changeNum" data-index="{{index}}" data-num="{{1}}">+</view>
            </view>
          </view>
        </view>
      </view>
        <!-- <view class="open-btn">
          展开（共7件） <image class="arrow" src="../../images/icon/black-down-arrow.png" mode=""/>
        </view> -->
    </view>

    <view class="reason-box box">
      <view class="title-box">
        <view class="title">退款原因</view>
        <view class="choose" bindtap="choose" >{{reasonList[buyerReason].name||'请选择退款原因'}} <image class="icon" src="../../images/icon/more.png" mode=""/> </view>
      </view>
      <view class="content">
        <textarea class="reason" maxlength="200" placeholder="补充描述和凭证，有助于提高退款效率" bindinput="onInput"  value="{{buyerDesc}}"/> 
        <view class="img-box">
          <view class="img-item"  wx:for="{{photoFiles}}">
            <image src="../../images/icon/del.png" bind:tap="delImg" data-index="{{index}}" mode="" class="del"/>
            <image src="{{item.url}}" mode="aspectFit" class="img"/>
          </view>
          <view class="upload"  bindtap="getUploadImg">
            <image src="../../images/icon/photo.png" mode="" class="photo"/>
          </view>
        </view>
      </view>
    </view>


    <van-action-sheet show="{{ show }}" title="" bind:click-overlay="close">
      <view class="reason-content">
      <view class="title">选择退款原因</view>
        <view class="notice" style="position: static;width: 100%;">
          <image class="icon" src="../../images/icon/warn.png" mode=""/>
          部分退款时，有积分消费的，优先返还积分。
        </view>

        <view class="reason-list">
          <view class="title-box">
            <view class="sub-title">请选择退款原因</view>
            <view class="desc">(必选)</view>
          </view>
          <radio-group bindchange="chooseReason">
            <view class="item" wx:for="{{reasonList}}" wx:key="{{index}}">
              <radio class="radio" checked="{{buyerReason === index}}" value="{{index}}" color="#FF941A" />
              <view class="text">{{item.name}}</view>
            </view>
          </radio-group>
        </view>
        <view class="submit-box">
          <view class="btn" bind:tap="submitReason">确认</view>
        </view>
      </view>
    </van-action-sheet>

    <view class="submit-box">
      <view class="btn" bind:tap="apply">提交</view>
    </view>

</view>
