import { getActivityInfo } from '~/api/activity' Page({ /** * 页面的初始数据 */ data: { state: true, tens: 2, bits: 0, configure: {} }, async onLoad(options) { let configure = await getActivityInfo(options.id) console.log(configure); this.setData({ configure }) }, play() { this.setData({ state: true }) let countDown = 20 // 一分钟倒计时 let dsq = setInterval(item => { if (countDown == 1) { clearInterval(dsq) } if (countDown % 10 == 0) { this.setData({ tens: --this.data.tens, bits: 9 }) } else { this.setData({ bits: --this.data.bits }) } --countDown }, 1000) } })