<navigation>
  <wxs src='../../utils/wxsUtil.wxs' module="wxs"></wxs>
  <cover-view class="navbar-box" style="height:{{navBarData.navBarHeight}}px;" bindtap="goToStore">
    <cover-view class="navbar-box-container" style="height:{{navBarData.menuHeight}}px; min-height:{{navBarData.menuHeight}}px; line-height:{{navBarData.menuHeight}}px; bottom:{{navBarData.menuBotton}}px;">
      <cover-image class="navbar-location" src="/images/black_location.png"></cover-image>
      <cover-view>
        <cover-view class="navbar-tips">{{homeData.store.store_name}}</cover-view>
      </cover-view>
    </cover-view>
  </cover-view>
</navigation>
<view class="insada" style="height: {{navBarHeight}}px;"></view>
<view class="tab">
  <wxs src="./../../utils/wxsUtil.wxs" module="wxsUtil" />
  <view class="tabs-wrap {{current==0?'tabs-wrap-not-item':''}}" style="top: {{navBarHeight}}px;">
    <van-search bind:change='changeSearch' bind:change='changeSearch' bind:search='startSearch' bind:focus='searchFocus' bind:cancel='cancelSearch' bind:blur='searchFocusNo' value="{{ searchValue }}" clearable show-action='{{isFocus}}' placeholder="请输入搜索关键词" />
    <view class="wrap-title flex-align-center">
      <view class="item-title {{ index == current ? 'active' : '' }}" wx:for="{{ currentList }}" wx:key="index" bindtap="onTabsChange" hidden="{{index==3||index==0||index==1||index==2?true:false}}" data-item="{{item}}">
        {{item.title}}
      </view>
    </view>
    <scroll-view scroll-x="true" class="wrap-list flex" style="width: 100%" scroll-into-view="c_{{current}}_{{currentItemIndex}}" hidden="{{current==0?true:false}}">
      <view class="item-list flex-center {{ index == currentItemIndex ? 'active' : '' }}" wx:for="{{ currentList[current].child }}" wx:key="index" bindtap="onTabsItem" data-item="{{item}}" data-index="{{index}}" id="c_{{currentList[current].id}}_{{index}}">
        {{item.name}}
      </view>
    </scroll-view>
  </view>

  <!-- 下面是新型订单列表 -->
  <!-- 下面是新型订单列表 -->
  <!-- 下面是新型订单列表 -->
  <!-- 下面是新型订单列表 -->




  <!-- 下面是卡券耗材以及美妆产品的 -->
  <view class="tabs-content {{ current != 0 ? 'active' : '' }}" hidden="{{current==0?true:false}}">
    <view wx:for="{{productData}}" wx:key="key" style="{{item.type != currentType || item.cat_id != currentItemCatId ? 'display: none;' : '' }}" class="content-item {{ current != 0 ? 'active' : '' }}">
      <navigator class="item flex" wx:for="{{ item.list }}" wx:key="index" wx:for-item="proItem" url="/pages/projectDetail/projectDetail?source={{currentList[current].source}}&id={{proItem.id}}&store_id={{storeId}}" hover-class="none">
        <image src="{{proItem.cover_url}}" class="item-image"></image>
        <view class="item-text flex1 flex-column flex-justify-space-around {{current==0?'insellShow':'insellShow2'}}">
          <text class="content-item-title">{{proItem.name}}</text>
          <view class="tags ellipsis" style="margin-top: 15rpx;" wx:if="{{proItem.tags}}">
            <view class="tags-item ellipsis" wx:for="{{ wxsUtil.split(proItem.tags, ' ') }}" wx:key="t_index" wx:for-item="t_item">
              {{t_item}}
            </view>
          </view>
          <view class="vip-price-box flex">
            <text class="vip-origin-price"><text wx:if="{{proItem.original_price!=0}}">¥</text>{{proItem.original_price==0?'':proItem.original_price}}</text>
            <!-- <text class="vip-origin-price"></text> -->
            <!-- </view> -->
          </view>
          <view class="btn-box flex-align-center">
            <view class="price-text">
              <text style="font-size: 24rpx;font-family: PingFangSC-Medium, PingFang SC;font-weight: 500;color: #FA4622;">¥<text style="font-size: 40rpx;color: #FA4622;font-weight: 500;">{{proItem.is_member ? proItem.member_price
                  :
                  proItem.price}}</text></text>
            </view>
            <image wx:if="{{proItem.is_member}}" src="/images/icon_11.png"></image>
            <text class="flex1"></text>
            <image data-proItem="{{proItem}}"  catchtap="showProduce" src="/images/icon_15.png" wx:if="{{ current != 0&&current!=4 }}" style="width: 48rpx;height: 48rpx;"></image>

            <view class="btn flex-center" wx:if="{{current == 0 &&!inFirstIn}}">下单</view>

            <view class="btn flex-center {{index==1?'onIndex':''}}" wx:if="{{current == 0&&inFirstIn}}" catchtap="noneEnoughPeople" catchtouchmove="noneEnoughPeople">
              <view class="ondistShow" wx:if="{{ current == 0&&index==1&&inFirstIn  }}">
                <view class="list_right_content">
                  <view class="first_and_title"><text>第二步：</text>选择你</view>
                  <view class="first_and_title">心仪的项目下单</view>
                </view>
                <image class="list_right_img" style="width: 40rpx;height: 40rpx;" src="/images/white_right.png">
                </image>
              </view>
              下单
            </view>

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


<view class="list_first_to" catchtouchmove="noneEnoughPeople" hidden="{{inFirstIn?false:true}}">
  <view class="list_top_show">
    <view class="insada" style="height: {{navBarHeight}}px;"></view>
    <image class="list_top_img" src="/images/white_on.png"></image>
    <view class="list_top_content">
      <view class="first_and_title"><text>第一步：</text>项目导航栏</view>
      <view class="first_and_title">可左右滑动快速筛选项目哟～</view>
    </view>
  </view>



  <view class="KnowBtn" catchtap="knowSubmit">我知道了</view>

</view>
<!-- 美妆产品购物车 -->
<view class="shopping-sup" wx:if="{{current==3}}" bindtap="onOpenMakeup">
  <image src="https://we-spa.oss-cn-shenzhen.aliyuncs.com/wxapp/20220610/shopping.png"></image>
  <view class="shopping-list-num">{{sum}}</view>
</view>

<!-- 美妆产品购物车 -->
<wux-popup class="popup-radius" position="bottom" catchtouchmove="true" visible="{{ onMakeup }}" bind:close="onCloseMakeup">
  <view class="popup-Title-Car">购物车</view>
  <scroll-view scroll-y="true" class="coupon-popup">
    <view class="select-product" wx:for="{{selectMakeupList}}" wx:key='index'>
      <image class="v2-select-image" src="{{item.cover_url}}"></image>
      <view class="v2-select-content">
        <view class="v2-select-content-name">
          <view class="v2-select-content-names">
            <view>{{item.goods_name}}</view>
          </view>
          <image src="/images/delete-gray.png" class="close-img" bindtap="inDeleteCarGood" data-index="{{index}}" />
        </view>

        <view class="v2-select-ontent-money">
          <view class="v2-box"> <text>¥</text><text class="price__big">{{wxs.formatValue(item.price, 'split')[0]}}</text>.<text class="price__small">{{wxs.formatValue(item.price, 'split')[1]}}</text></view>
          <view class="calculation">
            <view class="lation-content">
              <view class="reduce" bindtap="onReduce" data-index="{{index}}">-</view>
              <view class="lation-num">{{item.num}}</view>
              <view class="lation-add" bindtap="onLationAdd" data-index="{{index}}">+</view>
            </view>
          </view>
        </view>
      </view>
    </view>
    <!-- 美妆购物车加购提示 -->
    <view class="exchange-tip" wx:if="{{exchangeInfo.surplus_price&&exchangeInfo.category_plus_id!=0}}">再购<text>{{exchangeInfo.surplus_price}}元</text>{{exchangeInfo.category_name}}产品，可低价换购活动项</view>
    <view style="width:100%;height:80px"></view>
  </scroll-view>
  <view class="buttom-car">
    <view class="car-img">
      <image class="car-icon" src="/images/car-icon.png"></image>
      <view class="top-view" hidden="{{selectMakeupList.length==0?true:false}}">{{sum}}</view>
    </view>
    <view class="car-money"><text>¥</text>{{showMoneyGood}}</view>
    <view class="to-submit" catchtap="toSubmitGood">去结算</view>
  </view>

</wux-popup>
<!-- 下面是选择购物袋的弹出框 -->
<wux-popup class="popup-radius" position="bottom" catchtouchmove="true" visible="{{ showProducePup }}" bind:close="onClosePay">
  <scroll-view scroll-y="true" class="coupon-popup">
    <view class="showline"></view>
    <view class="select-product">
      <image class="v2-select-image" src="{{isIcon?proItem.cover_url:toSelectProduct.cover_url}}"></image>
      <view class="v2-select-content">
        <view class="v2-select-content-name">
          <view class="v2-select-content-names">{{isIcon?proItem.name:toSelectProduct.name}}</view>
          <image src="/images/icon_20.png" class="close-img" bindtap="onClosePay" />
        </view>

        <view class="v2-desc" wx:if="{{toSelectProduct.desc}}">
          <view class="desc-item" wx:for="{{ wxsUtil.split(toSelectProduct.desc, ' ') }}" wx:key="t_index" wx:for-item="t_item">{{t_item}}</view>
        </view>

        <view class="flex1In"></view>

        <view class="v2-select-ontent-money"><text>¥</text>{{isIcon?proItem.price:toSelectProduct.price}}</view>
      </view>
    </view>

    <view wx:if="{{!isIcon}}" class="v2-select-title" hidden="{{selectProductData.upgrade.length==0?true:false}}">精选耗材</view>

    <view class="v2-material">

      <view wx:if="{{!isIcon}}" class="{{selectProductIndex==index?'onSelectProduct':'material-item'}}" catchtap="selectProduct" data-index="{{index}}" wx:for="{{selectProductData.upgrade}}" wx:key="index">
        <image class="material-images" src="{{item.cover_url}}"></image>
        <view class="material-content">
          <view class="material-name {{selectProductIndex==index?'onSelectName':''}}">{{item.name}}</view>
        </view>
        <view class="material-price"><text>￥</text>{{item.price}}</view>

      </view>

    </view>

    <view class="bottom-select"></view>

    <view wx:if="{{!isIcon}}" class="submit_bottom" catchtap="submit_bottom">加入购物车</view>
    <view wx:if="{{isIcon}}" class="submit_bottom" catchtap="submit_add">加入购物车</view>

  </scroll-view>
</wux-popup>
