<wxs module="s_filter" src="g_filter.wxs"></wxs>
<com_top_nav title="服务项目"></com_top_nav>

<!-- 背景图片 -->
<view catchtap="close">
	<image class="backimage" style="top:{{navBarHeight}}px"  mode="widthFix" src="{{iurl}}/miniapp/images/yyservice/backimage.png" lazy-load="true"/>
	<view class="flex jc_sb pd20">
		<navigator class="fs26 white" url="/packageA/pages/service_record/service_record">服务记录</navigator>
		<navigator class="fs26 white" url="/packageG/pages/user/my_service/hist_service">历史预约</navigator>
	</view>
</view>

<!-- 预约内容 -->
<!-- 项目框架 -->
<view class="Serviceitems" catchtap="close">
	<view class="flex jc_sb flex-wrap">
		<!-- 单个项目 -->
		<view class="rel" wx:for="{{service_List}}">
		  <view class="abs">
		    <!-- 皇冠log -->
		    <block wx:if="{{item.BuyType==4}}">
		      <image class="equity_money" src="{{iurl}}/miniapp/images//yyservice/equity.png" lazy-load="true"></image>
		    </block>
		    <!-- 金钱log -->
		    <block wx:if="{{item.BuyType==1 || item.BuyType==2 }}">
		      <image class="equity_money" src="{{iurl}}/miniapp/images/yyservice/money.png" lazy-load="true"></image>
		    </block>
		    <!-- 礼包log -->
		    <block wx:if="{{item.BuyType==3}}">
		      <image class="equity_money" src="{{iurl}}/miniapp/images/yyservice/giftpackage.png" lazy-load="true"></image>
		    </block>
		  </view>
		  <view>
		    <view class="flex-center">
		      <image class="itemimage" src="{{item.ImageUrl==''?iurl+defimgurl:item.ImageUrl}}" lazy-load="true" data-errorimg="service_List[{{index}}].ImageUrl" binderror="bind_bnerr1" data-img="{{item.ImageUrl}}"></image>
		    </view>
		
		    <view class="flex-center itemName">
		      <view class="fs30 Name ellipsis-2">{{item.ServiceName}}</view>
		    </view>
		
		    <view class="flex-center fs24 itemCount">
		      <view>剩余次数：</view>
		      <view wx:if="{{item.DisplayQty=='不限次' || item.DisplayQty==1}}">无限次</view>
					<view wx:else>{{item.ObtainTimes}}</view>
		    </view>
		
		    <view class="flex-center fs24 itemEffective">
		      <view>有效期至</view>
		      <view class="Date">{{item.Validay==""?"长期有效":item.Validay}}</view>
		    </view>
		
		  </view>
		
		  <view class="flex-center fs28 functionMax">
			  <!-- 无项目时id是固定的，不能立即使用 -->
				<block wx:if="{{item.ServiceID !='0A2225CF-19A7-402B-A4E3-0226004DD068'}}">
					<view wx:if="{{s_filter.is_acting(item.BeginDate)}}" class="flex-level Use" bindtap="open_fw" data-ind="{{index}}" data-service_id="{{item.ServiceID}}">
						<view>立即使用</view>
					</view>
				<view wx:else class="flex-level Use nostart"  data-ind="{{index}}" data-service_id="{{item.ServiceID}}">
						<view>未开始</view>
					</view>
				</block>

		    <!-- 可预约 -->
		    <view wx:if="{{item.State>0}}" class="flex-level appointment yellow-b" data-url="/packageG/pages/user/my_service/appment_main?service_id={{item.ServiceID}}&BuyType={{item.BuyType}}&ProjectID={{item.ProjectID}}&Validay={{item.Validay}}" bindtap="correcting" data-service_id="{{item.ServiceID}}" data-project_id="{{item.ProjectID}}">
		      <view>预约</view>
		    </view>
		  </view>
		</view>
	</view>

	<block wx:if="{{service_List && service_List.length}}">
		<view class="fs26 t-c" style="line-height: 80rpx;">选择更多服务卡项，<text class="ctb" data-url="/packageA/pages/cardList/cardList" bindtap="goto">立即购买！</text></view>
	</block>
  
	

  <!-- 没有数据 -->
  <!-- 加载完毕并且数据大于=页大小 -->
  <view class="After_all flex-center" wx:if="{{ismore && service_List.length>=6}}">
    <view class="Line"></view>
    <view class="end fs24 xc-black">到底了</view>
    <view class="Line"></view>
  </view>
	<!-- <view class="After_all flex-center" wx:if="{{ismore && service_List.length>=6}}">选择更多服务卡项，</view> -->
</view>

<!-- 无服务项目 -->
<view wx:if="{{service_List.length<1 && is_service_read}}">
  <!-- 遮住 -->
  <!--  <view class="cover"></view>-->
  <!-- 无历史服务 -->
  <view class="empty_order" wx:if="{{true}}">
    <view class="flex-level">
      <image src="{{iurl}}miniapp/images/yyservice/no_history.png"></image>
    </view>
    <!-- <view class="flex-level fs30 xc-ash">暂无服务项目</view> -->
		<view class="flex-level fs30 xc-ash">暂无服务卡项，<text class="ctb" data-url="/packageA/pages/cardList/cardList" bindtap="goto">立即购买！</text></view>
    <view class="flex-level">
      <navigator data-url="/pages/user/index/index" bindtap="goto">
        <view class="flex-center fs28 white">回到首页</view>
      </navigator>
    </view>
  </view>
</view>
<!--  制作一个圆球导航  -->
<nav_b id="nav_b"></nav_b>
<!-- 弹出框扫描 -->
<qr_code id="qc_com"></qr_code>
<warn id="warn"></warn>
<my_confirm id="my_confirm"></my_confirm>

<!-- 批量预约图标 -->
<view class="icon-container" bindtap="goto" data-url="/packageA/pages/my_service2/appment_main" hidden><text class="iconfont icon-plyy"></text></view>