<!-- index.wxml -->
<view class="home-page page-container">
    <!-- 搜索块 -->
    <view class="search-view">
        <view class="serach-input-view">
            <image class="hhr-img fl" src="/images/home/hhr-icon.png" />
            <view class="input-box fl">
                <input class="weui-serach-input" value="{{ keyword }}" bindinput="bindKeyInput" bindconfirm="toSearch" confirm-type="search" placeholder="请输入关键字搜索" placeholder-class="phcolor"></input>
            </view>
            <view class="search-img-view" bindtap="toSearch">
                <image class="search-img" src="/images/home/search-icon.png" />
            </view>
        </view>
        <view class="title">
            全方位需求
            <text class="sub-title">交流平台</text>
        </view>
        <button type="default" plain class="set-attention" id="shouquan" bindtap="setAttention">
            设置关注类型喜好 >>
        </button>
        <image class="header-img" src="/images/home/header-icon.png" />
    </view>
    <!-- tab块 -->
    <view class="tab-view">
        <view wx:for="{{tabData}}" class="tab-li" wx:key="*this">
            <view class="tab-span {{currentTab == item.value ? 'isActive' : ''}}" bindtap="tabChange" data-value="{{ item.value }}">
                {{item.text}}
            </view>
        </view>
        <view class="tab-li last">
            <view class="tab-span {{currentTab == 'more' ? 'isActive' : ''}}" bindtap="toggleMore">
                {{ moreTitle }}
            </view>
        </view>
        <view class="tab-li right">
            <van-dropdown-menu class="tab-menu" active-color="#5e73e5">
                <van-dropdown-item id="item" bindchange="moreTabChange" title-class="{{ currentTab == 'more' ? 'isActive' : '' }}" value="{{ moreTab }}" options="{{ moreTabOption }}" />
            </van-dropdown-menu>
        </view>
    </view>
    <!-- list块 -->
    <view class="list-loading text-center" wx:if="{{ listLoading }}">
        <van-loading size="24px">加载中...</van-loading>
    </view>
    <view wx:else>
        <view class="not-data" wx:if="{{ listData.length < 1 && !(currentTab == 'my' && attentionTypeIds.length > 0) }}">
            <image class="not-data-img" src="/images/home/not-data.png" />
            <view class="not-info" wx:if="{{ currentTab == 'all' }}">抱歉，暂无任何需求</view>
            <view class="not-info" wx:elif="{{ currentTab == 'my' && attentionTypeIds.length < 1}}">
                <view>您尚未设置关注类型喜好</view>
                <view style="margin-bottom: 10rpx;">设置后将为您进行需求推荐~</view>
                <van-button class="set-attention-btn" color="#5e73e5" round bind:click="setAttention">
                    设置关注类型喜好
                </van-button>
            </view>
            <view class="not-info" wx:else>抱歉，暂无任何需求</view>
        </view>
        <view class="not-data" wx:elif="{{ listData.length < 1 && (currentTab == 'my' && attentionTypeIds.length > 0) }}">
            <view class="not-info-attention-type">
                <view class="not-data-attention-view fl">
                    <image class="not-data-attention-img" src="/images/home/not-data-attention-img.png" />
                </view>
                <view class="not-info">抱歉，您关注的类型暂无任何需求</view>
                <van-button class="set-attention-btn fl" color="#5e73e5" round bind:click="setAttention" size="small">
                    更换关注类型
                </van-button>
            </view>
        </view>
        <view wx:else>
            <view class="not-data clearfix" wx:if="{{ paramIsInterest == 1 }}">
                <view class="not-info-attention-type">
                    <view class="not-data-attention-view fl">
                        <image class="not-data-attention-img" src="/images/home/not-data-attention-img.png" />
                    </view>
                    <view class="not-info">抱歉，您关注的类型暂无任何需求</view>
                    <van-button class="set-attention-btn fl" color="#5e73e5" round bind:click="setAttention" size="small">
                        更换关注类型
                    </van-button>
                </view>
            </view>
            <view class="view-interested" wx:if="{{ paramIsInterest == 1 }}">为您推荐以下内容</view>
            <view class="list-view" wx:for="{{ listData }}" wx:key="*this">
                <listItem item="{{ item }}" bind:getItem="goDetails" customerId="{{ customerId }}"/>
            </view>
            <view class="text-center" wx:if="{{ itemLoading }}">
                <van-loading size="24px">加载中...</van-loading>
            </view>
            <view class="list-finished text-center" wx:if="{{ isFinished }}">
                <image class="finished-img" src="/images/home/finished-icon.png" />
                没有更多啦~
            </view>
        </view>
    </view>
    <tabBar currentIndex="{{currentIndex}}"></tabBar>
</view>