<wxs module="g_filter" src="g_filter.wxs"></wxs>
<view class="container">
  <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.money}}元 </text>
           <text space="{{true}}" wx:if="{{item.content.is_sale}}">打{{item.content.sale}}折 </text>
           <text space="{{true}}" wx:if="{{item.content.is_int}}">送{{item.content.int}}积分 </text>
           <text space="{{true}}" wx:if="{{item.content.is_coupon}}">送{{item.content.coupon}}元优惠券 </text>
           <text space="{{true}}" wx:if="{{item.content.is_gift}}">送{{item.content.gift_name}} </text>
           <text space="{{true}}" wx:if="{{item.content.is_libao}}">送{{item.content.lb_name}} </text>
         </view>
     </block>
  </view>
	
	<view class="pd20 flex ai-center jc_sb">
		<!-- 搜索框 -->
		<view class="search-box f1">
			<input style="color:#333" autoFocus bindconfirm="search" bindinput="getInput" placeholder="请输入您所搜索的商品" type="text"></input>
      <text style="color:#333;line-height:43rpx" bind:tap="search">搜索</text>
		</view>
		<!-- 单列/双列 显示切换 -->
		<text class="iconfont {{isToggle ? 'icon-fenxiang':'icon-fenlie'}} pdl30 fs36" bindtap="bindToggleDisplay"></text>
	</view>
	
  <view class="nav">
    <navigator bindtap="changeTab" class="nav-item" data-href="sort" data-ad="{{adname}}">综合
      <view class="ico-dg" wx:if="{{tabname=='sort'}}">
        <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>
    </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>

    </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>
    </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 class="choice_list" wx:if="{{!isToggle}}">
    <navigator class="choice_item" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}" wx:for="{{requestData}}" wx:key="{{index}}">
      <view class="img-wrap">
        <image src="{{iurl}}{{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_type!=2}}">
				<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}}">￥{{item.prom_price}}</text>			
					</view>
<!--					<view class="word-line xc-ash mgl10 rmb fs24">{{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">￥{{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 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>
                <view class="price">￥{{item.shop_price}}</view>
                <view class="comment">
<!--                  <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>
            <block wx:else>
              <view wx:if="{{g_filter.get_card_price(item,card_list,0)}}">
                <view class="flex ai-center">
                  <view class="price rmb">{{item.shop_price}}</view>
<!--                  <view class="word-line xc-ash mk_price rmb">{{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">￥{{item.shop_price}}</view>
<!--									<view class="word-line xc-ash">￥{{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 class="word-line xc-ash rmb fs24 mgl10">{{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>
    </navigator>
    </view>
		
		
		<view class="choice_list on" wx:else>
		  <navigator class="choice_item" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}" wx:for="{{requestData}}" wx:key="{{index}}">
		    <view class="img-wrap">
		      <image src="{{iurl}}{{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_type!=2}}">
					<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}}">￥{{item.prom_price}}</text>			
						</view>
<!--						<view class="word-line xc-ash mgl10 rmb fs24">{{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">￥{{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 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>
		              <view class="price">￥{{item.shop_price}}</view>
		              <view class="comment">
<!--		                <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>
		          <block wx:else>
		            <view wx:if="{{g_filter.get_card_price(item,card_list,0)}}">
		              <view class="flex ai-center">
		                <view class="price rmb">{{item.shop_price}}</view>
<!--		                <view class="word-line xc-ash mk_price rmb">{{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">￥{{item.shop_price}}</view>
<!--										<view class="word-line xc-ash">￥{{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 class="word-line xc-ash rmb fs24 mgl10">{{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>
		  </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 class="lookat"  url="/pages/index/index/index"> 去逛逛 </navigator>
    </view>
  </view>
  <view hidden="{{!openFilterModal}}">
    <view bindtap="closeFilterModal" class="cover-layer"></view>
    <view class="filter-modal">
      <icon bindtap="closeFilterModal" class="modal-close" color="gray" size="22" type="cancel"></icon>
      <button bindtap="restoreData" class="viewall-btn">显示全部分类</button>
      <view class="filter-box" wx:for="{{requestData.filter_spec}}" wx:key="{{index}}">
        <view class="filter-name">{{item.name}}</view>
        <view class="filter-items">
          <view bindtap="filterGoods" class="filter-item" data-href="{{item.href}}" wx:for="{{item.item}}" wx:key="{{index}}">
            {{item.name}}</view>
        </view>
      </view>

      <view class="filter-box" wx:for="{{requestData.filter_attr}}" wx:key="{{index}}">
        <view class="filter-name">{{item.name}}</view>
        <view class="filter-items">
          <view bindtap="filterGoods" class="filter-item" data-href="{{item.href}}" wx:for="{{item.item}}" wx:key="{{index}}">
            {{item.name}}</view>
        </view>
      </view>
      <view class="filter-box" wx:if="{{requestData.filter_brand.length>0}}">
        <view class="filter-name">相关品牌</view>
        <view class="filter-items">
          <view bindtap="filterGoods" class="filter-item" data-href="{{item.href}}" wx:for="{{requestData.filter_brand}}" wx:key="{{index}}">
            {{item.name}}</view>
        </view>
      </view>
      <view class="filter-box" wx:if="{{requestData.filter_price.length>0}}">
        <view class="filter-name">价格区间</view>
        <view class="filter-items">
          <view bindtap="filterGoods" class="filter-item" data-href="{{item.href}}" wx:for="{{requestData.filter_price}}" wx:key="{{index}}">
            {{item.name}}</view>
        </view>
      </view>
    </view>
  </view>

<share_box id="share"></share_box>