fix(subscription): 修复价格单位错误导致金额多100倍问题

- 确认 product.price 实际单位为分,修正所有价格计算需除以100转为元
- 后端 generatePayQrcode 方法价格计算改为 price/100,年付按10个月计费,季度付按3个月计费
- 前端 dashboard/index.vue 月付价格除以100,年付价格按月付价乘以10计算,保持与后端一致
- 保持 subscribe 价格计算逻辑,避免价格单位不一致的错误
- 修复后价格显示和支付逻辑统一,解决用户反馈金额偏大问题
This commit is contained in:
2026-07-15 14:12:54 +08:00
parent 29a18ffbc6
commit 09af76e4ea
2 changed files with 11 additions and 4 deletions

View File

@@ -410,10 +410,10 @@ const isFreeProduct = computed(() => {
return p.priceType === 'free' || !p.price || Number(p.price) === 0;
});
// 月付参考价格(元)
const monthPrice = computed(() => Number(currentProduct.value?.price) || 0);
// 年付参考价格(元,按12个月)
const yearPrice = computed(() => monthPrice.value * 12);
// 月付参考价格(product.price 单位为分除以100转为元)
const monthPrice = computed(() => (Number(currentProduct.value?.price) || 0) / 100);
// 年付参考价格按10个月计费,对齐后端 subscribe/generatePayQrcode 年付优惠
const yearPrice = computed(() => monthPrice.value * 10);
// 距到期天数负数表示已过期null 表示无到期时间
const daysToExpire = computed(() => {