diff --git a/dashboard/src2/components/JsiteServerOverview.vue b/dashboard/src2/components/JsiteServerOverview.vue index 321f8cc..bd4fdad 100644 --- a/dashboard/src2/components/JsiteServerOverview.vue +++ b/dashboard/src2/components/JsiteServerOverview.vue @@ -292,27 +292,13 @@ export default { return regionMap[region] || region; }, renewServer() { - const renewRequest = createResource({ - url: '/api/action/jcloud.api.aliyun_server_light.renew_aliyun_instance', - params: { - instance_id: this.$jsiteServer.pg.instance_id, - region_id: this.$jsiteServer.pg.region - }, - onSuccess: () => { - toast.success('续费请求已提交'); - }, - onError: (error) => { - toast.error(getToastErrorMessage(error)); - } - }); - toast.promise( - renewRequest.submit(), - { - loading: '正在处理续费请求...', - success: '续费请求已提交', - error: (e) => getToastErrorMessage(e), - }, - ); + const JsiteServerRenewalDialog = defineAsyncComponent(() => import('./JsiteServerRenewalDialog.vue')); + + renderDialog(h(JsiteServerRenewalDialog, { + server: this.server, + serverDoc: this.$jsiteServer.pg, + onSuccess: this.onRenewalSuccess + })); }, async restartServer() { if (!this.$jsiteServer.pg.instance_id) { @@ -501,6 +487,11 @@ export default { }); } }, + onRenewalSuccess(data) { + toast.success('服务器续费成功!'); + // 刷新服务器数据 + this.$jsiteServer.reload(); + }, }, computed: { serverInformation() { diff --git a/dashboard/src2/components/JsiteServerRenewalDialog.vue b/dashboard/src2/components/JsiteServerRenewalDialog.vue new file mode 100644 index 0000000..920f415 --- /dev/null +++ b/dashboard/src2/components/JsiteServerRenewalDialog.vue @@ -0,0 +1,541 @@ + + + + + + + + 选择续费时长,确保您的服务器持续可用 + + + + + + 续费周期 + + + + {{ period.name }} + -{{ period.discount }}% + + + + + + + 月度费用 + + ¥ {{ serverInfo.plan_price }} + (月付) + + + + 续费时长 + {{ selectedPeriod }} 个月 + + + 折扣 + -{{ discountPercentage }}% + + + 总计 + ¥ {{ totalAmount }} + + + + + + 选择支付方式 + + + + 余额支付 + + + + + + + + + + + + + + + + + + + + + + {{ error }} + + + + + + + + + + + + + 正在处理支付,请稍候... + + + + + + + + + + + + 续费成功! + + 您的服务器已成功续费 {{ selectedPeriod }} 个月 + + + + + + + + + + + + + 扫一扫付款(元) + {{ order?.total_amount }} 元 + + + + + + + + + + + 请使用微信扫描二维码完成支付 + + 二维码有效期 15 分钟 + + + + + + + + + + 请在新页面完成支付宝支付 + + 如果没有自动跳转,请点击下方按钮打开支付页面 + + + + 打开支付页面 + + + 支付完成后,请稍等片刻,系统会自动刷新页面 + + + + + + {{ error }} + + + + + + + + {{ isLoading ? '处理中...' : '确认续费' }} + + + + + 关闭 + + + + + + + + + + \ No newline at end of file
+ 选择续费时长,确保您的服务器持续可用 +
正在处理支付,请稍候...
+ 您的服务器已成功续费 {{ selectedPeriod }} 个月 +
+ 请使用微信扫描二维码完成支付 +
二维码有效期 15 分钟
+ 如果没有自动跳转,请点击下方按钮打开支付页面 +
+ 支付完成后,请稍等片刻,系统会自动刷新页面 +