project:强制覆盖代码,更新.gitignore文件内容
This commit is contained in:
+36
-27
@@ -109,7 +109,8 @@ class OrderMonitor {
|
||||
*/
|
||||
async checkOrderStatus(orderId) {
|
||||
try {
|
||||
common_vendor.index.__f__("log", "at utils/orderMonitor.js:137", `检查订单 ${orderId} 的状态`);
|
||||
const currentTime = /* @__PURE__ */ new Date();
|
||||
common_vendor.index.__f__("log", "at utils/orderMonitor.js:138", `检查订单 ${orderId} 的状态`);
|
||||
const result = await config_user.queryById(orderId);
|
||||
if (result.code === 200 && result.data) {
|
||||
const orderData = result.data;
|
||||
@@ -120,35 +121,43 @@ class OrderMonitor {
|
||||
pageName
|
||||
});
|
||||
if (orderData.orderStatus === "used_done" || orderData.orderStatus === "used_down") {
|
||||
common_vendor.index.__f__("log", "at utils/orderMonitor.js:153", `订单 ${orderId} 已完成!`);
|
||||
common_vendor.index.$emit("orderCompleted", orderData);
|
||||
common_vendor.index.showToast({
|
||||
title: "风扇归还成功",
|
||||
icon: "success",
|
||||
duration: 2e3
|
||||
});
|
||||
const innerAudioContext = common_vendor.index.createInnerAudioContext();
|
||||
innerAudioContext.src = "/static/audio/return_success.mp3";
|
||||
innerAudioContext.play();
|
||||
this.removeOrder({ orderId });
|
||||
setTimeout(() => {
|
||||
common_vendor.index.showModal({
|
||||
title: "归还成功",
|
||||
content: "风扇已归还成功,剩余押金将退还到您的账户",
|
||||
confirmText: "查看详情",
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
common_vendor.index.redirectTo({
|
||||
url: `/pages/order/return-success?orderId=${orderId}`
|
||||
});
|
||||
}
|
||||
}
|
||||
common_vendor.index.__f__("log", "at utils/orderMonitor.js:154", `订单 ${orderId} 已完成!`);
|
||||
let shouldNotify = true;
|
||||
if (orderData.endTime) {
|
||||
const endTime = new Date(orderData.endTime);
|
||||
const timeDiff = Math.abs(currentTime - endTime) / (1e3 * 60);
|
||||
if (timeDiff > 3) {
|
||||
common_vendor.index.__f__("log", "at utils/orderMonitor.js:165", `订单 ${orderId} 完成时间与当前时间相差${timeDiff.toFixed(2)}分钟,超过3分钟,不进行提醒`);
|
||||
shouldNotify = false;
|
||||
}
|
||||
}
|
||||
if (shouldNotify) {
|
||||
common_vendor.index.$emit("orderCompleted", orderData);
|
||||
common_vendor.index.showToast({
|
||||
title: "风扇归还成功",
|
||||
icon: "success",
|
||||
duration: 2e3
|
||||
});
|
||||
}, 500);
|
||||
setTimeout(() => {
|
||||
common_vendor.index.showModal({
|
||||
title: "归还成功",
|
||||
content: "风扇已归还成功,剩余押金将退还到您的账户",
|
||||
confirmText: "查看详情",
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
common_vendor.index.redirectTo({
|
||||
url: `/pages/order/return-success?orderId=${orderId}`
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}, 500);
|
||||
}
|
||||
this.removeOrder({ orderId });
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at utils/orderMonitor.js:192", `检查订单 ${orderId} 状态出错:`, error);
|
||||
common_vendor.index.__f__("error", "at utils/orderMonitor.js:209", `检查订单 ${orderId} 状态出错:`, error);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -158,7 +167,7 @@ common_vendor.index.onAppRoute((route) => {
|
||||
const pageSegments = pagePath.split("/");
|
||||
const pageName = pageSegments[pageSegments.length - 1];
|
||||
orderMonitor.setActivePage(pageName || null);
|
||||
common_vendor.index.__f__("log", "at utils/orderMonitor.js:209", "页面切换:", pagePath, "当前活跃页面:", pageName);
|
||||
common_vendor.index.__f__("log", "at utils/orderMonitor.js:226", "页面切换:", pagePath, "当前活跃页面:", pageName);
|
||||
});
|
||||
const initOrderMonitor = () => {
|
||||
const lastActiveOrderId = common_vendor.index.getStorageSync("activeOrderId");
|
||||
|
||||
Reference in New Issue
Block a user