feat:
取消了订单轮询 更新押金提现及订单查询功能 归还成功之后不会有归还成功的弹窗出现 提现的判断目前判断押金状态和订单状态 修改了提现API的参数名称,从订单ID更改为订单号,并新增了根据设备号和状态查询订单列表的功能。同时,优化了用户在提现过程中的错误提示,确保用户能够获得更清晰的反馈。更新了多个页面的逻辑,提升了整体用户体验。
This commit is contained in:
+1
-1
@@ -6876,7 +6876,7 @@ function initOnError() {
|
||||
function initRuntimeSocketService() {
|
||||
const hosts = "10.8.0.5,192.168.1.15,127.0.0.1";
|
||||
const port = "8090";
|
||||
const id = "mp-weixin_hczUPf";
|
||||
const id = "mp-weixin_V-Usyu";
|
||||
const lazy = typeof swan !== "undefined";
|
||||
let restoreError = lazy ? () => {
|
||||
} : initOnError();
|
||||
|
||||
+20
-9
@@ -15,10 +15,10 @@ const getMyIndexInfo = (data) => {
|
||||
data
|
||||
});
|
||||
};
|
||||
const withdrawDeposit = (orderId) => {
|
||||
common_vendor.index.__f__("log", "at config/user.js:23", "调用提现API,订单ID:", orderId);
|
||||
const withdrawDeposit = (orderNo) => {
|
||||
common_vendor.index.__f__("log", "at config/user.js:23", "调用提现API,订单号:", orderNo);
|
||||
return config_http.request({
|
||||
url: `/app/withdraw/add/${orderId}`,
|
||||
url: `/app/withdraw/add/${orderNo}`,
|
||||
method: "get",
|
||||
hideLoading: true
|
||||
});
|
||||
@@ -31,10 +31,13 @@ const getOrderList = (data) => {
|
||||
hideLoading: true
|
||||
});
|
||||
};
|
||||
const queryHasOrder = (deviceNo) => {
|
||||
const checkOrdersByStatus = (deviceNo, statuses) => {
|
||||
const statusQuery = statuses.join(",");
|
||||
return config_http.request({
|
||||
url: `/app/order/list?deviceNo=${deviceNo}&orderStatus=in_used`,
|
||||
method: "get"
|
||||
url: `/app/order/list?deviceNo=${deviceNo}&orderStatus=${statusQuery}`,
|
||||
method: "get",
|
||||
hideLoading: true
|
||||
// 隐藏加载提示,避免干扰用户
|
||||
});
|
||||
};
|
||||
const getDeviceInfo = (deviceNo) => {
|
||||
@@ -44,7 +47,6 @@ const getDeviceInfo = (deviceNo) => {
|
||||
});
|
||||
};
|
||||
const queryById = (id) => {
|
||||
common_vendor.index.__f__("log", "at config/user.js:69", `查询订单详情, orderId: ${id}`);
|
||||
return config_http.request({
|
||||
url: `/app/order/${id}`,
|
||||
method: "get",
|
||||
@@ -59,19 +61,28 @@ const rentPowerBank = (deviceNo, phone) => {
|
||||
});
|
||||
};
|
||||
const confirmPaymentAndRent = (orderId) => {
|
||||
common_vendor.index.__f__("log", "at config/user.js:108", `确认支付并弹出充电宝, orderId: ${orderId}`);
|
||||
common_vendor.index.__f__("log", "at config/user.js:118", `确认支付并弹出充电宝, orderId: ${orderId}`);
|
||||
return config_http.request({
|
||||
url: `/app/device/confirmPaymentAndRent?orderId=${orderId}`,
|
||||
method: "post"
|
||||
});
|
||||
};
|
||||
const updateOrderPackage = (data) => {
|
||||
common_vendor.index.__f__("log", "at config/user.js:157", "更新订单套餐信息:", data);
|
||||
return config_http.request({
|
||||
url: "/app/device/updateOrderPackage",
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
};
|
||||
exports.checkOrdersByStatus = checkOrdersByStatus;
|
||||
exports.confirmPaymentAndRent = confirmPaymentAndRent;
|
||||
exports.getDeviceInfo = getDeviceInfo;
|
||||
exports.getMyIndexInfo = getMyIndexInfo;
|
||||
exports.getOrderList = getOrderList;
|
||||
exports.login = login;
|
||||
exports.queryById = queryById;
|
||||
exports.queryHasOrder = queryHasOrder;
|
||||
exports.rentPowerBank = rentPowerBank;
|
||||
exports.updateOrderPackage = updateOrderPackage;
|
||||
exports.withdrawDeposit = withdrawDeposit;
|
||||
//# sourceMappingURL=../../.sourcemap/mp-weixin/config/user.js.map
|
||||
|
||||
+30
-38
@@ -8,8 +8,7 @@ const _sfc_main = {
|
||||
depositAmount: "0.00",
|
||||
orderNo: "",
|
||||
records: [],
|
||||
orderId: "",
|
||||
isLoading: false
|
||||
orderId: ""
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
@@ -20,28 +19,13 @@ const _sfc_main = {
|
||||
methods: {
|
||||
async loadUserInfo() {
|
||||
try {
|
||||
this.isLoading = true;
|
||||
const res = await util_index.getUserInfo();
|
||||
common_vendor.index.__f__("log", "at pages/deposit/index.vue:66", "loadUserInfo", res);
|
||||
common_vendor.index.__f__("log", "at pages/deposit/index.vue:64", "loadUserInfo", res);
|
||||
if (res.code === 200) {
|
||||
this.depositAmount = res.data.balanceAmount || "0.00";
|
||||
this.orderNo = res.data.latestOrderNo || "";
|
||||
this.orderId = res.data.latestOrderId || "";
|
||||
if (parseFloat(this.depositAmount) > 0 && !this.orderId) {
|
||||
common_vendor.index.__f__("log", "at pages/deposit/index.vue:74", "没有latestOrderId但有余额,尝试查询订单列表");
|
||||
const orderRes = await config_user.getOrderList({ pageNum: 1, pageSize: 10 });
|
||||
if (orderRes.code === 200 && orderRes.data && orderRes.data.records && orderRes.data.records.length > 0) {
|
||||
const depositOrder = orderRes.data.records.find(
|
||||
(order) => order.depositAmount && parseFloat(order.depositAmount) > 0
|
||||
);
|
||||
if (depositOrder) {
|
||||
common_vendor.index.__f__("log", "at pages/deposit/index.vue:83", "找到押金订单:", depositOrder);
|
||||
this.orderId = depositOrder.orderId;
|
||||
this.orderNo = depositOrder.orderNo;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (parseFloat(this.depositAmount) > 0) {
|
||||
if (parseFloat(this.depositAmount) > 0 && this.orderNo) {
|
||||
this.records = [
|
||||
{
|
||||
type: "支付",
|
||||
@@ -54,13 +38,11 @@ const _sfc_main = {
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/deposit/index.vue:104", "获取用户信息失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/deposit/index.vue:84", "获取用户信息失败:", error);
|
||||
common_vendor.index.showToast({
|
||||
title: "获取用户信息失败",
|
||||
icon: "none"
|
||||
});
|
||||
} finally {
|
||||
this.isLoading = false;
|
||||
}
|
||||
},
|
||||
async handleWithdraw() {
|
||||
@@ -71,25 +53,20 @@ const _sfc_main = {
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!this.orderId) {
|
||||
common_vendor.index.showToast({
|
||||
title: "无法找到押金订单",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
const res = await config_user.queryById(Number(this.orderNo));
|
||||
common_vendor.index.__f__("log", "at pages/deposit/index.vue:100", res);
|
||||
common_vendor.index.showModal({
|
||||
title: "确认提现",
|
||||
content: "押金将原路退回,预计0-7个工作日到账",
|
||||
success: async (res) => {
|
||||
if (res.confirm) {
|
||||
success: async (res2) => {
|
||||
if (res2.confirm) {
|
||||
common_vendor.index.showLoading({
|
||||
title: "提现中..."
|
||||
});
|
||||
try {
|
||||
common_vendor.index.__f__("log", "at pages/deposit/index.vue:140", "发起提现请求,订单ID:", this.orderId);
|
||||
const result = await config_user.withdrawDeposit(this.orderId);
|
||||
common_vendor.index.__f__("log", "at pages/deposit/index.vue:142", "提现响应:", result);
|
||||
common_vendor.index.__f__("log", "at pages/deposit/index.vue:119", "发起提现请求,订单号:", this.orderNo);
|
||||
const result = await config_user.withdrawDeposit(this.orderNo);
|
||||
common_vendor.index.__f__("log", "at pages/deposit/index.vue:121", "提现响应:", result);
|
||||
if (result.code === 200) {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.showToast({
|
||||
@@ -109,11 +86,26 @@ const _sfc_main = {
|
||||
throw new Error(result.msg || "提现失败");
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/deposit/index.vue:167", "提现失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/deposit/index.vue:146", "提现失败:", error);
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.showToast({
|
||||
title: error.message || "提现失败,请稍后再试",
|
||||
icon: "none"
|
||||
let errorMessage = "提现失败,请稍后再试";
|
||||
if (error.message) {
|
||||
if (error.message.includes("尚未归还")) {
|
||||
errorMessage = "当前订单尚未归还,请归还后再提现";
|
||||
} else if (error.message.includes("已退还")) {
|
||||
errorMessage = "押金已退还,无需重复提现";
|
||||
} else if (error.message.includes("处理中")) {
|
||||
errorMessage = "押金退还处理中,请耐心等待";
|
||||
} else if (error.message.includes("余额为0")) {
|
||||
errorMessage = "账户余额为0,无法提现";
|
||||
} else {
|
||||
errorMessage = error.message;
|
||||
}
|
||||
}
|
||||
common_vendor.index.showModal({
|
||||
title: "提现失败",
|
||||
content: errorMessage,
|
||||
showCancel: false
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
+38
-5
@@ -37,7 +37,8 @@ const _sfc_main = {
|
||||
},
|
||||
onLoad(options) {
|
||||
this.deviceId = options.deviceNo;
|
||||
common_vendor.index.__f__("log", "at pages/device/detail.vue:126", options.deviceNo);
|
||||
this.checkOrderStatus();
|
||||
common_vendor.index.__f__("log", "at pages/device/detail.vue:128", options.deviceNo);
|
||||
this.getDeviceInfo();
|
||||
},
|
||||
methods: {
|
||||
@@ -71,9 +72,16 @@ const _sfc_main = {
|
||||
try {
|
||||
const result = await this.$api.checkActiveOrder();
|
||||
if (result.hasOrder) {
|
||||
common_vendor.index.redirectTo({
|
||||
url: `/pages/device/return?deviceId=${this.deviceId}`
|
||||
});
|
||||
const order = result.order;
|
||||
if (order.status === "waiting_for_payment") {
|
||||
common_vendor.index.redirectTo({
|
||||
url: `/pages/order/payment?orderId=${order.orderId}&deviceId=${this.deviceId}`
|
||||
});
|
||||
} else if (order.status === "in_used") {
|
||||
common_vendor.index.redirectTo({
|
||||
url: `/pages/device/return?deviceId=${this.deviceId}`
|
||||
});
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.showToast({
|
||||
@@ -125,9 +133,34 @@ const _sfc_main = {
|
||||
throw new Error(rentResult.msg || "设备租借失败");
|
||||
}
|
||||
const order = rentResult.data;
|
||||
try {
|
||||
let packageTimeMinutes = 0;
|
||||
if (selectedPkg.time.includes("小时")) {
|
||||
packageTimeMinutes = parseInt(selectedPkg.time) * 60;
|
||||
} else if (selectedPkg.time.includes("分钟")) {
|
||||
packageTimeMinutes = parseInt(selectedPkg.time);
|
||||
} else {
|
||||
packageTimeMinutes = parseInt(selectedPkg.time) * 60;
|
||||
}
|
||||
const updateRes = await config_user.updateOrderPackage({
|
||||
orderId: order.orderId,
|
||||
packageTime: packageTimeMinutes,
|
||||
packagePrice: parseFloat(selectedPkg.price)
|
||||
});
|
||||
if (updateRes.code !== 200) {
|
||||
common_vendor.index.__f__("warn", "at pages/device/detail.vue:265", "更新订单套餐信息失败:", updateRes.msg);
|
||||
} else {
|
||||
common_vendor.index.__f__("log", "at pages/device/detail.vue:268", "订单套餐信息已提前更新");
|
||||
}
|
||||
} catch (updateError) {
|
||||
common_vendor.index.__f__("error", "at pages/device/detail.vue:271", "更新订单套餐信息时出错:", updateError);
|
||||
}
|
||||
const deposit = 99;
|
||||
const packagePrice = parseFloat(selectedPkg.price);
|
||||
const totalAmount = (deposit + packagePrice).toFixed(2);
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.redirectTo({
|
||||
url: `/pages/order/payment?orderId=${order.orderId}&packageTime=${selectedPkg.time}&packagePrice=${selectedPkg.price}`
|
||||
url: `/pages/order/payment?orderId=${order.orderId}&packageTime=${selectedPkg.time}&packagePrice=${selectedPkg.price}&totalAmount=${totalAmount}`
|
||||
});
|
||||
} catch (error) {
|
||||
common_vendor.index.hideLoading();
|
||||
|
||||
+45
-52
@@ -11,6 +11,8 @@ const _sfc_main = {
|
||||
time: "",
|
||||
price: "0.00"
|
||||
},
|
||||
passedTotalAmount: null,
|
||||
passedDepositAmount: null,
|
||||
orderStatus: {
|
||||
text: "等待支付",
|
||||
desc: "请在15分钟内完成支付",
|
||||
@@ -20,6 +22,9 @@ const _sfc_main = {
|
||||
},
|
||||
computed: {
|
||||
totalAmount() {
|
||||
if (this.passedTotalAmount !== null) {
|
||||
return parseFloat(this.passedTotalAmount).toFixed(2);
|
||||
}
|
||||
const deposit = parseFloat(this.orderInfo.deposit || 99);
|
||||
const amount = parseFloat(this.orderInfo.amount || this.packageInfo.price || 0);
|
||||
return (deposit + amount).toFixed(2);
|
||||
@@ -34,6 +39,12 @@ const _sfc_main = {
|
||||
price: options.packagePrice
|
||||
};
|
||||
}
|
||||
if (options.totalAmount) {
|
||||
this.passedTotalAmount = options.totalAmount;
|
||||
}
|
||||
if (options.depositAmount) {
|
||||
this.passedDepositAmount = options.depositAmount;
|
||||
}
|
||||
this.loadOrderInfo();
|
||||
} else {
|
||||
common_vendor.index.showToast({
|
||||
@@ -65,7 +76,6 @@ const _sfc_main = {
|
||||
formattedTime = this.formatTime(/* @__PURE__ */ new Date());
|
||||
}
|
||||
} catch (e) {
|
||||
common_vendor.index.__f__("error", "at pages/order/payment.vue:143", "时间格式化错误:", e);
|
||||
formattedTime = this.formatTime(/* @__PURE__ */ new Date());
|
||||
}
|
||||
this.orderInfo = {
|
||||
@@ -73,13 +83,13 @@ const _sfc_main = {
|
||||
deviceNo: orderData.deviceNo,
|
||||
createTime: formattedTime,
|
||||
phone: orderData.phone,
|
||||
deposit: "99.00",
|
||||
// 假设押金固定为99元
|
||||
amount: orderData.amount || this.packageInfo.price || "0.00"
|
||||
deposit: this.passedDepositAmount || orderData.depositAmount || "99.00",
|
||||
amount: orderData.packagePrice || this.packageInfo.price || "0.00"
|
||||
};
|
||||
if (!orderData.packageTime && this.packageInfo.time) {
|
||||
this.orderInfo.packageTime = this.packageInfo.time;
|
||||
this.orderInfo.packagePrice = this.packageInfo.price;
|
||||
if (orderData.packageTime) {
|
||||
this.packageInfo.time = `${orderData.packageTime / 60}小时`;
|
||||
this.packageInfo.price = orderData.packagePrice || "0.00";
|
||||
} else if (this.packageInfo.time) {
|
||||
}
|
||||
} else {
|
||||
throw new Error("获取订单信息失败");
|
||||
@@ -111,11 +121,18 @@ const _sfc_main = {
|
||||
const payParams = res.data.data;
|
||||
await common_vendor.index.requestPayment({
|
||||
...payParams,
|
||||
success: () => {
|
||||
this.pollOrderStatus();
|
||||
success: async () => {
|
||||
common_vendor.index.showToast({
|
||||
title: "支付成功",
|
||||
icon: "success"
|
||||
});
|
||||
setTimeout(() => {
|
||||
common_vendor.index.redirectTo({
|
||||
url: `/pages/order/index?orderId=${this.orderId}`
|
||||
});
|
||||
}, 1500);
|
||||
},
|
||||
fail: (err) => {
|
||||
common_vendor.index.__f__("error", "at pages/order/payment.vue:203", "支付失败:", err);
|
||||
throw new Error("支付失败,请重试");
|
||||
}
|
||||
});
|
||||
@@ -195,50 +212,26 @@ const _sfc_main = {
|
||||
const minute = date.getMinutes().toString().padStart(2, "0");
|
||||
return `${year}-${month}-${day} ${hour}:${minute}`;
|
||||
},
|
||||
// 轮询订单状态
|
||||
async pollOrderStatus() {
|
||||
let retryCount = 0;
|
||||
const maxRetries = 10;
|
||||
const interval = 1e3;
|
||||
const checkStatus = async () => {
|
||||
try {
|
||||
const res = await common_vendor.index.request({
|
||||
url: `${config_url.URL || "http://127.0.0.1:8080"}/app/wx-payment/status/${this.orderInfo.orderNo}`,
|
||||
method: "GET",
|
||||
header: {
|
||||
"Authorization": "Bearer " + common_vendor.index.getStorageSync("token"),
|
||||
"Clientid": common_vendor.index.getStorageSync("client_id")
|
||||
}
|
||||
});
|
||||
if (res.statusCode === 200 && res.data.code === 200) {
|
||||
const orderData = res.data.data;
|
||||
if (orderData.orderStatus === "in_used") {
|
||||
common_vendor.index.showToast({
|
||||
title: "支付成功",
|
||||
icon: "success"
|
||||
});
|
||||
setTimeout(() => {
|
||||
common_vendor.index.redirectTo({
|
||||
url: `/pages/order/index?orderId=${this.orderId}`
|
||||
});
|
||||
}, 1500);
|
||||
return;
|
||||
}
|
||||
// 检查订单状态(单次查询,不轮询)
|
||||
async checkOrderStatus() {
|
||||
try {
|
||||
const res = await common_vendor.index.request({
|
||||
url: `${config_url.URL || "http://127.0.0.1:8080"}/app/wx-payment/status/${this.orderInfo.orderNo}`,
|
||||
method: "GET",
|
||||
header: {
|
||||
"Authorization": "Bearer " + common_vendor.index.getStorageSync("token"),
|
||||
"Clientid": common_vendor.index.getStorageSync("client_id")
|
||||
}
|
||||
if (retryCount < maxRetries) {
|
||||
retryCount++;
|
||||
setTimeout(checkStatus, interval);
|
||||
} else {
|
||||
throw new Error("订单状态查询超时");
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.showToast({
|
||||
title: error.message || "查询订单状态失败",
|
||||
icon: "none"
|
||||
});
|
||||
});
|
||||
if (res.statusCode === 200 && res.data.code === 200) {
|
||||
return res.data.data;
|
||||
} else {
|
||||
throw new Error("查询订单状态失败");
|
||||
}
|
||||
};
|
||||
checkStatus();
|
||||
} catch (error) {
|
||||
common_vendor.index.__f__("error", "at pages/order/payment.vue:332", "查询订单状态错误:", error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
+47
-23
@@ -1,45 +1,69 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../../common/vendor.js");
|
||||
const util_index = require("../../../util/index.js");
|
||||
const config_user = require("../../../config/user.js");
|
||||
const _sfc_main = {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
async onLoad(option) {
|
||||
common_vendor.index.__f__("log", "at pages/serve/bagCheck/index.vue:29", "bagCheck onLoad option:", option);
|
||||
try {
|
||||
common_vendor.index.showLoading({
|
||||
title: "加载中..."
|
||||
title: "处理中...",
|
||||
mask: true
|
||||
});
|
||||
if (!common_vendor.index.getStorageSync("token")) {
|
||||
await util_index.wxLogin();
|
||||
if (!option || !option.deviceNo) {
|
||||
throw new Error("未识别到设备编号");
|
||||
}
|
||||
if (!option.deviceNo) {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.showToast({
|
||||
title: "设备编号不能为空",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
const result = await config_user.queryHasOrder(option.deviceNo);
|
||||
common_vendor.index.hideLoading();
|
||||
if (result.data && result.data.data && result.data.data.length > 0) {
|
||||
common_vendor.index.redirectTo({
|
||||
url: `/pages/device/return?deviceNo=${option.deviceNo}`
|
||||
});
|
||||
const deviceNo = option.deviceNo;
|
||||
const statusesToCheck = ["in_used", "waiting_for_payment"];
|
||||
const res = await config_user.checkOrdersByStatus(deviceNo, statusesToCheck);
|
||||
if (res.code === 200 && res.data && res.data.length > 0) {
|
||||
const latestOrder = res.data[0];
|
||||
if (latestOrder.orderStatus === "in_used") {
|
||||
common_vendor.index.__f__("log", "at pages/serve/bagCheck/index.vue:53", "检测到使用中订单,跳转归还页:", latestOrder.orderId);
|
||||
common_vendor.index.redirectTo({
|
||||
url: `/pages/device/return?orderId=${latestOrder.orderId}`
|
||||
});
|
||||
} else if (latestOrder.orderStatus === "waiting_for_payment") {
|
||||
common_vendor.index.__f__("log", "at pages/serve/bagCheck/index.vue:59", "检测到待支付订单,跳转支付页:", latestOrder.orderId);
|
||||
const packageTime = latestOrder.packageTime ? `${latestOrder.packageTime / 60}小时` : "默认套餐";
|
||||
const packagePrice = latestOrder.packagePrice || "0.00";
|
||||
const depositAmount = latestOrder.depositAmount || "99.00";
|
||||
const totalAmount = (parseFloat(depositAmount) + parseFloat(packagePrice)).toFixed(2);
|
||||
common_vendor.index.redirectTo({
|
||||
url: `/pages/order/payment?orderId=${latestOrder.orderId}&packageTime=${packageTime}&packagePrice=${packagePrice}&totalAmount=${totalAmount}&depositAmount=${depositAmount}`
|
||||
});
|
||||
} else {
|
||||
common_vendor.index.__f__("log", "at pages/serve/bagCheck/index.vue:70", "检测到其他状态订单,跳转详情页:", latestOrder.orderId);
|
||||
common_vendor.index.redirectTo({
|
||||
url: `/pages/device/detail?deviceNo=${deviceNo}`
|
||||
});
|
||||
}
|
||||
} else {
|
||||
common_vendor.index.__f__("log", "at pages/serve/bagCheck/index.vue:77", "未检测到相关订单,跳转详情页");
|
||||
common_vendor.index.redirectTo({
|
||||
url: `/pages/device/detail?deviceNo=${option.deviceNo}`
|
||||
url: `/pages/device/detail?deviceNo=${deviceNo}`
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.__f__("error", "at pages/serve/bagCheck/index.vue:83", "扫码检查订单失败:", error);
|
||||
common_vendor.index.showToast({
|
||||
title: "页面加载失败,请重试",
|
||||
icon: "none"
|
||||
title: error.message || "处理失败,请稍后重试",
|
||||
icon: "none",
|
||||
duration: 2e3
|
||||
});
|
||||
common_vendor.index.__f__("error", "at pages/serve/bagCheck/index.vue:62", "bagCheck onLoad error:", error);
|
||||
setTimeout(() => {
|
||||
if (option && option.deviceNo) {
|
||||
common_vendor.index.redirectTo({
|
||||
url: `/pages/device/detail?deviceNo=${option.deviceNo}`
|
||||
});
|
||||
} else {
|
||||
common_vendor.index.switchTab({ url: "/pages/index/index" });
|
||||
}
|
||||
}, 2e3);
|
||||
} finally {
|
||||
common_vendor.index.hideLoading();
|
||||
}
|
||||
},
|
||||
methods: {}
|
||||
|
||||
Reference in New Issue
Block a user