shawenguan 1 рік тому
батько
коміт
749dbf5a46
1 змінених файлів з 12 додано та 2 видалено
  1. 12 2
      Scripts/imoutai/imoutaiHelper.js

+ 12 - 2
Scripts/imoutai/imoutaiHelper.js

@@ -165,7 +165,12 @@ async function tryReserve() {
         if (retLstData) {
             let ntfMsgTips = '';
             let reservationItemVOS = retLstData.reservationItemVOS;
-            let todayZeroTime = getTodayZeroTime() - 3600 * 24 * 1000;
+            let nowDate = new Date();
+            let todayZeroTime = getTodayZeroTime();
+            if (nowDate.getHours() < 12) {
+                todayZeroTime = todayZeroTime - 3600 * 24 * 1000;
+            }
+            let isExistSucc = false;
             for (let i = 0; i < reservationItemVOS.length; i++) {
                 const item = reservationItemVOS[i];
                 const reservationTime = item.reservationTime;
@@ -180,6 +185,7 @@ async function tryReserve() {
                             break;
                         case 2:
                             statusStr = '申请成功';
+                            isExistSucc = true;
                             break;
                         default:
                             statusStr = `未知状态(${item.status})`;
@@ -188,7 +194,11 @@ async function tryReserve() {
                 }
             }
             if (ntfMsgTips && ntfMsgTips.length > 0) {
-                magicJS.fastWxpusherSend(ntfMsgTips, 'i茅台申购结果');
+                if (isExistSucc) {
+                    magicJS.fastWxpusherSend(ntfMsgTips, 'i茅台申购成功');
+                } else {
+                    magicJS.fastWxpusherSend(ntfMsgTips, 'i茅台申购结果');
+                }
             }
         }
     }