首頁  >  文章  >  微信小程式  >  微信小程式實現簽到的日曆功能

微信小程式實現簽到的日曆功能

coldplay.xixi
coldplay.xixi轉載
2020-08-17 16:37:333928瀏覽

微信小程式實現簽到的日曆功能

前言

前言

##一樣時簽到行事曆上。 只有基礎的行事曆,簽到需要自行實現。

(我等下也要實作簽到了…)

相關學習推薦:

微信小程式開發教學

微信小程式實現簽到的日曆功能

效果圖

wxml

    
      

        
            {{ item }}
        
        
            {{ item.day }}
        

      
    
  

wxss

.calendar{
   margin-top: 10%;}.month{
      display: flex;
      flex-flow: row wrap;
      font-size: 1.1rem;  }.item{
      width: 14.28%;
      text-align: center;
      line-height: 3rem;}.othe{
   color: grey}

js###
// pages/sing_in/sing_in.jsPage({
  data: {
    dateData: [],
    isSignin: false,
    week: ['日','一','二','三','四','五','六'],
  },
  onLoad: function (options) {
      this.initCurrMonthData()
  },
  /**
  * year string 年  如:2020 
  * month string 月 如: 5
  * return array 所有天数 如:[1,2,3...,31]
  **/
  monthDays(year,month){ 
     let days_count = new Date(year,month,0).getDate() //月总天数 如:31
     let days = []; //存放月的天数
     for(let i = 1; i  this.formatDay(val)) //当月的数据

     for(let i = 0; i ######相關學習推薦:###微信公眾號開發教學##########

以上是微信小程式實現簽到的日曆功能的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文轉載於:jb51.net。如有侵權,請聯絡admin@php.cn刪除