<import src="index.skeleton.wxml" />
<template is="skeleton" wx:if="{{loading}}" />

<van-search class="search" value="{{ params.content.where.condition }}" shape="round" placeholder="请输入搜索关键词" bind:search='startSearch' bind:clear='onClear' />
<view class="total">共{{params.content.total}}个</view>

<Yl_ListBox id='ListBox' bind:getlist='getList'>
	<navigator class="item" url="#" wx:for="{{list}}" wx:key="itemno" data-id="{{item[idname]}}" bindtap="changeResult">
		<van-checkbox wx:if="{{!radio}}" value="{{ handle.isCheck(item[idname],result) }}" shape="square" icon-size='28rpx' />
		<view class="main" style="padding-left: {{!radio?'10rpx':''}};">
			<view class="title line-1">抬头:{{item.enterprisename}}</view>
			<view class="subfield line-1">
				开户行/账号：{{item.bank || ' --'}}/{{item.bankcardno || ' --'}}
			</view>
			<view class="subfield line-1">
				开票地址{{item.address || " --"}}
			</view>
			<view class="subfield line-1">
				统一社会信用代码：{{item.taxno || " --"}}
			</view>
			<view class="subfield line-1">
				联系电话：{{item.phonenumber || " --"}}
			</view>
		</view>
	</navigator>
	<view wx:if="{{!radio}}" style="height: 130rpx;" />
	<Yl_Empty wx:if="{{list.length==0}}" />
</Yl_ListBox>

<block wx:if="{{!radio}}">
	<view class="footer">
		<view class="count">
			已选：{{result.length}}
		</view>
		<van-button custom-class='but' disabled='{{result.length==0}}' bind:click="submit">确定</van-button>
	</view>
	<wxs module="handle">
		module.exports = {
			isCheck: function (id, list) {
				return list.some(function (v) {
					return v == id
				});
			},
		}
	</wxs>
</block>