<!-- pages/myModule/components/myRelease/myRelease.wxml -->
<view class="my-release-page page-container">
    <view class="header">
        <view class="header-tab">
            <view class="tab-item fl {{ currentTab == item.code ? 'isActive' : '' }}" wx:for="{{ tabs }}" wx:key="*this" bindtap="tabChange" data-code="{{ item.code }}">
                <image class="{{ item.code }}-img" src="/images/home/{{ item.code }}-icon.png" />
                {{  item.tab }}
            </view>
        </view>
        <view class="search-view">
            <view class="input-box fl">
                <input class="weui-serach-input" value="{{ keyword }}" bindinput="bindKeyInput" confirm-type="search" placeholder="请输入关键字搜索" placeholder-class="phcolor" bindconfirm="toSearch"></input>
            </view>
            <view class="search-img-view" bindtap="toSearch">
                <image class="search-img" src="/images/home/search-icon.png" />
            </view>
        </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 }}">
            <image class="not-data-img" src="/images/home/not-data.png" />
            <view class="not-info">该用户没有发布任何需求</view>
        </view>
        <view wx:else>
            <view class="list-view" wx:for="{{ listData }}" wx:key="*this">
                <listItem item="{{ item }}" pageStatus="myRelease"/>
                <view class="forced-removal" wx:if="{{ item.state == -2 }}">
                    <image class="forced-removal-img" src="/images/home/forced-removal-icon.png" data-outreason="{{ item.outReason }}" bindtap="showOutReason"/>
                    已强制下架
                </view>
                <view class="foot-btn">
                    <van-button 
                        plain 
                        type="info" 
                        size="small" 
                        round 
                        class="foot-van-btn" 
                        data-item="{{ item }}" 
                        bindtap="productIsOnTop"
                        wx:if="{{ item.state != -1 && item.state != -2}}"
                    >
                        {{ item.isOnTop ? '取消置顶' : '置顶' }}
                    </van-button>
                    <van-button plain type="info" size="small" round class="foot-van-btn" data-item="{{ item }}" bindtap="productEdit">修改</van-button>
                    <van-button plain type="info" size="small" round class="foot-van-btn" data-item="{{ item }}" bindtap="productRelease" wx:if="{{ item.state != -2}}">
                        {{ item.state == 0 ? '下架' : '上架' }}
                    </van-button>
                    <van-button plain type="info" size="small" round class="foot-van-btn" data-item="{{ item }}" bindtap="productDel">删除</van-button>
                </view>
            </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>
</view>