From e8e8790c3e959324e67365fe62c9b57458ef8d92 Mon Sep 17 00:00:00 2001 From: 502647092 Date: Wed, 6 Dec 2023 02:02:14 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20ele/auto-meal-complete.use?= =?UTF-8?q?r.js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ele/auto-meal-complete.user.js | 83 +++++++++++++++++++--------------- 1 file changed, 47 insertions(+), 36 deletions(-) diff --git a/ele/auto-meal-complete.user.js b/ele/auto-meal-complete.user.js index 04aeaf8..77d1b6a 100644 --- a/ele/auto-meal-complete.user.js +++ b/ele/auto-meal-complete.user.js @@ -113,8 +113,8 @@ return mealComplete(cook, cookTime, '骑手到店出餐') } if (leftTime < ele.autoSubmitLeftTime) { - // 大于最小上报时长 并且距离上报超时不足120秒 直接上报出餐 - debug('订单 #' + daySn + ' 骑手未到店 订单剩余时间 ' + leftTime + 's 小于 ' + ele.autoSubmitLeftTimeWhenOnShop + 's 模拟提交出餐.') + // 大于最小上报时长 并且距离上报超时不足 直接上报出餐 + debug('订单 #' + daySn + ' 骑手未到店 订单剩余时间 ' + leftTime + 's 小于 ' + ele.autoSubmitLeftTime + 's 模拟提交出餐.') return mealComplete(cook, cookTime, '骑手未到店出餐') } debug('订单 #' + daySn + ' 还剩 ' + cook.mealPreparationInfo.commonShowTime + 's 上报超时.') @@ -133,37 +133,51 @@ if (ele.logs.length > ele.maxLogLength) { ele.logs = ele.logs.slice(ele.logs.length - ele.maxLogLength) } - let title = '饿了么自动出餐 By MiaoWoo
' - let configInfo = '当前配置:
' - + '骑手到店 提前 ' + ele.autoSubmitLeftTimeWhenOnShop + 's 出餐 ' - + '骑手未到店 提前 ' + ele.autoSubmitLeftTime + 's 出餐
' - + '
' - let submitInfo = '已自动出餐的订单信息:
' - + (ele.submitOrders.length - ? ele.submitOrders.map(o => '[' + o.completeTime + '] 订单: #' + o.daySn - + ' 出餐用时 ' + convertSecondsToMinutesSeconds(o.cookTime) + ' ' + o.tip).join('
') - : '当前没有自动出餐的订单.') - + '
' - let orderInfo = '进行中的订单信息:
' - + (ele.processOrders.length + let title = '饿了么自动出餐 By MiaoWoo' + let configInfo = `当前配置:
+
+ 骑手到店 提前 ${ele.autoSubmitLeftTimeWhenOnShop}s 出餐 + 骑手未到店 提前 ${ele.autoSubmitLeftTime}s 出餐
+
` + let submitInfo = `已自动出餐的订单信息:
+
+ ${ele.submitOrders.length + ? ele.submitOrders + .map(o => '[' + o.completeTime + '] 订单: #' + o.daySn + + ' 出餐用时 ' + convertSecondsToMinutesSeconds(o.cookTime) + ' ' + o.tip).join('
') + : '当前没有自动出餐的订单.'} +
` + let orderInfo = `进行中的订单信息:
+
+ ${ele.processOrders.length ? ele.processOrders.map(o => ' 订单: #' + o.header.daySn + ' 出餐状态 ' + (o.mealPreparationInfo.mealComplete ? '已出餐' : '未出餐') + ' 配送状态 ' + o.deliveryInfo.distTraceView.traceView.status + '' + (o.deliveryInfo.deliveryDistance ? ' ' + o.deliveryInfo.deliveryDistance : '')).join('
') - : '当前没有进行中的订单.') - + '
' - let logs = '运行日志:
' - + ele.logs.join('
') - + '
' - window.appContainerNoticeBar.innerHTML = '
' - + title + '
' - + configInfo + '
' - + submitInfo + '
' - + orderInfo + '
' - + '
' - + '
' - + logs - + '
' + : '当前没有进行中的订单.'} +
` + let logs = `运行日志:
+
+ ${ele.logs.join('
')} +
` + window.appContainerNoticeBar.innerHTML = ` +
+
+ ${title} +
+ ${configInfo} +
+
+ ${orderInfo} +
+
+
+ ${submitInfo} +
+
+ ${logs} +
+
` } catch (error) { console.log(msg) } @@ -171,9 +185,6 @@ async function main() { setTimeout(() => { window.appContainerNoticeBar = document.getElementById('app-container-notice-bar') - window.appContainerNoticeBar.style.marginLeft = '35px' - window.appContainerNoticeBar.style.marginTop = '20px' - window.appContainerNoticeBar.style.display = 'flex' updateOrders() }, 5000) setInterval(() => { checkCooking() }, 5000) @@ -182,14 +193,14 @@ var SubmitOrdersKey = 'AutoMealComplete:SubmitOrders' var ele = { logs: [], - maxLogLength: 15, - maxLogOrderLength: 5, + maxLogLength: 20, + maxLogOrderLength: 20, orderStatus: {}, processOrders: [], submitOrders: JSON.parse(localStorage.getItem(SubmitOrdersKey)), autoCheckTask: undefined, - autoSubmitLeftTime: 180, - autoSubmitLeftTimeWhenOnShop: 300, + autoSubmitLeftTime: 200, + autoSubmitLeftTimeWhenOnShop: 320, debug: debug, updateOrders: updateOrders, checkCooking: checkCooking,