refactor(modal): remove legacy compatibility paths
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
bdfe3a461d
commit
34150f3358
18 files changed
+188
-380
No files matched your search
@@ -16,21 +16,10 @@
|
||||
var detailOrderNumber = "";
|
||||
|
||||
function toast(message, type) {
|
||||
if (typeof window.AksrtToast === "function") {
|
||||
window.AksrtToast(message, type || "info");
|
||||
return;
|
||||
}
|
||||
if (typeof window.aksrtNotify === "function") {
|
||||
window.aksrtNotify(message, type || "info");
|
||||
return;
|
||||
}
|
||||
window.alert(message);
|
||||
window.AksrtToast(message, type || "info");
|
||||
}
|
||||
|
||||
function request(path, body, method) {
|
||||
if (!window.AksrtRequest || typeof window.AksrtRequest.request !== "function") {
|
||||
return Promise.resolve({ success: false, message: "请求适配器未加载" });
|
||||
}
|
||||
var options = { method: method || "POST" };
|
||||
if (body !== undefined) options.body = JSON.stringify(body || {});
|
||||
return window.AksrtRequest.request(path, options).then(function (response) {
|
||||
@@ -219,9 +208,7 @@
|
||||
button.disabled = true;
|
||||
request(orderPath(number, "/pay"), method ? { payment_method: method } : {}).then(function (result) {
|
||||
if (!result.success) throw new Error(result.message || "支付失败");
|
||||
if (window.AksrtModalRuntime && typeof window.AksrtModalRuntime.invalidate === "function") {
|
||||
window.AksrtModalRuntime.invalidate(["orders", "vip"]);
|
||||
}
|
||||
window.AksrtModalRuntime.invalidate(["orders", "vip"]);
|
||||
var data = result.data || {};
|
||||
if (data.redirect && data.payment_url) {
|
||||
window.location.assign(data.payment_url);
|
||||
@@ -246,9 +233,7 @@
|
||||
button.disabled = true;
|
||||
request(orderPath(number, "/cancel")).then(function (result) {
|
||||
if (!result.success) throw new Error(result.message || "关闭订单失败");
|
||||
if (window.AksrtModalRuntime && typeof window.AksrtModalRuntime.invalidate === "function") {
|
||||
window.AksrtModalRuntime.invalidate(["orders", "vip"]);
|
||||
}
|
||||
window.AksrtModalRuntime.invalidate(["orders", "vip"]);
|
||||
toast("订单已关闭");
|
||||
refreshView();
|
||||
}).catch(function (error) {
|
||||
|
||||
Reference in new issue
Block a user