select.wxml 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <van-search class="search" value="{{ params.content.where.condition }}" shape="round" placeholder="请输入搜索关键词" bind:search='startSearch' bind:clear='onClear' />
  2. <Yl_ListBox id='ListBox' bind:getlist='getList'>
  3. <view class="total">共{{params.content.total}}个</view>
  4. <navigator class="setclient-list-item" url="#" wx:for="{{list}}" wx:key="index" data-id="{{item[idname]}}" bindtap="changeResult">
  5. <van-checkbox wx:if="{{!radio}}" value="{{ handle.isCheck(item[idname],result) }}" shape="square" icon-size='28rpx' />
  6. <view class="con">
  7. <view class="portrait {{item.enterprisename <=2?'min-portrait':''}}">
  8. {{handle.getName(item.enterprisename)}}
  9. </view>
  10. <view class="mian">
  11. <view class="label line-1"><text wx:if="{{item.brandname}}">【{{item.brandname}}】</text>{{item.enterprisename}}</view>
  12. <view class="tag-box">
  13. <van-tag custom-class='tag' wx:if="{{item.type}}" wx:for-item='tag' color='#FA8C16' text-color='#fff' round>{{item.type}}</van-tag>
  14. <van-tag custom-class='tag' wx:for="{{item.tags.systemtag}}" wx:key="index" wx:for-item='tag' color='#FA8C16' text-color='#fff' round>{{tag}}</van-tag>
  15. <van-tag custom-class='tag' wx:for="{{item.tags.datatag}}" wx:key="index" wx:for-item='tag' color='#FAAB16' text-color='#fff' round>{{tag}}</van-tag>
  16. </view>
  17. </view>
  18. </view>
  19. </navigator>
  20. <view style="height: 230rpx;" />
  21. <My_empty wx:if="{{!list.length}}" />
  22. </Yl_ListBox>
  23. <block wx:if="{{!radio}}">
  24. <view style="height: 130rpx;" />
  25. <view class="footer">
  26. <view class="count">
  27. 已选:{{result.length}}
  28. </view>
  29. <van-button custom-class='but' disabled='{{result.length==0}}' bind:click="submit">确定</van-button>
  30. </view>
  31. </block>
  32. <wxs module="handle">
  33. module.exports = {
  34. getName: function (name) {
  35. return name.substring(0, 4)
  36. },
  37. isCheck: function (id, list) {
  38. return list.some(function (v) {
  39. return v == id
  40. });
  41. },
  42. }
  43. </wxs>