fix: ui
All checks were successful
构建并部署前端到生产环境 / build-and-deploy (push) Successful in 1m9s

This commit is contained in:
luo
2026-07-30 15:41:11 +08:00
parent d0f032aa1c
commit 5f8ff768e6
4 changed files with 332 additions and 55 deletions

View File

@@ -334,7 +334,27 @@
}
};
defineExpose({ open, openOrderPayment });
const payOrderDirectly = async (orderId, method = 'wallet') => {
if (!orderId || submitting.value) return;
submitting.value = true;
uni.showLoading({ title: '准备支付...', mask: true });
try {
await orderApi.pay(orderId, method);
uni.hideLoading();
if (method === 'wallet') {
await confirmOrderStatus(orderId);
}
} catch (error) {
uni.hideLoading();
console.error('直接支付订单失败', error);
uni.showToast({ title: error.msg || error.message || '支付失败,请稍后重试', icon: 'none' });
} finally {
submitting.value = false;
}
};
defineExpose({ open, openOrderPayment, payOrderDirectly });
</script>
<style scoped lang="scss">