indexes.wxml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <view class="{{classPrefix}} {{prefix}}-class">
  2. <scroll-view
  3. class="{{classPrefix}}__content"
  4. scroll-y
  5. scroll-into-view="index_{{ currentGroup.index }}"
  6. scroll-with-animation="{{ false }}"
  7. style="height: {{ height ? height + 'px' : clientHeight + 'px' }};"
  8. bindscroll="onListScroll"
  9. >
  10. <t-cell-group
  11. t-class-title="{{classPrefix}}__title"
  12. class="{{classPrefix}}__group"
  13. wx:for="{{ groups }}"
  14. wx:key="index"
  15. wx:for-item="group"
  16. wx:for-index="gindex"
  17. id="index_{{ group.index }}"
  18. title="{{ group.title }}"
  19. >
  20. <t-cell
  21. t-class="{{classPrefix}}__row"
  22. wx:for="{{ group.children }}"
  23. id="cell_{{gindex}}_{{rindex}}"
  24. wx:key="title"
  25. wx:for-item="row"
  26. wx:for-index="rindex"
  27. bind:tap="onCellTap"
  28. data-indexes="{{ [gindex, rindex] }}"
  29. title="{{ row.title }}"
  30. ></t-cell>
  31. </t-cell-group>
  32. </scroll-view>
  33. <view class="{{classPrefix}}__index {{prefix}}-class-index">
  34. <view
  35. class="{{classPrefix}}__bar"
  36. id="id-{{classPrefix}}__bar"
  37. catch:touchstart="onTouchStart"
  38. catch:touchmove="onTouchMove"
  39. catch:touchcancel="onTouchCancel"
  40. catch:touchend="onTouchEnd"
  41. >
  42. <view
  43. class="{{classPrefix}}__btn {{activeGroup.index === group.index ? 'is-actived' : ''}}"
  44. wx:for="{{ groups }}"
  45. wx:key="index"
  46. wx:for-item="group"
  47. data-group="{{ group }}"
  48. >
  49. {{ group.index }}
  50. <view class="{{classPrefix}}__tips" wx:if="{{ showScrollTip && currentGroup.index === group.index }}">
  51. <view class="{{classPrefix}}__tips-text">{{ currentGroup.index }}</view>
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. </view>