优化订单创建

This commit is contained in:
ember 2025-12-14 13:30:24 +08:00
parent 48bf09c73b
commit 74489e5cdc
7 changed files with 14 additions and 8 deletions

File diff suppressed because one or more lines are too long

1
dist/css/850.907a6d19.css vendored Normal file

File diff suppressed because one or more lines are too long

2
dist/index.html vendored
View File

@ -1 +1 @@
<!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>NEU小站</title><script defer="defer" src="/js/chunk-vendors.63c63273.js"></script><script defer="defer" src="/js/app.8f386f5c.js"></script><link href="/css/chunk-vendors.c52e575a.css" rel="stylesheet"><link href="/css/app.e6bab7f6.css" rel="stylesheet"></head><body><noscript><strong>抱歉NEU小站无法在没有 JavaScript 的情况下正常工作。请启用 JavaScript 以继续。</strong></noscript><div id="app"></div></body></html> <!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>NEU小站</title><script defer="defer" src="/js/chunk-vendors.63c63273.js"></script><script defer="defer" src="/js/app.efbe6496.js"></script><link href="/css/chunk-vendors.c52e575a.css" rel="stylesheet"><link href="/css/app.e6bab7f6.css" rel="stylesheet"></head><body><noscript><strong>抱歉NEU小站无法在没有 JavaScript 的情况下正常工作。请启用 JavaScript 以继续。</strong></noscript><div id="app"></div></body></html>

File diff suppressed because one or more lines are too long

2
dist/js/850.ef2f2bfd.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -113,14 +113,16 @@ export default {
orderUuid: '', orderUuid: '',
notification: '', notification: '',
notificationType: 'info', // info, success, error notificationType: 'info', // info, success, error
isCheckingStatus: false isCheckingStatus: false,
isCreatingOrder: false
}; };
}, },
computed: { computed: {
canPurchase() { canPurchase() {
return this.isLogin && !this.isVip; return this.isLogin && !this.isVip && !this.isCreatingOrder;
}, },
buttonText() { buttonText() {
if (this.isCreatingOrder) return '创建订单中...';
if (!this.isLogin) return '请先登录'; if (!this.isLogin) return '请先登录';
if (this.isVip) return '您已拥有'; if (this.isVip) return '您已拥有';
return '立即购买'; return '立即购买';
@ -161,6 +163,8 @@ export default {
async handlePurchase() { async handlePurchase() {
if (!this.canPurchase) return; if (!this.canPurchase) return;
this.isCreatingOrder = true;
try { try {
const token = Cookies.get('token'); const token = Cookies.get('token');
const response = await axios.get('https://newfront.xn--xhq44jb2fzpc.com/subscribe/order', { const response = await axios.get('https://newfront.xn--xhq44jb2fzpc.com/subscribe/order', {
@ -181,6 +185,8 @@ export default {
console.error('创建订单失败:', error); console.error('创建订单失败:', error);
MessageBox.alert('创建订单失败,请稍后重试', '错误'); MessageBox.alert('创建订单失败,请稍后重试', '错误');
} }
} finally {
this.isCreatingOrder = false;
} }
}, },