套餐计划价格统一设置原始价格增加20%,前端套餐计划下拉增加公网IP数量显示
This commit is contained in:
parent
d38736f137
commit
f5132fbccf
@ -637,6 +637,7 @@ export default {
|
|||||||
const bandwidth = plan.bandwidth || '未知';
|
const bandwidth = plan.bandwidth || '未知';
|
||||||
const price = plan.origin_price || '未知';
|
const price = plan.origin_price || '未知';
|
||||||
const planType = plan.plan_type || '';
|
const planType = plan.plan_type || '';
|
||||||
|
const publicIpNum = plan.public_ip_num || 0;
|
||||||
|
|
||||||
// 处理内存显示(如果是小数,转换为MB)
|
// 处理内存显示(如果是小数,转换为MB)
|
||||||
let memoryDisplay = memory;
|
let memoryDisplay = memory;
|
||||||
@ -671,7 +672,7 @@ export default {
|
|||||||
typePrefix = '';
|
typePrefix = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
return `${typePrefix}${cpu}核/${memoryDisplay}/${disk}GB/${bandwidthDisplay} - ¥${price}/月`;
|
return `${typePrefix}${cpu}核/${memoryDisplay}/${disk}GB/${bandwidthDisplay}/${publicIpNum}个公网IP - ¥${price}/月`;
|
||||||
},
|
},
|
||||||
getSelectedPlanPrice() {
|
getSelectedPlanPrice() {
|
||||||
const selectedPlan = this.plans.find(plan => plan.plan_id === this.selectedPlanId);
|
const selectedPlan = this.plans.find(plan => plan.plan_id === this.selectedPlanId);
|
||||||
|
|||||||
@ -638,6 +638,13 @@ def get_aliyun_plans(region_id='cn-shanghai'):
|
|||||||
plan for plan in result['data']['plans']
|
plan for plan in result['data']['plans']
|
||||||
if plan.get('plan_type') in allowed_types
|
if plan.get('plan_type') in allowed_types
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# 在origin_price上统一增加20%作为利润
|
||||||
|
for plan in filtered_plans:
|
||||||
|
if 'origin_price' in plan and plan['origin_price'] is not None:
|
||||||
|
original_price = float(plan['origin_price'])
|
||||||
|
plan['origin_price'] = int(original_price / (1 - 0.2)) # 确保20%利润率且价格为整数
|
||||||
|
|
||||||
result['data']['plans'] = filtered_plans
|
result['data']['plans'] = filtered_plans
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user