<!--index.wxml-->
<navigation-bar title="会员单位" back="{{false}}" color="black" background="white" fixed="{{true}}"></navigation-bar>
<view class="search" style="top:{{navHeight}}PX">
  <t-search class="search-input" model:value="{{keyword}}" placeholder="请输入您要查找的内容" shape="round" bind:submit="handleSearch" />
  <view class="search-tabs flex align-center">
    <view class="search-tabs-item {{item.select ? 'active': 'normal'}} {{item.id == SUPPORT_ID ? 'text-nowrap' : ''}}" wx:for="{{tabs}}" wx:key="code" wx:for-item="item" data-attr="{{item.id}}" bindtap="handleSelect">
      {{item.title}}
      <t-icon wx:if="{{item.id == SUPPORT_ID}}" style="display:inline-block;vertical-align: middle;" name="chevron-right-s" size="48rpx" />
    </view>
  </view>
</view>
<view class="scrollarea" style="margin-top: {{totalHeight}}PX">
  <view class="list container pad">
    <t-cell class="list-item" wx:for="{{list}}" wx:key="id" wx:for-item="item" title="{{item.companyName}}" jump-type="navigateTo" url="/pages/webview/index?main={{item.companyMainId}}" arrow align="top">
      <view class="list-item-avatar" slot="left-icon">
        <t-image class="list-item-avatar-img" src="{{item.avatar}}" shape="circle" />
      </view>
      <view class="description" slot="description">
        <view class="text-small ft-small text-cut txt">单位资质：{{item.attr}}</view>
        <view class="text-small ft-small text-cut txt">主营产品：{{item.businessProduct || ''}}</view>
        <view class="role" wx:if="{{!!item.role}}">{{item.role}}</view>
      </view>
    </t-cell>
  </view>
  <load-more list-is-empty="{{!list.length}}" status="{{listStatus}}" bind:retry="onReTry">
    <view class="empty pt-16 pb-16" slot="empty">
      <t-empty t-class-image="t-empty__image" image="{{OSS_ROOT}}/assets/404.png" description="暂无内容" />
    </view>
  </load-more>
</view>

<t-popup t-class="popup" visible="{{visible}}" bind:visible-change="togglePopup" placement="bottom">
  <view class="popup-title text-center text-title ft-main">
    配套商
  </view>
  <scroll-view scroll-y class="popup-filter" style="height: 60vh">
    <view class="filter-item flex align-center flex-between" wx:for="{{items}}" wx:key="title" wx:for-item="item" data-attr="{{item.id}}" bindtap="toggleSelect">
      <view class="text-normal ft-small">{{item.title}}</view>
      <image class="filter-item-img" src="{{OSS_ROOT}}/assets/icon_checkbox{{item.select ? '_active': ''}}.png" />
    </view>
  </scroll-view>
  <view class="popup-footer flex align-center flex-between pt-8">
    <view class="btn btn-outline" bindtap="togglePopup" data-attr="close">关闭</view>
    <view class="btn btn-outline" bindtap="togglePopup" data-attr="reset">重置</view>
    <view class="btn btn-primary" bindtap="togglePopup" data-attr="confirm">确定</view>
  </view>
</t-popup>