微信小程序数组转字符串

微信小程序数组转字符串,第1张

微信小程序数组字符串

var arr = [1,2,3,4,5,6]

var str = arr.join(',')

console.log(str) // 1,2,3,4,5,6

您好。希望可以帮助到你!

<van-calendar

      poppable="{{ false }}"

      show-confirm="{{ false }}"

      formatter="{{ formatter }}"

      class="calendar"

      show-title="{{ false }}"

      show-subtitle="{{ false }}"

    >

    </van-calendar>

onLoad(options){

    this.CalendarShow()

}

CalendarShow() {

    let _this=this

    var data = {}

    data.formatter = this.dayFormatter

      // 渲染日历

    this.setData({formatter: function (day) {

        let month = day.date.getMonth() + 1

        let date = day.date.getDate()

        for(let i of list){

          if(month ===i.month){

            if (date === i.day) {

              day.bottomInfo = '余票'+i.stock+'张'

            }

          }

        }

        return day

      } })

  },

<view>{{min}}:{{sec}}</view>

//计时器,cycleTime为豪秒数

  timerSec(cycleTime) {

    var that = this

    let intervalsec = null //倒计时函数

    intervalsec = setInterval(function() {

      cycleTime--

      that.setData({

        min: parseInt(cycleTime / 60) <10 ? '0' + parseInt(cycleTime / 60) : parseInt(cycleTime / 60),

        sec: (cycleTime % 60) <10 ? '0' + (cycleTime % 60) : (cycleTime % 60),

      })

      if (cycleTime == 0) {

        clearInterval(intervalsec)

      }

    }, 1000)

  },


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/yw/12148876.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-21
下一篇 2023-05-21

发表评论

登录后才能评论

评论列表(0条)

保存