Browse Source

Merge branch 'dev_1.1.2' of https://git.yishihui.com/DeNet/de-net into dev_1.1.2

nieyuge 2 năm trước cách đây
mục cha
commit
8f5770f3df
1 tập tin đã thay đổi với 11 bổ sung12 xóa
  1. 11 12
      src/view/iframe/red-packet/luck-draw.vue

+ 11 - 12
src/view/iframe/red-packet/luck-draw.vue

@@ -861,10 +861,10 @@ const getTimeStr = (end_time_ms) => {
     return _time_str
 }
 
-let stop_open_conut_down_time_type = ''
-function openConutDownTime(end_time_ms, type = '未打开', callback) {
+function openConutDownTime(end_time_ms, callback) {
+    end_time_ms = Number(end_time_ms) + 5000
     let timer = setInterval(() => {
-        if (stop_open_conut_down_time_type == type) {
+        if (state.open_timer_status == true) {
             clearInterval(timer)
         }
         callback(getTimeStr(end_time_ms))
@@ -1053,6 +1053,7 @@ const getDiscordInfo = (params, cb) => {
 
 const showCloseEndTimePage = () => {
     state.status = 'close'
+    state.open_timer_status = true
     state.close_status = '已经过期了'
     state.close_text = [`This Giveaways`, `expired on ${moment(state.detail.endTimestamp).format('MM-DD')}`]
 }
@@ -1085,10 +1086,10 @@ const showSuccessPage = () => {
 
 const showNotOpenPage = () => {
     state.status = 'not-open'
-    openConutDownTime(state.detail.endTimestamp, '未打开', (time_str) => {
+    openConutDownTime(state.detail.endTimestamp, (time_str) => {
         state.count_down_time = time_str
         if (time_str == '00:00:00') {
-            stop_open_conut_down_time_type = '未打开'
+            init()
         }
     })
     Report.reportLog({
@@ -1101,6 +1102,7 @@ const showNotOpenPage = () => {
 }
 const showOpenedPage = () => {
     state.status = 'opened'
+    state.open_timer_status == true
     initTaskDetail(() => {
         showOpenedPageReport()
     })
@@ -1183,7 +1185,7 @@ const handleStatusPage = () => {
         return
     }
     // 如果 红包状态 =  已终止 | 终止退款进行中
-    if (state.detail.status == 3 || 4) {
+    if (state.detail.status == 3 || state.detail.status == 4) {
         //      显示过期页面
         showCloseEndTimePage()
         showCloseEndTimePageReport()
@@ -1219,7 +1221,7 @@ const handleStatusPage = () => {
             else if (state.detail.status == 1) {
                 // 显示等待结果页面
                 showLoadResult()
-                open_timer()
+                openTimer()
             }
             // 如果 任务完成状态 = 已经过期
         } else {
@@ -1431,19 +1433,16 @@ const doTaskReport = (req, sender) => {
 
 let open_timer_flag = false
 // 倒计时开奖
-const open_timer = () => {
+const openTimer = () => {
     if (open_timer_flag) {
         return
     }
     open_timer_flag = true
 
-    openConutDownTime(state.detail.endTimestamp, '等待结果', (time_str) => {
+    openConutDownTime(state.detail.endTimestamp, (time_str) => {
         state.count_down_time = time_str
         if (time_str == '00:00:00') {
             init()
-            if (state.open_timer_status == true) {
-                stop_open_conut_down_time_type = '等待结果'
-            }
         }
     })
 }