<wxs src="../../../utils/formatFuc.wxs" module="formatFuc" />
<view class="poster" wx:if="{{myqr_show}}">
<view>
  <image src="{{myqr_url}}" style="width:{{myqr_width}}rpx;" mode="widthFix">
  </image>
  <view class="tool">
    <view>
    <button open-type='share' class="share-btn">
      <image class="img" style="width: 85rpx;margin-right: 25rpx;"  mode="widthFix" src="/static/images/share/p_wx.png"></image>
    </button>
    </view>
    <view>
      <image class="img" mode="widthFix" bindtap="goSaveQrcode" src="/static/images/share/p_save.png"></image>
    </view>
  </view>
  <view style="text-align:center">
    <image class="closeImg" bindtap="hidePoster" src="/static/images/share/close.png"></image>
  </view>
  </view>
</view>

<view class="container" style="filter:blur({{myqr_blur}}rpx)">


	<van-sticky>
<van-tabs active="{{showType }}" color="#09afff" bind:change="onTabChange">
    <van-tab title="全部" name="0"></van-tab>
    <van-tab title="待付款" name="1"></van-tab>
    <van-tab title="待确认" name="5"></van-tab>
    <van-tab title="待领取" name="6"></van-tab>
    <van-tab title="已付款" name="2"></van-tab>
    <van-tab title="已取消" name="3"></van-tab>
    <van-tab title="待退款" name="4"></van-tab>
   
  </van-tabs>

</van-sticky>

  <view class="no-order" wx:if="{{orderList.length <= 0}}">
    <view class="c">
      <text>还没有任何订单呢</text>
    </view>
  </view>

  <view class="orders" wx:if="{{showType!=5&&showType!=6}}">
   
      <view class="order"  wx:for="{{orderList}}" wx:key="index">
      <view class="h">
        <!-- <view class="l">订单编号：{{item.orderNo}}</view> -->
				<view class="l"  wx:if="{{item.buyType==1}}">{{item.orderNo}}(自购)</view>
				<view class="l"  wx:if="{{item.buyType==2}}">{{item.orderNo}} (代购)</view>
        <view class="r" wx:if="{{showType==0}}">{{formatFuc.statusText(item.orderStatus)}}</view>
      </view>
      <!-- <navigator url="../orderDetail/orderDetail?id={{item.id}}"  open-type="redirect" > -->
				<view class="special-content">
			  <scroll-view class="goods-scroll" scroll-x="true" >
      <view class="goods" wx:for="{{item.orderItemList}}" wx:key="id" wx:for-item="gitem">
        <view class="img">
          <image src="{{gitem.thumbnail}}"></image>
        </view>
        <view class="info">
          <view class="name">{{gitem.skuName}}</view>
          <view class="number">件数：{{gitem.buyNumber}}</view>
        </view>   
        <view class="status"> 
        </view>
      </view>
      </scroll-view>
			<view class="goods-num">共{{item.commodityNum}}件</view>
		</view>
    <!-- </navigator> -->
      <view class="b">
        <view class="l">实付：￥{{item.orderAmount}}</view>
				<view style="float:right">{{item.createTime}}</view>
      </view>
      <!-- 操作事件 -->
      <view  class="order-item-operate" >
            <view class="order-item-result">

            </view>
            <view class="order-operate-wrapper">
              <view catchtap="payOrder" wx:if="{{item.orderStatus==0}}" data-id="{{item.id}}">去付款</view>
              <!-- <view  catchtap="confirmOrder" wx:if="{{item.handleOption.confirm}}" data-id="{{item.id}}">待上门</view> -->
              <view catchtap="deleteOrder" wx:if="{{item.orderStatus==0||item.orderStatus==2||item.orderStatus==3}}" data-id="{{item.id}}">删除订单</view>
              <view  catchtap="cancelOrder" wx:if="{{item.orderStatus==0}}" data-id="{{item.id}}">取消订单</view>

              <view  catchtap="refundOrder" wx:if="{{item.orderStatus==1}}" data-id="{{item.id}}">申请退款</view>
              <!-- <view  data-id="{{item.goodsList[0].goodsId}}" catchtap="shareFriendOrCircle" >分享商品</view> -->
               <!-- <view catchtap="viewService" data-id="{{item.id}}" wx:if="{{!(item.orderStatus==101||item.orderStatus==102||item.orderStatus==103)}}">查看服务</view> -->
            </view>
      </view>
 
  </view>
  </view> 
  <view class="special-orders" wx:if="{{showType==5}}">
     <view class="special-item" wx:for="{{orderList}}" wx:key="index">
     <view class="title">
     <image src="/static/images/upgrade/order@selected.png"></image>
     <view wx:if="{{item.buyType==1}}">
		 {{item.orderNo}} (自购)</view>
		 <view wx:if="{{item.buyType==2}}">
		 {{item.orderNo}} (代购)</view>
     </view>
     <view class="special-content">
      <scroll-view class="special-scroll" scroll-x="true" >
          <view class="scroll-item" wx:for="{{item.orderItemList}}" wx:key="id" wx:for-item="gitem">
            <image src="{{gitem.thumbnail}}" class="goods-img"></image>
            <view class="googs-name">
							{{gitem.skuName}}
            </view>
						<view  class="buy-num">件数：{{gitem.buyNumber}}</view>

          </view>
         
        </scroll-view>
      <view class="goods-num">共{{item.commodityNum}}件</view>
     </view>
     <view class="special-operate">
       <view class="special-btn" bindtap="confirmOrder" data-id="{{item.id}}">确认领取</view>

     </view>

     </view>

  </view>

	<view class="special-orders" wx:if="{{showType==6}}">
     <view class="special-item" wx:for="{{orderList}}" wx:key="index">
     <view class="title-wrapper">
		 <view class="title">
     <image src="/static/images/upgrade/order@selected.png"></image>
     <view>
		 {{item.kitNo}}</view>
		</view>
		<view class="status-special">
			{{formatFuc.specialStatusText(item.disStatus)}}
		</view>

     </view>
     <view class="special-content">
      <scroll-view class="special-scroll" scroll-x="true" >
          <view class="scroll-item" wx:for="{{item.detailList}}" wx:key="id" wx:for-item="gitem">
            <image src="{{gitem.commodityPic}}" class="goods-img"></image>
            <view class="googs-name">
							{{gitem.name}}
            </view>
						<view  class="buy-num">件数：{{gitem.num}}</view>

          </view>
         
        </scroll-view>
      <view class="goods-num">共{{item.total}}件</view>
     </view>
		 <view class="fail-reason" wx:if="{{item.disStatus==8}}">{{item.failReason}}</view>
     <view class="special-operate">
		 
			<view class="special-btn"  wx:if="{{item.disStatus==2}}" bindtap="cancelSpec" data-id="{{item.id}}">我不需要</view>
       <view class="special-btn" wx:if="{{item.disStatus==2}}" bindtap="confirmSpec" data-id="{{item.id}}">确认规格</view>

     </view>

     </view>

  </view>

</view>