diff --git a/src/views/tool/Instead/index.vue b/src/views/tool/Instead/index.vue index 700d337..de6217f 100644 --- a/src/views/tool/Instead/index.vue +++ b/src/views/tool/Instead/index.vue @@ -343,21 +343,25 @@ async function createOrder(key) { refOrder.value.nowPayClick("cash"); return; } - clearTimeout(loadingTimer); - loading = ElLoading.service({ - lock: true, - text: "订单生成中,请稍等……", - background: "rgba(0, 0, 0, 0.7)", - }); - loadingTimer = setTimeout(() => { - ElMessage.error("订单生成超时"); - loading.close(); - }, 1000 * 20); + try { if (key == "to-pay" && carts.list.length <= 0 && oldOrder.value.id) { showOrder.value = true; + nextTick(() => { + refOrder.value.nowPayClick(); + }); return; } + clearTimeout(loadingTimer); + loading = ElLoading.service({ + lock: true, + text: "订单生成中,请稍等……", + background: "rgba(0, 0, 0, 0.7)", + }); + loadingTimer = setTimeout(() => { + ElMessage.error("订单生成超时"); + loading.close(); + }, 1000 * 20); const res = await orderApi.add({ orderId: oldOrder.value.id || "", shopId: shopUser.userInfo.id,