<!--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}}" mode="aspectFill" />
            <view>
              <view class="round" wx:if="{{orderDetail.goodsList[0].round}}">轮次：{{orderDetail.goodsList[0].round}}</view>
              <view class="middle-text">{{orderDetail.goodsList[0].activityName}}</view>
              <view class="look-coupon-detail" catchtap="extendCouponWrap"><text class="word_text" style="color: {{config.secColor?config.secColor:'#B01717'}};">查看券包详情</text>
                <image wx:if="{{!isExtend}}" class="fold-btn" src="../../../images/welfareMall/down-ico.png" />
                <image wx:else class="fold-btn" src="../../../images/welfareMall/up-ico.png" />
              </view>
            </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-line"></view>
      <view class="content-lower flex-row" catchtap="getCompletion">
        <view class="lower-total">共{{orderDetail.goodsList.length}}件商品 合计￥{{orderDetail.payPriceFormatter}}</view>
      </view>
    </view>

    <view wx:if="{{isExtend}}" class="coupon-wrap-list">
      <coupon-wrap wx:if="{{couponList.length>0}}" 
        coupon-list="{{couponList}}" 
        class="coupon_wrap"
        coupon-item-ex-class="coupon-item-style"
        coupon-circule-ex-class="coupon-circule-style"
        />
    </view>
    <view style="height: 20rpx;" wx:else></view>
    <view class="order-information flex-column">
      <view class="order-information-code flex-row">
        <view class="code-text">订单编号</view>
        <text selectable='true'  class="code-num">{{orderDetail.orderSn}}</text>
      </view>
      <view class="order-information-date flex-row">
        <view class="date-text">交易时间</view>
        <view class="date-time">{{orderDetail.payedAt}}</view>
      </view>
      <view class="order-information-date flex-row">
        <view class="date-text">支付方式</view>
        <view class="date-time">微信支付</view>
      </view>
    </view>
    <view class="order-rt flex-row">
      <view class="order-refund flex-row" wx:if="{{orderDetail.status.value == 1}}" catchtap="toCancelOrder" style="color: {{config.secColor?config.secColor:'#B01717'}};">
        <view class="lower-order-text" style="color: {{config.secColor?config.secColor:'#B01717'}};">取消订单</view>
      </view>
      <view class="order-refund flex-row" wx:if="{{orderDetail.status.value == 1}}" catchtap="goPay" style="color: {{config.secColor?config.secColor:'#B01717'}};">
        <view class="lower-order-text" style="color: {{config.secColor?config.secColor:'#B01717'}};">去支付</view>
      </view>
      <view class="order-refund flex-row" wx:if="{{(orderDetail.status.value == 2 || orderDetail.status.value == 5) && orderDetail.goodsList[0].activity.isPay == 1}}" catchtap="getMode" style="color: {{config.secColor?config.secColor:'#B01717'}};">
        <view class="lower-order-text" style="color: {{config.secColor?config.secColor:'#B01717'}};">申请退款</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 class="bg-zindex" hidden="{{hidden}}">
      <view class="success_window flex-column">
        <view class="w_title">退款原因</view>
        <view class="w_text"><input bindinput="getReason" type="text" placeholder="请输入退款原因" value="{{inputValue}}" maxlength="50" /></view>
        <view class="w_border"></view>
        <view class="w_button flex-row">
          <view class="w_go_order" catchtap="cancel">取消</view>
          <view class="w_go_order" catchtap="confirm">确定</view>
        </view>
      </view>
    </view>
  </view>
</view>