From 936d325cf9e74ce64278dbea8f65705352cd20ee Mon Sep 17 00:00:00 2001 From: lishuo Date: Wed, 9 Jun 2021 19:44:06 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=B3=95=E8=AF=AD=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=B8=AA=E4=BA=BA=E4=BD=93=E9=87=8D=E5=B0=8F=E6=95=B0?= =?UTF-8?q?=E7=82=B9=E4=B8=8D=E6=8A=A5=E9=94=99=E4=BB=A5=E5=8F=8A=E9=A6=96?= =?UTF-8?q?=E9=A1=B5=E5=8D=A1=E8=B7=AF=E9=87=8C=E4=B8=BA0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/UI/Prefab/Panel/EditUserController.cs | 9 ++++++++- Assets/Scripts/UI/Prefab/Panel/HomeController.cs | 5 +++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Assets/Scripts/UI/Prefab/Panel/EditUserController.cs b/Assets/Scripts/UI/Prefab/Panel/EditUserController.cs index 6d81b620..64043944 100644 --- a/Assets/Scripts/UI/Prefab/Panel/EditUserController.cs +++ b/Assets/Scripts/UI/Prefab/Panel/EditUserController.cs @@ -283,7 +283,14 @@ public class EditUserController : PFUIPanel void Save(BaseEventData e) { //UIManager.ShowConfirm("Confirm", "Are you sure to edit?", SaveFunc); - SaveFunc(); + try + { + SaveFunc(); + } + catch (Exception ex) + { + Utils.showToast(gameObject, ex.Message); + } //App.CurrentUser = user; //UIManager.ShowAlert("result.errMsg"); diff --git a/Assets/Scripts/UI/Prefab/Panel/HomeController.cs b/Assets/Scripts/UI/Prefab/Panel/HomeController.cs index 95954bb9..27454648 100644 --- a/Assets/Scripts/UI/Prefab/Panel/HomeController.cs +++ b/Assets/Scripts/UI/Prefab/Panel/HomeController.cs @@ -6,6 +6,7 @@ using DG.Tweening; using System; using System.Collections; using System.Collections.Generic; +using System.Globalization; using System.Threading.Tasks; using UnityEngine; using UnityEngine.Events; @@ -152,9 +153,9 @@ public class HomeController : PFUIPanel Utils.DisplayHead(userInfo.Find("Avatar").GetComponent(), App.CurrentUser.WxHeadImg); userInfo.Find("Country").GetComponent().texture = UIManager.Instance.loginRegOptions.GetCountryImageByName(App.CurrentUser.Country); - userInfo.Find("CaloriesContainer").Find("CaloriesValue").GetComponent().text = double.Parse(summary.Kcal).ToString("0") +" KCAL"; + userInfo.Find("CaloriesContainer").Find("CaloriesValue").GetComponent().text = double.Parse(summary.Kcal,CultureInfo.InvariantCulture).ToString("0") +" KCAL"; userInfo.Find("KMContainer").Find("KMValue").GetComponent().text = summary.TotalDistance.ToString("0") +" KM"; - userInfo.Find("ClimbContainer").Find("ClimbValue").GetComponent().text = summary.TotalClimb +" M"; + userInfo.Find("ClimbContainer").Find("ClimbValue").GetComponent().text = double.Parse(summary.TotalClimb,CultureInfo.InvariantCulture).ToString("0") + " M"; userInfo.Find("GroupTop").Find("FtpContainer").Find("FtpTime").GetComponent().text = App.CurrentUser.LastUpdateFtpTime.ToString("dd.MM.yyyy"); userInfo.Find("GroupTop").Find("WeightContainer").Find("WeightTime").GetComponent().text = App.CurrentUser.LastUpdateWeightTime.ToString("dd.MM.yyyy");