zhangwei 3 år sedan
förälder
incheckning
46bd6af1a7
1 ändrade filer med 11 tillägg och 6 borttagningar
  1. 11 6
      src/view/red-packet.vue

+ 11 - 6
src/view/red-packet.vue

@@ -388,7 +388,6 @@ function init() {
       postId: data.postId
     }
   }).then((res) => {
-    initTaskDetail()
     switch (res.code.toString()) {
       case "0":
         data.srcContentId = res.data.srcContentId
@@ -397,16 +396,21 @@ function init() {
         //   data.status = 'error'
         //   return
         // }
-
+        data.detail = JSON.parse(res.data.postBizData)
         // 未开始
-        if (res.data.postType == 0) {
+        if (data.detail.status == 0) {
           data.status = 'not-open'
         }
 
         // 进行中
-        if (res.data.postType == 1) {
+        if (data.detail.status == 1) {
+          
+          if(data.detail.totalCount == data.detail.finishCount){
+            data.status = 'close'
+            data.close_title = 'Better luck next time!'
+            return 
+          }
           data.status = 'opened'
-          data.detail = JSON.parse(res.data.postBizData)
           if (data.detail.myReceived) {
             data.status = 'opened'
             if (data.detail.myReceived.taskFinishStatus == 1) {
@@ -431,9 +435,10 @@ function init() {
             getValidity()
           }
           console.log(data.detail)
+          initTaskDetail()
         }
         // 已结束
-        if (res.data.postType == 2) {
+        if (data.detail.status == 2) {
           data.status = 'close'
         }
         break