<!-- <button class='goback' bindtap='goback'><image src='{{wmhome}}' mode="widthFix"></image></button> -->
<navbar home="{{!ifshowtab}}" back="{{!back}}" text="我的订单" background="#fff"></navbar>
<view style="height:{{navigationBarHeight}} "></view>
<view class="market">

  <view class="boatBoxf" style="top:{{navigationBarHeight}}">
    <view class="boatBox">
      <view class="boatItemBox" tt:for="{{tabs}}" tt:key="index" bindtap="setBoatFlag" data-index="{{item.key}}">
        <view class="{{boatFlag==item.key?'boatTitleA':'boatTitle'}}">{{item.name}}</view>
        <view class="boatA" tt:if="{{boatFlag==item.key}}"></view>
      </view>
    </view>
  </view>

  <view style='padding-top:90rpx;'>
    <view tt:for='{{list}}' tt:if="{{list.length!=0}}" class='section' tt:key='index'>
      <view class='detail_top'>
        <view>
          <text>订单id：{{item.id}}</text>
        </view>
      </view>
      <!-- 购物车模式 -->
      <view class="itemBox" tt:for="{{item.orders}}" tt:for-item="child" tt:key="index">
        <view class="payStatus">
          <text class='wait' tt:if="{{child.orderStatus==0}}">等待付款</text>
          <text class='wait' tt:if="{{child.orderStatus==10}}">拼团中</text>
          <text class='sucess' tt:if="{{child.orderStatus==3}}">待退款</text>
          <text class='close' tt:if="{{child.orderStatus==2}}">交易关闭</text>
          <text class='close' tt:if="{{child.orderStatus==6}}">砍价中</text>
          <text class='sucess' tt:if="{{child.orderStatus==7}}">砍价成功</text>
          <text class='close' tt:if="{{child.orderStatus==8}}">砍价失败</text>
          <text class='close' tt:if="{{child.orderStatus==9}}">砍价取消</text>
          <text class='close' tt:if="{{child.orderStatus==12}}">拼团已过期</text>
          <text class='close' tt:if="{{child.orderStatus==12}}">拼团失败</text>
          <text class='close' tt:if="{{child.orderStatus==8}}">砍价失败</text>
          <text class='close' tt:if="{{child.orderStatus==4}}">已退款</text>
          <text class='wait' tt:if="{{child.orderStatus==5}}">退款失败</text>
          <text class='sucess' tt:if="{{child.orderStatus==11}}">拼团成功</text>
          <text class='sucess' tt:if="{{child.orderStatus==1&&child.salePrice==0&&child.type!=50&&child.type!=51}}">免费领取</text>
          <text class='sucess' tt:if="{{child.orderStatus==1&&child.salePrice==0&&(child.type==50||child.type==51)}}">积分兑换</text>
          <text class='sucess' tt:if="{{child.orderStatus==1&&child.salePrice!=0}}">付款成功</text>
        </view>

        <view class="itemImg">
          <image mode="aspectFill" src='{{child.coverImg}}'></image>
        </view>
        <view class="itemContent">
          <!-- <view class="yunfeK" tt:if="{{!(child.type==11&&child.shippingType==2)}}"></view> -->
          <view class="sub">{{child.title}}</view>
          <view class="face">价格：
            <text>{{(child.salePrice)/100}}元 x {{child.couponNumber}}</text>
          </view>
          <view class="yunfe" tt:if="{{child.type==11&&child.shippingType==2}}">运费：{{child.freightPriceStr}}</view>
          <view class="date">下单时间：
            <text>{{child.createDate}}</text>
          </view>

          <view tt:if="{{child.orderStatus!=0 && child.orderStatus!=7&&child.orderStatus!=5&&child.orderStatus!=6}}" class="btnZf" data-shippingtype="{{child.shippingType}}" data-id="{{child.composeOrderId}}" data-shipping="{{child.shippingType}}" bindtap="gotopay">
            <text>去查看</text>
          </view>
          <view tt:if="{{child.orderStatus == 6}}" class="btn" data-id="{{child.id}}" bindtap="gotoDiscount">
            <text>砍价详情</text>
          </view>

          <view tt:if="{{child.orderStatus==0 || child.orderStatus==7}}" class="cancel" data-shippingtype="{{child.shippingType}}" data-id="{{child.composeOrderId}}" bindtap="cancel">
            <text>取消</text>
          </view>

          <view tt:if="{{child.orderStatus==0 || child.orderStatus==7}}" class="btnZf" data-shippingtype="{{child.shippingType}}" data-id="{{child.composeOrderId}}" bindtap="gotopay">
            <text>去支付</text>
          </view>
          <view tt:if="{{child.orderStatus==5}}" style="background:#999;opacity: .6;" class="btn">
            <text>退款失败</text>
          </view>
        </view>
      </view>
      <!-- 购物车模式 -->



      <view class='payment'>
        <view>
          <text>订单总金额:</text>
          <text>{{item.payment/100}}元</text>
        </view>
        <!-- 
          orderStatus 
          0待付款
          1完成
          2取消
         -->
        <!-- item.composeOrderId=='0'?item.id:item.composeOrderId -->


      </view>
    </view>



    <view>
    </view>
    <view class="dingdan" tt:if="{{list.length==0}}">
      <image src="{{noOrdersUrl}}" mode="widthFix"></image>
      <text>您还没有相关订单</text>
      <text>再忙，也要记得买点什么犒赏自己～</text>
    </view>
  </view>

  <view class="loading" tt:if="{{loading}}">
    <image src="{{loadingUrl}}" mode="widthFix"></image>{{content}}
  </view>

  <phoen showBox="{{showBox}}" bind:hiePhoen="setPhone" bind:heiBox="setBox" />

</view>

<tabbar tt:if="{{ifshowtab}}"></tabbar>