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