index.wxml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <view class="flex b tb ac" wx:if="{{calendar}}">
  2. <view class="calendar b tb">
  3. <!-- 头部操作栏 -->
  4. <view wx:if="{{!calendarConfig.hideHeadOnWeekMode}}" class="handle {{calendarConfig.theme}}_handle-color fsnd b lr ac pc">
  5. <view class="prev fsnd" wx:if="{{calendarConfig.showHandlerOnWeekMode || !calendarConfig.weekMode}}">
  6. <text class="prev-handle iconfont icon-doubleleft" bindtap="chooseDate" data-type="prev_year"></text>
  7. <text class="prev-handle iconfont icon-left" bindtap="chooseDate" data-type="prev_month"></text>
  8. </view>
  9. <view class="flex date-in-handle b lr cc" bindtap="doubleClickToToday">{{calendar.curYear || "--"}} 年 {{calendar.curMonth || "--"}} 月</view>
  10. <view class="next fsnd" wx:if="{{calendarConfig.showHandlerOnWeekMode || !calendarConfig.weekMode}}">
  11. <text class="next-handle iconfont icon-right" bindtap="chooseDate" data-type="next_month"></text>
  12. <text class="next-handle iconfont icon-doubleright" bindtap="chooseDate" data-type="next_year"></text>
  13. </view>
  14. </view>
  15. <!-- 星期栏 -->
  16. <view class="weeks b lr ac {{calendarConfig.theme}}_week-color">
  17. <view class="week fsnd" wx:for="{{calendar.weeksCh}}" wx:key="index" data-idx="{{index}}">{{item}}</view>
  18. </view>
  19. <!-- 日历面板主体 -->
  20. <view class="b lr wrap"
  21. bindtouchstart="calendarTouchstart"
  22. catchtouchmove="calendarTouchmove"
  23. catchtouchend="calendarTouchend">
  24. <!-- 上月日期格子 -->
  25. <view
  26. class="grid b ac pc {{calendarConfig.theme}}_prev-month-date"
  27. wx:if="{{calendar.empytGrids}}"
  28. wx:for="{{calendar.empytGrids}}"
  29. wx:key="index"
  30. data-idx="{{index}}">
  31. <view class="date-wrap b cc">
  32. <view class="date">
  33. {{item.day}}
  34. <view
  35. wx:if="{{calendarConfig.showLunar && item.lunar}}"
  36. class="date-desc date-desc-bottom">
  37. {{item.lunar.Term || item.lunar.IDayCn}}
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. <!-- 本月日期格子 -->
  43. <view
  44. wx:for="{{calendar.days}}"
  45. wx:key="index"
  46. data-idx="{{index}}"
  47. data-date="{{item}}"
  48. bindtap="tapDayItem"
  49. class="grid {{item.class ? item.class : ''}} {{calendarConfig.theme}}_normal-date b ac pc">
  50. <view
  51. class="date-wrap b cc {{(item.week === 0 || item.week === 6) ? calendarConfig.theme + '_weekend-color' : ''}}">
  52. <view class="date b ac pc {{item.class ? item.class : ''}} {{calendarConfig.chooseAreaMode ? 'date-area-mode' : ''}} {{calendar.todoLabelCircle && item.showTodoLabel && !item.choosed ? calendarConfig.theme + '_todo-circle todo-circle' : '' }} {{item.isToday ? calendarConfig.theme + '_today' : ''}} {{item.choosed ? calendarConfig.theme + '_choosed' : ''}} {{item.disable ? calendarConfig.theme + '_date-disable' : ''}}">
  53. {{calendarConfig.markToday && item.isToday ? calendarConfig.markToday : item.day}}
  54. <view
  55. wx:if="{{(calendarConfig.showLunar && item.lunar && !item.showTodoLabel) || (item.showTodoLabel && calendar.todoLabelPos !== 'bottom')}}"
  56. class="date-desc {{calendarConfig.theme}}_date-desc date-desc-bottom {{(item.choosed || item.isToday) ? 'date-desc-bottom-always' : ''}} {{item.disable ? calendarConfig.theme + '_date-desc-disable' : ''}}">
  57. {{item.lunar.Term || item.lunar.IDayCn}}
  58. </view>
  59. <view
  60. wx:if="{{item.showTodoLabel && !calendar.todoLabelCircle}}"
  61. class="{{item.todoText ? 'date-desc' : calendarConfig.theme + '_todo-dot todo-dot'}} {{calendarConfig.showLunar ? calendarConfig.theme + '_date-desc-lunar' : ''}} {{calendar.todoLabelPos === 'bottom' ? 'date-desc-bottom todo-dot-bottom' : 'date-desc-top todo-dot-top'}} {{calendar.showLabelAlways && item.choosed && calendar.todoLabelPos === 'bottom' ? 'date-desc-bottom-always todo-dot-bottom-always' : ''}} {{calendar.showLabelAlways && item.choosed && calendar.todoLabelPos === 'top' ? 'date-desc-top-always todo-dot-top-always' : ''}}"
  62. style="background-color: {{item.todoText ? '' : item.color || calendar.todoLabelColor}}; color: {{item.color}}">
  63. {{item.todoText}}
  64. </view>
  65. </view>
  66. </view>
  67. </view>
  68. <!-- 下月日期格子 -->
  69. <view
  70. class="grid b ac pc {{calendarConfig.theme}}_next-month-date"
  71. wx:for="{{calendar.lastEmptyGrids}}"
  72. wx:key="index"
  73. data-idx="{{index}}">
  74. <view class="date-wrap b cc">
  75. <view class="date">
  76. {{item.day}}
  77. <view
  78. wx:if="{{calendarConfig.showLunar && item.lunar}}"
  79. class="date-desc date-desc-bottom">
  80. {{item.lunar.Term || item.lunar.IDayCn}}
  81. </view>
  82. </view>
  83. </view>
  84. </view>
  85. </view>
  86. </view>
  87. </view>