<!--packageI/invoice/components/childInvoiceHeader/childInvoiceHeader.wxml-->
<view class="invoice-bearers-page">
    <view class="header flex flex-j-sb flex-a-c">
        <view class="total">
            总数：<text class="red-text">{{total}}</text>
        </view>
        <view class="delete-icon" bindtap="selectBolfun">
            <view wx:if="{{isBatchOperation}}" style="color: #868686;">取消</view>
            <view wx:else class="flex flex-a-c">
                <icon class="iconfont icon-fontclass-shanchu"></icon> 删除
            </view>
        </view>
    </view>

    <van-checkbox-group class="ul" value="{{ batchBearers }}" bind:change="checkboxGroupChange">
        <view class="cell-plane" wx:if="{{personalList.length > 0}}">
            <view class="cell-title"> 普通发票抬头-个人 </view>
            <van-divider borderColor="#efefef" custom-style="margin: 20rpx 0;"></van-divider>
            <view class="li flex-j-sb flex-a-c" wx:for="{{personalList}}" wx:for-item="perItem" wx:key="index">
                <view class="li-left-box flex-a-c">
                    <van-checkbox wx:if="{{isBatchOperation}}" class="checkbox checkbox-{{perItem.id}}" name="{{perItem.id}}"></van-checkbox>
                    <view class="bearers flex-a-c" catchtap="toggle" data-id="{{perItem.id}}">
                        <text class="text-overHide">{{perItem.collect_name}}</text>
                        <view wx:if="{{perItem.is_default}}" class="default">默认</view>
                    </view>
                </view>
                <icon wx:if="{{ !isBatchOperation }}" class="iconfont icon-fontclass-xiugai" catchtap="toInvoiceOperation" data-item="{{perItem}}"></icon>
            </view>
        </view>
        <view class="cell-plane" wx:if="{{companyList.length > 0}}">
            <view class="cell-title"> 普通发票抬头-单位 </view>
            <van-divider borderColor="#efefef" custom-style="margin: 20rpx 0;"></van-divider>
            <view class="li flex-j-sb flex-a-c" wx:for="{{companyList}}" wx:for-item="comItem" wx:key="index">
                <view class="li-left-box flex-a-c">
                    <van-checkbox wx:if="{{isBatchOperation}}" class="checkbox checkbox-{{comItem.id}}" name="{{comItem.id}}"></van-checkbox>
                    <view class="bearers flex-a-c" catchtap="toggle" data-id="{{comItem.id}}">
                        <text class="text-overHide">{{comItem.collect_name}}</text>
                        <view wx:if="{{comItem.is_default}}" class="default">默认</view>
                    </view>
                </view>
                <icon wx:if="{{ !isBatchOperation }}" class="iconfont icon-fontclass-xiugai" catchtap="toInvoiceOperation" data-item="{{comItem}}"></icon>
            </view>
        </view>
    </van-checkbox-group>

    <!-- 空 占位组件 -->
    <van-empty wx:if="{{!loading && !(personalList.length || companyList.length)}}" image="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/empty-image-search.png"></van-empty>
    <view wx:elif="{{!loading && finshed }}" class="finshed-class=">已经到底了~~~</view>

    <view class="bottom-box">
        <view class="delete-count-box flex-a-c flex-j-sb"  wx:if="{{isBatchOperation}}">
            <view style="font-size: 32rpx;">已选{{batchBearers.length}}个</view>
            <view class="delete-btn {{(batchBearers.length <= 0) ? 'invalid-btn' : ''}}" bindtap="deleteBearers">删除</view>
        </view>
        <view wx:else class="add-invoice-btn" bindtap="toInvoiceOperation">添加发票抬头</view>
    </view>
</view>
