index.wxml 4.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <wux-popup position="bottom" visible="{{ in }}" zIndex="1010" safeArea="bottom" bind:close="close">
  2. <view class="wux-class {{ classes.wrap }}">
  3. <view class="{{ classes.content }}">
  4. <view class="{{ classes.hd }}" wx:if="{{ toolbar }}">
  5. <view class="{{ classes.toolbar }}">
  6. <view class="{{ classes.picker }}">
  7. <view class="{{ classes.link }}" bindtap="prevMonth">
  8. <view class="{{ classes.prev }}"></view>
  9. </view>
  10. <view class="{{ classes.value }}">{{ currentMonthName }}</view>
  11. <view class="{{ classes.link }}" bindtap="nextMonth">
  12. <view class="{{ classes.next }}"></view>
  13. </view>
  14. </view>
  15. <view class="{{ classes.picker }}">
  16. <view class="{{ classes.link }}" bindtap="prevYear">
  17. <view class="{{ classes.prev }}"></view>
  18. </view>
  19. <text class="{{ classes.value }}">{{ currentYear }}</text>
  20. <view class="{{ classes.link }}" bindtap="nextYear">
  21. <view class="{{ classes.next }}"></view>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. <view class="{{ classes.bd }}">
  27. <view class="{{ classes.weekdays }}" wx:if="{{ weekHeader }}">
  28. <block wx:for="{{ weeks }}" wx:for-item="week" wx:for-index="weekIndex" wx:key="weekIndex">
  29. <view class="{{ classes.weekday }} {{ week.weekend ? prefixCls + '__weekday--weekend' : '' }}">
  30. {{ week.dayName }}
  31. </view>
  32. </block>
  33. </view>
  34. <view class="{{ classes.months }}">
  35. <view class="{{ classes.monthsContent }}" bindtouchstart="onTouchStart" catchtouchmove="{{ swiping ? 'noop' : '' }}" capture-bind:touchmove="onTouchMove" bindtouchend="onTouchEnd" style="{{ wrapperTranslate }}">
  36. <block wx:for="{{ months }}" wx:for-item="month" wx:for-index="monthIndex" wx:key="monthIndex">
  37. <view
  38. data-year="{{ month.year }}"
  39. data-month="{{ month.month }}"
  40. class="{{ classes.month }} {{ monthIndex === 0 ? (prefixCls + '__month--prev') : monthIndex === 1 ? (prefixCls + '__month--current') : (prefixCls + '__month--next') }}"
  41. style="{{ monthsTranslate[monthIndex] }}"
  42. >
  43. <block wx:for="{{ month.items }}" wx:for-item="row" wx:for-index="rowIndex" wx:key="rowIndex">
  44. <view class="{{ classes.days }}">
  45. <block wx:for="{{ row }}" wx:for-item="col" wx:for-index="colIndex" wx:key="colIndex">
  46. <view
  47. data-year="{{ col.year }}"
  48. data-month="{{ col.month }}"
  49. data-day="{{ col.day }}"
  50. data-date="{{ col.date }}"
  51. data-type="{{ col.type }}"
  52. class="{{ classes.day }} {{ col.type.prev ? prefixCls + '__day--prev' : '' }} {{ col.type.next ? prefixCls + '__day--next' : '' }} {{ col.type.today ? prefixCls + '__day--today' : '' }} {{ col.type.selected ? prefixCls + '__day--selected' : '' }} {{ col.type.weekend ? prefixCls + '__day--weekend' : '' }} {{ col.type.disabled ? prefixCls + '__day--disabled' : '' }}"
  53. bindtap="onDayClick"
  54. >
  55. <text class="{{ classes.text }}">{{ col.day }}</text>
  56. </view>
  57. </block>
  58. </view>
  59. </block>
  60. </view>
  61. </block>
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. </view>
  67. </wux-popup>