cascader.wxml 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <wxs src="../common/utils.wxs" module="_" />
  2. <t-popup visible="{{visible}}" placement="bottom" bind:visible-change="hide">
  3. <view style="{{_._style([style, customStyle])}}" class="{{name}}">
  4. <view class="{{name}}__title">
  5. <slot name="title" />
  6. {{title}}
  7. </view>
  8. <view class="{{name}}__close-btn" bind:tap="hide">
  9. <slot name="close-btn" />
  10. <t-icon wx:if="{{closeBtn}}" size="24" name="close" />
  11. </view>
  12. <view class="{{name}}__content">
  13. <block wx:if="{{steps && steps.length}}">
  14. <view wx:if="{{theme == 'step'}}" class="{{name}}__steps">
  15. <view wx:for="{{steps}}" wx:key="index" class="{{name}}__step" bind:tap="onStepClick" data-index="{{index}}">
  16. <view
  17. class="{{name}}__step-dot {{name}}__step-dot--{{item !== defaultOptionLabel ? 'active' : ''}} {{name}}__step-dot--{{index === steps.length - 1 ? 'last' : ''}}"
  18. ></view>
  19. <view class="{{name}}__step-label {{name}}__step-label--{{index === stepIndex ? 'active' : ''}}">
  20. {{ item }}
  21. </view>
  22. <t-icon name="chevron-right" size="22" t-class="{{name}}__step-arrow" />
  23. </view>
  24. </view>
  25. <block wx:if="{{theme == 'tab'}}">
  26. <t-tabs id="tabs" value="{{stepIndex}}" bind:change="onTabChange" space-evenly="{{false}}">
  27. <t-tab-panel wx:for="{{steps}}" wx:key="index" value="{{index}}" label="{{item}}" />
  28. </t-tabs>
  29. </block>
  30. </block>
  31. <view wx:if="{{ subTitles && subTitles[stepIndex] }}" class="{{name}}__options-title"
  32. >{{subTitles[stepIndex]}}</view
  33. >
  34. <view
  35. class="{{name}}__options-container"
  36. style="width: {{items.length + 1}}00vw; transform: translateX(-{{stepIndex}}00vw)"
  37. >
  38. <scroll-view
  39. wx:for="{{items}}"
  40. wx:for-item="options"
  41. wx:key="index"
  42. class="{{name}}__options"
  43. scroll-y
  44. scroll-top="{{scrollTopList[index]}}"
  45. >
  46. <view class="cascader-radio-group-{{index}}">
  47. <t-radio-group
  48. value="{{selectedValue[index]}}"
  49. keys="{{keys}}"
  50. options="{{options}}"
  51. bind:change="handleSelect"
  52. data-level="{{index}}"
  53. align="right"
  54. icon="line"
  55. borderless
  56. >
  57. </t-radio-group>
  58. </view>
  59. </scroll-view>
  60. </view>
  61. </view>
  62. </view>
  63. </t-popup>