fix: 修复支付3位数问题
This commit is contained in:
@@ -93,19 +93,13 @@ 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)]
|
||||
@@ -125,7 +119,6 @@ public enum GoodsTypeEnum
|
||||
[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