index.wxml 4.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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 fs28 b lr ac pc">
  5. <view class="prev fs36" wx:if="{{calendarConfig.showHandlerOnWeekMode || !calendar.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 fs36" wx:if="{{calendarConfig.showHandlerOnWeekMode || !calendar.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 fs28" 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. bindtouchmove="calendarTouchmove"
  23. bindtouchend="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">
  32. {{item.day}}
  33. <view
  34. wx:if="{{calendarConfig.showLunar && item.lunar}}"
  35. class="date-desc date-desc-bottom">
  36. {{item.lunar.Term || item.lunar.IDayCn}}
  37. </view>
  38. </view>
  39. </view>
  40. <!-- 本月日期格子 -->
  41. <view class="grid {{calendarConfig.theme}}_normal-date b ac pc"
  42. wx:for="{{calendar.days}}"
  43. wx:key="{{index}}"
  44. data-disable="{{item.disable}}"
  45. data-idx="{{index}}"
  46. bindtap="tapDayItem">
  47. <view
  48. class="date-wrap b cc">
  49. <view class="date b ac pc {{(item.week === 0 || item.week === 6) ? calendarConfig.theme + '_weekend-color' : ''}} {{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' : ''}}">
  50. {{item.day}}
  51. <view
  52. wx:if="{{(calendarConfig.showLunar && item.lunar && !item.showTodoLabel) || (item.showTodoLabel && calendar.todoLabelPos !== 'bottom')}}"
  53. 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' : ''}}">
  54. {{item.lunar.Term || item.lunar.IDayCn}}
  55. </view>
  56. <view
  57. wx:if="{{item.showTodoLabel && !calendar.todoLabelCircle}}"
  58. 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' : ''}}"
  59. style="background-color: {{calendar.todoLabelColor}};">
  60. {{item.todoText}}
  61. </view>
  62. </view>
  63. </view>
  64. </view>
  65. <!-- 下月日期格子 -->
  66. <view
  67. class="grid b ac pc {{calendarConfig.theme}}_next-month-date"
  68. wx:for="{{calendar.lastEmptyGrids}}"
  69. wx:key="{{index}}"
  70. data-idx="{{index}}">
  71. <view class="date">
  72. {{item.day}}
  73. <view
  74. wx:if="{{calendarConfig.showLunar && item.lunar}}"
  75. class="date-desc date-desc-bottom">
  76. {{item.lunar.Term || item.lunar.IDayCn}}
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. </view>