<wxs module="g_filter" src="g_filter.wxs"></wxs>
<wxs src="../../../../utils/filter.wxs" module="filter"></wxs>
<!-- 风格3 -->
<block wx:if="{{is_show_pl || is_show_gb || is_show_pp }}">
  <!-- 头部 -->
  <view class="xc-search-box flex-center white_b" id="navbar" style="position:fixed;top:0;z-index:99">
    <view class="share-height t-c" bindtap="getScancode">
      <image class="scanning_black-img" src="{{iurl}}/miniapp/images/goodscategory/scanning_black.png"></image>
      <view class="fs24">扫一扫</view>
    </view>
    <view class="xc-search-inner ">
      <view class="search-img left">
        <image class="wh100" src="{{iurl}}/miniapp/images/search.png"></image>
      </view>
      <input class="search-cont" bindconfirm="search" bindinput="getInput" placeholder="请输入您所搜索的商品" type="text"></input>
    </view>
    <view class="c-red fs26" bindtap="search">搜索</view>
  </view>
  <!-- 分类项目内容 -->
  <view class="flex project_height" style="margin-left:-10rpx;">
    <!-- 分类项目的类型 -->
    <view class="project_type" style="background-color:#eee;overflow-y:auto;position:fixed;left:0;z-index:99;top:120rpx;" id="thress_type3">
      <view class="project_type-frame">
        <view wx:if="{{is_show_gb}}">
          <view bindtap="click_classify" class="tab-bar-item {{select_classify_on==223 ? 'active' : ''}}" data-current="223" data-name="国家" wx:if="{{is_country}}">
            <text style="letter-spacing:50rpx;">国家</text>
          </view>
        </view>
        <view wx:if="{{is_show_pp}}">
          <view bindtap="click_classify" class="tab-bar-item {{select_classify_on==220 ? 'active' : ''}}" wx:if="{{is_brand}}" data-current="220" data-name="品牌">
            <text style="letter-spacing:50rpx;">品牌</text>
          </view>
        </view>
        <view wx:if="{{is_show_pl}}">
          <scroll-view scroll-y scroll-with-animation class="tab-view" scroll-top="{{scrollTop}}" style="height:88%">
            <view wx:for="{{catelist}}" wx:if="{{item}}"  class="tab-bar-item {{select_classify_on==index ? 'active' : ''}}"
                  data-current="{{index}}" catchtap="click_classify" data-cid="{{item.id}}" data-index="{{index}}" data-name="{{item.name}}">
              <text>{{item.name}}</text>
            </view>
          </scroll-view>
          <!-- </view> -->
        </view>
      </view>
    </view>
    <!-- 分类项目的内容 -->
    <view class="classify_content" style="margin-left:27%;margin-top:120rpx">
      <!-- 国家的样式 -->
      <block wx:if="{{select_classify_on==223&&is_show_gb}}">
        <view class="classify_name fs28 flex-space-between">
          <view>{{ishaf_three==1?good_list.name:classify_name}}</view>
        </view>
        <view class=" classify_content-frame flex-space-between ">
          <view bindtap="go_nation" class="country_img-frame rel outer_location" wx:for="{{nationlist}}" wx:for-item="bitem" wx:for-index="pidx" data-nid="{{bitem.id}}">
            <image wx:if="{{bitem.imgtype==1}}" class="country_img" src="{{bitem.logo}}"></image>
            <image wx:else class="country_img" src="{{iurl}}{{bitem.logo}}"></image>
            <view class='nation_box abs box'>
              <view class='nt_1 t-c line-height' style="height:50rpx">
                <text class="nation_z_name ellipsis-1 nt_1_t height fs24">{{bitem.name}}</text>
              </view>
              <view class='nt_2 t-c line-height fs24' style="line-height: 50rpx">
                <text class="nation_y_name ellipsis-1 nt_1_t height fs24">{{bitem.enname}}</text>
              </view>
            </view>
            <!-- <view class='nation_box abs box' style="top:20rpx"> -->
            <!-- </view> -->
          </view>
        </view>
      </block>
      <!-- 品牌 -->
      <block wx:if="{{select_classify_on==220&&is_show_pp}}">
        <view class="classify_name fs28 flex-space-between">
          <view>{{classify_name}}</view>
        </view>
        <view class="classify_content-frame flex flex-wrap">
          <block wx:for="{{groups}}" wx:for-item="brand_list" wx:for-index="pidx">
            <view class="brand_img_frame " wx:for="{{brand_list.array}}" wx:for-item="user" wx:for-index="idx" bindtap="go_brand" data-bid="{{user.id}}">
              <view class="t-c">
                <image class=" brand_img" src="{{user.logo}}" data-pix="{{pidx}}" data-idx="{{idx}}" data-errorimg="groups[{{pidx}}].array[{{idx}}].logo" binderror="bind_bnerr_pp"></image>
                <view class="brand_img_name ellipsis-1 fs24">{{user.name}}</view>
              </view>
            </view>
          </block>
        </view>
      </block>
      <!-- 品类 -->
      <block wx:if="{{is_show_pl}}">
        <block wx:if="{{select_classify_on!=220&&select_classify_on!=223}}">
          <view style="width:100%;height:100%;">
            <view class="classify_name fs28 flex-space-between" id="header" data-pid="0" data-cid="{{cat_id}}" bindtap='select_more' style="position:fixed;z-index:999999;top:130rpx;width:70%;background-color:#ffffff;left:27%;padding:0 10rpx;">
              <view class="classify_title ellipsis-1">{{classify_name}}</view>
              <!-- <view class="flex select_more">
                <view class="red-co fs24">更多</view>
                <view class="bg_right width_height"></view>
              </view> -->
            </view>
            <!-- 显示商品列表开始 -->
            <!-- <view class="classify_content-frame flex-wrap" style="width:100%;overflow:hidden;heigth:100%;"> -->
            <!-- <view class="null" style="width:100%;margin-top:70rpx;"></view> -->
            <scroll-view wx:if="{{is_get}}" scroll-y scroll-top="{{scrollTop}}" bindscroll="bd_scroll" bindtouchstart="touchstart" bindtouchend="touchend" bindscrolltolower='scrollLower' lower-threshold="200" style="height:{{windowHeight}};position:absolute;margin-top:70rpx;top:140rpx;bottom:0;rigth:0;left:26%;width:73%;">
              <!-- <view class="null" style="width:100%;height:1px;"></view> -->
              <!-- goodslist -->
              <view class="choice_list" style="height:{{requestData.length?'100%':''}}">
                <navigator class="choice_item" style="margin-bottom:{{dataLength -1 == index?'100px':'0'}}" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}" wx:for="{{requestData}}" data-id="{{item.id}}">
                  <view class="img-wrap" data-txt="已售:{{item.sales_sum}}">
                    <image src="{{url+item.original_img}}" binderror="bind_bnerr_t3" data-url="{{url+item.original_img}}" lazy-load="true" data-errorimg="requestData[{{index}}].original_img"></image>
                  </view>
                  <view class="item-cont">
                    <view class="title">{{item.goods_name}}</view>
                    <!-- 判断是否有活动价 -->
                    <block wx:if="{{item.prom_price>0 || item.prom_integral}}">
                      <!-- 活动价 -->
                      <view class="price">
                        <text wx:if="{{item.prom_integral}}">{{item.prom_integral}}积分</text>
                        <text wx:if="{{item.prom_integral && item.prom_price}}">+</text>
                        <text wx:if="{{item.prom_price}}">￥{{item.prom_price}}</text>
                      </view>
<!--                      <view class="comment flex jc_sb">-->
<!--                        <view class="word-line xc-ash">￥{{item.market_price}}</view>-->
<!--                      </view>-->
                      <view class="fs24 c-a flex jc_sb">
                        <text class="money c-red">分成金额：{{filter.toFix(item.commission,2)}}</text>
                        <text>评论{{item.comment_count}}</text>
                      </view>
                    </block>
                    <block wx:else>
                      <!-- 商品价格,先判断下是否有等级价 -->
                      <block wx:if="{{g_filter.is_has_rank(rank_switch,item)}}">
                        <!-- 当会员是等级卡的时候 -->
                        <block wx:if="{{card_field}}">
                          <!-- 等级价>0 -->
                          <block wx:if="{{item[card_field]>0}}">
                            <view class="flex ai_and">
                              <view class="price">￥{{item[card_field]}}</view>
                              <view class="card_bg ellipsis-1">
                                <image src="{{url}}/miniapp/images/plus/dj_icon.png"></image>
                                <view class="card_name">{{card_name}}</view>
                              </view>
                            </view>
<!--                            <view class="comment flex jc_sb">-->
<!--                              <view class="word-line xc-ash">￥{{item.market_price}}</view>-->
<!--                            </view>-->
                            <view class="fs24 c-a flex jc_sb">
                              <text class="c-red">分成金额：{{filter.toFix(item.commission,2)}}</text>
                              <text>评论{{item.comment_count}}</text>
                            </view>
                          </block>
                          <block wx:else>
                            <view class="price">￥{{item.shop_price}}</view>
<!--                            <view class="comment flex jc_sb">-->
<!--                              <view class="word-line xc-ash">￥{{item.market_price}}</view>-->
<!--                            </view>-->
                            <view class="fs24 c-a flex jc_sb">
                              <text class="c-red">分成金额：{{filter.toFix(item.commission,2)}}</text>
                              <text>评论{{item.comment_count}}</text>
                            </view>
                          </block>
                        </block>
                        <block wx:else>
                          <block wx:if="{{g_filter.get_card_price(item,card_list,0)}}">
                            <view class="flex ai-center">
                              <view class="price">￥{{item.shop_price}}</view>
<!--                              <view class="word-line xc-ash mk_price">￥{{item.market_price}}</view>-->
                            </view>
                            <view class="comment flex jc_sb">
                              <view class="flex ai-center">
                                <view class="">￥{{g_filter.get_card_price(item,card_list,0)}}</view>
                                <view class="card_bg ellipsis-1">
                                  <image src="{{url}}/miniapp/images/plus/dj_icon.png"></image>
                                  <view class="card_name">
                                    {{g_filter.get_card_price(item,card_list,1)}}
                                  </view>
                                </view>
                              </view>
                            </view>
                            <view class="fs24 c-a flex jc_sb">
                              <text class="c-red">分成金额：{{filter.toFix(item.commission,2)}}</text>
                              <text>评论{{item.comment_count}}</text>
                            </view>
                          </block>
                          <block wx:else>
                            <view class="price">￥{{item.shop_price}}</view>
<!--                            <view class="comment flex jc_sb">-->
<!--                              <view class="word-line xc-ash">￥{{item.market_price}}</view>-->
<!--                            </view>-->
                            <view class="fs24 c-a flex jc_sb">
                              <text class="money c-red">
                                分成金额：{{filter.toFix(item.commission,2)}}
                              </text>
                              <text>评论{{item.comment_count}}</text>
                            </view>
                          </block>
                        </block>
                      </block>
                      <block wx:else>
                        <view class="price">￥{{item.shop_price}}</view>
<!--                        <view class="comment flex jc_sb">-->
<!--                          <view class="word-line xc-ash">￥{{item.market_price}}</view>-->
<!--                        </view>-->
                        <view class="fs24 c-a flex jc_sb">
                          <text class="money c-red">分成金额：{{filter.toFix(item.commission,2)}}</text>
                          <text>评论{{item.comment_count}}</text>
                        </view>
                      </block>
                    </block>
                  </view>
                </navigator>
                <!-- 暂无更多 -->
                <view id="morelb" wx:if="{{is_no_more&&!is_none&&requestData.length}}" style="color:c-red; height: 60rpx;line-height: 30rpx;margin-top: 20rpx;font-size: 25rpx; text-align: center;">
                  <text style="font-size:32rpx;color:red;margin-right:10rpx" class="iconfont icon-arrowup"></text>
                  <text style="color:#999">向上拉继续浏览下一个类别</text>
                  
                </view>
              <view wx:if="{{is_none}}" style="color:#999; height: 60rpx;line-height: 30rpx;margin-top: 20rpx;font-size: 25rpx; text-align: center;">没有更多了</view>

              </view>
              <view class="no-data" wx:if="{{requestData.length==0}}">
                <!-- <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image> -->
                <view class="no-data-title" style="text-align:center;margin-top:100px">
                  <view style="color:#444;line-height:30px;">该类别暂无推荐商品</view>
                  <view style="color:#444;line-height:30px;">{{countDownNum}} 秒后自动跳到下一个类别</view>
                </view>
                <!-- <navigator class="lookat"  url="/pages/index/index/index"> 去逛逛 </navigator> -->
              </view>
            </scroll-view>
            <!-- /goodslist -->
          </view>
          <!-- 商品列表结束 -->
        </block>
      </block>
    </view>
  </view>
</block>
<block wx:elif="{{is_do}}">
  <view class="no-data">
    <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image>
    <view class="no-data-title">商家暂未设置分类</view>
    <navigator class="lookat" url="/pages/index/index/index">去逛逛</navigator>
  </view>
</block>