<!--packageA/member/order/cpsComponents/cpsOrderItem/cpsOrderItem.wxml-->
<view>
  <view class="order-box" wx:if="{{!isCoupon}}">
    <view class="head">
      <text class="name">{{orderData.type_name}}</text>
      <text class="status">{{orderData.status_name}}</text>
    </view>
    <view class="detail">
      <view class="left-img">
        <image src="{{orderData.image}}" alt=""></image>
      </view>
      <view class="right-box">
        <view class="title ellipsis">{{orderData.title}}</view>
        <view class="info">
          <view>
            <view>付款日 <text>{{orderData.create_time}}</text></view>
            <view>确认收货日 <text>{{orderData.receive_time}}</text></view>
            <view class="orderNo ellipsis">订单号 <text>{{orderData.sub_order_id}}</text></view>
          </view>
          <view class="button-box">
            <!-- <text class="price">￥{{orderData.goods_price}}</text> -->
            <text class="copy" bindtap="copyText" data-text="{{orderData.sub_order_id}}">复制</text>
          </view>
        </view>
        <view class="money-box">
          <text>付款￥{{orderData.pay_price}}</text>
          <text class="money">赠送￥{{orderData.pre_commission}}</text>
        </view>
      </view>
    </view>
  </view>

  <view class="coupon-box" wx:else>
    <view class="head">
      <text class="name">订单状态</text>
      <text class="status">{{orderData.code == 0 ? '成功' : '失败' }} </text>
    </view>
    <view class="detail">
      <view class="left-img">
        <image src="{{orderData.goods_cover}}" alt=""></image>
      </view>
      <view class="right-box">
        <view class="title ellipsis">{{orderData.goods_name}}</view>
        <view class="info">
          <view>
            <view>下单日期 <text>{{orderData.created_at}}</text></view>
            <view class="orderNo ellipsis">订单号 <text>{{orderData.order_no}}</text></view>
          </view>
          <view class="button-box">
            <text></text>
            <text class="copy" bindtap="copyText" data-text="{{orderData.order_no}}">复制</text>
          </view>
        </view>
        <view class="money-box" style="margin-top: 0.8rem">
          <text>付款￥{{orderData.order_price}}</text>
        </view>
      </view>
    </view>

    <view class="coupon-info" wx:for="{{(orderData.coupon_info ? orderData.coupon_info.coupons : [])}}" wx:key="index">
      <view class="item" wx:if="{{item.goods_link}}">
        <text class="left-text ellipsis">卡券链接：{{item.goods_link}}</text>
        <text class="btn-copy" bindtap="copyText" data-text="{{item.goods_link}}">复制</text>
      </view>
      <view class="item" wx:if="{{item.goods_number}}">
        <text class="left-text ellipsis">卡券卡号：{{item.goods_number}}</text>
        <text class="btn-copy" bindtap="copyText" data-text="{{item.goods_number}}">复制</text>
      </view>
      <view class="item" wx:if="{{item.goods_password}}">
        <text class="left-text ellipsis">卡券密码：{{item.goods_password}}</text>
        <text class="btn-copy" bindtap="copyText" data-text="{{item.goods_password}}">复制</text>
      </view>
      <view class="item" wx:if="{{item.effective_time}}">
        <text class="left-text ellipsis">过期时间：{{item.effective_time}}</text>
      </view>
    </view>
  </view>
</view>