<wxs module="filters" src="../../../utils/filter.wxs"></wxs>
<wxs module="ofil" src="ofilter.wxs"></wxs>

<view class="container">
		<!-- 一级tabbar -->
		<view class="tab-container" bindtap="onClickTab">
			<view class="tab {{currentIndex == 0 ? 'active':''}}" data-index="0"><text class="iconfont icon-cloud"></text>线上订单</view>
			<view class="tab {{currentIndex == 2 ? 'active':''}}" data-index="2"><text class="iconfont icon-bankcard"></text>卡项订单</view>
			<view class="tab {{currentIndex == 1 ? 'active':''}}" data-index="1"><text class="iconfont icon-shop"></text>线下订单</view>
		</view>
		
		<!-- 搜索框 -->
		<view class="search-container flex" wx:if="{{currentIndex != 1 }}">
			<input class="search-input" type="text" placeholder="请输入您所搜索的商品" bindinput="bindInput" bindconfirm="bindInput" placeholder-style="color:#ccc;"/>
			<view class="search-btn" bindtap="searchOnline">搜索</view>
		</view>
		
		<!-- 二级tabbar - 线上订单 -->
		<view class="type-navbar fs28" wx:if="{{currentIndex == 0}}">
		  <view class="type-box flex-center" wx:for="{{categories}}" wx:key="{{index}}">
		    <view id="{{item.id}}" bindtap="changeTab" class="type-navbar-item {{activeCategoryId==item.id?'type-item-on':''}}">
		      {{item.name}}
		    </view>
		  </view>
		</view>
		
		<!-- 二级tabbar - 线下订单 -->
		<view class="search-container" wx:if="{{currentIndex == 1}}">
			<view class="flex jc_sb">
				<view class="picker-container flex f1">
					<picker class="picker-date" mode="date" value="{{date}}" start="2015-09-01" end="{{}}" bindchange="bindDateChange1">
						<view class="picker">{{startDate}}</view>
					</picker>
					<view class="fs28 pdh10">至</view>
					<picker class="picker-date" mode="date" value="{{date}}" start="2015-09-01" end="{{currentDate}}" bindchange="bindDateChange2">
						<view class="picker">{{endDate}}</view>
					</picker>
				</view>
				<view class="search-btn search-btn2" bindtap="searchOffline">查询</view>
			</view>
		
		</view>
		
		<!-- 二级tabbar - 卡项订单 -->
		<view class="type-navbar fs28" wx:if="{{currentIndex == 2}}">
		  <view class="type-box flex-center f1" wx:for="{{tab_serviceCard}}" wx:key="{{index}}">
		    <view data-index="{{index}}" bindtap="clickTab" class="type-navbar-item {{tabIndex ==index?'type-item-on':''}}">
		      {{item.name}}
		    </view>
		  </view>
		</view>
</view>

<!-- 线上订单 -->
<view class="list-container" wx:if="{{currentIndex == 0}}">
	<view class="stay_evaluate" data-id="{{item.order_id}}" wx:for="{{orderList}}" wx:key="{{index}}">
	  <!-- 商品编号和状态 -->
	  <view class="Commodity_number flex-vertical-between fs24 padding border_bottom">
	    <!--商品编号 -->
	    <text selectable='true'>订单编号：{{item.order_sn}}</text>
	    <!-- 商品评价状态 -->
	    <view class="flex-center c-r">
			<!-- 这是预售的 -->
			<block wx:if="{{item.presell}}">
				<block wx:if="{{item.order_status==3}}">
					<text wx:if="{{item.presell.tail_pay_state==2}}">尾款支付失败</text>
				</block>
				<block wx:else>
					<text wx:if="{{item.presell.presell_type==0 &&  !item.presell.deposit_pay_time}}">待支付定金</text>
					<text wx:if="{{item.presell.presell_type!=1 && item.presell.deposit_pay_time && !item.presell.tail_pay_state}}">待尾款</text>
					<text wx:if="{{item.presell.presell_type==1 &&  item.order_status<2  && item.pay_status<1 }}">未支付</text>
				</block>

				<block wx:if="{{!(item.is_all_return_status==0 || item.is_all_return_status==1)}}">
					<view wx:if="{{(item.order_status==1&&item.pay_status==1&&item.shipping_status==0)}}">
            <block wx:if="{{item.exp_type==1}}">待自提</block>
            <block wx:else>待发货</block>
          </view>
					<view wx:if="{{(item.order_status==1&&item.pay_status==1&&item.shipping_status==1)}}">
            <block wx:if="{{item.exp_type==1}}">待自提</block>
            <block wx:else>待发货</block>
          </view>
					<view wx:if="{{(item.order_status==2)}}" class="flex-center">待评价<view class="lin"></view>
						<image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteOrderData_"  data-index="{{index}}"   data-order_id="{{item.order_id}}"></image>
          </view>
					<view wx:if="{{item.order_status==4}}" class="flex-center">已评价<view class="lin"></view>
						<image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteOrderData_"  data-index="{{index}}"   data-order_id="{{item.order_id}}"></image>
          </view>
					<view wx:if="{{item.order_status==3 && item.pt_status!=6}}"  class="flex-center" >已取消<view class="lin"></view>
						<image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteOrderData"  data-index="{{index}}"   data-order_id="{{item.order_id}}"></image>
					</view>
					<view wx:if="{{item.order_status==6}}">退款成功</view>
				</block>
				<block wx:else>退款中</block>

			</block>
			<!-- 幸运购 -->
			<block wx:elif="{{item.order_goods[0].prom_type == 9}}">
				<view wx:if="{{item.is_back ==1 && item.pay_status ==1}}">已退款</view>
				<view wx:elif="{{item.is_back == 0 && item.pay_status ==1 && item.team_status == 0}}">已支付,待成团</view>
				<view wx:if="{{(item.order_status==0&&item.pay_status==0)}}">未支付</view>
				<view wx:if="{{(item.order_status==1&&item.pay_status==1&&item.shipping_status==0 && item.team_status == 2)}}">
          <block wx:if="{{item.exp_type==1}}">待自提</block>
            <block wx:else>待发货</block>
        </view>
				<view wx:if="{{(item.order_status==1&&item.pay_status==1&&item.shipping_status==1 && item.team_status == 2)}}">
          <block wx:if="{{item.exp_type==1}}">待自提</block>
            <block wx:else>待发货</block>
        </view>
				<view wx:if="{{(item.order_status==2)}}" class="flex-center">待评价<view class="lin"></view>      
					<image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteOrderData_"  data-index="{{index}}"   data-order_id="{{item.order_id}}"></image>
        </view>
				<view wx:if="{{item.order_status==4}}" class="flex-center">已评价<view class="lin"></view>
					<image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteOrderData_"  data-index="{{index}}"   data-order_id="{{item.order_id}}"></image>
        </view>
				<view wx:if="{{item.pay_status == 0 && item.order_status==3 && item.pt_status!=6}}"  class="flex-center" >已取消<view class="lin"></view>
					<image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteOrderData"  data-index="{{index}}"   data-order_id="{{item.order_id}}"></image>
				</view>
			</block>
			<block wx:else>
				<!-- 订单状态 -->
				<view wx:if="{{item.pt_status==1 && item.pt_prom_id>0}}">组团中</view>
				<view wx:if="{{(item.order_status==0&&item.pay_status==0)}}">未支付</view>
				<block wx:if="{{!(item.is_all_return_status==0 || item.is_all_return_status==1)}}">
					<view wx:if="{{(item.order_status==1&&item.pay_status==1&&item.shipping_status==0)}}">
            <block wx:if="{{item.exp_type==1}}">待自提</block>
            <block wx:else>待发货</block>
          </view>
					<view wx:if="{{(item.order_status==1&&item.pay_status==1&&item.shipping_status==1)}}">待收货</view>
					<view wx:if="{{(item.order_status==2)}}" class="flex-center">待评价<view class="lin"></view>
						<image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteOrderData_"  data-index="{{index}}"   data-order_id="{{item.order_id}}"></image>
          </view>
					<view wx:if="{{item.order_status==4}}" class="flex-center">已评价<view class="lin"></view>
						<image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteOrderData_"  data-index="{{index}}"   data-order_id="{{item.order_id}}"></image>
          </view>
					<view wx:if="{{item.order_status==3 && item.pt_status!=6}}"  class="flex-center" >已取消<view class="lin"></view>
						<image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteOrderData"  data-index="{{index}}"   data-order_id="{{item.order_id}}"></image>
					</view>
					<view wx:if="{{item.pt_status==2 && item.pt_tail_money>0}}">待支付尾款</view>
					<view wx:if="{{item.order_status==6}}">退款成功</view>
					<view wx:if="{{item.pt_status==6}}"><text style="font-size: 26rpx;">支付尾款失败</text></view>
				</block>
				<block wx:else>退款中</block>
			</block>
			
			
		  
	    </view>
	  </view>
	
	  <!-- 商品详情集合 -->
	  <view class="detail_commoditys">
	    <!-- 单个商品 -->
	    <!-- wx:if="{{goods.return_btn!=4}}" -->
	    <view>
				 <!-- url="/packageC/pages/luckyGo/luckyGo_order/luckyGo_order?order_id={{item.order_id}}" wx:if="{{item.order_goods[0].prom_type==9}}"
				{{item.ord_url}}?order_id={{item.order_id}} -->
	      <navigator class="detail_commodity flex-vertical padding" wx:for="{{item.order_goods}}" wx:for-item="goods"  wx:for-index="pinx" url="{{item.order_goods[0].prom_type==9 ? ('/packageC/pages/luckyGo/luckyGo_order/luckyGo_order?order_id=' + item.order_id + '&group_id=' + item.order_goods[0].prom_id):(item.ord_url + '?order_id=' + item.order_id)}}">
	        <!-- 商品图片 -->
	        <navigator class="rel">
	          <image src="{{resourceUrl+goods.original_img}}" binderror="bind_bnerr" lazy-load="{{true}}" data-errorimg="orderList[{{index}}].order_goods[{{pinx}}].original_img"></image>
	          <view class="abs flex-center fs26" wx:if="{{goods.prom_type==1}}">秒杀</view>
	          <view class="abs flex-center fs26" wx:if="{{goods.prom_type==6}}">团购</view>
						<view class="abs flex-center fs26" wx:if="{{goods.prom_type==9}}">幸运购</view>
	        </navigator>
	        <!-- 商品内容 -->
	        <view class="Commodity_content">
	          <view class="Commodity_goods">
	            <!-- 商品名称 -->
	            <view class="goods_name ellipsis-2 fs26">{{goods.goods_name}}</view>
	            <view class="flex-space-between">
	              <!-- 商品规格 -->
	              <view class="Commodity_spec fs28 flex-center">
	                <!--<text class="ellipsis-1" wx:if="{{goods.goods_color.length>1 && goods.goods_spec.length>1}}">{{goods.goods_color+"/"+goods.goods_spec}}</text>-->
	                <!--<text class="ellipsis-1" wx:elif="{{goods.goods_color.length>1 || goods.goods_spec.length>1}}">{{goods.goods_color==undefined?"":goods.goods_color}}{{goods.goods_spec==undefined?"":goods.goods_spec}}</text>-->
	                <!--<text class="ellipsis-1" wx:else>规格1</text>-->
	                  <text class="ellipsis-1">{{filters.show_gui_ge(goods.goods_spec, goods.goods_color)}}</text>
	              </view>
	              <view class="flex-level-right fs26 refund">
	                <!-- 不是整单退的时候 -->
	                <block wx:if="{{!item.pre_cut && item.is_all_return!=1 && item.discount<=0 && item.coupon_price<=0 &&  item.order_prom_amount<=0 && item.discount_amount<=0 && goods.prom_type!=5 && !item.is_prom && goods.is_whsle_goods!=1}}">
	                  <view catchtap="checkReturnGoodsStatus" class="return-btn" data-oid="{{goods.order_id}}" data-recid="{{goods.goods_id}}" wx:if="{{goods.return_btn==1 && !item.is_bedistri }}">申请退款</view>
	                  <view catchtap="gotoreturn" class="return-btn" data-oid="{{goods.order_id}}" data-recid="{{goods.goods_id}}" wx:if="{{goods.return_btn==2}}">退款中</view>
	                  <view catchtap="checkReturnGoodsStatus" class="return-btn" data-oid="{{goods.order_id}}" data-recid="{{goods.goods_id}}" wx:if="{{goods.return_btn==3}}">重新退款</view>
	                  <view catchtap="gotoreturn" class="return-btn" data-oid="{{goods.order_id}}" data-recid="{{goods.goods_id}}" wx:if="{{goods.return_btn==4}}">退款完成</view>
	                </block>
	              </view>
	            </view>
	          </view>
	          <!-- 商品价格数量 -->
	          <view class="Commodity_money flex-vertical-between baseline">
	            <!-- 商品价格 -->
	            <view class="flex-vertical c-tb baseline">
	              <view class="fs24">￥</view>
								<!-- 幸运购prom_type等于9 -->
								<!-- 如果是幸运购就显示幸运购参团价格 -->
								<view class="fs26" wx:if="{{goods.prom_type == 9}}">{{filters.toFix(goods.goods_price,2)}}</view>
	              <view class="fs26" wx:else>{{filters.toFix(goods.member_goods_price,2)}} <text wx:if="{{goods.prom_type==10}}">({{goods.ladder_discount}}折)</text> </view>
	            </view>
	            <view class="fs26 c-a9">x{{goods.goods_num}}</view>
	          </view>
	        </view>
	      </navigator>
	      <!-- 去评价 -->
	      <view class="commodity_evaluate jc_sb baseline fs26">
	        <!-- 商品数量 -->
	        <view class="commodity_smy fs24">
	          <view class="order-total">
	            <view>
	              共{{item.g_num}}件商品
	            </view>
	            <view class="goods-total flex">
	              <block wx:if="{{item.pt_status==4 || item.pt_status==5}}">
	                <view class="commodity_money flex baseline">
	                  <view>合计<text wx:if="{{item.discount!=underdefine && item.discount!=null && item.discount!=0}}" style="color:#d60021;">(改)</text>:</view>
	                  <view class="fs24 c-r">￥</view>
	                  <view class="c-r">{{filters.toFix(item.order_amount+item.user_money+item.pt_tail_money+item.use_commission+item.pre_cut,2)}}
						  <text wx:if="{{item.coupon_price}}">+{{item.coupon_price}}元优惠券</text>
	                  </view>
	
	                </view>
	              </block>
	              <block wx:else>
	                <view wx:if="{{item.is_zsorder==4}}" class="commodity_money flex baseline">
	                  <view>定金<text wx:if="{{item.discount!=underdefine && item.discount!=null && item.discount!=0}}" style="color:#d60021;">(改)</text>:</view>
	                  <view class="fs24 c-r">￥</view>
	                  <view class="c-r">{{filters.toFix(item.order_amount+item.user_money+item.use_commission+item.pre_cut,2)}}
	                  </view>
	                </view>
	                <view class="commodity_money flex baseline" wx:else>
	                  <view>合计<text wx:if="{{item.discount!=underdefine && item.discount!=null && item.discount!=0}}" style="color:#d60021;">(改)</text>:</view>
	                  <view class="fs24 c-r">￥</view>
	                     <view class="c-r">
										 {{filters.toFix(item.order_amount+item.user_money+item.use_commission+item.pre_cut,2)}}
	                     <text wx:if="{{item.coupon_price}}">+{{item.coupon_price}}元优惠券</text>
	                     <text wx:if="{{item.integral}}">+{{item.integral}}积分</text>
	                  </view>
	                </view>
	                <view wx:if="{{item.pt_tail_money>0}}" class="commodity_money flex baseline">
	                  <view>待支付尾款:</view>
	                  <view class="fs24 c-r">￥</view>
	                  <view class="c-r">{{filters.toFix(item.pt_tail_money+item.use_commission,2)}}
	                  </view>
	                </view>
	
	
	              </block>
	            </view>
	          </view>
	        </view>
	        <view class="links flex-right-vertical fs24 padding">
	          <image wx:if="{{(item.order_status==1&&item.pay_status==1 && item.shipping_status==0 && item.exp_type==1 && !(item.order_goods[0].prom_type==9))}}" class="code" src="{{iurl}}miniapp/images/order/code.png" bindtap="code_show" data-order_sn="{{item.order_sn}}"></image>
	          <view bindtap="cancelOrder" class="commodity_To_evaluate flex-level View_evaluation" data-id="{{item.order_id}}" data-zsorder="{{item.is_zsorder}}" data-orderindex="{{index}}" wx:if="{{(item.order_status==0 &&item.pay_status==0)}}">取消订单</view>
	          <view class="commodity_To_evaluate flex-level View_evaluation" wx:if="{{item.pt_status==3}}">拼团失败</view>
	          <!---has_rt部分退---->
	          <block wx:if="{{item.return_btn==undefined && item.is_all_return!=1 && item.has_rt!=1 && !(item.order_goods[0].prom_type==9)}}">
	            <navigator class="commodity_To_evaluate flex-level View_evaluation" wx:if="{{(item.order_status==0&&item.pay_status==1) && !item.is_bedistri}}" url="/packageG/pages/order/refund_order/refund_order?order_id={{item.order_id}}">申请退款</navigator>
	            <navigator class="commodity_To_evaluate flex-level View_evaluation" wx:if="{{(item.order_status==1&&item.pay_status==1) && !item.is_bedistri}}" url="/packageG/pages/order/refund_order/refund_order?order_id={{item.order_id}}">申请退款</navigator>
	          </block>
	          <block wx:else>
	            <view class="commodity_To_evaluate flex-level View_evaluation" wx:if="{{item.is_all_return_status==2  && item.isdel==0}}" bindtap="deleteOrderData" data-order_id="{{item.order_id}}" data-index="{{index}}">删除订单</view>
	            <navigator class="commodity_To_evaluate flex-level View_evaluation" wx:if="{{item.is_all_return_status==3 && item.order_status<2}}" url="/packageG/pages/order/refund_order/refund_order?order_id={{item.order_id}}">重新退款</navigator>
	            <navigator class="commodity_To_evaluate flex-level View_evaluation" wx:if="{{item.is_all_return_status==0 || item.is_all_return_status==1}}" url="/packageF/pages/user/return_goods_info/return_goods_info?order_id={{item.order_id}}">退款详情</navigator>
	          </block>

	          <view bindtap="go_wuliu" class="commodity_To_evaluate flex-level View_evaluation" data-order_id="{{item.order_id}}"
					hidden="{{!(item.exp_type==0&&item.pay_status==1&&item.shipping_status==1)}}" data-url="/packageG/pages/user/express/express?order_id={{item.order_id}}">查看物流</view>
	          <view bindtap="go_wuliu" class="commodity_To_evaluate flex-level View_evaluation" data-order_id="{{item.order_id}}"
					hidden="{{!(item.exp_type==0&&item.pay_status==1&&item.shipping_status==2)}}" data-url="/packageG/pages/user/express/express?order_id={{item.order_id}}">查看物流</view>
            <view bindtap="go_wuliu" class="commodity_To_evaluate flex-level View_evaluation" data-order_id="{{item.order_id}}"
					hidden="{{!(item.exp_type==0&&item.pay_status==1&&item.shipping_status==3)}}" data-url="/packageG/pages/user/express/express?order_id={{item.order_id}}">查看物流</view>
	      
				<navigator class="commodity_To_evaluate flex-level View_evaluation" url="/packageC/pages/luckyGo/luckyGo_order/luckyGo_order?order_id={{item.order_id}}&&group_id={{item.order_goods[0].prom_id}}" wx:if="{{item.order_goods[0].prom_type==9}}">订单详情</navigator>	 
			  <navigator class="commodity_To_evaluate flex-level View_evaluation" url="{{item.ord_url}}?order_id={{item.order_id}}" wx:else>订单详情</navigator>
	
	          <block wx:if="{{!(item.has_rt || item.return_btn==2 || item.return_btn==4)}}">
	            <view bindtap="confirmOrder" data-zsorder="{{item.is_zsorder}}" class="commodity_To_evaluate flex-level comment_go" data-id="{{item.order_id}}" hidden="{{!(item.order_status==1&&item.pay_status==1&&item.shipping_status==1)}}">确认收货</view>
	            <view bindtap="confirmOrder" data-zsorder="{{item.is_zsorder}}" class="commodity_To_evaluate flex-level comment_go" data-id="{{item.order_id}}" hidden="{{!(item.order_status==1&&item.pay_status==1&&item.shipping_status==2)}}">确认收货</view>
	          </block>

				<block wx:if="{{item.presell && item.presell.presell_type!=1}}">
					<navigator class="commodity_To_evaluate flex-level comment_go" url="/packageC/pages/presell/cart/cart?order_id={{item.order_id}}" data-idx="{{index}}" wx:if="{{item.order_status<3 && item.presell.deposit_pay_time>0 && item.presell.tail_pay_state==0}}">支付尾款</navigator>

				</block>



				<block wx:if="{{item.order_status==2 && item.is_zsorder!=4}}">
	            <navigator wx:if="{{item.order_goods.length>1}}"  class="order-btn white"
	                       url="/packageB/pages/user/comment/comment?status=0&order_id={{item.order_id}}">评价</navigator>
	            <navigator wx:else  class="order-btn white red-b"
	                       url="/packageB/pages/user/add_comment/add_comment?goods_id={{item.order_goods[0].goods_id}}&order_id={{item.order_id}}&price={{item.order_goods[0].member_goods_price}}">评价</navigator>
	          </block>
	
	
	          <navigator class="commodity_To_evaluate flex-level comment_go" url="/packageE/pages/cart/cart_wk/cart_wk?order_id={{item.order_id}}" data-idx="{{index}}" wx:if="{{item.pt_status==2 && item.pt_tail_money>0}}">支付尾款</navigator>
	          <navigator class="commodity_To_evaluate flex-level comment_go" bindtap="jumpToCart4" data-idx="{{index}}" wx:if="{{(item.order_status==0&&item.pay_status==0)}}">
				<text wx:if="{{paying && paying[index]}}">支付中</text>
				<text wx:else>立即支付</text>
			  </navigator>
			  
			  <!-- 积分购  拼团 搭配购没有有再来一单 -->
			  <block wx:if="{{(item.pay_status==1 || item.order_status==3) && !item.presell && item.pt_prom_id<=0 && item.integral<=0 && item.order_goods[0].prom_type!=5 && !(item.order_goods[0].prom_type==9)}}">
			  			  <view bindtap="moreOrder"  class="commodity_To_evaluate flex-level comment_go"
			  			   data-index="{{index}}">再来一单</view>			  
			  </block>





			  
	        </view>
	      </view>
	    </view>
	  </view>
	</view>
</view>

<!-- 服务卡项 -->
<!-- 订单状态:0=未付款 1=已付款、待评价  2已评价、完成 3已取消   5作废 -->
<view class="list-container" wx:elif="{{currentIndex == 2}}">
	<view class="stay_evaluate" data-id="{{item.order_id}}" wx:for="{{cardList}}" wx:key="{{item}}">
	  <!-- 商品编号和状态 -->
	  <view class="Commodity_number flex-vertical-between fs24 padding border_bottom">
	    <!--商品编号 -->
	    <text selectable='true'>订单编号：{{item.order_sn}}</text>

		  <!-- 这是预售的 -->
		  <block wx:if="{{item.presell}}">
			  <block wx:if="{{item.order_status==3}}">
				  <text wx:if="{{item.presell.tail_pay_state==2}}">尾款支付失败</text>
			  </block>
			  <block wx:else>
				  <text wx:if="{{item.presell.presell_type==0 &&  !item.presell.deposit_pay_time}}">待支付定金</text>
				  <text wx:if="{{item.presell.presell_type!=1 && item.presell.deposit_pay_time && !item.presell.tail_pay_state}}">待尾款</text>
				  <text wx:if="{{item.presell.presell_type==1 &&  item.order_status<2  && item.pay_status<1 }}">未支付</text>
			  </block>

			  <view wx:if="{{(item.order_status==1 && item.pay_status==1)}}" class="flex-center">待评价<view class="lin"></view>
				  <image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteSerOrderData"  data-index="{{index}}"   data-order_id="{{item.order_id}}"></image>
			  </view>
			  <view wx:if="{{item.order_status==2}}" class="flex-center">已评价<view class="lin"></view>
				  <image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteSerOrderData"  data-index="{{index}}"   data-order_id="{{item.order_id}}"></image>
			  </view>
			  <view wx:if="{{item.order_status==3 && item.pt_status!=6}}"  class="flex-center" >已取消<view class="lin"></view>
				  <image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteSerOrderData"  data-index="{{index}}"   data-order_id="{{item.order_id}}"></image>
			  </view>

		  </block>

		  <block wx:else>
			  <!-- 订单状态 -->
			  <view class="flex-center c-r">
				  <view wx:if="{{item.pay_status == 0 && item.order_status<2 }}">
					  <block wx:if="{{item.prom_type==6}}">
						  <block wx:if="{{item.pt_status==0}}" >未支付</block>
						  <block wx:if="{{item.pt_status==1}}" >组团中</block>

					  </block>
					  <block wx:else>
						  待支付
					  </block>
				  </view>
				  <view wx:if="{{item.order_status<2}}">
					  <block wx:if="{{item.pt_status==2 && item.pt_tail_money>0}}">待支付尾款</block>
				  </view>

				  <view wx:if="{{item.order_status == 1 && item.pay_status==1}}" class="flex-center">待评价
					  <view class="lin"></view>
					  <image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteSerOrderData"
							 data-index="{{index}}" data-orderid="{{item.order_id}}" data-ordersn="{{item.order_sn}}">

					  </image>
				  </view>
				  <view wx:if="{{item.order_status == 2}}" class="flex-center">已评价
					  <view class="lin"></view>
					  <image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteSerOrderData" data-index="{{index}}"
							 data-orderid="{{item.order_id}}" data-ordersn="{{item.order_sn}}"></image>
				  </view>


				  <!-- 要判断支付尾款失败 -->
				  <view wx:if="{{item.order_status == 3 && item.pt_status!=6}}" class="c-a9" class="flex-center">已取消
					  <view class="lin"></view>
					  <image src="{{iurl}}miniapp/images/trash.png" bindtap="deleteSerOrderData" data-index="{{index}}"
							 data-orderid="{{item.order_id}}" data-ordersn="{{item.order_sn}}"></image>
				  </view>
				  <view wx:if="{{item.order_status == 5}}">已作废</view>
				  <view wx:if="{{item.pt_status==6}}"><text style="font-size: 26rpx;">支付尾款失败</text></view>
			  </view>
		  </block>


	  </view>
	
	  <!-- 商品详情集合 -->
	  <view class="detail_commoditys">
	    <!-- 单个商品 -->
	    <view>
	      <navigator class="detail_commodity flex-vertical padding" wx:for="{{item.list}}" wx:for-item="goods"  wx:for-index="pinx" url="{{ofil.card_url(item)}}">
	        <!-- 商品图片 -->
	        <navigator class="rel">
	            <image src="{{resourceUrl+goods.img_url}}" binderror="bind_bnerr" lazy-load="{{true}}" data-errorimg="cardList[{{index}}].list[{{pinx}}].img_url"></image>
				<view class="abs flex-center fs26" wx:if="{{goods.prom_type==1}}">秒杀</view>
				<view class="abs flex-center fs26" wx:if="{{goods.prom_type==6}}">团购</view>
	        </navigator>
	        <!-- 商品内容 -->
	        <view class="Commodity_content">
	          <view class="Commodity_goods">
	            <!-- 商品名称 -->
	            <view class="goods_name ellipsis-2 fs26">{{goods.service_name}}</view>
	            <view class="flex-space-between">
	              <!-- 商品规格 -->
	              <!-- <view class="Commodity_spec fs28 flex-center"> -->
	                <!--<text class="ellipsis-1" wx:if="{{goods.goods_color.length>1 && goods.goods_spec.length>1}}">{{goods.goods_color+"/"+goods.goods_spec}}</text>-->
	                <!--<text class="ellipsis-1" wx:elif="{{goods.goods_color.length>1 || goods.goods_spec.length>1}}">{{goods.goods_color==undefined?"":goods.goods_color}}{{goods.goods_spec==undefined?"":goods.goods_spec}}</text>-->
	                <!--<text class="ellipsis-1" wx:else>规格1</text>-->
	                  <!-- <text class="ellipsis-1">{{filters.show_gui_ge(goods.goods_spec, goods.goods_color)}}</text> -->
	              <!-- </view> -->
	            </view>
	          </view>
	          <!-- 商品价格数量 -->
	          <view class="Commodity_money flex-vertical-between baseline">
	            <!-- 商品价格 -->
	            <view class="flex-vertical c-tb baseline">
	              <view class="fs24">￥</view>
								<!-- 幸运购prom_type等于9 -->
								<!-- 如果是幸运购就显示幸运购参团价格 -->
								<view class="fs26">{{filters.toFix(goods.price,2)}}</view>
	              <!-- <view class="fs26" wx:else>{{filters.toFix(goods.member_goods_price,2)}} <text wx:if="{{goods.prom_type==10}}">({{goods.ladder_discount}}折)</text> </view> -->
	            </view>
	            <view class="fs26 c-a9">x{{goods.qty}}</view>
	          </view>
	        </view>
	      </navigator>
	      <!-- 去评价 -->
	      <view class="commodity_evaluate jc_sb baseline fs26">
	        <!-- 商品数量 -->
	        <view class="commodity_smy fs24">
	          <view class="order-total">
	            <view>
	              共{{filters.count(item.list)}}件商品
	            </view>
	            <view class="goods-total flex">
	              <block>
	                <view class="commodity_money flex baseline">
	                  <view>合计<text wx:if="{{item.discount!=underdefine && item.discount!=null && item.discount!=0}}" style="color:#d60021;">(改)</text>:</view>
	                  <view class="fs24 c-r">￥</view>
	                  <view class="c-r">{{filters.toFix(item.account+item.pt_tail_money,2)}}
	                  </view>
	
	                </view>
	              </block>
								
	            </view>
	          </view>
	        </view>
					
	        <view class="links flex-right-vertical fs24 padding">
	          <image wx:if="{{(item.order_status==1&&item.pay_status==1 && item.shipping_status==0 && item.exp_type==1 && !(item.order_goods[0].prom_type==9))}}"
					 class="code" src="{{iurl}}miniapp/images/order/code.png" bindtap="code_show" data-order_sn="{{item.order_sn}}"></image>
	          <view bindtap="cancle" class="commodity_To_evaluate flex-level View_evaluation" data-id="{{tabIndex}}" data-orderid="{{item.order_id}}" data-ordersn="{{item.order_sn}}" wx:if="{{(item.order_status==0)}}" data-index="{{tabIndex}}">取消订单</view>

	            <!-- 尾款的支付时候，不显示订单详情 -->
				<navigator class="commodity_To_evaluate flex-level View_evaluation"
						   hidden="{{item.presell && item.presell.presell_type==0 && item.order_status<3 && item.presell.deposit_pay_time>0 && item.presell.tail_pay_state==0}}"
						   url="/packageA/pages/details_serviceCard/details_serviceCard?order_id={{item.order_id}}">订单详情</navigator>


				<block wx:if="{{item.order_status==1 && item.pay_status==1}}">
					<navigator wx:if="{{item.list.length > 1}}"  class="order-btn white bg-orange"
										 url="/packageB/pages/user/comment/comment?card=1&status=0&order_id={{item.list[index].order_id}}">评价</navigator>
					<navigator wx:else  class="order-btn white bg-orange"
										 url="/packageB/pages/user/add_comment/add_comment?card=1&goods_id={{item.list[0].card_id}}&order_id={{item.list[0].order_id}}&price={{item.list[0].price}}">评价</navigator>
				</block>


				<block wx:if="{{item.presell && item.presell.presell_type==0 && item.order_status<3 && item.presell.deposit_pay_time>0 && item.presell.tail_pay_state==0}}">
					<navigator class="commodity_To_evaluate flex-level comment_go" url="/packageC/pages/presell/cart/cart?order_id={{item.order_id}}&is_fwk=1" data-idx="{{index}}" >支付尾款</navigator>

				</block>

				<navigator class="commodity_To_evaluate flex-level comment_go"
						   bindtap="pay" data-index="{{index}}" wx:if="{{item.prom_type!=6 && item.order_status==0 && item.pay_status==0 && item.order_status<2}}">
					<text wx:if="{{ser_paying && ser_paying[index]}}">支付中</text>
					<text wx:else>立即支付</text>

				</navigator>

				<navigator class="commodity_To_evaluate flex-level comment_go"
						   bindtap="pay" data-index="{{index}}" wx:if="{{item.prom_type==6 && item.pt_status==0 && item.order_status<2}}">
					<text wx:if="{{ser_paying && ser_paying[index]}}">支付中</text>
					<text wx:else>立即支付</text>

				</navigator>

				<navigator class="commodity_To_evaluate flex-level comment_go" url="/packageA/pages/serviceCard_pd/cart_wk/cart_wk?order_id={{item.order_id}}"
						   data-idx="{{index}}" wx:if="{{item.order_status<2 && item.pt_status==2 && item.pt_tail_money>0}}">支付尾款</navigator>


			</view>
	      </view>
	    </view>
	  </view>
	</view>
</view>

<!-- 线下订单 -->
<view class="offline-container" wx:elif="{{currentIndex == 1}}">
		<view class="offline-list">
			<view class="item new_d" wx:for="{{list2}}">
				<!-- 顶部 -->
				<view class="fs32 sto_title">{{item.StorageName}}</view>
				<view class="fs24 order_info_new flex jc_sb">
					<view>营业员：{{item.StaffName}}</view>
					<view>单号：{{item.No}}</view>
				</view>
				<view class="fs24 order_info_new flex jc_sb" style="margin-top: 26rpx;">
					<view>收银员：{{ofil.for_mat_val(item.Operator)}}</view>
					<view>{{item.BillDate}}</view>
				</view>
				<view class="line_new" style="margin-top: 34rpx;"></view>
				<!-- 中间商品 -->
				<view class="flex fs24 tab_title">
					<view class="subitem_n1">
						名称/条码
					</view>
					<view class="flex subitem_n2">
						<view class="subitem_nn">数量</view>
						<view class="subitem_nn">单价</view>
						<view class="subitem_nn">金额</view>
					</view>
				</view>
				<view class="val_item flex ai_c" wx:for="{{item.list}}" wx:for-item="i">
					<view class="subitem_n1">
						<view class="ellipsis-2">{{i.WareName}}</view>
						<view>
							{{i.BarCode}}
							<block wx:if="{{i.SpecName || i.UnitName}}">
                                 ({{i.SpecName}}<text wx:if="{{i.SpecName && i.UnitName}}">/</text>{{i.UnitName}})
							</block>
						</view>
					</view>
					<view class="flex subitem_n2">
						<view class="subitem_nn">{{i.Qty}}</view>
						<view class="subitem_nn">{{i.Price}}</view>
						<view class="subitem_nn je_color">{{ofil.toFix(i.Sum,2)}}</view>
					</view>
				</view>
				<view class="line_new" style="margin-top: 34rpx;"></view>
				<!-- 底部金额 -->
				<view style="margin-top: 16rpx;padding-bottom: 26rpx;">
					<view class="more_info flex jc_sb ai_c fs24">
						<text>商品总数</text>
						<text>{{item.all_qty}}</text>
					</view>
					<view class="more_info flex jc_sb ai_c fs24">
						<text>优惠金额</text>
						<text class="je_color">{{ofil.toFix(item.all_yh,2)}}</text>
					</view>
					<view class="more_info flex jc_sb ai_c fs24">
						<text>实付金额</text>
						<text class="je_color">{{ofil.toFix(item.FactAndBank,2)}}</text>
					</view>
					<view class="more_info flex jc_sb ai_c fs24">
						<text>本次积分</text>
						<text>{{ofil.for_mat_val(item.PIntegral)}}</text>
					</view>
					<view class="more_info flex jc_sb ai_c fs24">
						<text>会员卡号</text>
						<text>{{item.VIPNo}}</text>
					</view>
					<view class="more_info flex jc_sb fs24">
						<view>本次使用优惠券号</view>
						<view wx:if="{{!item.quan_arr}}">-</view>
						<view wx:else>
							<view wx:for="{{item.quan_arr}}" wx:for-item="quan">{{quan}}</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>


<!-- 没有数据 -->
<view class="After_all flex-center" wx:if="{{(iscodeall==1 && orderList.length>1 && currentIndex ==0) || (is_no_more2 && currentIndex == 1) || (is_no_more2 && currentIndex == 2)}}">
  <!-- <view class="Line"></view> -->
  <view class="end fs26 xc-black">——— 到底了 ———</view>
  <!-- <view class="Line"></view> -->
</view>

<!-- 无订单 -->
<view class="empty_order" wx:if="{{((!orderList||orderList.length==0) && is_get && currentIndex == 0) || (list2.length==0 && currentIndex == 1 && is_get) || (cardList.length == 0 && currentIndex == 2 && is_get)}}">
  <view class="flex-level">
    <image src="{{iurl}}miniapp/images/order/empty_order.png"></image>
  </view>
  <view class="flex-level fs30 xc-ash">当前暂无订单</view>
  <view class="flex-level">
    <navigator bindtap="go_url" data-url="/pages/index/index/index" >
      <view class="flex-center fs28 white">去首页逛逛</view>
    </navigator>
  </view>
</view>

<!-- 无会员，跳转提示 -->
<view class="empty_order" wx:if="{{no_user}}">
	<view class="flex-level">
		<image src="{{iurl}}miniapp/images/order/empty_order.png"></image>
	</view>
	<view class="flex-level fs30 xc-ash">会员未登陆。。</view>
</view>

<!-- 弹出框扫描 -->
<qr_code id="qc_com"></qr_code>
