shawenguan 2 лет назад
Родитель
Сommit
50c94690e9
1 измененных файлов с 44 добавлено и 34 удалено
  1. 44 34
      Scripts/thwj/thwjHelper.js

+ 44 - 34
Scripts/thwj/thwjHelper.js

@@ -132,51 +132,61 @@ function getAllUserList() {
 
 async function checkTryExploreAll() {
     let userLst = getAllUserList();
+    let succCnt = 0;
     for (let info of userLst) {
-        let isSucc = await checkLogin(info);
+        let isSucc = await checkExplore(info);
+        if (isSucc) {
+            succCnt++;
+        }
         break;
     }
 }
 
-async function checkLogin(accountData) {
+async function checkExplore(accountData) {
     let phone = accountData.phone;
     let password = accountData.password;
     lk.log(`开始登录搜索检查:${phone}----${password}`);
 
     let userInfo = getPrivData(phone, 'UserData');
     let isSucc = false;
-    await loadIndex();
-    // if (userInfo.phone && userInfo.password && userInfo.token) {
-    //     let isNeddExplore = await checkNeedExplore(userInfo.phone, userInfo.password, userInfo.token);
-    //     if (isNeddExplore) {
-    //         let exploreData = await doExplore(userInfo.phone, userInfo.password, userInfo.token);
-    //         if (exploreData) {
-    //             isSucc = true;
-    //         }
-    //     } else {
-    //         lk.log(`已在探索中...`);
-    //     }
-    // } else {
-    //     let tryCount = 10;
-    //     for (let i = 0; i < tryCount; i++) {
-    //         let codeStr = await checkGetVerifyCodeImgNum();
-    //         if (codeStr) {
-    //             lk.log(`尝试第${i + 1}次...`);
-    //             userInfo = await doLogin(phone, password, codeStr);
-    //             if (userInfo) {
-    //                 let isNeddExplore = await checkNeedExplore(userInfo.phone, userInfo.password, userInfo.token);
-    //                 if (isNeddExplore) {
-    //                     let exploreData = await doExplore(userInfo.phone, userInfo.password, userInfo.token);
-    //                     if (exploreData) {
-    //                         isSucc = true;
-    //                     }
-    //                 }
-    //                 break;
-    //             } else {
-    //             }
-    //         }
-    //     }
-    // }
+    // await loadIndex();
+    if (userInfo.phone && userInfo.password && userInfo.token) {
+        let isNeddExplore = await checkNeedExplore(userInfo.phone, userInfo.password, userInfo.token);
+        if (isNeddExplore) {
+            let exploreData = await doExplore(userInfo.phone, userInfo.password, userInfo.token);
+            if (exploreData) {
+                isSucc = true;
+            }
+        } else {
+            lk.log(`已在探索中...`);
+        }
+    } else {
+        let tryCount = 10;
+        for (let i = 0; i < tryCount; i++) {
+            let codeStr = await checkGetVerifyCodeImgNum();
+            if (codeStr) {
+                lk.log(`尝试第${i + 1}次...`);
+                userInfo = await doLogin(phone, password, codeStr);
+                if (userInfo) {
+                    let isNeddExplore = await checkNeedExplore(userInfo.phone, userInfo.password, userInfo.token);
+                    if (isNeddExplore) {
+                        let exploreData = await doExplore(userInfo.phone, userInfo.password, userInfo.token);
+                        if (exploreData) {
+                            isSucc = true;
+                        }
+                    } else {
+                        let orderData = data.paradrop_order_data;
+                        if (orderData && orderData.start_time && orderData.end_time) {
+                            let stimeStr = lk.formatDate(new Date(orderData.start_time), "yyyy-MM-dd hh:mm:ss");
+                            let etimeStr = lk.formatDate(new Date(orderData.end_time), "yyyy-MM-dd hh:mm:ss");
+                            lk.log(`此时间${stimeStr}-${etimeStr}探索中`);
+                        }
+                    }
+                    break;
+                }
+            }
+        }
+    }
     return isSucc;
 }