index.axml 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. ref="handleRef">
  39. <block
  40. a:for="{{ monthList }}"
  41. a:for-index="index"
  42. a:for-item="currentMonth">
  43. <view class="ant-calendar-body-container">
  44. <view class="ant-calendar-title-container">
  45. <slot name="calendarTitle">
  46. <view class="ant-calendar-title">{{ currentMonth.title }}</view>
  47. </slot>
  48. </view>
  49. <view class="ant-calendar-cells">
  50. <block
  51. a:for="{{ currentMonth.cells }}"
  52. a:for-index="index"
  53. a:for-item="item">
  54. <block>
  55. <view
  56. class="{{ helper.getClassName(item, index) }}"
  57. data-time="{{ item }}"
  58. onTap="clickCell">
  59. <view class="ant-calendar-cell-container">
  60. <view class="ant-calendar-cell-top">
  61. <!-- display: inline -->
  62. <text
  63. a:if="{{ item.top }}"
  64. class="ant-calendar-cell-top-text {{ item.top.className ? item.top.className : '' }}"
  65. >{{ item.top.label }}</text
  66. >
  67. </view>
  68. <view class="ant-calendar-cell-center">{{ item.date }}</view>
  69. <view class="ant-calendar-cell-bottom">
  70. <slot
  71. name="cell-bottom"
  72. cell="{{ item }}">
  73. <!-- display: inline -->
  74. <text
  75. a:if="{{ item.bottom }}"
  76. class="{{ item.bottom.className }}"
  77. >{{ item.bottom.label }}</text
  78. >
  79. </slot>
  80. </view>
  81. </view>
  82. </view>
  83. <view
  84. a:if="{{ index % 7 !== 6 }}"
  85. class="{{ helper.getSpaceClassName(index, currentMonth.cells) }}" />
  86. </block>
  87. </block>
  88. </view>
  89. </view>
  90. </block>
  91. </scroll-view>
  92. </view>