<view class="container m-b5">
  <view class="goods-detail-box">
    <view class="header f-28 col-3">
      <view catchtap="bindHeaderTap" class="{{dataType===''?'active':''}}" data-type="">全部订单</view>
      <view bindtap="bindHeaderTap" class="{{dataType==='payStatus'?'active':''}}" data-type="payStatus">已付款</view>
      <view bindtap="bindHeaderTap" class="{{dataType==='deliveryStatus'?'active':''}}" data-type="deliveryStatus">待发货</view>
      <view bindtap="bindHeaderTap" class="{{dataType==='receiveStatus'?'active':''}}" data-type="receiveStatus">待收货</view>
    </view>
    <scroll-view scroll-y="{{true}}">
      <view class="wrapper">
        <view wx:if="{{list.length}}">
          <view class="m-top20 " wx:for="{{list}}" wx:key="this">
            <view class="order-box b-f">
              <view class="order-header dis-flex">
                <view class="flex-box t-l">
                  <text class="title">商品列表</text>
                </view>
                <view class="flex-box t-r">
                  <text class="cont" wx:if="{{item.payStatus=='NO'}}">待付款</text>
                  <text class="cont"
                    wx:if="{{item.payStatus=='YES'&&item.deliveryStatus=='NO'&&item.status=='CREATED'&&item.status!='REJECT'}}">待发货</text>
                  <text class="cont" wx:if="{{item.payStatus=='YES'&&item.deliveryStatus=='YES' && item.receiveStatus=='NO'}}">待收货</text>
                  <text class="cont" wx:if="{{item.status=='COMPLETE'}}">已完成</text>
                  <text class="cont"
                    wx:if="{{item.payStatus=='YES'&&item.deliveryStatus=='NO'&&item.status=='REFUNDING'}}">待退款</text>
                  <text class="cont"
                    wx:if="{{item.payStatus=='YES'&&item.deliveryStatus=='NO'&&item.status=='REJECT'}}">退款驳回</text>
                </view>
              </view>
            </view>
            <view class="order-box b-f">
              <view class="order-cont dis-flex">
                <view class="order-num">
                  <text>订单号：{{item.sn}}</text>
                </view>
                <view class="order-time">
                  <text>{{item.createTime}}</text>
                </view>
              </view>
            </view>
            <view class="order-box order-img_list">
              <view class="order-shop">
                <view bindtap="detail" class="order-list-box dis-flex" data-id="{{item.orderId}}">
                  <view class="left">
                    <view class="dis-flex">
                      <view class="order-shop-left" wx:for="{{item.ordersItemList}}" wx:key="goods">
                        <image src="{{IMG_NAME+item.product.productImages[0].name}}"></image>
                      </view>
                    </view>
                  </view>
                  <view class="right p-r">
                    <text class="goods-number">共{{item.ordersItemList.length}}件</text>
                    <text class="iconfont icon-xiangyoujiantou user-orderJtou"></text>
                  </view>
                </view>
              </view>
            </view>
            <view class="order-box b-f">
              <view class="order-btn dis-flex">
                <view class="order-left">
                  <view class="text">
                    <text>合计：</text>
                    <text class="col-m">￥{{item.amount}}</text>
                  </view>
                </view>
                <view class="order-right">
                  <view class="dis-flex">
                    <view class="flex-box" wx:if="{{item.payStatus=='NO'}}">
                      <view bindtap="cancelOrder" class="btn-default" data-id="{{item.orderId}}">取消</view>
                    </view>
                    <view class="" wx:if="{{item.payStatus=='NO'}}">
                      <view bindtap="payOrder" class="btn-main" data-id="{{item.orderId}}">付款</view>
                    </view>
                    <view class="flex-box"
                      wx:if="{{item.payStatus=='YES' && item.status=='CREATED' && item.deliveryStatus=='YES' && item.receiveStatus=='NO'}}">
                      <view bindtap="receipt" class="btn-main" data-id="{{item.orderId}}">确认收货</view>
                    </view>
                    <view class="flex-box"
                      wx:if="{{item.deliveryStatus=='NO' && item.payStatus=='YES' && item.status=='CREATED'}}">
                      <view bindtap="refund" class="btn-main" data-id="{{item.orderId}}">申请退款</view>
                    </view>
                  </view>
                </view>
              </view>
            </view>
          </view>
        </view>
        <view wx:else>
          <view class="yoshop-notcont">
            <text class="iconfont iconmeiyoudingdan"></text>
            <text class="cont">亲，您还没有订单信息哦！</text>
          </view>
        </view>
      </view>
    </scroll-view>
  </view>
</view>