<wxs module="g_filter" src="../g_filter.wxs"></wxs>
<wxs module="filter" src="../../../utils/filter.wxs"></wxs>
<view class="container" wx:if="{{show_all}}">
  <view>

    <view wx:if="{{prom_goods_list}}" class="fs30"><text style="color: red;" wx:if="{{index==0 && limit_num>0}}">每人限参与{{limit_num}}次;</text></view>
    <block wx:for="{{prom_goods_list}}">
      <view class="fs30 ellipsis-1" style="padding: 20rpx 30rpx">
        满{{item.condition}}<text space="{{true}}" wx:if="{{item.prom_type==0}}">元 </text> <text space="{{true}}" wx:else>件 </text>
        <text space="{{true}}" wx:if="{{item.content.is_money && item.content.is_money!='0'}}">减{{item.content.money}}元 </text>
        <text space="{{true}}" wx:if="{{item.content.past && item.content.past!='0'}}">包邮 </text>
        <text space="{{true}}" wx:if="{{item.content.is_sale && item.content.is_sale!='0'}}">打{{item.content.sale}}折 </text>
        <text space="{{true}}" wx:if="{{item.content.is_int && item.content.is_int!='0'}}">送{{item.content.int}}积分 </text>
        <text space="{{true}}" wx:if="{{item.content.is_coupon && item.content.is_coupon!='0'}}">送{{item.content.coupon_money}}元优惠券 </text>
        <text space="{{true}}" wx:if="{{item.content.is_gift  && item.content.is_gift!='0'}}">送{{item.content.zp_mode==1?'多赠品':item.content.gift_name}} </text>
        <text space="{{true}}" wx:if="{{item.content.is_libao && item.content.is_libao!='0'}}">送{{item.content.lb_name}} </text>
        <text space="{{true}}" wx:if="{{item.content.is_zxlibao && item.content.is_zxlibao!='0'}}">送{{item.content.zxlb_name}} </text>
        <text space="{{true}}" wx:if="{{item.content.is_monthgiftbag && item.content.is_monthgiftbag!='0'}}">送{{item.content.monthgift_name}} </text>
      </view>
    </block>

    <!-- 新增 -->
    <view wx:if="{{jieti_prom}}" class="fs30 ellipsis-1" style="padding: 20rpx">阶梯促销：{{jieti_prom}}</view>

  </view>
  <view class="pd20 flex ai-center jc_sb search_fixed">
    <!-- 搜索框 -->
    <view class="search-box f1">
      <view hover-class="none" data-url="/packageG/pages/goods/search/search?ladder_id={{ladder_id}}" bindtap="go_url"><text class="iconfont icon-sousuo pdr10"></text>请输入商品关键字</view>
    </view>
    <!-- 单列/双列 显示切换 -->
    <text class="iconfont {{isToggle ? 'icon-fenlie':'icon-fenxiang'}} pdl30 fs36" bindtap="bindToggleDisplay"></text>
  </view>

  <view class="nav-box">
    <view class="nav">


      <navigator class="nav-item">
        <picker bindchange="bind_pk_sort" value="{{index}}" range="{{more_sort_arr}}" range-key="name">
          <text wx:if="{{tabname=='on_time'}}">新品</text>
          <text wx:elif="{{tabname=='comment_count'}}">评论</text>
          <text wx:else>综合</text>
        </picker>
        <view class="arrow_down"></view>

      </navigator>


      <navigator bindtap="changeTab" class="nav-item" data-href="sales_sum" data-ad="{{adname}}">销量
        <!--				<view class="ico-dg" wx:if="{{tabname=='sales_sum'}}">-->
        <!--					<image class="wh100" src="{{iurl}}/miniapp/images/dg.png" wx:if="{{adname=='desc'}}"></image>-->
        <!--					<image class="wh100" src="{{iurl}}/miniapp/images/up_s.png" wx:if="{{adname=='asc'}}"></image>-->
        <!--				</view>-->
        <view>
          <view class="arrow_up {{tabname=='sales_sum' && adname=='asc'?'on':''  }}  "></view>
          <view class="arrow_down  {{tabname=='sales_sum' && adname=='desc'?'on':''  }} "></view>
        </view>

      </navigator>
      <navigator bindtap="changeTab" class="nav-item" data-href="final_price" data-ad="{{adname}}">
        价格
        <!--				<view class="ico-dg" wx:if="{{tabname=='final_price'}}">-->
        <!--					<image class="wh100" src="{{iurl}}/miniapp/images/dg.png" wx:if="{{adname=='desc'}}"></image>-->
        <!--					<image class="wh100" src="{{iurl}}/miniapp/images/up_s.png" wx:if="{{adname=='asc'}}"></image>-->
        <!--				</view>-->
        <view>
          <view class="arrow_up {{tabname=='final_price' && adname=='asc'?'on':''  }}  "></view>
          <view class="arrow_down  {{tabname=='final_price' && adname=='desc'?'on':''  }} "></view>
        </view>
      </navigator>
      <navigator bindtap="openFilterModal" class="nav-item">
        筛选<view class="ico-filter">
          <image class="wh100" src="{{iurl}}/miniapp/images/xx.png"></image>
        </view>
      </navigator>

      <!-- <navigator class="nav-item search" url="/packageG/pages/goods/search/search">
				<image class="wh100 search-img" src="{{iurl}}/miniapp/images/search.png"></image>
			</navigator> -->
    </view>
  </view>

  <view class="choice_list" style="position: relative;" wx:if="{{!isToggle}}">
    <navigator class="choice_item" url="{{g_filter.get_goods_url(item)}}" wx:for="{{requestData}}" wx:key="{{index}}">
      <view class="img-wrap">
        <image src="{{item.original_img}}" binderror="bind_bnerr2" data-url="{{url+item.original_img}}" lazy-load="true" data-errorimg="requestData[{{index}}].original_img"></image>
      </view>
      <view class="item-cont">
        <view class="title ellipsis-2">{{item.goods_name}}</view>
        <!-- 判断是否有活动价 -->
        <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_id>0  && item.prom_type!=3  && item.prom_type!=5 && item.prom_type!=7 && item.prom_type!=10 }}">
          <view class="flex on">
            <!-- 活动价 -->
            <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}}" class="rmb">{{item.prom_price}}</text>
            </view>
            <view wx:if="{{is_retail_price}}" class="word-line xc-ash mgl10 rmb fs24 no_line_c">{{item.market_price}}</view>
          </view>


          <view class="comment pdt10">
            <!-- <view class="word-line xc-ash">￥{{item.market_price}}</view> -->
            <view class="fs24 t-r">
              <span>评论{{item.comment_count}}</span>
              <span class="pdl30">已售{{item.sales_sum}}</span>
            </view>
          </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-center">
                  <view class="price rmb">{{item[card_field]}}</view>
                  <view class="card_bg ellipsis-1">
                    <image src="{{url}}/miniapp/images/plus/dj_icon.png"></image>
                    <text class="card_name">{{card_name}}</text>
                  </view>
                </view>
                <view class="comment">
                  <view wx:if="{{is_retail_price}}" class="word-line xc-ash rmb no_line_c">{{item.market_price}}</view>
                  <view class="fs24 t-r">
                    <span>评论{{item.comment_count}}</span>
                    <span class="pdl30">已售{{item.sales_sum}}</span>
                  </view>
                </view>
              </block>
              <block wx:else>
                <view class="price rmb">{{item.shop_price}}</view>
                <view class="comment">
                  <!--                  <view class="word-line xc-ash rmb">{{item.market_price}}</view>-->
                  <view class="fs24 t-r">
                    <span>评论{{item.comment_count}}</span>
                    <span class="pdl30">已售{{item.sales_sum}}</span>
                  </view>
                </view>
              </block>
            </block>
            <block wx:else>
              <view wx:if="{{g_filter.get_card_price(item,card_list,0) && is_no_plus}}">
                <view class="flex ai-center">
                  <view class="price rmb">{{item.shop_price}}</view>
                  <view wx:if="{{is_retail_price}}" class="word-line xc-ash mk_price rmb no_line_c">{{item.market_price}}</view>
                </view>
                <view class="comment">
                  <view class="flex ai-center">
                    <view class="rmb">{{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>
                      <text class="card_name">{{g_filter.get_card_price(item,card_list,1)}}</text>
                    </view>
                  </view>
                  <view class="fs24 pdt10 t-r">
                    <span class="">评论{{item.comment_count}}</span>
                    <span class="pdl30">已售{{item.sales_sum}}</span>
                  </view>
                </view>
              </view>
              <block wx:else>
                <view>
                  <view class="price rmb">{{item.shop_price}}</view>
                  <view wx:if="{{is_retail_price}}" class="word-line xc-ash rmb no_line_c">{{item.market_price}}</view>
                </view>
                <!-- <view class="price">￥{{item.shop_price}}</view> -->
                <view class="comment pdt10">
                  <view class="fs24 t-r">
                    <span>评论{{item.comment_count}}</span>
                    <span class="pdl30">已售{{item.sales_sum}}</span>
                  </view>
                </view>
              </block>
            </block>
          </block>
          <view wx:else>
            <view class="flex ai-center">
              <view class="price rmb">{{item.shop_price}}</view>
              <view wx:if="{{is_retail_price}}" class="word-line xc-ash rmb fs24 mgl10 no_line_c">{{item.market_price}}</view>
            </view>

            <view class="comment pdt10">
              <view class="fs24 t-r">
                <span>评论{{item.comment_count}}</span>
                <span class="pdl30">已售{{item.sales_sum}}</span>
              </view>
            </view>
          </view>
        </block>
      </view>
      <view class="gicon" catchtap="addPurchase"  wx:if="{{filter.has_add_goods(item.prom_type)}}"  data-gid="{{item.goods_id}}" data-prom_id="{{item.id}}" data-prom_type="{{item.prom_type}}" data-goods_type="{{item.goods_type}}">
        <text  class="iconfont icon-gouwuche fs60" style="color: #f23030;"></text>
      </view>
    </navigator>
  </view>


  <view class="choice_list on"  wx:else>
    <navigator class="choice_item" url="{{g_filter.get_goods_url(item)}}" wx:for="{{requestData}}" wx:key="{{index}}">
      <view class="img-wrap">
        <image src="{{item.original_img}}" binderror="bind_bnerr2" data-url="{{url+item.original_img}}" lazy-load="true" data-errorimg="requestData[{{index}}].original_img"></image>
      </view>
      <view class="item-cont" style="position: relative;">
        <view class="title ellipsis-2">{{item.goods_name}}</view>
        <!-- 判断是否有活动价 -->
        <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_type!=2 && item.prom_id>0}}">
          <view class="flex on">
            <!-- 活动价 -->
            <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}}" class="rmb">{{item.prom_price}}</text>
            </view>
            <view wx:if="{{is_retail_price}}" class="word-line xc-ash mgl10 rmb fs24 no_line_c">{{item.market_price}}</view>
          </view>


          <view class="comment pdt10">
            <!--		             <view  class="word-line xc-ash">￥{{item.market_price}}</view>-->
            <view class="fs24 t-r">
              <span>评论{{item.comment_count}}</span>
              <span class="pdl30">已售{{item.sales_sum}}</span>
            </view>
          </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-center">
                  <view class="price rmb">{{item[card_field]}}</view>
                  <view class="card_bg ellipsis-1">
                    <image src="{{url}}/miniapp/images/plus/dj_icon.png"></image>
                    <text class="card_name">{{card_name}}</text>
                  </view>
                </view>
                <view class="comment">
                  <view wx:if="{{is_retail_price}}" class="word-line xc-ash rmb no_line_c">{{item.market_price}}</view>
                  <view class="fs24 t-r">
                    <span>评论{{item.comment_count}}</span>
                    <span class="pdl30">已售{{item.sales_sum}}</span>
                  </view>
                </view>
              </block>
              <block wx:else>
                <view class="price rmb">{{item.shop_price}}</view>
                <view class="comment">
                  <view wx:if="{{is_retail_price}}" class="word-line xc-ash rmb no_line_c">{{item.market_price}}</view>
                  <view class="fs24 t-r">
                    <span>评论{{item.comment_count}}</span>
                    <span class="pdl30">已售{{item.sales_sum}}</span>
                  </view>
                </view>
              </block>
            </block>
            <block wx:else>
              <view wx:if="{{g_filter.get_card_price(item,card_list,0) && is_no_plus}}">
                <view class="flex ai-center">
                  <view class="price rmb">{{item.shop_price}}</view>
                  <view wx:if="{{is_retail_price}}" class="word-line xc-ash mk_price rmb no_line_c">{{item.market_price}}</view>
                </view>
                <view class="comment">
                  <view class="flex ai-center">
                    <view class="rmb">{{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>
                      <text class="card_name">{{g_filter.get_card_price(item,card_list,1)}}</text>
                    </view>
                  </view>
                  <view class="fs24 pdt10 t-r">
                    <span class="">评论{{item.comment_count}}</span>
                    <span class="pdl30">已售{{item.sales_sum}}</span>
                  </view>
                </view>
              </view>
              <block wx:else>
                <view>
                  <view class="price rmb">{{item.shop_price}}</view>
                  <view wx:if="{{is_retail_price}}" class="word-line xc-ash rmb no_line_c">{{item.market_price}}</view>
                </view>
                <!-- <view class="price">￥{{item.shop_price}}</view> -->
                <view class="comment pdt10">
                  <view class="fs24 t-r">
                    <span>评论{{item.comment_count}}</span>
                    <span class="pdl30">已售{{item.sales_sum}}</span>
                  </view>
                </view>
              </block>
            </block>
          </block>
          <view wx:else>
            <view class="">
              <view class="price rmb">{{item.shop_price}}</view>
              <view wx:if="{{is_retail_price}}" class="word-line xc-ash rmb fs24 mgl10 no_line_c">{{item.market_price}}</view>
            </view>
            <view class="comment pdt10">
              <view class="fs24 t-r">
                <span>评论{{item.comment_count}}</span>
                <span class="pdl30">已售{{item.sales_sum}}</span>
              </view>
            </view>
          </view>
        </block>

        <view class="gicon2" catchtap="addPurchase"  wx:if="{{filter.has_add_goods(item.prom_type)}}"  data-gid="{{item.goods_id}}" data-prom_id="{{item.id}}" data-prom_type="{{item.prom_type}}" data-goods_type="{{item.goods_type}}">
          <text  class="iconfont icon-gouwuche fs60" style="color: #f23030;"></text>
        </view>
      </view>
    </navigator>
  </view>





  <view class="no-data" wx:if="{{(!requestData||requestData.length==0) && is_go}}">
    <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image>
    <view class="no-data-title">暂无相关商品</view>
    <navigator bindtap="go_url" class="lookat" data-url="/pages/index/index/index">回到首页</navigator>
  </view>
</view>

<include src="../com_screen.wxml" />

<share_box id="share"></share_box>
<view class="t-c fs32" wx:if="{{err_txt}}">
  <view class="no-data">
    <image class="cart-image" src="{{iurl}}/miniapp/images/cart-null.png"></image>
    <view class="no-data-title">{{err_txt}}</view>
    <navigator bindtap="go_url" class="lookat" data-url="/pages/index/index/index">回到首页</navigator>
  </view>
</view>


<!-- 加购 -->
<add_purchase id="add_purchase" bindhide_add_purchase="hide_add_purchase" wx:if="{{add_purchase}}"></add_purchase>




