fix: 修复代客下单左边购物车点击立即支付显示订单生成问题

This commit is contained in:
2025-03-14 17:11:07 +08:00
parent 05ce745e58
commit 088826881b

View File

@@ -343,6 +343,15 @@ async function createOrder(key) {
refOrder.value.nowPayClick("cash"); refOrder.value.nowPayClick("cash");
return; return;
} }
try {
if (key == "to-pay" && carts.list.length <= 0 && oldOrder.value.id) {
showOrder.value = true;
nextTick(() => {
refOrder.value.nowPayClick();
});
return;
}
clearTimeout(loadingTimer); clearTimeout(loadingTimer);
loading = ElLoading.service({ loading = ElLoading.service({
lock: true, lock: true,
@@ -353,11 +362,6 @@ async function createOrder(key) {
ElMessage.error("订单生成超时"); ElMessage.error("订单生成超时");
loading.close(); loading.close();
}, 1000 * 20); }, 1000 * 20);
try {
if (key == "to-pay" && carts.list.length <= 0 && oldOrder.value.id) {
showOrder.value = true;
return;
}
const res = await orderApi.add({ const res = await orderApi.add({
orderId: oldOrder.value.id || "", orderId: oldOrder.value.id || "",
shopId: shopUser.userInfo.id, shopId: shopUser.userInfo.id,