<!--pages/welfareMall/order/orderCompletion.wxml-->
<view class="order flex-column">
  <view class="order-style flex-column">
    <view class="order-state flex-column">
      <!-- 1 待支付  -->
      <view class="order-state-title" wx:if="{{orderDetail.status.value == 1}}">订单{{orderDetail.status.showText}}</view>
      <!-- 2 已支付  -->
      <view class="order-state-title" wx:if="{{orderDetail.status.value == 2}}">订单{{orderDetail.status.showText}}</view>
      <!-- 3 失败  -->
      <view class="order-state-title" wx:if="{{orderDetail.status.value == 3}}">订单{{orderDetail.status.showText}}</view>
      <!-- 4 已取消  -->
      <view class="order-state-title" wx:if="{{orderDetail.status.value == 4}}">订单{{orderDetail.status.showText}}</view>
      <!-- 5 已完成  -->
      <view class="order-state-title" wx:if="{{orderDetail.status.value == 5}}">订单{{orderDetail.status.showText}}</view>
      <view class="order-state-text">感谢您对沪上阿姨的喜爱与支持，欢迎再度光临</view>
    </view>
    <view class="order-details flex-column">
      <view class="content-hm flex-column">
        <view class="content-head flex-row">
          <view class="content-head-text">订单详情</view>
        </view>
        <view class="content-middle flex-row">
          <view class="middle-it flex-row">
            <image class="middle-img" src="{{orderDetail.goodsList[0].fullCoverImg}}" />
            <view class="middle-text">{{orderDetail.goodsList[0].activityName}}</view>
          </view>
          <view class="middle-num flex-column">
            <view class="middle-num-money">￥{{orderDetail.payPriceFormatter}}</view>
            <view class="money-num-count">x{{orderDetail.goodsList.length}}</view>
          </view>
        </view>
      </view>
      <view class="content-payment flex-row">
        <view class="content-payment-mode">支付方式</view>
        <view class="content-payment-mode">微信支付</view>
      </view>
      <view class="content-line"></view>
      <view class="content-lower flex-row" catchtap="getCompletion">
        <view class="lower-total">共{{orderDetail.goodsList.length}}件商品 合计￥{{orderDetail.payPriceFormatter}}</view>
      </view>
    </view>
    <view class="order-information flex-column">
      <view class="order-information-code flex-row">
        <view class="code-text">订单编号</view>
        <view class="code-num">{{orderDetail.orderSn}}</view>
      </view>
      <view class="order-information-date flex-row">
        <view class="date-text">交易时间</view>
        <view class="date-time">{{orderDetail.payedAt}}</view>
      </view>
    </view>
    <view class="order-rt flex-row">
      <view class="order-refund flex-row" wx:if="{{orderDetail.status.value == 1}}" catchtap="toCancelOrder">
        <view class="lower-order-text">取消订单</view>
      </view>
      <view class="order-refund flex-row" wx:if="{{orderDetail.status.value == 1}}" catchtap="goPay">
        <view class="lower-order-text">去支付</view>
      </view>
      <view class="order-refund flex-row" wx:if="{{orderDetail.status.value == 2 || orderDetail.status.value == 5}}" catchtap="getMode">
        <view class="lower-order-text">申请退款</view>
      </view>
    </view>
    <modal hidden="{{hidden}}" title="退款原因" confirm-text="提交" cancel-text="取消" bindcancel="cancel" bindconfirm="confirm" >
      <input bindinput="getReason" type="text" placeholder="请输入退款原因" value="{{inputValue}}"/>
    </modal>
  </view>
</view>