From 395e90589e79b60e7654406dc590097d34aa63f5 Mon Sep 17 00:00:00 2001 From: liugongyu <290219706@qq.com> Date: Fri, 19 Aug 2022 13:57:50 +0800 Subject: [PATCH] 动态码1分钟刷新 --- pages/businessCard/provideCard.vue | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/pages/businessCard/provideCard.vue b/pages/businessCard/provideCard.vue index 1197297..46bb463 100644 --- a/pages/businessCard/provideCard.vue +++ b/pages/businessCard/provideCard.vue @@ -49,6 +49,7 @@ export default { } }, onLoad(params) { + let that = this wx.showShareMenu({ withShareTicket: true }) @@ -62,6 +63,11 @@ export default { this.cardNum = option.cardNum // this.maxNum = option.cardNum this.getCouponDynamicQR() + that.timer = setInterval(() => { + // 业务逻辑 + console.log('11') + that.getCouponDynamicQR() //调用二维码方法 + }, 60000) }, onShow() { var me = this; @@ -83,11 +89,7 @@ export default { console.log(res) that.qrUrl = res.data.qrUrl that.qrFun(that.qrUrl) //调用二维码方法 - that.timer = setInterval(() => { - // 业务逻辑 - console.log('11') - that.qrFun(that.qrUrl) //调用二维码方法 - }, 300000) + console.log(that.qrUrl) }) }, @@ -121,8 +123,8 @@ export default { that.timer = setInterval(() => { // 业务逻辑 console.log('11') - that.qrFun(that.qrUrl) //调用二维码方法 - }, 300000) + that.getCouponDynamicQR() //调用二维码方法 + }, 60000) } }, toPrintCard: function () { -- libgit2 0.21.4