calendar.wxml 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <!--component/calendar/calendar.wxml-->
  2. <view class="calendar">
  3. <view class="direction_box">
  4. <view style="width:40rpx;height:30rpx;" bindtap="toLeft">
  5. <image src="https://point.xiuqinews.cn/file/file?fileName=left.png" mode="" class="left direction"/>
  6. </view>
  7. <view class="week_box">
  8. {{startTime}}—{{endTime}}
  9. <!-- {{date.days[0].id}} — {{date.days[6].id}} -->
  10. </view>
  11. <view style="width:40rpx;height:30rpx;" bindtap="toRight">
  12. <image src="https://point.xiuqinews.cn/file/file?fileName=right.png" mode="" class="right direction"/>
  13. </view>
  14. </view>
  15. <view class="title">
  16. <view class="header-wrap">
  17. <!-- <view class="flex">
  18. <view class="title">{{title}}</view>
  19. <view class="month">
  20. <block wx:if="{{title}}">
  21. (
  22. </block>
  23. {{selectDay.year}}年{{selectDay.month}}月
  24. <block wx:if="{{title}}">
  25. )
  26. </block>
  27. </view>
  28. </view> -->
  29. <!-- <block wx:if="{{goNow}}">
  30. <view wx:if="{{open && !(nowDay.year==selectDay.year&&nowDay.month==selectDay.month&&nowDay.day==selectDay.day)}}" class="today" bindtap="switchNowDate">
  31. 今日
  32. </view>
  33. </block> -->
  34. </view>
  35. </view>
  36. <!-- 日历头部 -->
  37. <!-- <view class="flex-around calendar-week">
  38. <view class="view">一</view>
  39. <view class="view">二</view>
  40. <view class="view">三</view>
  41. <view class="view">四</view>
  42. <view class="view">五</view>
  43. <view class="view">六</view>
  44. <view class="view">日</view>
  45. </view> -->
  46. <!-- 日历主体 -->
  47. <swiper class="swiper" style="height:{{swiperHeight}}rpx" bindchange="swiperChange" circular="{{true}}" current="{{swiperCurrent}}" duration="{{swiperDuration}}" >
  48. <swiper-item wx:for="{{[dateList0, dateList1, dateList2]}}" wx:for-index="listIndex" wx:for-item="listItem" wx:key="listIndex" catchtouchmove="stopTouchMove">
  49. <view class="flex-start flex-wrap calendar-main" style="height:{{listItem.length/7*82}}rpx">
  50. <view wx:for="{{listItem}}" wx:key="dateList" class="day">
  51. <view class="bg {{item.month === selectDay.month?spotMap['y'+item.year+'m'+item.month+'d'+item.day]?spotMap['y'+item.year+'m'+item.month+'d'+item.day]:'':''}} {{(item.year === nowDay.year && item.month === nowDay.month && item.day === nowDay.day) ? 'now' : ''}} {{(item.year === selectDay.year && item.month === selectDay.month) ? (item.day === selectDay.day && oldCurrent === listIndex ?'select':''): 'other-month'}}" bindtap="chooseDate" data-day="{{item.day}}" data-year="{{item.year}}" data-month="{{item.month}}">
  52. {{item.day}}
  53. </view>
  54. </view>
  55. </view>
  56. </swiper-item>
  57. </swiper>
  58. <!-- <view catchtap="openChange" class="flex list-open">
  59. <view class="icon {{open?'fold':'unfold'}}"></view>
  60. </view> -->
  61. </view>