|
@@ -116,6 +116,7 @@ export default {
|
|
spaceTime: 60,
|
|
spaceTime: 60,
|
|
cardActive: {},
|
|
cardActive: {},
|
|
cardList: [],
|
|
cardList: [],
|
|
|
|
+ countdownTimer: null,
|
|
// qr dialog
|
|
// qr dialog
|
|
dialogVisible: false,
|
|
dialogVisible: false,
|
|
payQR: '',
|
|
payQR: '',
|
|
@@ -129,6 +130,7 @@ export default {
|
|
},
|
|
},
|
|
beforeDestroy() {
|
|
beforeDestroy() {
|
|
this.stopOrderStatusTimer()
|
|
this.stopOrderStatusTimer()
|
|
|
|
+ this.stopCountdownTimer()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
getCode() {
|
|
getCode() {
|
|
@@ -145,11 +147,11 @@ export default {
|
|
// 成功60秒不让点击
|
|
// 成功60秒不让点击
|
|
this.disabled = true
|
|
this.disabled = true
|
|
this.captchaBtnText = `(${this.spaceTime}秒)免费获取`
|
|
this.captchaBtnText = `(${this.spaceTime}秒)免费获取`
|
|
- let clock = window.setInterval(() => {
|
|
|
|
|
|
+ this.countdownTimer = window.setInterval(() => {
|
|
this.spaceTime--
|
|
this.spaceTime--
|
|
this.captchaBtnText = `(${this.spaceTime}秒)免费获取`
|
|
this.captchaBtnText = `(${this.spaceTime}秒)免费获取`
|
|
if (this.spaceTime < 0) {
|
|
if (this.spaceTime < 0) {
|
|
- window.clearInterval(clock)
|
|
|
|
|
|
+ this.stopCountdownTimer()
|
|
this.captchaBtnText = '免费获取'
|
|
this.captchaBtnText = '免费获取'
|
|
this.totalTime = 60
|
|
this.totalTime = 60
|
|
this.disabled = false
|
|
this.disabled = false
|
|
@@ -205,6 +207,12 @@ export default {
|
|
clearInterval(this.orderTimer)
|
|
clearInterval(this.orderTimer)
|
|
this.orderTimer = null
|
|
this.orderTimer = null
|
|
}
|
|
}
|
|
|
|
+ },
|
|
|
|
+ stopCountdownTimer() {
|
|
|
|
+ if (this.countdownTimer) {
|
|
|
|
+ clearInterval(this.countdownTimer)
|
|
|
|
+ this.countdownTimer = null
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|