<!--pages/yuezhan/search/index.wxml-->

<view class='container'>
  <view class='top-nav'>
    <view class='search-con'>
    <view class='search-bar'>
      <view class='search-wrapper'>
        <text class='iconfont icon-sousuo fix-icon-search' bindtap='searchByText'></text>
        <input placeholder="输入关键词" bindconfirm="searchByText" bindinput="bindInput" value="{{searchText}}" data-key="searchText" class='search-input' focus="{{focus}}" />
      </view>
    </view>

    </view>
    <view class='yuezhan-con'>
      <view class='yuezhan-nav'>
        <view class="yuezhan-navbar">
          <block wx:for="{{tabs}}" wx:key="index">
            <view id="{{index}}" class="nav-item {{index==activeIndex?'nav-item_on':''}}" bindtap='tabClick'>
              <view class="nav-item_txt">
                {{item}}
              </view>
            </view>
          </block>
          <view class="navbar__slider" style="width:{{100/tabs.length}}%; left: {{activeIndex * (100/tabs.length)}}%; ">
            <view class='navbar_slider-item'></view>
          </view>
        </view>
      </view>
    </view>
  </view>

  <view class='search-container' hidden="{{activeIndex!=0}}">
    <view class="weui-tab__panel">
      <block wx:for="{{exhibitionList}}" wx:key="index">
        <navigator hover-class='none' url="{{item.online === 1 ? ('../../wv_page/index?id='+item.id):('../../zl_detail/index?id='+item.id)}}" class='weui-tab__content_item'>
          <view class="fdkk-cells">
            <view class="weui-panel__bd">
              <view class="weui-media-box weui-media-box_appmsg">
                <view class="weui-media-box__hd weui-media-box__hd_in-appmsg">
                  <image class="weui-media-box__thumb" mode='aspectFill' src="{{imgServer + item.imageUrl||defaultImg}}">
                    <!-- <view class="fdkz-card-tag {{item.statusText=='展览中'||item.statusText==''?'':item.statusText=='已结束'?'fdkz-card-tag_finish':'fdkz-card-tag_coming'}}">
                      <text class='fdkz-card-tag-txt'>{{item.statusText||"常设展"}}</text>
                    </view> -->
                  </image>
                </view>
                <view class="weui-media-box__bd weui-media-box__bd_in-appmsg">
                  <view class="weui-media-box__title weui-flex">
                    <text class="title-txt">{{item.name}}</text>
                    <view class="pavilionName">
                      {{item.pavilionName}}
                    </view>
                    <!-- 心 收藏 -->
                    <!-- <navigator url='' hover-stop-propagation="true" hover-class='none' data-idx="{{index}}" data-type="{{item.hasCollect}}" data-id="{{item.id}}" class="iconfont icon-like {{item.hasCollect?'icon-like_active':''}}" catchtap='addLike' style='float:right'></navigator> -->
                  </view>
                  
                  <view class='desc'>
                    <view class="weui-media-box__desc">{{item.online == 1 ? '线上看展' :  item.statusTextDesp}}</view>
                    <view>
                      <view class="iconfont {{item.online?'iconredu':'iconweizhi'}}"></view>
                      <text>{{item.online?item.pv:(item.distance || 0) +' km'}}</text>
                    </view>
                  </view>
                </view>
                <view>
                </view>
              </view>
            </view>
          </view>
        </navigator>
      </block>
      <view class='noDataClass'   wx:if='{{exhibitionList.length === 0 && !loading }}'>
        <image class='no_exhibitionImg' mode='aspectFit' src='{{noExhibitionImg}}'></image>
        <view class="tips">
          没有搜到对应的展览
        </view>
      </view>
    </view>
    

    

    <!-- 没有更多内容 -->
    <!-- <view class='no-more'>
      <text>没有更多内容啦</text>
    </view> -->

  </view>


  <view class='pavilionList-container' hidden="{{activeIndex!=1}}">
    <view class="weui-tab__panel">
      <block wx:for="{{pavilionList}}" wx:key="index">
        <navigator hover-class='none' url="{{'../../cg_detail/index?id='+item.id}}" class='weui-tab__content_item'>
          <view class="fdkk-cells" style='margin-bottom:0;'>
            <view class="weui-panel__bd">
              <view class="weui-media-box weui-media-box_appmsg">
                <view class="weui-media-box__hd weui-media-box__hd_in-appmsg">
                  <image class="weui-media-box__thumb" mode='aspectFill' src="{{imgServer + item.imageUrl||defaultImg}}" />
                </view>
                <view class='fix-flex'>
                  <view class="weui-media-box__title weui-flex">
                    <view class="weui-flex__item" style='margin-bottom:20rpx;'>{{item.name}}</view>
                  </view>
                  <text class='weui-media-box__desc'>{{item.address}}</text>
                  <text class='weui-media-box__desc'>有{{item.relatedActivities.length}}个展览正在进行</text>
                </view>

                <view>
                </view>
              </view>
            </view>
          </view>
        </navigator>
      </block>
      
      <view class='noDataClass' wx:if='{{pavilionList.length === 0 && !loading}}'>
        <image class='no_pavilionImg' mode='aspectFit' src='{{noExhibitionHallImg}}'></image>
        <view class="tips">
          没有搜到对应的展馆
        </view>
      </view>

    </view>
  </view>

  <view class='hot-search-con' wx:if="{{totalElements < 5 }}">
      <view class='hot-search'>
        <view class='hot-search-title'>
          <text class='hot-search-title-txt'>热门推荐</text>
        </view>
        <!-- <view class='hot-tag'>
          <text wx:for="{{keyword}}" wx:key="index" bindtap='keywordSearch' data-keyword='{{item.dataValue}}' class='hot-tag-item'>{{item.dataValue}}</text>
        </view> -->
          <block wx:for="{{ExhibitionPopular}}" wx:key="index">
            <navigator hover-class='none' url="{{item.online ? ('../../wv_page/index?&id='+item.id):('../../zl_detail/index?id='+item.id)}}" class='weui-tab__content_item'>
              <view class="fdkk-cells">
                <view class="weui-panel__bd">
                  <view class="weui-media-box weui-media-box_appmsg">
                    <view class="weui-media-box__hd weui-media-box__hd_in-appmsg">
                      <image class="weui-media-box__thumb" mode='aspectFill' src="{{ imgServer + item.imageUrl||defaultImg}}">
                      </image>
                    </view>
                    <view class="weui-media-box__bd weui-media-box__bd_in-appmsg">
                      <view class="weui-media-box__title weui-flex">
                        <text class="title-txt">{{item.name}}</text>
                        <view class="pavilionName">
                          {{item.pavilionName}}
                        </view>
                      </view>
                      
                      <view class='desc'>
                        <view class="weui-media-box__desc">{{item.online == 1 ? '线上看展' :  item.statusTextDesp}}</view>
                        <view>
                          <view class="iconfont {{item.online?'iconredu':'iconweizhi'}}"></view>
                          <text>{{item.online?item.pv:(item.distance || 0 )+' km'}}</text>
                        </view>
                      </view>
                    </view>
                    <view>
                    </view>
                  </view>
                </view>
              </view>
            </navigator>
          </block>
      </view>
    </view>

  <view class="weui-loadmore" wx:if="{{loading}}">
    <view class="weui-loading"></view>
    <view class="weui-loadmore__tips">正在加载</view>
  </view>

</view>