Commit 395e90589e79b60e7654406dc590097d34aa63f5

Authored by 刘淇
1 parent 843fbfe3

动态码1分钟刷新

pages/businessCard/provideCard.vue
@@ -49,6 +49,7 @@ export default { @@ -49,6 +49,7 @@ export default {
49 } 49 }
50 }, 50 },
51 onLoad(params) { 51 onLoad(params) {
  52 + let that = this
52 wx.showShareMenu({ 53 wx.showShareMenu({
53 withShareTicket: true 54 withShareTicket: true
54 }) 55 })
@@ -62,6 +63,11 @@ export default { @@ -62,6 +63,11 @@ export default {
62 this.cardNum = option.cardNum 63 this.cardNum = option.cardNum
63 // this.maxNum = option.cardNum 64 // this.maxNum = option.cardNum
64 this.getCouponDynamicQR() 65 this.getCouponDynamicQR()
  66 + that.timer = setInterval(() => {
  67 + // 业务逻辑
  68 + console.log('11')
  69 + that.getCouponDynamicQR() //调用二维码方法
  70 + }, 60000)
65 }, 71 },
66 onShow() { 72 onShow() {
67 var me = this; 73 var me = this;
@@ -83,11 +89,7 @@ export default { @@ -83,11 +89,7 @@ export default {
83 console.log(res) 89 console.log(res)
84 that.qrUrl = res.data.qrUrl 90 that.qrUrl = res.data.qrUrl
85 that.qrFun(that.qrUrl) //调用二维码方法 91 that.qrFun(that.qrUrl) //调用二维码方法
86 - that.timer = setInterval(() => {  
87 - // 业务逻辑  
88 - console.log('11')  
89 - that.qrFun(that.qrUrl) //调用二维码方法  
90 - }, 300000) 92 +
91 console.log(that.qrUrl) 93 console.log(that.qrUrl)
92 }) 94 })
93 }, 95 },
@@ -121,8 +123,8 @@ export default { @@ -121,8 +123,8 @@ export default {
121 that.timer = setInterval(() => { 123 that.timer = setInterval(() => {
122 // 业务逻辑 124 // 业务逻辑
123 console.log('11') 125 console.log('11')
124 - that.qrFun(that.qrUrl) //调用二维码方法  
125 - }, 300000) 126 + that.getCouponDynamicQR() //调用二维码方法
  127 + }, 60000)
126 } 128 }
127 }, 129 },
128 toPrintCard: function () { 130 toPrintCard: function () {