shawenguan 1 سال پیش
والد
کامیت
5f9aefa421
1فایلهای تغییر یافته به همراه14 افزوده شده و 11 حذف شده
  1. 14 11
      Scripts/imoutai/imoutaiHelper.js

+ 14 - 11
Scripts/imoutai/imoutaiHelper.js

@@ -165,11 +165,11 @@ async function tryReserve() {
         if (retLstData) {
             let ntfMsgTips = '';
             let reservationItemVOS = retLstData.reservationItemVOS;
-            let nowTime = getTodayZeroTime();
+            let todayZeroTime = getTodayZeroTime() - 3600 * 24 * 1000;
             for (let i = 0; i < reservationItemVOS.length; i++) {
                 const item = reservationItemVOS[i];
                 const reservationTime = item.reservationTime;
-                if (reservationTime > nowTime) {
+                if (reservationTime > todayZeroTime) {
                     let statusStr = '';
                     switch (item.status) {
                         case 0:
@@ -178,6 +178,9 @@ async function tryReserve() {
                         case 1:
                             statusStr = '申请失败';
                             break;
+                        case 2:
+                            statusStr = '申请成功';
+                            break;
                         default:
                             statusStr = `未知状态(${item.status})`;
                     }
@@ -344,13 +347,13 @@ function handleReservationList() {
     if (headers['MT-V']) {
         magicJS.data.write('lkMT-V', headers['MT-V']);
     }
-    let data = rspParams.data;
-    let reservationItemVOS = data.reservationItemVOS;
-    for (let i = 0; i < reservationItemVOS.length; i++) {
-        const item = reservationItemVOS[i];
-        item.status = 2;
-    }
-    gRetBody = rspParams;
+    // let data = rspParams.data;
+    // let reservationItemVOS = data.reservationItemVOS;
+    // for (let i = 0; i < reservationItemVOS.length; i++) {
+    //     const item = reservationItemVOS[i];
+    //     item.status = 2;
+    // }
+    // gRetBody = rspParams;
 }
 
 function getUserData() {
@@ -980,7 +983,7 @@ async function getUserEnergyAward(tokenWap, deviceId) {
 
 async function getReservationList(token, tokenWap, deviceId) {
     const mtK = `${new Date().getTime()}`;
-    const mtV = await getMtv(deviceId, G_MT_VERSION);
+    let mtV = await getMtv(deviceId, G_MT_VERSION);
     if (!mtV) {
         mtV = magicJS.data.read('lkMT-V', '');
     }
@@ -1054,7 +1057,7 @@ function signature(data, timestamp) {
 
 async function login(phone, vCode, deviceId) {
     const mtK = `${new Date().getTime()}`;
-    const mtV = await getMtv(deviceId, G_MT_VERSION);
+    let mtV = await getMtv(deviceId, G_MT_VERSION);
     if (!mtV) {
         mtV = magicJS.data.read('lkMT-V', '');
     }