修复购物车位置操作的版本绑定与冲突确认
前端验证 / verify (push) Failing after 15m3s

This commit is contained in:
cieanyau committed 2026-11-07 08:27:36 +08:00
1 parent e27f08e36e
commit b788f890f8
5 files changed
+288 -59

No files matched your search

+10 -4
View File
@@ -50,6 +50,7 @@ import PaymentDialog from "~/components/PaymentDialog.vue";
import { t as product_order_module_t } from "~/lib/product-order-module.js";
import ConfigLoadingShell from "~/components/config/ConfigLoadingShell.vue";
import { n as cart_edit_n } from "~/lib/cart-edit.js";
import { requireCartRevision } from "~/lib/cart-edit.js";
import CommonConfig from "~/components/config/CommonConfig.vue";
import FinanceConfig from "~/components/config/FinanceConfig.vue";
import JyCloudConfig from "~/components/config/JyCloudConfig.vue";
@@ -119,7 +120,8 @@ var j = {
if (K.value !== null && U.value)
return {
position: K.value,
item: U.value,
item: U.value.item,
revision: U.value.revision,
};
return undefined;
}),
@@ -150,11 +152,15 @@ var j = {
if (r.order_allowed === !1)
throw Error(r.order_block_reason || `该产品已停止订购`);
if (K.value !== null) {
let t = (await L.get(`/cart`))?.list?.[K.value];
if (!t || Number(t.product_id) !== Number(R))
let t = await L.get(`/cart`),
item = t?.list?.[K.value];
if (!item || Number(item.product_id) !== Number(R))
throw Error(`购物车商品已变化,请返回购物车重新编辑`);
if (e !== Z) return;
U.value = cart_edit_n(t);
U.value = {
item: cart_edit_n(item),
revision: requireCartRevision(t),
};
}
let i = await product_order_module_t(L, r);
if (e !== Z) return;