index.axml 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <import-sjs
  2. from="./helper.sjs"
  3. name="helper" />
  4. <import-sjs
  5. from="./scroll.sjs"
  6. name="scroll" />
  7. <view
  8. class="ant-calendar {{ className ? className : '' }}"
  9. style="{{ style }}">
  10. <view class="ant-calendar-mark">
  11. <block
  12. a:for="{{ markItems }}"
  13. a:for-index="index"
  14. a: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. a:if="{{ !!elementSize }}"
  23. class="ant-calendar-sticky">
  24. <view class="ant-calendar-sticky-title">
  25. <slot name="calendarTitle">
  26. <view class="ant-calendar-title">
  27. {{ monthList[headerState].title }}
  28. </view>
  29. </slot>
  30. </view>
  31. </view>
  32. <scroll-view
  33. scroll-y="{{ true }}"
  34. class="ant-calendar-body"
  35. data-elementsize="{{ elementSize }}"
  36. data-monthlist="{{ monthList }}"
  37. onScroll="{{ scroll.handleScroll }}"
  38. scroll-into-view="{{ scrollIntoViewId }}"
  39. scroll-with-animation
  40. scroll-animation-duration="{{ 300 }}"
  41. ref="handleRef">
  42. <block
  43. a:for="{{ monthList }}"
  44. a:for-index="index"
  45. a:for-item="currentMonth">
  46. <view class="ant-calendar-body-container">
  47. <view class="ant-calendar-title-container">
  48. <slot name="calendarTitle">
  49. <view class="ant-calendar-title">{{ currentMonth.title }}</view>
  50. </slot>
  51. </view>
  52. <view class="ant-calendar-cells">
  53. <block
  54. a:for="{{ currentMonth.cells }}"
  55. a:for-index="index"
  56. a:for-item="item">
  57. <block>
  58. <view
  59. class="{{ helper.getClassName(item, index) }}"
  60. id="id_{{ item.time }}"
  61. data-time="{{ item }}"
  62. onTap="clickCell">
  63. <view class="ant-calendar-cell-container">
  64. <view class="ant-calendar-cell-top">
  65. <!-- display: inline -->
  66. <text
  67. a:if="{{ item.top }}"
  68. class="ant-calendar-cell-top-text {{ item.top.className ? item.top.className : '' }}"
  69. >{{ item.top.label }}</text
  70. >
  71. </view>
  72. <view class="ant-calendar-cell-center">{{ item.date }}</view>
  73. <view class="ant-calendar-cell-bottom">
  74. <slot
  75. name="cell-bottom"
  76. cell="{{ item }}">
  77. <!-- display: inline -->
  78. <text
  79. a:if="{{ item.bottom }}"
  80. class="{{ item.bottom.className }}"
  81. >{{ item.bottom.label }}</text
  82. >
  83. </slot>
  84. </view>
  85. </view>
  86. </view>
  87. <view
  88. a:if="{{ index % 7 !== 6 }}"
  89. class="{{ helper.getSpaceClassName(index, currentMonth.cells) }}" />
  90. </block>
  91. </block>
  92. </view>
  93. </view>
  94. </block>
  95. </scroll-view>
  96. </view>