nieyuge 3 years ago
parent
commit
cf5cd10575
1 changed files with 15 additions and 11 deletions
  1. 15 11
      pages/luckdraw.vue

+ 15 - 11
pages/luckdraw.vue

@@ -431,8 +431,11 @@ export default {
 					this.validity = `${_h}:${_m}:${_s}`
 				} else {
                     this.validity = `00:00:00`
-                    this.getDetail()
-                    this.getReceivedList()
+                    setTimeout(() => {
+                        this.getDetail(() => {
+                            this.handleStatusPage()
+                        })
+                    }, 1000)
 					clearInterval(timer)
 				}
 			}, 1000)
@@ -451,13 +454,13 @@ export default {
         handleStatusPage() {
             // 如果 我领取过了
             // taskFinishStatus  任务完成状态(0:未完成,1:已完成,2:已过期)
-            if (this.detail.myReceived) {
-                this.receiveAmount = this.detail.myReceived.amountValue || 0
+            if (this.detail.postBizData.myReceived) {
+                this.receiveAmount = this.detail.postBizData.myReceived.amountValue || 0
                 // 如果 任务完成状态 = 未完成
-                if (this.detail.myReceived.taskFinishStatus == 0) {
+                if (this.detail.postBizData.myReceived.taskFinishStatus == 0) {
                     // 显示任务未完成页面
                     this.status = `opened`
-                } else if (this.detail.myReceived.taskFinishStatus == 1) {
+                } else if (this.detail.postBizData.myReceived.taskFinishStatus == 1) {
                     //如果 任务完成状态 = 已经完成
                     if (this.receiveAmount == 0) {
                         // 领取到空红包
@@ -468,7 +471,7 @@ export default {
                     }
                 } else {
                     // 如果 任务完成状态 = 已经过期
-                    if (this.detail.status == 1) {
+                    if (this.detail.postBizData.status == 1) {
                         // 显示未打开页面
                         this.status = 'not-open'
                     } else {
@@ -479,9 +482,9 @@ export default {
             } else {
                 // 如果 我没有领取过
                 // 如果 红包状态 = 进行中
-                if (this.detail.status == 1) {
+                if (this.detail.postBizData.status == 1) {
                     // 如果 过了红包的领取截止时间 = true
-                    if (this.detail.receiveTimeExpired) {
+                    if (this.detail.postBizData.receiveTimeExpired) {
                         // 显示过期页面
                         this.status = 'expire'
                     } else {
@@ -502,10 +505,10 @@ export default {
             if (this.status !== 'not-open') {
                 this.getReceivedList()
             } else {
-                this.getValidity(this.detail.endTimestamp)
+                this.getValidity(this.detail.postBizData.endTimestamp)
             }
         },
-        async getDetail() {
+        async getDetail(fn) {
 			let { data } = await axios.post(`${baseURL}/denet/post/getDetail`, {
 				baseInfo: {
 					appVersionCode: appVersionCode,
@@ -517,6 +520,7 @@ export default {
 			})
 			if (data.code == 0) {
 				this.detail.postBizData = JSON.parse(data.data.postBizData)
+                if (fn) fn();
 			}
 		},
         async getReceivedList() {