search.wxml 6.4 KB
<!-- 搜索输入框的遮罩层 -->
<view class="searchregister" wx:if="{{searchshow}}">
  <view class="searchitem" wx:for="{{searchlist}}" wx:key='' bindtap="searchlist">
    <view class="searchitemleft">
      <view class="searimg">
        <image src="{{url}}aicon_04@2x.png"></image>
      </view>

      <view class="searchtitle">{{item.name}}</view>
    </view>

    <view class="iconfont icon-jiantou listrow "></view>

  </view>


</view>
<view class="searchhead">

  <view class="searchheaditem {{select==1?'selectactive':''}}" data-id="1" bindtap="select">酒品</view>
  <view class="searchheaditem {{select==2?'selectactive':''}}" data-id="2" bindtap="select">品牌</view>
  <view class="searchheaditem {{select==3?'selectactive':''}}" data-id="3" bindtap="select">酒企</view>
</view>
<view class="searchtent">
  <view class="searchtentleft">
    <view class="searimg">
      <image src="{{url}}aicon_04@2x.png"></image>
    </view>

    <view class="searcontent">
      <input placeholder='搜索酒品/品牌/酒企' placeholder-class='searcontent' bindinput="enterword" value="{{keyword}}" />
    </view>

    <view class="closeimg" bindtap="clear">
      <image src="{{url}}aicon_07x.png"></image>
    </view>
  </view>

  <view class="searchtentr">取消</view>
</view>

<view class="searchrecord" wx:if="{{recordshow}}">



  <view class="textbox">

    <view class="seahead">

      <view class="searword" wx:for="{{list}}" wx:key="" bindtap="enterwine" data-id="{{item.id}}" wx:if="{{select==1}}">{{item.name}}</view>
      <view class="searword" wx:for="{{list}}" wx:key="" bindtap="enterpinpai" data-id="{{item.id}}" wx:if="{{select==2}}">{{item.name}}</view>
      <view class="searword" wx:for="{{list}}" wx:key="" bindtap="enterjiuqi" data-id="{{item.id}}" wx:if="{{select==3}}">{{item.name}}</view>

    </view>

    <view class="historyrecord">
      <view class="hisimg">
        <image src="{{url}}aicon_05x.png"></image>
      </view>

      <view class="hisword">历史记录</view>

    </view>
    <view class="seahead" wx:if="{{history.length!=0}}">
      <view class="searword" wx:for="{{history}}" wx:key='' bindtap="searchhistory" data-keyword="{{item.keyword}}">{{item.keyword}}</view>

    </view>
    <view class="historyrecord">
      <view class="hisimg">
        <image src="{{url}}aicon_06x.png"></image>
      </view>

      <view class="hisword">猜你喜欢</view>

    </view>

    <view class="seahead">
      <view class="searword" wx:for="{{favorite}}" wx:key='' wx:key="" bindtap="enterwine" data-id="{{item.id}}" wx:if="{{select==1}}">{{item.name}}</view>
      <view class="searword" wx:for="{{favorite}}" wx:key='' wx:key="" bindtap="enterpinpai" data-id="{{item.id}}" wx:if="{{select==2}}">{{item.name}}</view>
      <view class="searword" wx:for="{{favorite}}" wx:key='' wx:key="" bindtap="enterjiuqi" data-id="{{item.id}}" wx:if="{{select==3}}">{{item.name}}</view>

    </view>

  </view>
</view>

<view class="searchresult" wx:if="{{searchlist}}">

  <view class="jiupin" wx:if="{{select==1}}">

    <view class="nodataimg" wx:if="{{searchlistarr.length==0}}">
      <image src="/img/wushuju.png"></image>
    </view>
    <block wx:else>

      <view class="searchitem" wx:for="{{searchlistarr}}" wx:key='' bindtap="jumpbrand" data-id="{{item.id}}">
        <view class="searchitemleft">
          <view class="itemleftimg">
            <image src="{{item.logo}}"></image>
          </view>

          <view class="itemiddle">
            <view class="itemidelename">{{item.name}}</view>
            <view class="nambottom">
              <text class="namebottomitem">{{item.degree_name}}</text>
              <text class="namebottomitem">{{item.odor_name}}</text>
              <text class="namebottomitem">{{item.price}}</text>
              <text class="namebottomitem">{{item.ml}}</text>
            </view>
          </view>
        </view>

        <view class="starimg" catchtap="collect" data-id="{{item.id}}">
          <image src="{{url}}aicon_10x.png" wx:if="{{item.is_favorite==1}}"></image>
          <image src="{{url}}aicon_09x.png" wx:else></image>

        </view>

      </view>
    </block>
  </view>

  <view class="brand" wx:if="{{select==2}}">

    <view class="nodataimg" wx:if="{{searchlistarr.length==0}}">
      <image src="/img/wushuju.png"></image>
    </view>

    <block wx:else>

      <view class="searchitem" wx:for="{{searchlistarr}}" wx:key='' bindtap="jumpbrand" data-id="{{item.id}}">
        <view class="searchitemleft">
          <view class="branditemleftimg">
            <image src="{{url}}aicon_12@2x.png"></image>
          </view>

          <view class="itemiddle">
            <view class="itemidelename">{{item.name}}</view>
            <view class="nambottom">
              <text class="namebottomitem">{{item.sort_name}}</text>
              <text class="namebottomitem">{{item.country}}</text>
              <text class="namebottomitem">{{item.city}}</text>
              <text class="namebottomitem">{{item.odor_name}}</text>
            </view>
          </view>
        </view>

        <view class="starimg" catchtap="collect" data-id="{{item.id}}">


          <image src="{{url}}aicon_10x.png" wx:if="{{item.is_favorite==1}}"></image>
          <image src="{{url}}aicon_09x.png" wx:else></image>
        </view>

      </view>

    </block>

  </view>

  <view class="brand" wx:if="{{select==3}}">
    <view class="nodataimg" wx:if="{{searchlistarr.length==0}}">
      <image src="/img/wushuju.png"></image>
    </view>

    <block>

      <view class="searchitem" wx:for="{{searchlistarr}}" wx:key='' bindtap="jumpcompany" data-id="{{item.id}}">
        <view class="searchitemleft">
          <view class="jiuqiimg">
            <image src="{{item.logo}}"></image>
          </view>

          <view class="itemiddle">
            <view class="itemidelename">{{item.name}}</view>
            <view class="nambottom">
              <text class="namebottomitem">{{item.country}}</text>
              <text class="namebottomitem">{{item.city}}</text>
              <text class="namebottomitem">{{item.sort_name}}</text>
              <text class="namebottomitem">{{item.concern_count}}关注</text>
            </view>
          </view>
        </view>

        <view class="atten" wx:if="{{item.is_concern==1}}" data-id="{{item.id}}" catchtap="attention">取消关注</view>
        <view class="atten" data-id="{{item.id}}" wx:else catchtap="attention">关注</view>

      </view>
    </block>
  </view>

</view>