calendar.wxml 1.3 KB

123456789101112131415161718192021222324
  1. <popup show="{{show}}" height="{{height}}" bind:close="close" class="popupHeight">
  2. <view class="monthTitle">{{title}}</view>
  3. <view class="container">
  4. <view class='week_body white-bg'>
  5. <view wx:for="{{week}}" class='week_date {{item=="六"||item=="日"?"subtitleColor":""}}' wx:key="item">
  6. {{item}}
  7. </view>
  8. </view>
  9. <view class="layout_body white-bg">
  10. <!-- 这里用 bindtouchstart 和 bindtouchend 两个事件来控制滑动的 -->
  11. <view class="date_container" bindtouchstart="touchStart" bindtouchend="touchEnd">
  12. <view class="date_box1 flex {{slideOne}}">
  13. <view wx:for="{{calendar}}" wx:for-item='x' wx:key='index' bindtap='bindDayTap'
  14. class='grid{{x.date == today ? " todayBg":(x.dateSecond < todaySecond || x.month != month ? " old":"")}}{{x.date == clickDate ? " clickBg":""}}'
  15. data-day="{{today}}" bindtap='bindDayTap' data-date='{{x.date}}' data-dateSecond='{{x.dateSecond}}'
  16. data-year='{{x.year}}' data-month='{{x.month}}' data-day='{{x.day}}' data-num='{{x.num}}'>
  17. {{(x.month!=todayMonth&&x.day == 1 ? months[x.month - 1]+'月' : x.day)}}
  18. <text class='tips' wx:if="{{(x.dateSecond > todaySecond || x.date== today) && x.num}}">{{x.num}}</text>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. </popup>