From a6d5d0339984b272844658e0e6bd34dc60069f3f Mon Sep 17 00:00:00 2001 From: chr_ Date: Tue, 2 Jul 2024 19:32:01 +0800 Subject: [PATCH] =?UTF-8?q?bugfix=20=E4=BF=AE=E6=AD=A3=20`PURCHASEHISTORY`?= =?UTF-8?q?=20=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ASFEnhance/Account/CurrencyHelper.cs | 4 +++- ASFEnhance/Account/HtmlParser.cs | 3 ++- ASFEnhance/RegexUtils.cs | 2 +- Directory.Build.props | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ASFEnhance/Account/CurrencyHelper.cs b/ASFEnhance/Account/CurrencyHelper.cs index 4d75fa30..6ba81d00 100644 --- a/ASFEnhance/Account/CurrencyHelper.cs +++ b/ASFEnhance/Account/CurrencyHelper.cs @@ -61,6 +61,7 @@ internal static class CurrencyHelper { "¥", "CNY" }, { "COL$", "COP" }, { "₡", "CRC" }, + { "--€", "EUR" }, { "€", "EUR" }, { "£", "GBP" }, { "HK$", "HKD" }, @@ -102,6 +103,7 @@ internal static class CurrencyHelper "BRL", "NOK", "EUR", - "PLN" + "PLN", + "VND", ]; } diff --git a/ASFEnhance/Account/HtmlParser.cs b/ASFEnhance/Account/HtmlParser.cs index 14397c60..9b74f4c2 100644 --- a/ASFEnhance/Account/HtmlParser.cs +++ b/ASFEnhance/Account/HtmlParser.cs @@ -165,7 +165,7 @@ decimal ParseMoneyString(string strMoney) string strItem = whtItem?.Text().Trim().Replace("\t", "") ?? ""; string strType = whtType?.Text().Trim().Replace("\t", "") ?? ""; - string strTotal = whtTotal?.Text().Trim().Replace("\t", "") ?? ""; + string strTotal = whtTotal?.Text().Replace("资金", "").Trim().Replace("\t", "") ?? ""; string strChange = whtChange?.Text().Trim().Replace("\t", "") ?? ""; if (!string.IsNullOrEmpty(strType)) @@ -174,6 +174,7 @@ decimal ParseMoneyString(string strMoney) if (!string.IsNullOrEmpty(strType) && !strType.StartsWith("转换") && !strType.StartsWith("退款")) { int total = (int)(ParseMoneyString(strTotal) * 100); + int walletChange; int walletChangeAbs; diff --git a/ASFEnhance/RegexUtils.cs b/ASFEnhance/RegexUtils.cs index 9c37ff15..56332dd0 100644 --- a/ASFEnhance/RegexUtils.cs +++ b/ASFEnhance/RegexUtils.cs @@ -21,7 +21,7 @@ internal static partial class RegexUtils [GeneratedRegex("g_historyCursor = ([^;]+)")] public static partial Regex MatchHistortyCursor(); - [GeneratedRegex(@"^\s*([-+])?([^\d,.]*)([\d,.]+)([^\d,.]*)$")] + [GeneratedRegex(@"^([-+])?([^\d,.]*)([\d,.]+)\s*([^\d,.]*|[pуб.]*)$")] public static partial Regex MatchHistoryItem(); [GeneratedRegex(@"\( (\d+),")] diff --git a/Directory.Build.props b/Directory.Build.props index ffaadda6..9876e886 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,6 @@ - 2.1.10.3 + 2.1.10.4