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

This commit is contained in:
502647092 2023-12-06 05:45:55 +00:00
parent 042fa4c040
commit a73e863fe7

View File

@ -107,17 +107,20 @@
let cookTime = (Date.now() - new Date(cook.activeTime).getTime()) / 1000 let cookTime = (Date.now() - new Date(cook.activeTime).getTime()) / 1000
let leftTime = cook.mealPreparationInfo.commonShowTime let leftTime = cook.mealPreparationInfo.commonShowTime
let deliveOnShop = cook.deliveryInfo.distTraceView.traceView.status == '骑士已到店' let deliveOnShop = cook.deliveryInfo.distTraceView.traceView.status == '骑士已到店'
|| (cook.deliveryInfo.deliveryDistance
&& cook.deliveryInfo.deliveryDistance.endsWith('m')
&& parseInt(cook.deliveryInfo.deliveryDistance) < 100)
if (deliveOnShop && cook.mealPreparationInfo.minMealCompleteTimeCount < 0 if (deliveOnShop && cook.mealPreparationInfo.minMealCompleteTimeCount < 0
&& leftTime < ele.autoSubmitLeftTimeWhenOnShop) { && leftTime < ele.autoSubmitLeftTimeWhenOnShop) {
debug('订单 #' + daySn + ' 骑手已到店.') debug('订单 #' + daySn + ' 骑手已到店.')
debug('订单 #' + daySn + ' 剩余出餐时间 ' + leftTime + 's 小于 ' + ele.autoSubmitLeftTimeWhenOnShop + 's 模拟提交出餐.') debug('订单 #' + daySn + ' 剩余出餐时间 ' + leftTime + 's 小于 ' + ele.autoSubmitLeftTimeWhenOnShop + 's 模拟提交出餐.')
return mealComplete(cook, cookTime, '骑手到店出餐') return mealComplete(cook, cookTime, '骑手到店')
} }
if (leftTime < ele.autoSubmitLeftTime) { if (leftTime < ele.autoSubmitLeftTime) {
// 大于最小上报时长 并且距离上报超时不足 直接上报出餐 // 大于最小上报时长 并且距离上报超时不足 直接上报出餐
debug('订单 #' + daySn + ' 骑手未到店.') debug('订单 #' + daySn + ' 骑手未到店.')
debug('订单 #' + daySn + ' 剩余出餐时间 ' + leftTime + 's 小于 ' + ele.autoSubmitLeftTime + 's 模拟提交出餐.') debug('订单 #' + daySn + ' 剩余出餐时间 ' + leftTime + 's 小于 ' + ele.autoSubmitLeftTime + 's 模拟提交出餐.')
return mealComplete(cook, cookTime, '骑手未到店出餐') return mealComplete(cook, cookTime, '骑手未到店')
} }
debug('订单 #' + daySn + ' 还剩 ' + leftTime + 's 上报超时 将于 ' debug('订单 #' + daySn + ' 还剩 ' + leftTime + 's 上报超时 将于 '
+ (leftTime - (deliveOnShop ? ele.autoSubmitLeftTimeWhenOnShop : ele.autoSubmitLeftTime)) + 's 后自动上报.') + (leftTime - (deliveOnShop ? ele.autoSubmitLeftTimeWhenOnShop : ele.autoSubmitLeftTime)) + 's 后自动上报.')