index.wxml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <wxs
  2. src="./helper.wxs"
  3. module="helper" />
  4. <wxs
  5. src="./scroll.wxs"
  6. module="scroll" />
  7. <view
  8. class="ant-calendar {{ className ? className : '' }}"
  9. style="{{ style }}">
  10. <view class="ant-calendar-mark">
  11. <block
  12. wx:for="{{ markItems }}"
  13. wx:for-index="index"
  14. wx:for-item="item">
  15. <view class="{{ helper.getMarkCellClassName(index, markItems) }}">
  16. <!-- display: inline -->
  17. <text>{{ item }}</text>
  18. </view>
  19. </block>
  20. </view>
  21. <view
  22. wx:if="{{ !!elementSize }}"
  23. class="ant-calendar-sticky">
  24. <view class="ant-calendar-sticky-title">
  25. <view class="ant-calendar-title">{{ monthList[headerState].title }}</view>
  26. </view>
  27. </view>
  28. <scroll-view
  29. scroll-y="{{ true }}"
  30. class="ant-calendar-body"
  31. data-elementsize="{{ elementSize }}"
  32. data-monthlist="{{ monthList }}"
  33. bind:scroll="{{ scroll.handleScroll }}"
  34. bind:ref="handleRef">
  35. <block
  36. wx:for="{{ monthList }}"
  37. wx:for-index="index"
  38. wx:for-item="currentMonth">
  39. <view class="ant-calendar-body-container">
  40. <view class="ant-calendar-title-container">
  41. <view class="ant-calendar-title">{{ currentMonth.title }}</view>
  42. </view>
  43. <view class="ant-calendar-cells">
  44. <block
  45. wx:for="{{ currentMonth.cells }}"
  46. wx:for-index="index"
  47. wx:for-item="item">
  48. <block>
  49. <view
  50. class="{{ helper.getClassName(item, index) }}"
  51. data-time="{{ item }}"
  52. bind:tap="clickCell">
  53. <view class="ant-calendar-cell-container">
  54. <view class="ant-calendar-cell-top">
  55. <!-- display: inline -->
  56. <text
  57. wx:if="{{ item.top }}"
  58. class="ant-calendar-cell-top-text {{ item.top.className ? item.top.className : '' }}"
  59. >{{ item.top.label }}</text
  60. >
  61. </view>
  62. <view class="ant-calendar-cell-center">{{ item.date }}</view>
  63. <view class="ant-calendar-cell-bottom">
  64. <!-- display: inline -->
  65. <text
  66. wx:if="{{ item.bottom }}"
  67. class="{{ item.bottom.className }}"
  68. >{{ item.bottom.label }}</text
  69. >
  70. </view>
  71. </view>
  72. </view>
  73. <view
  74. wx:if="{{ index % 7 !== 6 }}"
  75. class="{{ helper.getSpaceClassName(index, currentMonth.cells) }}" />
  76. </block>
  77. </block>
  78. </view>
  79. </view>
  80. </block>
  81. </scroll-view>
  82. </view>