合伙人运营小程序
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

dropdown-item.wxml 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <wxs module="this" src="./index.wxs" />
  2. <wxs module="_" src="../common/utils.wxs" />
  3. <view
  4. wx:if="{{wrapperVisible}}"
  5. class="{{classPrefix}} class {{prefix}}-class"
  6. style="{{_._style([this.getStyles(top, zIndex), style, customStyle])}}"
  7. >
  8. <view
  9. class="{{ classPrefix }}__mask"
  10. hidden="{{!show}}"
  11. style="{{_._style(['height:' + maskHeight + 'px', style, customStyle])}}"
  12. bind:tap="handleMaskClick"
  13. catchtouchmove="closeDropdown"
  14. ></view>
  15. <t-popup
  16. visible="{{show}}"
  17. z-index="{{zIndex + 1}}"
  18. duration="{{duration}}"
  19. show-overlay="{{showOverlay}}"
  20. custom-style="position: absolute"
  21. overlay-props="{{ { style: 'position: absolute' } }}"
  22. bind:leaved="onLeaved"
  23. bind:visible-change="handleMaskClick"
  24. t-class="{{classPrefix}}__popup-host"
  25. t-class-content="{{classPrefix}}__content {{prefix}}-class-content"
  26. >
  27. <view class="{{classPrefix}}__body">
  28. <!-- 单选列表 -->
  29. <scroll-view wx:if="{{!multiple}}" class="{{classPrefix}}__scroll" scroll-y scroll-into-view="id_{{value}}">
  30. <t-radio-group
  31. class="{{classPrefix}}__radio {{prefix}}-class-column"
  32. t-class="{{classPrefix}}__radio-group"
  33. style="grid-template-columns: repeat({{optionsColumns}}, 1fr)"
  34. value="{{value}}"
  35. placement="right"
  36. bind:change="handleRadioChange"
  37. >
  38. <view wx:for="{{options}}" wx:key="index" id="id_{{item[valueAlias]}}">
  39. <t-radio
  40. tabindex="0"
  41. icon="line"
  42. class="{{classPrefix}}__radio-item {{prefix}}-class-column-item"
  43. t-class="radio"
  44. t-class-label="{{prefix}}-class-column-item-label"
  45. value="{{item[valueAlias]}}"
  46. label="{{item[labelAlias]}}"
  47. disabled="{{item.disabled}}"
  48. />
  49. </view>
  50. </t-radio-group>
  51. </scroll-view>
  52. <!-- 多选列表 -->
  53. <scroll-view wx:else class="{{classPrefix}}__scroll" scroll-y scroll-into-view="id_{{firstCheckedValue}}">
  54. <t-checkbox-group
  55. class="{{classPrefix}}__checkbox {{prefix}}-class-column"
  56. t-class="{{classPrefix}}__checkbox-group"
  57. style="grid-template-columns: repeat({{optionsColumns}}, 1fr)"
  58. value="{{value}}"
  59. bind:change="handleRadioChange"
  60. >
  61. <view wx:for="{{options}}" wx:key="index" id="id_{{item[valueAlias]}}">
  62. <t-checkbox
  63. tabindex="0"
  64. class="{{classPrefix}}__checkbox-item {{prefix}}-class-column-item"
  65. theme="tag"
  66. value="{{item[valueAlias]}}"
  67. label="{{item[labelAlias]}}"
  68. disabled="{{item.disabled}}"
  69. ></t-checkbox>
  70. </view>
  71. </t-checkbox-group>
  72. </scroll-view>
  73. <slot />
  74. </view>
  75. <view class="{{classPrefix}}__footer {{prefix}}-class-footer" wx:if="{{multiple}}">
  76. <t-button
  77. block
  78. class="{{classPrefix}}__footer-btn {{classPrefix}}__reset-btn"
  79. theme="light"
  80. disabled="{{value.length == 0}}"
  81. bindtap="handleReset"
  82. >重置</t-button
  83. >
  84. <t-button
  85. block
  86. class="{{classPrefix}}__footer-btn {{classPrefix}}__confirm-btn"
  87. theme="primary"
  88. disabled="{{value.length == 0}}"
  89. bindtap="handleConfirm"
  90. >确定</t-button
  91. >
  92. </view>
  93. </t-popup>
  94. </view>