index.axml 5.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <view class='calendar-index {{className}}' style='{{style}}' ref='saveChildRef0'>
  2. <import-sjs from='./index.sjs' name='computed'>
  3. </import-sjs>
  4. <van-popup a:if='{{ poppable }}' custom-class='van-calendar__popup--{{ position }}' close-icon-class='van-calendar__close-icon' show='{{ show }}' round='{{ round }}' position='{{ position }}' closeable='{{ showTitle || showSubtitle }}' close-on-click-overlay='{{ closeOnClickOverlay }}' onEnter='onOpen' onClose='onClose' onAfter-enter='onOpened' onAfter-leave='onClosed' ref='saveChildRef1'>
  5. <block a:for='{{ [{ title, subtitle, showTitle, showSubtitle, minDate, maxDate, type, color, showMark, rowHeight, currentDate, safeAreaInsetBottom, showConfirm, confirmDisabledText, confirmText, scrollIntoView, allowSameDay }] }}' a:for-item='amitem' _is='calendar' ref-numbers='{{ [{ title, subtitle, showTitle, showSubtitle, minDate, maxDate, type, color, showMark, rowHeight, currentDate, safeAreaInsetBottom, showConfirm, confirmDisabledText, confirmText, scrollIntoView, allowSameDay }] }}'>
  6. <view class='van-calendar'>
  7. <header title='{{ amitem.title }}' showTitle='{{ amitem.showTitle }}' subtitle='{{ amitem.subtitle }}' showSubtitle='{{ amitem.showSubtitle }}' ref='saveChildRef5'>
  8. <slot name='title' slot='title'>
  9. </slot>
  10. </header>
  11. <scroll-view class='van-calendar__body' scroll-y=' ' scroll-into-view='{{ amitem.scrollIntoView }}'>
  12. <month a:for='{{ computed.getMonths(amitem.minDate, amitem.maxDate) }}' a:key='{{*this}}' id='month{{ index }}' class='month' data-date='{{ item }}' date='{{ item }}' type='{{ amitem.type }}' color='{{ amitem.color }}' minDate='{{ amitem.minDate }}' maxDate='{{ amitem.maxDate }}' showMark='{{ amitem.showMark }}' onFormatter='onFormatter' rowHeight='{{ amitem.rowHeight }}' currentDate='{{ amitem.currentDate }}' showSubtitle='{{ amitem.showSubtitle }}' allowSameDay='{{ amitem.allowSameDay }}' showMonthTitle="{{ typeof index === 'number' || !amitem.showSubtitle }}" onClick='onClickDay' ref-numbers='{{ computed.getMonths(amitem.minDate, amitem.maxDate) }}' ref='saveChildRef6'>
  13. </month>
  14. </scroll-view>
  15. <view class="van-calendar__footer {{ amitem.safeAreaInsetBottom ? 'van-calendar__footer--safe-area-inset-bottom' : '' }}">
  16. <slot name='footer'>
  17. </slot>
  18. </view>
  19. <view class="van-calendar__footer {{ amitem.safeAreaInsetBottom ? 'van-calendar__footer--safe-area-inset-bottom' : '' }}">
  20. <van-button a:if='{{ amitem.showConfirm }}' round=' ' block=' ' type='danger' color='{{ amitem.color }}' custom-class='van-calendar__confirm' disabled='{{ computed.getButtonDisabled(amitem.type, amitem.currentDate) }}' nativeType='text' onClick='onConfirm' ref='saveChildRef7'>
  21. {{ computed.getButtonDisabled(amitem.type, amitem.currentDate) ? amitem.confirmDisabledText : amitem.confirmText }}
  22. </van-button>
  23. </view>
  24. </view>
  25. </block>
  26. </van-popup>
  27. <block a:else a:for='{{ [{ title, subtitle, showTitle, showSubtitle, minDate, maxDate, type, color, showMark, rowHeight, currentDate, safeAreaInsetBottom, showConfirm, confirmDisabledText, confirmText, scrollIntoView, allowSameDay }] }}' a:for-item='amitem' _is='calendar' ref-numbers='{{ [{ title, subtitle, showTitle, showSubtitle, minDate, maxDate, type, color, showMark, rowHeight, currentDate, safeAreaInsetBottom, showConfirm, confirmDisabledText, confirmText, scrollIntoView, allowSameDay }] }}'>
  28. <view class='van-calendar'>
  29. <header title='{{ amitem.title }}' showTitle='{{ amitem.showTitle }}' subtitle='{{ amitem.subtitle }}' showSubtitle='{{ amitem.showSubtitle }}' ref='saveChildRef11'>
  30. <slot name='title' slot='title'>
  31. </slot>
  32. </header>
  33. <scroll-view class='van-calendar__body' scroll-y=' ' scroll-into-view='{{ amitem.scrollIntoView }}'>
  34. <month a:for='{{ computed.getMonths(amitem.minDate, amitem.maxDate) }}' a:key='{{*this}}' id='month{{ index }}' class='month' data-date='{{ item }}' date='{{ item }}' type='{{ amitem.type }}' color='{{ amitem.color }}' minDate='{{ amitem.minDate }}' maxDate='{{ amitem.maxDate }}' showMark='{{ amitem.showMark }}' onFormatter='onFormatter' rowHeight='{{ amitem.rowHeight }}' currentDate='{{ amitem.currentDate }}' showSubtitle='{{ amitem.showSubtitle }}' allowSameDay='{{ amitem.allowSameDay }}' showMonthTitle="{{ typeof index === 'number' || !amitem.showSubtitle }}" onClick='onClickDay' ref-numbers='{{ computed.getMonths(amitem.minDate, amitem.maxDate) }}' ref='saveChildRef12'>
  35. </month>
  36. </scroll-view>
  37. <view class="van-calendar__footer {{ amitem.safeAreaInsetBottom ? 'van-calendar__footer--safe-area-inset-bottom' : '' }}">
  38. <slot name='footer'>
  39. </slot>
  40. </view>
  41. <view class="van-calendar__footer {{ amitem.safeAreaInsetBottom ? 'van-calendar__footer--safe-area-inset-bottom' : '' }}">
  42. <van-button a:if='{{ amitem.showConfirm }}' round=' ' block=' ' type='danger' color='{{ amitem.color }}' custom-class='van-calendar__confirm' disabled='{{ computed.getButtonDisabled(amitem.type, amitem.currentDate) }}' nativeType='text' onClick='onConfirm' ref='saveChildRef13'>
  43. {{ computed.getButtonDisabled(amitem.type, amitem.currentDate) ? amitem.confirmDisabledText : amitem.confirmText }}
  44. </van-button>
  45. </view>
  46. </view>
  47. </block>
  48. <van-toast id='van-toast' ref='saveChildRef14'>
  49. </van-toast>
  50. </view>