index.wxml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <view class="flex b tb ac" wx:if="{{calendar}}">
  2. <view class="calendar b tb">
  3. <!-- 头部操作栏 -->
  4. <view
  5. wx:if="{{!config.hideHeader}}"
  6. class="handle {{config.theme}}_handle-color fsnd b lr ac pc fsnd calendar_header">
  7. <view class="prev fsnd" wx:if="{{!config.weekMode}}">
  8. <text class="prev-handle iconfont icon-doubleleft fsnd" bindtap="changeDate" data-type="prev_month"></text>
  9. <!-- <text class="prev-handle iconfont icon-doubleleft fsnd" bindtap="changeDate" data-type="prev_year"></text> -->
  10. <!-- <text class="prev-handle iconfont icon-left" bindtap="changeDate" data-type="prev_month"></text> -->
  11. </view>
  12. <view class="calendar_title flex date-in-handle b lr cc fsnd" bindtap="doubleClickJumpToToday">
  13. {{calendar.curYear || "--"}} 年 {{calendar.curMonth || "--"}} 月
  14. </view>
  15. <view class="calender-search" bindtap="gotoSearch">
  16. <i-icon class="icon" type="search" size="26" style="color: #2563EB;"></i-icon>
  17. </view>
  18. <view class="next fsnd" wx:if="{{!config.weekMode}}">
  19. <!-- <text class="next-handle iconfont icon-right" bindtap="changeDate" data-type="next_month"></text> -->
  20. <!-- <text class="next-handle iconfont icon-doubleright" bindtap="changeDate" data-type="next_year"></text> -->
  21. <text class="next-handle iconfont icon-doubleright fsnd" bindtap="changeDate" data-type="next_month"></text>
  22. </view>
  23. </view>
  24. <!-- 星期栏 -->
  25. <view class="weeks b lr ac {{config.theme}}_week-color mt10">
  26. <!-- fsnd -->
  27. <view class="week" wx:for="{{calendar.weeksCh}}" wx:key="index" data-idx="{{index}}">{{item}}</view>
  28. </view>
  29. <!-- 日历面板主体 -->
  30. <!-- bindtouchstart="calendarTouchstart" catchtouchmove="calendarTouchmove" catchtouchend="calendarTouchend" -->
  31. <view class="b lr wrap calendar_body" >
  32. <!-- 上月日期格子 -->
  33. <view class="grid b ac pc {{config.theme}}_prev-month-date calendar_date" wx:for="{{calendar.prevMonthGrids}}" wx:key="index" data-idx="{{index}}">
  34. <view class="date-wrap b cc">
  35. <view class="date">
  36. {{item.date}}
  37. </view>
  38. </view>
  39. </view>
  40. <!-- 本月日期格子 -->
  41. <view wx:for="{{calendar.dates}}" wx:key="index" data-idx="{{index}}" data-info="{{item}}" bindtap="tapDate" class="grid {{item.class ? item.class : ''}} {{config.theme}}_normal-date b ac pc calendar_date">
  42. <view class="date-wrap b cc {{config.emphasisWeek && (item.week === 0 || item.week === 6) ? config.theme + '_weekend-color' : ''}} {{item.choosed ? 'calendar_date_choosed' : ''}}">
  43. <!-- {{item.choosed ? config.theme + '_choosed' : ''}} -->
  44. <view class="date b ac pc {{item.class ? item.class : ''}} {{item.isToday && config.highlightToday ? 'calendar_today' : ''}} {{item.disable ? config.theme + '_date-disable' : ''}} {{config.chooseAreaMode ? 'date-area-mode' : ''}} {{calendar.todoLabelCircle && item.showTodoLabel && !item.choosed ? config.theme + '_todo-circle todo-circle' : '' }}">
  45. {{config.markToday && item.isToday ? config.markToday : item.date}}
  46. <!-- <view
  47. wx:if="{{(config.showLunar && item.lunar && !item.showTodoLabel) || (item.showTodoLabel && calendar.todoLabelPos !== 'bottom') || config.showHolidays}}"
  48. class="date-desc {{config.theme}}_date-desc date-desc-bottom {{(item.choosed || item.isToday) ? 'date-desc-bottom-always' : ''}} {{item.disable ? config.theme + '_date-desc-disable' : ''}}">
  49. <text class="{{config.showHolidays && !item.showTodoLabel && item.label && !item.choosed ? config.theme + '_date-desc-lunar' : ''}} {{item.type === 'festival' ? config.theme + '_festival' : ''}}">{{item.label || item.lunar.Term || item.lunar.IDayCn}}</text>
  50. </view> -->
  51. <!-- <view
  52. wx:if="{{item.showTodoLabel && !calendar.todoLabelCircle}}"
  53. class="{{item.todoText ? 'date-desc' : config.theme + '_todo-dot todo-dot'}} {{config.showLunar ? config.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' : ''}}"
  54. style="background-color: {{item.todoText ? '' : item.color || calendar.todoLabelColor}}; color: {{item.color}}">
  55. {{item.todoText}}
  56. </view> -->
  57. </view>
  58. <view class="calander-todos" wx:if="{{item.todoText}}">
  59. <view class="calander-todo" wx:for="{{item.todoText}}" wx:for-item="todo" wx:for-index="todoIndex" wx:key="todoIndex" style="background-color: {{todo && todo[1] || ''}}">
  60. {{todo[0]}}
  61. </view>
  62. </view>
  63. </view>
  64. </view>
  65. <!-- 下月日期格子 -->
  66. <view class="grid b ac pc {{config.theme}}_next-month-date calendar_date" wx:for="{{calendar.nextMonthGrids}}" wx:key="index" data-idx="{{index}}">
  67. <view class="date-wrap b cc">
  68. <view class="date">
  69. {{item.date}}
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. </view>
  75. </view>