<van-tabs wx:if="{{showTabs}}" active="{{ active }}" color='#3874F6' title-active-color='#3874F6' bind:change="onChange">
    <van-tab name='项目合同' title="{{language['项目合同']||'项目合同'}}" />
    <van-tab name='客户合同' title="{{language['客户合同']||'客户合同'}}" />
</van-tabs>
<van-search class="search" value="{{ params.content.where.condition }}" shape="round" placeholder="{{language['关键字']||'请输入搜索关键词'}}" bind:search='startSearch' bind:clear='onClear' />
<Yl_ListBox id='ListBox' bind:getlist='getList'>
    <view class="total">
        <text wx:if="{{language['总共']}}">{{language['总共']}}：{{params.content.total}}</text>
        <text wx:else>总共{{params.content.total}}个</text>
    </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 line-1">
                {{item.title||'--'}}
            </view>
            <view class="exp line-1">{{language['合同编号']||'合同编号'}}：<text>{{item.billno||' --'}}</text></view>
            <view class="exp line-1">{{language['合同类型']||'合同类型'}}：<text>{{active}}</text></view>
            <view wx:if="{{active=='项目合同'}}" class="exp line-1">{{language['项目名称']||'项目名称'}}：<text>{{item.projectname||' --'}}</text></view>
            <view wx:else class="exp line-1">{{language['客户名称']||'客户名称'}}：<text>{{item.enterprisename||' --'}}</text></view>
            <view class="exp line-1">{{language['负责人']||'负责人'}}：<text>{{item.name||' --'}}</text></view>
            <view class="exp line-1">{{language['状态']||'状态'}}：<text style="color: {{sColors[item.status]||'#333'}};">{{language[item.status]||item.status}}</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">
            {{language['已选']||'已选'}}：{{result.length}}
        </view>
        <van-button custom-class='but' disabled='{{result.length==0}}' bind:click="submit">{{language['添加']||'添加'}}</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>