<van-search class="search" value="{{ params.content.where.condition }}" shape="round" placeholder="请输入搜索关键词" bind:search='startSearch' bind:clear='onClear' />
<Yl_ListBox id='ListBox' bind:getlist='getList'>
    <view class="total">共{{params.content.total}}个</view>
    <navigator class="offer-list" url="#" wx:for="{{list}}" wx:key="index" data-id="{{item[idname]}}" bindtap="changeResult">
        <van-checkbox wx:if="{{!radio}}" value="{{ handle.isCheck(item[idname],result) }}" shape="square" icon-size='28rpx' />
        <view class="box">
            <view class="title">
                <text class="line-1">{{item.title||'--'}}</text>
            </view>
            <view class="tag-box">
                <view class="systemtag" wx:for="{{item.tags.systemtag}}" wx:key="item">{{item}}</view>
                <view class="datatag" wx:for="{{item.tags.datatag}}" wx:key="item">{{item}}</view>
            </view>
            <view class="exp line-1">合同编号：<text>{{item.billno}}</text></view>
            <view class="exp line-1">合同类型：<text>{{item.typemx?item.typemx+'项目协议':handle.getType(item.type)}}</text></view>
            <view class="exp line-1">有效期：<text>{{item.begdate}} 至 {{item.enddate}}</text></view>
        </view>
    </navigator>
    <view style="height: 230rpx;" />
    <My_empty wx:if="{{!list.length}}" />
</Yl_ListBox>

<block wx:if="{{!radio}}">
    <view style="height: 130rpx;" />
    <view class="footer">
        <view class="count">
            已选：{{result.length}}
        </view>
        <van-button custom-class='but' disabled='{{result.length==0}}' bind:click="submit">添加</van-button>
    </view>
</block>

<wxs module="handle">
    module.exports = {
        isCheck: function (id, list) {
            return list.some(function (v) {
                return v == id
            });
        },
        getType: function (type) {
            var result = "";
            switch (type) {
                case "框架":
                    result = '经销商合作协议'
                    break;
                case "工具借用":
                    result = '工具使用(借用)协议'
                    break;
                case "居间":
                    result = '居间协议'
                    break;
                default:
                    result = '--'
                    break;
            };
            return result;
        }
    }
</wxs>