From 4d95116696ab0061de18604638b6c70861ef832a Mon Sep 17 00:00:00 2001 From: jingrow Date: Sat, 9 Aug 2025 23:23:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E6=9C=8D=E5=8A=A1=E5=99=A8?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=97=B6=E4=B8=9A=E5=8A=A1=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0plan=5Ftype=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dashboard/src2/pages/NewJsiteServer.vue | 5 +++++ jcloud/api/aliyun_server_light.py | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/dashboard/src2/pages/NewJsiteServer.vue b/dashboard/src2/pages/NewJsiteServer.vue index 9e0f5d6..8f7ff43 100644 --- a/dashboard/src2/pages/NewJsiteServer.vue +++ b/dashboard/src2/pages/NewJsiteServer.vue @@ -608,6 +608,7 @@ export default { image_id: this.selectedImageId, period: this.period, region_id: this.selectedRegionId, + plan_type: this.getSelectedPlanType(), payment_method: this.selectedPaymentMethod }); @@ -714,6 +715,10 @@ export default { const selectedPlan = this.filteredPlans.find(plan => plan.plan_id === this.selectedPlanId); return selectedPlan ? (selectedPlan.origin_price || 0) : 0; }, + getSelectedPlanType() { + const selectedPlan = this.filteredPlans.find(plan => plan.plan_id === this.selectedPlanId); + return selectedPlan ? (selectedPlan.plan_type || '') : ''; + }, getTotalAmount() { const monthlyPrice = this.getSelectedPlanPrice(); return (monthlyPrice * this.period).toFixed(2); diff --git a/jcloud/api/aliyun_server_light.py b/jcloud/api/aliyun_server_light.py index f0e80fc..3ceccfa 100644 --- a/jcloud/api/aliyun_server_light.py +++ b/jcloud/api/aliyun_server_light.py @@ -980,6 +980,7 @@ def create_server_order(**kwargs): image_id = kwargs.get('image_id') period = kwargs.get('period', 1) region_id = kwargs.get('region_id', 'cn-shanghai') + plan_type = kwargs.get('plan_type', '') if not plan_id or not image_id: jingrow.throw("缺少必要参数") @@ -1009,6 +1010,7 @@ def create_server_order(**kwargs): "image_id": image_id, "period": period, "region_id": region_id, + "plan_type": plan_type, "monthly_price": monthly_price, "total_amount": total_amount, "plan_info": { @@ -1360,6 +1362,7 @@ def create_aliyun_server(order_name): image_id = biz_params.get("image_id") period = biz_params.get("period", 1) region_id = biz_params.get("region_id", "cn-shanghai") + plan_type = biz_params.get("plan_type", "") monthly_price = biz_params.get("monthly_price", 0) plan_info = biz_params.get("plan_info", {}) @@ -1390,6 +1393,7 @@ def create_aliyun_server(order_name): "end_date": jingrow.utils.add_months(jingrow.utils.nowdate(), period), "title": f"{region_id} - {plan_info.get('core', '')}核/{plan_info.get('memory', '')}GB", "planid": plan_id, + "plan_type": plan_type, "period": period, "plan_price": monthly_price, "cpu": plan_info.get('core'),