|
@@ -142,6 +142,7 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ loading: false,
|
|
|
activeIndex: null,
|
|
|
awardProgressValue: '0%',
|
|
|
giftList: [],
|
|
@@ -164,10 +165,11 @@ export default {
|
|
|
}
|
|
|
};
|
|
|
},
|
|
|
+ onShow() {
|
|
|
+ this.handleEvent();
|
|
|
+ },
|
|
|
mounted() {
|
|
|
- this.getGiftListEvent()
|
|
|
- this.getActiveInfo()
|
|
|
- this.getRouteListInfo()
|
|
|
+
|
|
|
},
|
|
|
onUnload() {
|
|
|
clearTimeout(this.timer)
|
|
@@ -199,6 +201,11 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
methods: {
|
|
|
+ handleEvent() {
|
|
|
+ this.getGiftListEvent()
|
|
|
+ this.getActiveInfo()
|
|
|
+ this.getRouteListInfo()
|
|
|
+ },
|
|
|
onShareTimeline() {
|
|
|
return {
|
|
|
title: '逛展会,领福利!',
|
|
@@ -265,6 +272,8 @@ export default {
|
|
|
gift_id: this.current_gift.id,
|
|
|
}).then(res => {
|
|
|
if (res.code === 0) {
|
|
|
+ this.hideLoading()
|
|
|
+ this.loading = false
|
|
|
this.qr_code = res.data.qrcode_url
|
|
|
if (res.data.verify_note) {
|
|
|
this.verify_note.company_name = res.data.verify_note.company_name
|
|
@@ -293,6 +302,11 @@ export default {
|
|
|
if (item.is_receipts > 0 || this.activeIndex !== index) {
|
|
|
return false
|
|
|
}
|
|
|
+ if (this.loading) {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ this.loading = true
|
|
|
+ this.showLoading()
|
|
|
this.current_gift = item
|
|
|
this.getRouteListInfo(() => {
|
|
|
//获取当前是否生成过奖品二维码 is_receipts
|
|
@@ -308,10 +322,18 @@ export default {
|
|
|
if (res.confirm) {
|
|
|
//获取二维码
|
|
|
this.claimDataEvent()
|
|
|
+ } else {
|
|
|
+ this.loading = false
|
|
|
+ this.hideLoading()
|
|
|
}
|
|
|
+ },
|
|
|
+ fail: ()=>{
|
|
|
+ this.loading = false
|
|
|
+ this.hideLoading()
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
})
|
|
|
},
|
|
|
checkGiftState(callback) {
|