更新 ele/auto-meal-complete.user.js

This commit is contained in:
502647092 2023-12-08 09:05:23 +00:00
parent fd4c405d20
commit 9b38968350

View File

@ -123,7 +123,8 @@
return mealComplete(cook, cookTime, '骑手未到店') return mealComplete(cook, cookTime, '骑手未到店')
} }
debug('订单 #' + daySn + ' 还剩 ' + leftTime + 's 上报超时 将于 ' debug('订单 #' + daySn + ' 还剩 ' + leftTime + 's 上报超时 将于 '
+ (leftTime - (deliveOnShop ? ele.autoSubmitLeftTimeWhenOnShop : ele.autoSubmitLeftTime)) + 's 后自动上报.') + (Math.max(cook.mealPreparationInfo.minMealCompleteTimeCount,
leftTime - (deliveOnShop ? ele.autoSubmitLeftTimeWhenOnShop : ele.autoSubmitLeftTime))) + 's 后自动上报.')
cook.mealPreparationInfo.minMealCompleteTimeCount -= 5 cook.mealPreparationInfo.minMealCompleteTimeCount -= 5
cook.mealPreparationInfo.commonShowTime -= 5 cook.mealPreparationInfo.commonShowTime -= 5
} }
@ -158,6 +159,7 @@
${ele.processOrders.length ${ele.processOrders.length
? ele.processOrders.map(o => ' 订单: #' + o.header.daySn ? ele.processOrders.map(o => ' 订单: #' + o.header.daySn
+ ' 出餐状态 ' + (o.mealPreparationInfo.mealComplete ? '已出餐' : '未出餐') + ' 出餐状态 ' + (o.mealPreparationInfo.mealComplete ? '已出餐' : '未出餐')
+ (o.mealPreparationInfo.minMealCompleteTimeCount > 0 ? `(${o.mealPreparationInfo.minMealCompleteTimeCount}s)` : '')
+ ' 配送状态 ' + o.deliveryInfo.distTraceView.traceView.status + '' + ' 配送状态 ' + o.deliveryInfo.distTraceView.traceView.status + ''
+ (o.deliveryInfo.deliveryDistance ? ' ' + o.deliveryInfo.deliveryDistance : '')).join('</br>') + (o.deliveryInfo.deliveryDistance ? ' ' + o.deliveryInfo.deliveryDistance : '')).join('</br>')
: '当前没有进行中的订单.'} : '当前没有进行中的订单.'}
@ -189,21 +191,19 @@
} }
} }
async function scheduleCheck() { async function scheduleCheck() {
await sleep(ele.checkInterval * 1000)
await checkCooking() await checkCooking()
scheduleCheck() await sleep(ele.checkInterval * 1000)
}
async function scheduleSync() {
await sleep(ele.syncInterval * 1000)
await syncOrders()
scheduleCheck() scheduleCheck()
} }
async function main() { async function main() {
setTimeout(async () => { while (!document.getElementById('app-container-notice-bar')) {
await sleep(300)
}
window.appContainerNoticeBar = document.getElementById('app-container-notice-bar') window.appContainerNoticeBar = document.getElementById('app-container-notice-bar')
await scheduleSync() debug('页面注入成功 开始运行...')
await scheduleCheck() syncOrders()
}, 3000) scheduleCheck()
setInterval(() => syncOrders(), ele.syncInterval * 1000)
} }
var SubmitOrdersKey = 'AutoMealComplete:SubmitOrders' var SubmitOrdersKey = 'AutoMealComplete:SubmitOrders'
var ele = { var ele = {