<view a:if="{{order_data != null}}">
  <!-- 商品 -->
  <view class="goods bg-white spacing-mb">
      <view class="goods-item oh">
        <navigator url="/pages/goods-detail/goods-detail?goods_id={{order_data.items.goods_id}}" hover-class="none">
          <image class="goods-image fl" src="{{order_data.items.images}}" mode="aspectFill" />
          <view class="goods-base">
            <view class="goods-title multi-text">{{order_data.items.title}}</view>
            <block a:if="{{order_data.items.spec != null}}">
              <view class="goods-spec cr-888" a:for="{{order_data.items.spec}}" a:for-item="spec" a:key="spec">
                {{spec.type}}:{{spec.value}}
              </view>
            </block>
          </view>
          <view class="oh goods-price">
            <text class="sales-price">{{order_data.currency_data.currency_symbol}}{{order_data.items.price}}</text>
            <text a:if="{{order_data.items.original_price > 0}}" class="original-price">{{order_data.currency_data.currency_symbol}}{{order_data.items.original_price}}</text>
            <text class="buy-number">x{{order_data.items.buy_number}}</text>
          </view>
        </navigator>
      </view>
  </view>

  <!-- 基础信息 -->
  <view a:if="{{new_aftersale_data != null}}" class="detail bg-white">
    <!-- 提示/退货 -->
    <view a:if="{{new_aftersale_data.status <= 2}}" class="msg-tips spacing-mb">
      <text class="msg-text">{{new_aftersale_data.tips_msg}}</text>
      <text class="msg-a" onTap="show_aftersale_event">详情查看 >></text>
      <view>
        <button a:if="{{new_aftersale_data.status == 1 && new_aftersale_data.type == 1 && return_goods_address != null}}" type="primary" size="mini" onTap="delivery_submit_event">立即退货</button>
      </view>
    </view>

    <!-- 退货地址 -->
    <view a:if="{{new_aftersale_data.status == 1 && new_aftersale_data.type == 1 && return_goods_address != null}}" class="return-address msg-tips msg-tips-warning spacing-mb">
      <view>
        <text class="address-title">退货地址：</text>
        <text class="address-value">{{return_goods_address}}</text>
      </view>
    </view>

    <!-- 提示 -->
    <view a:if="{{new_aftersale_data.status >= 3}}" class="msg-tips {{new_aftersale_data.status != 5 ? 'spacing-mb' : ''}} {{new_aftersale_data.status == 3 ? 'msg-tips-success' : (new_aftersale_data.status == 4 ? 'msg-tips-danger' : 'msg-tips-warning')}}">
      <text class="msg-text">{{new_aftersale_data.tips_msg}}</text>
      <text class="msg-a" onTap="show_aftersale_event">详情查看 >></text>
    </view>

    <!-- 详情 -->
    <view a:if="{{new_aftersale_data.status != 5}}">
      <!-- 申请信息 -->
      <view class="panel-item">
        <view class="panel-title">申请信息</view>
        <view class="panel-content">
          <view a:for="{{panel_base_data_list}}" class="item br-b oh">
            <view class="title fl">{{item.name}}</view>
            <view class="content fl br-l">{{new_aftersale_data[item.field] || ''}}</view>
          </view>
        </view>
      </view>

      <!-- 快递信息 -->
      <view a:if="{{new_aftersale_data.status > 1 && new_aftersale_data.type == 1}}" class="panel-item spacing-mt">
        <view class="panel-title">快递信息</view>
        <view class="panel-content">
          <view a:for="{{panel_express_data_list}}" class="item br-b oh">
            <view class="title fl">{{item.name}}</view>
            <view class="content fl br-l">{{new_aftersale_data[item.field] || ''}}</view>
          </view>
        </view>
      </view>

      <!-- 凭证 -->
      <view a:if="{{(new_aftersale_data.images || null) != null && new_aftersale_data.images.length > 0}}" class="panel-item spacing-mt">
        <view class="panel-title">凭证</view>
        <view class="panel-content voucher-data oh">
          <view a:for="{{new_aftersale_data.images}}" class="fl item">
            <image src="{{item}}" mode="aspectFill" onTap="images_view_event" data-index="{{index}}" />
          </view>
        </view>
      </view>
    </view>
  </view>

  <!-- 没有售后数据/售后数据为已取消则可以重新申请售后 -->
  <view a:if="{{new_aftersale_data == null || new_aftersale_data.status == 5}}" class="spacing-mt">
    <!-- 类型选择 -->
    <view a:if="{{aftersale_type_list.length > 0}}" class="choose-type bg-white spacing-mb oh">
      <block a:for="{{aftersale_type_list}}">
        <view class="choose-item {{index == 0 ? 'fl' : 'fr'}} {{form_type == item.value ? 'choose-item-active' : ''}}" data-value="{{item.value}}" onTap="form_type_event">
          <view class="choose-name">{{item.name}}</view>
          <view class="choose-desc cr-888">{{item.desc}}</view>
        </view>
      </block>
    </view>

    <!-- 表单 -->
    <view a:if="{{form_type != null}}" class="form-container spacing-mb oh">
      <view class="form-gorup bg-white">
        <view class="form-gorup-title">退款原因<text class="form-group-tips-must">必选</text></view>
        <picker onChange="form_reason_event" value="{{form_reason_index}}" range="{{reason_data_list}}">
          <view class="picker {{form_reason_index == null ? 'cr-ccc' : 'cr-666'}} arrow-right">
            {{form_reason_index == null ? '请选择原因' : reason_data_list[form_reason_index]}}
          </view>
        </picker>
      </view>

      <view a:if="{{form_type == 1}}" class="form-gorup bg-white">
        <view class="form-gorup-title">商品件数<text class="form-group-tips">不能大于{{returned_data.returned_quantity}}数量</text></view>
        <slider onChange="form_number_event" min="0" max="{{returned_data.returned_quantity}}" step="1" value="{{returned_data.returned_quantity}}" show-value />
      </view>

      <view class="form-gorup bg-white">
        <view class="form-gorup-title">退款金额<text class="form-group-tips">不能大于{{returned_data.refund_price}}元</text></view>
        <input type="digit" onInput="form_price_event" placeholder-class="cr-ccc" class="cr-666" placeholder="请输入退款金额" value="{{form_price}}" />
      </view>

      <view class="form-gorup bg-white">
        <view class="form-gorup-title">退款说明<text class="form-group-tips">选填</text></view>
        <textarea onInput="form_msg_event" placeholder-class="cr-ccc" class="cr-666" placeholder="退款说明最多200个字符" maxlength="200" auto-height="{{true}}" value="{{form_msg}}" />
      </view>

      <view class="form-gorup bg-white form-container-upload oh">
        <view class="form-gorup-title">上传凭证<text class="form-group-tips">最多上传3张图片</text></view>
        <view class="form-upload-data fl">
          <block a:if="{{form_images_list.length > 0}}">
            <view a:for="{{form_images_list}}" class="item fl">
              <text class="delete-icon" onTap="upload_delete_event" data-index="{{index}}">x</text>
              <image src="{{item}}" onTap="upload_show_event" data-index="{{index}}" mode="aspectFill" />
            </view>
          </block>
        </view>
        <image a:if="{{form_images_list.length < 3}}" class="upload-icon" src="/images/default-upload-icon.png" mode="aspectFill" onTap="file_upload_event" />
      </view>
      <view class="form-gorup">
        <button class="bg-main submit-bottom" type="default" onTap="form_submit_event" hover-class="none" disabled="{{form_button_disabled}}">提交</button>
      </view>
    </view>
  </view>

  <!-- 退货弹层 -->
  <component-popup prop-show="{{popup_delivery_status}}" prop-position="bottom" onClose="popup_delivery_close_event">
    <view class="delivery-popup bg-white">
      <view class="close fr oh">
        <view class="fr" catchTap="popup_delivery_close_event">
          <icon type="clear" size="20" />
        </view>
      </view>
      <view class="delivery-popup-content">
        <view class="form-container">
          <view class="form-gorup">
            <view class="form-gorup-title">快递名称<text class="form-group-tips-must">必填</text></view>
            <input type="text" onInput="form_express_name_event" placeholder-class="cr-ccc" class="cr-666" placeholder="请输入快递名称" value="{{form_express_name}}" />
          </view>
          <view class="form-gorup">
            <view class="form-gorup-title">快递单号<text class="form-group-tips-must">必填</text></view>
            <input type="text" onInput="form_express_number_event" placeholder-class="cr-ccc" class="cr-666" placeholder="请输入快递单号" value="{{form_express_number}}" />
          </view>
          <view class="form-gorup">
            <button class="bg-main submit-bottom" type="default" onTap="form_delivery_submit_event" hover-class="none" disabled="{{form_button_disabled}}">提交</button>
          </view>
        </view>
      </view>
    </view>
  </component-popup>
</view>
<view a:if="{{order_data == null}}">
  <import src="/pages/common/nodata.axml" />
  <template is="nodata" data="{{status: data_list_loding_status, msg: data_list_loding_msg}}"></template>
</view>
<import src="/pages/common/bottom_line.axml" />
<template a:if="{{new_aftersale_data != null && new_aftersale_data.status != 5}}" is="bottom_line" data="{{status: data_bottom_line_status}}"></template>