fix: 修复支付3位数问题
This commit is contained in:
@@ -93,19 +93,13 @@ public class TokenAmountAttribute : Attribute
|
|||||||
public enum GoodsTypeEnum
|
public enum GoodsTypeEnum
|
||||||
{
|
{
|
||||||
// VIP服务
|
// VIP服务
|
||||||
[Price(29.9, 1,29.9)]
|
[Price(29.9, 1, 29.9)] [DisplayName("YiXinVip 1 month", "1个月", "灵活选择")] [GoodsCategory(GoodsCategoryType.Vip)]
|
||||||
[DisplayName("YiXinVip 1 month", "1个月", "灵活选择")]
|
|
||||||
[GoodsCategory(GoodsCategoryType.Vip)]
|
|
||||||
YiXinVip1 = 1,
|
YiXinVip1 = 1,
|
||||||
|
|
||||||
[Price(83.7, 3,27.9)]
|
[Price(83.7, 3, 27.9)] [DisplayName("YiXinVip 3 month", "3个月", "短期体验")] [GoodsCategory(GoodsCategoryType.Vip)]
|
||||||
[DisplayName("YiXinVip 3 month", "3个月", "短期体验")]
|
|
||||||
[GoodsCategory(GoodsCategoryType.Vip)]
|
|
||||||
YiXinVip3 = 3,
|
YiXinVip3 = 3,
|
||||||
|
|
||||||
[Price(155.4, 6,25.9)]
|
[Price(155.4, 6, 25.9)] [DisplayName("YiXinVip 6 month", "6个月", "年度热销")] [GoodsCategory(GoodsCategoryType.Vip)]
|
||||||
[DisplayName("YiXinVip 6 month", "6个月", "年度热销")]
|
|
||||||
[GoodsCategory(GoodsCategoryType.Vip)]
|
|
||||||
YiXinVip6 = 6,
|
YiXinVip6 = 6,
|
||||||
|
|
||||||
[Price(183.2, 8, 22.9)]
|
[Price(183.2, 8, 22.9)]
|
||||||
@@ -125,7 +119,6 @@ public enum GoodsTypeEnum
|
|||||||
[GoodsCategory(GoodsCategoryType.PremiumPackage)]
|
[GoodsCategory(GoodsCategoryType.PremiumPackage)]
|
||||||
[TokenAmount(10000)]
|
[TokenAmount(10000)]
|
||||||
PremiumPackage10000W = 102,
|
PremiumPackage10000W = 102,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class GoodsTypeEnumExtensions
|
public static class GoodsTypeEnumExtensions
|
||||||
@@ -304,6 +297,6 @@ public static class GoodsTypeEnumExtensions
|
|||||||
var discountedPrice = originalPrice - discount;
|
var discountedPrice = originalPrice - discount;
|
||||||
|
|
||||||
// 确保价格不为负数,至少为0.01元
|
// 确保价格不为负数,至少为0.01元
|
||||||
return Math.Max(discountedPrice, 0.01m);
|
return Math.Round(discountedPrice, 2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user