diff --git a/dashboard/src/components/BuyPrepaidCreditsAlipay.vue b/dashboard/src/components/BuyPrepaidCreditsAlipay.vue index 37ea8e0..8ad43ed 100644 --- a/dashboard/src/components/BuyPrepaidCreditsAlipay.vue +++ b/dashboard/src/components/BuyPrepaidCreditsAlipay.vue @@ -11,7 +11,7 @@ :loading="$resources.createAlipayOrder.loading || loading" @click="processAlipayPayment" > - 使用支付宝支付 + {{ $t('Pay with Alipay') }} @@ -49,18 +49,18 @@ export default { }, validate() { if (this.amount <= 0) { - throw new DashboardError('支付金额必须大于0'); + throw new DashboardError(this.$t('Payment amount must be greater than 0')); } if (this.amount < this.minimumAmount) { - throw new DashboardError('金额低于最低要求金额'); + throw new DashboardError(this.$t('Amount is below the minimum required amount')); } }, onSuccess(response) { window.open(response.payment_url, '_blank'); - toast.success('支付页面已在新窗口打开'); + toast.success(this.$t('Payment page opened in new window')); - // 如果需要检查支付状态 + // Optional: check payment status // this.checkPaymentStatus(response.order_id); } }; @@ -71,7 +71,7 @@ export default { this.$resources.createAlipayOrder.submit(); }, - // 可选:检查支付状态的方法 + // Optional: method to check payment status checkPaymentStatus(orderId) { const checkInterval = setInterval(() => { this.$call('jcloud.api.billing.check_payment_status', { @@ -80,15 +80,15 @@ export default { }).then(result => { if (result && result.status === 'Success') { clearInterval(checkInterval); - toast.success('支付成功!账户已充值'); + toast.success(this.$t('Payment successful! Account has been recharged')); this.$emit('payment-success'); } }).catch(err => { - console.error('检查支付状态出错:', err); + console.error('Error checking payment status:', err); }); }, 3000); - // 5分钟后停止检查 + // Stop checking after 5 minutes setTimeout(() => { clearInterval(checkInterval); }, 300000); diff --git a/dashboard/src/components/BuyPrepaidCreditsForm.vue b/dashboard/src/components/BuyPrepaidCreditsForm.vue index 503aec6..878be7a 100644 --- a/dashboard/src/components/BuyPrepaidCreditsForm.vue +++ b/dashboard/src/components/BuyPrepaidCreditsForm.vue @@ -1,7 +1,7 @@