微信小程序日历组件(swiper可滑动的日历)

可滑动的日历组件

根据现实需求自行调整其他
在这里插入图片描述

rili.wxml页面

<!--pages/rili/rili.wxml-->
<view class="rili">

</view>
<view class='month'>
    <!-- <view class='arrow' bindtap='prevMonth'>《 </view> -->
    <view class="shijian">
        <!-- <picker mode="date" value="{
   {date}}" start="2015-09" end="2020-09" fields='month' bindchange="bindDateChange"> -->
        <view class="flex">
           <view style="color: #1677FF;margin-right: 20rpx;font-weight: bold;"></view>{
  {date}}
        </view>
        <!-- </picker> -->
        <view class="jintian" bindtap="jintian">回今天</view>
    </view>
    <!-- <view class='arrow' bindtap='nextMonth'> 》</view> -->
</view>
<view class='container'>
  <view class='calendar flex column s-center'>
    <view class='week-row flex m-around wid100'>
      <view class='grid weeks' wx:for="{
    {week}}" wx:key='key'>{
  {item}}</view>
    </view>
    <swiper class='swpier-box' circular="true" current="{
    {swiperIndex}}" bindchange='swiperChange'>
      <swiper-item class='flex m-around days-table '>
        <view wx:for="{
    {calendar.first}}" wx:for-item='x' wx:key='key'
          class='grid fw {
    {x.month === month?"":"notCurrent"}} {
    {x.date === today?"today":""}} {
    {x.date === beSelectDate ? "choice":"" || bindDayTap === x.date ? "choice" :"" }}' data-month='{
    {x.month}}' data-day='{
    {x.day}}' data-date='{
    {x.date}}' bindtap='bindDayTap'>
          <view  class='views {
    {x.date === today ? "view" :""}} {
    { bindDayTap === x.date ? "view" :""}} {
    {x.year+"-"+x.month+"-"+x.day === date+"-01"?"yellow":""}} {
    {x.year+"-"+x.month+"-"+x.day === date+"-02"?"blue":""}}'>
              <!-- <view class="weizhi">{
   {x.date === today?'今天':x.day}}</view> -->
              <view class="weizhi">{
  {x.day}}</view>
              <view class="tods" wx:if="{
    {x.date === today}}">今天</view>
          </view>
              <!-- <block wx:if="{
   {workerClockData.length>0}}">
              <view wx:for="{
   {workerClockData}}" wx:key="key">
                <text class='da' wx:if="{
   {x.year+'-'+x.month+'-'+x.day==item.clockDate}}">记</text>
                <text class='da2'wx:if="{
   {x.year+'-'+x.month+'-'+x.day==item.clockDate}}">+{
   {item.actualDayWage}}</text>
              </view>
              </block> -->
        </view>
      </swiper-item>
      <!-- 当前月 -->
      <swiper-item class='flex m-around days-table '>
        <view wx:for="{
    {calendar.second}}" wx:for-item='x' wx:key='key'
          class='grid fw {
    {x.month === month?"":"notCurrent"}} {
    {x.date === today?"today":""}} {
    {x.date === beSelectDate ? "choice":"" || bindDayTap === x.date ? "choice" :"" }}' data-month='{
    {x.month}}' data-day='{
    {x.day}}' data-date='{
    {x.date}}' data-test='{
    {(year + "-" +month + "-" + day)}}'  bindtap='bindDayTap'>
          <view class='views {
    {x.date === today || x.date === date+"-05" ? "view" :""}} {
    { bindDayTap === x.date ? "view" :""}} {
    {x.year+"-"+x.month+"-"+x.day === date+"-01"?"yellow":""}} {
    {x.year+"-"+x.month+"-"+x.day === date+"-02"?"blue":""}} '>
              <!-- <view class="weizhi">{
   {x.date === today?'今天':x.day}}</view> -->
              <view class="weizhi">{
  {x.day}}</view>
              <view class="tods" wx:if="{
    {x.date === today}}">今天</view>
          <!-- {
   {x.date === today?'今天':x.day}} -->
          </view>
          <!-- <block wx:if="{
   {workerClockData.length>0}}">
          <view wx:for="{
   {workerClockData}}" wx:key="key">
            <text class='da' wx:if="{
   {x.year+'-'+x.month+'-'+x.day==item.clockDate}}">记</text>
            <text class='da2'wx:if="{
   {x.year+'-'+x.month+'-'+x.day==item.clockDate}}">+{
   {item.actualDayWage}}</text>
          </view>
          </block> -->
        </view>
      </swiper-item>
      <swiper-item class='flex m-around days-table'>
        <view wx:for="{
    {calendar.third}}" wx:for-item='x' wx:key='key'
          class='grid fw  {
    {x.date === today?"today":""}} {
    {x.date === beSelectDate ? "choice":"" || bindDayTap === x.date ? "choice" :"" }}' data-month='{
    {x.month}}' data-day='{
    {x.day}}' data-date='{
    {x.date}}' bindtap='bindDayTap'>
          <!-- <view class='view {
   {x.year+"-"+x.month+"-"+x.day === date+"-01"?"choice2":""}}{
   {x.month === month?"":"notCurrent"}}'>{
   {x.date === today?'今天':x.day}}</view> -->
          <!-- <view style="color: #1677FF;">{
   {date+"-01"}}</view> -->
          <!-- <view>1{
   {bindDayTap}}</view> -->
          <view class='views {
    {x.date === date+"-01" ? "view" :""}} {
    { bindDayTap === x.date ? "view" :""}} {
    {x.year+"-"+x.month+"-"+x.day === date+"-01"?"yellow":""}} {
    {x.year+"-"+x.month+"-"+x.day === date+"-02"?"blue":""}} {
    {x.month === month?"":"notCurrent"}}'>
              <view class="weizhi">{
  {x.day}}</view>
              <view class="tods" wx:if="{
    {x.date === today}}">今天</view>
          </view>
          
          <!-- <block wx:if="{
   {workerClockData.length>0}}">
          <view wx:for="{
   {workerClockData}}" wx:key="key">
            <text class='da' wx:if="{
   {x.year+'-'+x.month+'-'+x.day==item.clockDate}}">记</text>
            <text class='da2'wx:if="{
   {x.year+'-'+x.month+'-'+x.day==item.clockDate}}">+{
   {item.actualDayWage}}</text>
          </view>
          </block> -->
        </view>
      </swiper-item>
      <swiper-item class='flex m-around days-table '>
        <view wx:for="{
    {calendar.fourth}}" wx:for-item='x' wx:key='key'
          class='grid fw {
    {x.month === month?"":"notCurrent"}} {
    {x.date === today?"today":""}} {
    {x.date === beSelectDate ? "choice":
  • 2
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

钟Bubble

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值