html52.com
我爱小程序-开发者交流社区

通过页面传参动态设定延迟时间用手机开发版测试出错

问题模块 框架类型 问题类型 操作系统 操作系统版本 手机型号 微信版本
客户端 小程序 Bug Android 7.1.2 vivo x9 6.7.3

通过前一个页面传参动态设定延迟时间,用手机开发板测试会一闪而过,代码是执行了,但时间延迟没作用,但利用开发工具

调试和通过开发工具的“真机调试”功能调试都是没问题的,百思不得其解啊。。。。。,快要疯了,哈哈,请各位大牛不吝赐教,ღ( ´・ᴗ・` )比心


主要代码如下:


onLoad: function (options) {

this.setData({

conTime: options.conTime

})

},


startClick: function() {

var that = this

that.setData({

time: 10

})

console.log("倒计时开始")

setTimeout(that.countDown, that.data.conTime)

},


countDown: function () {

console.log("countDown")

var that = this

var time = that.data.time

time--

that.setData({

time: time

})

if (time != 0) {

setTimeout(that.countDown, that.data.conTime)

} else {

console.log("倒计时结束")

return

}

},


评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

真正的个人免签约支付接口

云免签H5支付