<block wx:if="{{!principal}}">
    <van-search value="{{ value }}" shape="round" background="#fff" placeholder="搜索姓名、手机号" bind:search='startSearch' bind:clear='onClear' />
    <view style="height: 20rpx;" />
</block>

<van-checkbox-group value="{{ result }}">
    <view class="box">
        <navigator url="#" class="item" wx:for="{{list}}" wx:key="userid" data-item="{{item}}" bindtap="onChange">
            <view class="checkbox">
                <van-checkbox shape='square' icon-size='14' name="{{item.userid}}" />
            </view>
            <view class="user">
                <view class="portrait">
                    <van-image wx:if="{{item.headpic}}" width="100%" height="100%" src="{{item.headpic}}" use-loading-slot lazy-load>
                        <van-loading slot="loading" type="spinner" size="20" vertical />
                    </van-image>
                    <view class="replace" wx:else>
                        {{item.name[0]}}
                    </view>
                </view>
                <view class="exp">
                    <view class="line-1">
                        {{item.name}}
                    </view>
                    <view class="phone">
                        {{item.phonenumber}}
                    </view>
                </view>
            </view>
        </navigator>
    </view>
</van-checkbox-group>
<My_empty wx:if="{{list.length==0}}" />
<view style="height: 130rpx;" />
<view class="footer">
    <view class="count">
        已选：{{result.length}}
    </view>
    <van-button custom-class='but' disabled='{{result.length==0}}' bindtap="submit">确定</van-button>
</view>

<wxs module="active">
    module.exports.que = function (name, list) {
        return list.some(function (v) {
            return v === name
        })
    }
</wxs>