fix: 修复支付3位数问题
This commit is contained in:
@@ -93,39 +93,32 @@ public class TokenAmountAttribute : Attribute
|
||||
public enum GoodsTypeEnum
|
||||
{
|
||||
// VIP服务
|
||||
[Price(29.9, 1,29.9)]
|
||||
[DisplayName("YiXinVip 1 month", "1个月", "灵活选择")]
|
||||
[GoodsCategory(GoodsCategoryType.Vip)]
|
||||
[Price(29.9, 1, 29.9)] [DisplayName("YiXinVip 1 month", "1个月", "灵活选择")] [GoodsCategory(GoodsCategoryType.Vip)]
|
||||
YiXinVip1 = 1,
|
||||
|
||||
[Price(83.7, 3,27.9)]
|
||||
[DisplayName("YiXinVip 3 month", "3个月", "短期体验")]
|
||||
[GoodsCategory(GoodsCategoryType.Vip)]
|
||||
[Price(83.7, 3, 27.9)] [DisplayName("YiXinVip 3 month", "3个月", "短期体验")] [GoodsCategory(GoodsCategoryType.Vip)]
|
||||
YiXinVip3 = 3,
|
||||
|
||||
[Price(155.4, 6,25.9)]
|
||||
[DisplayName("YiXinVip 6 month", "6个月", "年度热销")]
|
||||
[GoodsCategory(GoodsCategoryType.Vip)]
|
||||
[Price(155.4, 6, 25.9)] [DisplayName("YiXinVip 6 month", "6个月", "年度热销")] [GoodsCategory(GoodsCategoryType.Vip)]
|
||||
YiXinVip6 = 6,
|
||||
|
||||
[Price(183.2, 8,22.9)]
|
||||
[Price(183.2, 8, 22.9)]
|
||||
[DisplayName("YiXinVip 8 month", "8个月(推荐)", "限时活动,超高性价比")]
|
||||
[GoodsCategory(GoodsCategoryType.Vip)]
|
||||
YiXinVip8 = 8,
|
||||
|
||||
// 尊享包服务 - 需要VIP资格才能购买
|
||||
[Price(188.9, 0,1750)]
|
||||
[Price(188.9, 0, 1750)]
|
||||
[DisplayName("YiXinPremiumPackage 5000W Tokens", "5000万Tokens", "简单尝试")]
|
||||
[GoodsCategory(GoodsCategoryType.PremiumPackage)]
|
||||
[TokenAmount(5000)]
|
||||
PremiumPackage5000W = 101,
|
||||
|
||||
[Price(248.9, 0,3500)]
|
||||
[Price(248.9, 0, 3500)]
|
||||
[DisplayName("YiXinPremiumPackage 10000W Tokens", "1亿Tokens(推荐)", "极致性价比")]
|
||||
[GoodsCategory(GoodsCategoryType.PremiumPackage)]
|
||||
[TokenAmount(10000)]
|
||||
PremiumPackage10000W = 102,
|
||||
|
||||
}
|
||||
|
||||
public static class GoodsTypeEnumExtensions
|
||||
@@ -304,6 +297,6 @@ public static class GoodsTypeEnumExtensions
|
||||
var discountedPrice = originalPrice - discount;
|
||||
|
||||
// 确保价格不为负数,至少为0.01元
|
||||
return Math.Max(discountedPrice, 0.01m);
|
||||
return Math.Round(discountedPrice, 2);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user