合并后错误修改
This commit is contained in:
1 parent
e513eeac5c
commit
c6d0f7ac13
22 files changed
+20977
-24867
No files matched your search
@@ -195,7 +195,7 @@ public class ActivityController : PFUIPanel
|
||||
{
|
||||
CancelInvoke("StartPageFunc");
|
||||
Close();
|
||||
webView.LoadHTMLString("<div style=\"background:#23232d\" />", this.url);
|
||||
//webView.LoadHTMLString("<div style=\"background:#23232d\" />", this.url);
|
||||
//Destroy(gameObject);
|
||||
//UIManager.Instance.mActivityController = null;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@ public class HomeController : PFUIPanel
|
||||
[SerializeField] Button BtnRide;
|
||||
[SerializeField] Transform userInfo;
|
||||
Transform BtnMatch, BtnTraining;
|
||||
Transform BtnBattle;
|
||||
private MainNav mainNav;
|
||||
private Dictionary<string, Sprite[]> dict;
|
||||
// Start is called before the first frame update
|
||||
@@ -40,7 +39,7 @@ public class HomeController : PFUIPanel
|
||||
{
|
||||
UIManager.ShowUserInfoPanel();
|
||||
});
|
||||
var BtnContainer = transform.Find("MainFuncContainer");
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS
|
||||
var nav = transform.Find("MainNav-mobile").GetComponent<NewMainNav>();
|
||||
nav.SetButtonActive(new List<int> { 1, 3, 4, 6 },null,new NewMainNav.CustomButton(Resources.Load<Sprite>("Images/RowerNew/ICON_mode_44"), () =>
|
||||
@@ -59,17 +58,8 @@ public class HomeController : PFUIPanel
|
||||
});
|
||||
mainNav = this.transform.Find("MainNav").GetComponent<MainNav>();
|
||||
mainNav.ShowExit();
|
||||
|
||||
UIManager.AddEvent(transform.Find("TodayData/ChangePlayerBtn").gameObject, EventTriggerType.PointerClick, b =>
|
||||
{
|
||||
UIManager.ShowChangePlayerPanel();
|
||||
});
|
||||
BtnBattle = BtnContainer.Find("BtnBattle");
|
||||
UIManager.AddEvent(BtnBattle.gameObject, EventTriggerType.PointerClick, GoGameRoom);
|
||||
UIManager.AddEvent(BtnBattle.gameObject, EventTriggerType.PointerEnter, OnHover);
|
||||
UIManager.AddEvent(BtnBattle.gameObject, EventTriggerType.PointerExit, OnExit);
|
||||
#endif
|
||||
|
||||
var BtnContainer = transform.Find("MainFuncContainer");
|
||||
UIManager.AddEvent(BtnRide.gameObject, EventTriggerType.PointerClick, GoRide);
|
||||
UIManager.AddEvent(BtnRide.gameObject, EventTriggerType.PointerEnter, OnHover);
|
||||
UIManager.AddEvent(BtnRide.gameObject, EventTriggerType.PointerExit, OnExit);
|
||||
@@ -89,28 +79,28 @@ public class HomeController : PFUIPanel
|
||||
});
|
||||
UIManager.AddEvent(BtnTraining.gameObject, EventTriggerType.PointerEnter, OnHover);
|
||||
UIManager.AddEvent(BtnTraining.gameObject, EventTriggerType.PointerExit, OnExit);
|
||||
var avatar = userInfo.Find("Avatar").GetComponent<RawImage>();
|
||||
var rect = ((RectTransform)avatar.transform).rect;
|
||||
var avatar = userInfo.Find("Avatar").GetComponent<RawImage>();
|
||||
var rect = ((RectTransform)avatar.transform).rect;
|
||||
SetRounded(avatar.transform, rect.height);
|
||||
|
||||
UIManager.AddEvent(avatar.gameObject, EventTriggerType.PointerClick, x =>
|
||||
{
|
||||
UIManager.ShowUserInfoPanel();
|
||||
});
|
||||
|
||||
|
||||
UIManager.AddEvent(userInfo.Find("BtnMore").gameObject, EventTriggerType.PointerClick, x =>
|
||||
{
|
||||
UIManager.ShowUserInfoPanel();
|
||||
//UIManager.ShowConfirm("Quit", "Do you want to quit PowerFun?", null);
|
||||
});
|
||||
if (transform.Find("Other/BtnRower"))
|
||||
if (transform.Find("Other/BtnRower"))
|
||||
{
|
||||
UIManager.AddEvent(transform.Find("Other/BtnRower").gameObject, EventTriggerType.PointerClick, b =>
|
||||
{
|
||||
UIManager.ShowRowerPanel();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//GetSummary();
|
||||
dict = new Dictionary<string, Sprite[]>
|
||||
{
|
||||
@@ -129,18 +119,7 @@ public class HomeController : PFUIPanel
|
||||
// }
|
||||
//},
|
||||
};
|
||||
|
||||
}
|
||||
private void GoGameRoom(BaseEventData e)
|
||||
{
|
||||
#if UNITY_STANDALONE_WIN
|
||||
OnExit(e);
|
||||
var pe = (PointerEventData)e;
|
||||
if (pe == null)
|
||||
return;
|
||||
var parent = pe.pointerEnter.transform.parent;
|
||||
UIManager.ShowGameRoomListPanel();
|
||||
#endif
|
||||
|
||||
}
|
||||
private void GoRide(BaseEventData e)
|
||||
{
|
||||
@@ -158,11 +137,11 @@ public class HomeController : PFUIPanel
|
||||
{
|
||||
UIManager.ShowNewRouteOverviewPanel();
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
OnExit(e);
|
||||
}
|
||||
void goTraining(BaseEventData e)
|
||||
void goTraining(BaseEventData e)
|
||||
{
|
||||
#if !(UNITY_IOS || UNITY_ANDROID)
|
||||
var path = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\PowerFun\Rhino.PowerFun.exe";
|
||||
@@ -205,7 +184,7 @@ public class HomeController : PFUIPanel
|
||||
UIManager.ShowRaceHomePanel();
|
||||
OnExit(e);
|
||||
}
|
||||
private void OnHover(BaseEventData e)
|
||||
private void OnHover(BaseEventData e)
|
||||
{
|
||||
var pe = (PointerEventData)e;
|
||||
var parent = pe.pointerEnter.transform.parent;
|
||||
@@ -217,10 +196,6 @@ public class HomeController : PFUIPanel
|
||||
//parent.Find("Text").GetComponent<Text>().color = Utils.HexToColorHtml("#ffffff");
|
||||
parent.DOScale(new Vector3(1.05f, 1.05f, 0), 0.3f);
|
||||
//parent.GetComponent<RectTransform>().localScale = ;
|
||||
|
||||
#if UNITY_STANDALONE_WIN
|
||||
parent.Find("ImageL").gameObject.SetActive(true);
|
||||
#endif
|
||||
}
|
||||
private void OnExit(BaseEventData e)
|
||||
{
|
||||
@@ -228,15 +203,12 @@ public class HomeController : PFUIPanel
|
||||
var parent = pe.pointerEnter.transform.parent;
|
||||
//parent.Find("Image").GetComponent<Image>().sprite = Resources.Load<Sprite>("Images/home/Entrance - ROUTES_nomal");
|
||||
//parent.Find("Text").GetComponent<Text>().color = Utils.HexToColorHtml("#5C5C6E");
|
||||
if (dict.ContainsKey(parent.name))
|
||||
if (dict.ContainsKey(parent.name))
|
||||
{
|
||||
parent.Find("Image").GetComponent<Image>().sprite = dict[parent.name][0];
|
||||
}
|
||||
parent.DOScale(new Vector3(1f, 1f, 0), 0.3f);
|
||||
//parent.GetComponent<RectTransform>().localScale = new Vector3(1f, 1f, 0);
|
||||
#if UNITY_STANDALONE_WIN
|
||||
parent.Find("ImageL").gameObject.SetActive(false);
|
||||
#endif
|
||||
}
|
||||
void MoreFunc()
|
||||
{
|
||||
@@ -250,7 +222,7 @@ public class HomeController : PFUIPanel
|
||||
userInfo.Find("NickName").GetComponent<Text>().text = App.CurrentUser.Nickname;
|
||||
userInfo.Find("GroupTop").Find("FtpContainer").Find("FtpValue").GetComponent<Text>().text = App.CurrentUser.FTP.ToString();
|
||||
userInfo.Find("GroupTop").Find("WeightContainer").Find("WeightValue").GetComponent<Text>().text = App.CurrentUser.Weight.ToString();
|
||||
userInfo.Find("GroupTop").Find("WKGContainer").Find("WKGValue").GetComponent<Text>().text = $"{ (App.CurrentUser.FTP/ App.CurrentUser.Weight).ToString("0.0") }";
|
||||
userInfo.Find("GroupTop").Find("WKGContainer").Find("WKGValue").GetComponent<Text>().text = $"{ (App.CurrentUser.FTP / App.CurrentUser.Weight).ToString("0.0") }";
|
||||
userInfo.Find("IDText").GetComponent<Text>().text = "ID:" + App.CurrentUser.Id.ToString("000000");
|
||||
if (!string.IsNullOrWhiteSpace(App.CurrentUser.Unionid))
|
||||
{
|
||||
@@ -267,22 +239,22 @@ public class HomeController : PFUIPanel
|
||||
Utils.DisplayHead(userInfo.Find("Avatar").GetComponent<RawImage>(), App.CurrentUser.WxHeadImg);
|
||||
|
||||
userInfo.Find("Country").GetComponent<RawImage>().texture = UIManager.Instance.loginRegOptions.GetCountryImageByName(App.CurrentUser.Country);
|
||||
userInfo.Find("CaloriesContainer").Find("CaloriesValue").GetComponent<Text>().text = double.Parse(summary.Kcal,CultureInfo.InvariantCulture).ToString("0") +" KCAL";
|
||||
userInfo.Find("KMContainer").Find("KMValue").GetComponent<Text>().text = summary.TotalDistance.ToString("0") +" KM";
|
||||
userInfo.Find("ClimbContainer").Find("ClimbValue").GetComponent<Text>().text = double.Parse(summary.TotalClimb,CultureInfo.InvariantCulture).ToString("0") + " M";
|
||||
userInfo.Find("CaloriesContainer").Find("CaloriesValue").GetComponent<Text>().text = double.Parse(summary.Kcal, CultureInfo.InvariantCulture).ToString("0") + " KCAL";
|
||||
userInfo.Find("KMContainer").Find("KMValue").GetComponent<Text>().text = summary.TotalDistance.ToString("0") + " KM";
|
||||
userInfo.Find("ClimbContainer").Find("ClimbValue").GetComponent<Text>().text = double.Parse(summary.TotalClimb, CultureInfo.InvariantCulture).ToString("0") + " M";
|
||||
|
||||
userInfo.Find("GroupTop").Find("FtpContainer").Find("FtpTime").GetComponent<Text>().text = App.CurrentUser.LastUpdateFtpTime.ToString("dd.MM.yyyy");
|
||||
userInfo.Find("GroupTop").Find("WeightContainer").Find("WeightTime").GetComponent<Text>().text = App.CurrentUser.LastUpdateWeightTime.ToString("dd.MM.yyyy");
|
||||
userInfo.Find("GroupTop").Find("WKGContainer").Find("WKGTime").GetComponent<Text>().text =
|
||||
DateTime.Compare(App.CurrentUser.LastUpdateFtpTime, App.CurrentUser.LastUpdateWeightTime)>0
|
||||
? App.CurrentUser.LastUpdateFtpTime.ToString("dd.MM.yyyy")
|
||||
userInfo.Find("GroupTop").Find("WKGContainer").Find("WKGTime").GetComponent<Text>().text =
|
||||
DateTime.Compare(App.CurrentUser.LastUpdateFtpTime, App.CurrentUser.LastUpdateWeightTime) > 0
|
||||
? App.CurrentUser.LastUpdateFtpTime.ToString("dd.MM.yyyy")
|
||||
: App.CurrentUser.LastUpdateWeightTime.ToString("dd.MM.yyyy");
|
||||
//新版设计稿
|
||||
var todayData = transform.Find("TodayData");
|
||||
if (todayData)
|
||||
if (todayData)
|
||||
{
|
||||
Utils.DisplayHead(todayData.Find("Avatar").GetComponent<RawImage>(), App.CurrentUser.WxHeadImg);
|
||||
todayData.Find("Datas/Distance/Value").GetComponent<Text>().text = $"{summary.ContinuesDay}"+ (summary.ContinuesDay > 1 ? App.GetLocalString("DAYS") : App.GetLocalString("DAY"));
|
||||
todayData.Find("Datas/Distance/Value").GetComponent<Text>().text = $"{summary.ContinuesDay}" + (summary.ContinuesDay > 1 ? App.GetLocalString("DAYS") : App.GetLocalString("DAY"));
|
||||
todayData.Find("Datas/Climb/Value").GetComponent<Text>().text = $"{summary.ContinuesKm.ToString("#0.0")}";//$"{double.Parse(summary.TotalClimb, CultureInfo.InvariantCulture).ToString("0")}M";
|
||||
todayData.Find("Datas/Carlories/Value").GetComponent<Text>().text = $"{summary.ContinuesKcal.ToString("#0")}";
|
||||
//todayData.Find("Datas/Distance/Rank").GetComponent<Text>().text = summary.CurrentTotalDistance == 0 ? "——" : $"+{summary.CurrentTotalDistance.ToString("#0")}";
|
||||
@@ -293,7 +265,7 @@ public class HomeController : PFUIPanel
|
||||
//todayData.Find("ID").GetComponent<Text>().text = $"ID:{App.CurrentUser.Id.ToString("000000")}";
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
async void GetSummary()
|
||||
{
|
||||
@@ -364,7 +336,7 @@ public class HomeController : PFUIPanel
|
||||
//d.Find("NickName").GetComponent<Text>().text = list[0].NickName;
|
||||
//c.Find("NickName").GetComponent<Text>().text = list[2].NickName;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
transform.Find("MaxRankingData").gameObject.SetActive(false);
|
||||
}
|
||||
@@ -387,7 +359,7 @@ public class HomeController : PFUIPanel
|
||||
se.Append(s1);
|
||||
se.Append(t.DORotate(Vector3.zero, 0.5f));
|
||||
}
|
||||
void SetMessage(MapMaxRanking e)
|
||||
void SetMessage(MapMaxRanking e)
|
||||
{
|
||||
var m = transform.Find("MaxRankingData");
|
||||
Utils.DisplayHead(m.transform.Find("Avatar").GetComponent<RawImage>(), e.WxHeadImg);
|
||||
@@ -412,15 +384,15 @@ public class HomeController : PFUIPanel
|
||||
private async Task GetNotify()
|
||||
{
|
||||
var r = await ConfigHelper.userApi.GetNotify();
|
||||
if (r.result)
|
||||
if (r.result)
|
||||
{
|
||||
var lm = transform.Find("LongMessage");
|
||||
if (r.data.Value<int>("Id") > 1)
|
||||
{
|
||||
lm.gameObject.SetActive(true);
|
||||
lm.GetComponent<LongMessageScript>().Initial(r.data["Content"].ToString().Replace("\r\n"," "));
|
||||
lm.GetComponent<LongMessageScript>().Initial(r.data["Content"].ToString().Replace("\r\n", " "));
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
lm.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ public class NewHomeController : PFUIPanel
|
||||
[SerializeField] Button BtnRide;
|
||||
[SerializeField] Transform userInfo;
|
||||
Transform BtnMatch, BtnTraining;
|
||||
Transform BtnBattle;
|
||||
private MainNav mainNav;
|
||||
private Dictionary<string, Sprite[]> dict;
|
||||
// Start is called before the first frame update
|
||||
@@ -39,7 +40,7 @@ public class NewHomeController : PFUIPanel
|
||||
{
|
||||
UIManager.ShowUserInfoPanel();
|
||||
});
|
||||
|
||||
var BtnContainer = transform.Find("MainFuncContainer");
|
||||
#if UNITY_ANDROID || UNITY_IOS
|
||||
var nav = transform.Find("MainNav-mobile").GetComponent<NewMainNav>();
|
||||
nav.SetButtonActive(new List<int> { 1, 3, 4, 6 });
|
||||
@@ -49,22 +50,23 @@ public class NewHomeController : PFUIPanel
|
||||
UIManager.ShowResultListPanel();
|
||||
});
|
||||
#else
|
||||
UIManager.AddEvent(transform.Find("TodayData/Distance").gameObject, EventTriggerType.PointerClick, b =>
|
||||
UIManager.AddEvent(transform.Find("TodayData/Datas/Distance").gameObject, EventTriggerType.PointerClick, b =>
|
||||
{
|
||||
UIManager.ShowUserInfoPanel();
|
||||
});
|
||||
UIManager.AddEvent(transform.Find("ProfileBtn").gameObject, EventTriggerType.PointerClick, b =>
|
||||
{
|
||||
UIManager.ShowEditUserPanel();
|
||||
});
|
||||
UIManager.AddEvent(transform.Find("ChangeBtn").gameObject, EventTriggerType.PointerClick, b =>
|
||||
mainNav = this.transform.Find("MainNav").GetComponent<MainNav>();
|
||||
mainNav.ShowExit();
|
||||
|
||||
UIManager.AddEvent(transform.Find("TodayData/ChangePlayerBtn").gameObject, EventTriggerType.PointerClick, b =>
|
||||
{
|
||||
UIManager.ShowChangePlayerPanel();
|
||||
});
|
||||
mainNav = this.transform.Find("MainNav").GetComponent<MainNav>();
|
||||
mainNav.ShowExit();
|
||||
BtnBattle = BtnContainer.Find("BtnBattle");
|
||||
UIManager.AddEvent(BtnBattle.gameObject, EventTriggerType.PointerClick, GoGameRoom);
|
||||
UIManager.AddEvent(BtnBattle.gameObject, EventTriggerType.PointerEnter, OnHover);
|
||||
UIManager.AddEvent(BtnBattle.gameObject, EventTriggerType.PointerExit, OnExit);
|
||||
#endif
|
||||
var BtnContainer = transform.Find("MainFuncContainer");
|
||||
|
||||
UIManager.AddEvent(BtnRide.gameObject, EventTriggerType.PointerClick, GoRide);
|
||||
UIManager.AddEvent(BtnRide.gameObject, EventTriggerType.PointerEnter, OnHover);
|
||||
UIManager.AddEvent(BtnRide.gameObject, EventTriggerType.PointerExit, OnExit);
|
||||
@@ -84,28 +86,28 @@ public class NewHomeController : PFUIPanel
|
||||
});
|
||||
UIManager.AddEvent(BtnTraining.gameObject, EventTriggerType.PointerEnter, OnHover);
|
||||
UIManager.AddEvent(BtnTraining.gameObject, EventTriggerType.PointerExit, OnExit);
|
||||
var avatar = userInfo.Find("Avatar").GetComponent<RawImage>();
|
||||
var rect = ((RectTransform)avatar.transform).rect;
|
||||
var avatar = userInfo.Find("Avatar").GetComponent<RawImage>();
|
||||
var rect = ((RectTransform)avatar.transform).rect;
|
||||
SetRounded(avatar.transform, rect.height);
|
||||
|
||||
UIManager.AddEvent(avatar.gameObject, EventTriggerType.PointerClick, x =>
|
||||
{
|
||||
UIManager.ShowUserInfoPanel();
|
||||
});
|
||||
|
||||
|
||||
UIManager.AddEvent(userInfo.Find("BtnMore").gameObject, EventTriggerType.PointerClick, x =>
|
||||
{
|
||||
UIManager.ShowUserInfoPanel();
|
||||
//UIManager.ShowConfirm("Quit", "Do you want to quit PowerFun?", null);
|
||||
});
|
||||
if (transform.Find("Other/BtnRower"))
|
||||
if (transform.Find("Other/BtnRower"))
|
||||
{
|
||||
UIManager.AddEvent(transform.Find("Other/BtnRower").gameObject, EventTriggerType.PointerClick, b =>
|
||||
{
|
||||
UIManager.ShowRowerPanel();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//GetSummary();
|
||||
dict = new Dictionary<string, Sprite[]>
|
||||
{
|
||||
@@ -124,7 +126,18 @@ public class NewHomeController : PFUIPanel
|
||||
// }
|
||||
//},
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
private void GoGameRoom(BaseEventData e)
|
||||
{
|
||||
#if UNITY_STANDALONE_WIN
|
||||
OnExit(e);
|
||||
var pe = (PointerEventData)e;
|
||||
if (pe == null)
|
||||
return;
|
||||
var parent = pe.pointerEnter.transform.parent;
|
||||
UIManager.ShowGameRoomListPanel();
|
||||
#endif
|
||||
}
|
||||
private void GoRide(BaseEventData e)
|
||||
{
|
||||
@@ -142,11 +155,11 @@ public class NewHomeController : PFUIPanel
|
||||
{
|
||||
UIManager.ShowNewRouteOverviewPanel();
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
OnExit(e);
|
||||
}
|
||||
void goTraining(BaseEventData e)
|
||||
void goTraining(BaseEventData e)
|
||||
{
|
||||
#if !(UNITY_IOS || UNITY_ANDROID)
|
||||
var path = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\PowerFun\Rhino.PowerFun.exe";
|
||||
@@ -189,7 +202,7 @@ public class NewHomeController : PFUIPanel
|
||||
UIManager.ShowRaceHomePanel();
|
||||
OnExit(e);
|
||||
}
|
||||
private void OnHover(BaseEventData e)
|
||||
private void OnHover(BaseEventData e)
|
||||
{
|
||||
var pe = (PointerEventData)e;
|
||||
var parent = pe.pointerEnter.transform.parent;
|
||||
@@ -201,6 +214,10 @@ public class NewHomeController : PFUIPanel
|
||||
//parent.Find("Text").GetComponent<Text>().color = Utils.HexToColorHtml("#ffffff");
|
||||
parent.DOScale(new Vector3(1.05f, 1.05f, 0), 0.3f);
|
||||
//parent.GetComponent<RectTransform>().localScale = ;
|
||||
|
||||
#if UNITY_STANDALONE_WIN
|
||||
parent.Find("ImageL").gameObject.SetActive(true);
|
||||
#endif
|
||||
}
|
||||
private void OnExit(BaseEventData e)
|
||||
{
|
||||
@@ -208,12 +225,15 @@ public class NewHomeController : PFUIPanel
|
||||
var parent = pe.pointerEnter.transform.parent;
|
||||
//parent.Find("Image").GetComponent<Image>().sprite = Resources.Load<Sprite>("Images/home/Entrance - ROUTES_nomal");
|
||||
//parent.Find("Text").GetComponent<Text>().color = Utils.HexToColorHtml("#5C5C6E");
|
||||
if (dict.ContainsKey(parent.name))
|
||||
if (dict.ContainsKey(parent.name))
|
||||
{
|
||||
parent.Find("Image").GetComponent<Image>().sprite = dict[parent.name][0];
|
||||
}
|
||||
parent.DOScale(new Vector3(1f, 1f, 0), 0.3f);
|
||||
//parent.GetComponent<RectTransform>().localScale = new Vector3(1f, 1f, 0);
|
||||
#if UNITY_STANDALONE_WIN
|
||||
parent.Find("ImageL").gameObject.SetActive(false);
|
||||
#endif
|
||||
}
|
||||
void MoreFunc()
|
||||
{
|
||||
@@ -227,7 +247,7 @@ public class NewHomeController : PFUIPanel
|
||||
userInfo.Find("NickName").GetComponent<Text>().text = App.CurrentUser.Nickname;
|
||||
userInfo.Find("GroupTop").Find("FtpContainer").Find("FtpValue").GetComponent<Text>().text = App.CurrentUser.FTP.ToString();
|
||||
userInfo.Find("GroupTop").Find("WeightContainer").Find("WeightValue").GetComponent<Text>().text = App.CurrentUser.Weight.ToString();
|
||||
userInfo.Find("GroupTop").Find("WKGContainer").Find("WKGValue").GetComponent<Text>().text = $"{ (App.CurrentUser.FTP/ App.CurrentUser.Weight).ToString("0.0") }";
|
||||
userInfo.Find("GroupTop").Find("WKGContainer").Find("WKGValue").GetComponent<Text>().text = $"{ (App.CurrentUser.FTP / App.CurrentUser.Weight).ToString("0.0") }";
|
||||
userInfo.Find("IDText").GetComponent<Text>().text = "ID:" + App.CurrentUser.Id.ToString("000000");
|
||||
if (!string.IsNullOrWhiteSpace(App.CurrentUser.Unionid))
|
||||
{
|
||||
@@ -244,22 +264,22 @@ public class NewHomeController : PFUIPanel
|
||||
Utils.DisplayHead(userInfo.Find("Avatar").GetComponent<RawImage>(), App.CurrentUser.WxHeadImg);
|
||||
|
||||
userInfo.Find("Country").GetComponent<RawImage>().texture = UIManager.Instance.loginRegOptions.GetCountryImageByName(App.CurrentUser.Country);
|
||||
userInfo.Find("CaloriesContainer").Find("CaloriesValue").GetComponent<Text>().text = double.Parse(summary.Kcal,CultureInfo.InvariantCulture).ToString("0") +" KCAL";
|
||||
userInfo.Find("KMContainer").Find("KMValue").GetComponent<Text>().text = summary.TotalDistance.ToString("0") +" KM";
|
||||
userInfo.Find("ClimbContainer").Find("ClimbValue").GetComponent<Text>().text = double.Parse(summary.TotalClimb,CultureInfo.InvariantCulture).ToString("0") + " M";
|
||||
userInfo.Find("CaloriesContainer").Find("CaloriesValue").GetComponent<Text>().text = double.Parse(summary.Kcal, CultureInfo.InvariantCulture).ToString("0") + " KCAL";
|
||||
userInfo.Find("KMContainer").Find("KMValue").GetComponent<Text>().text = summary.TotalDistance.ToString("0") + " KM";
|
||||
userInfo.Find("ClimbContainer").Find("ClimbValue").GetComponent<Text>().text = double.Parse(summary.TotalClimb, CultureInfo.InvariantCulture).ToString("0") + " M";
|
||||
|
||||
userInfo.Find("GroupTop").Find("FtpContainer").Find("FtpTime").GetComponent<Text>().text = App.CurrentUser.LastUpdateFtpTime.ToString("dd.MM.yyyy");
|
||||
userInfo.Find("GroupTop").Find("WeightContainer").Find("WeightTime").GetComponent<Text>().text = App.CurrentUser.LastUpdateWeightTime.ToString("dd.MM.yyyy");
|
||||
userInfo.Find("GroupTop").Find("WKGContainer").Find("WKGTime").GetComponent<Text>().text =
|
||||
DateTime.Compare(App.CurrentUser.LastUpdateFtpTime, App.CurrentUser.LastUpdateWeightTime)>0
|
||||
? App.CurrentUser.LastUpdateFtpTime.ToString("dd.MM.yyyy")
|
||||
userInfo.Find("GroupTop").Find("WKGContainer").Find("WKGTime").GetComponent<Text>().text =
|
||||
DateTime.Compare(App.CurrentUser.LastUpdateFtpTime, App.CurrentUser.LastUpdateWeightTime) > 0
|
||||
? App.CurrentUser.LastUpdateFtpTime.ToString("dd.MM.yyyy")
|
||||
: App.CurrentUser.LastUpdateWeightTime.ToString("dd.MM.yyyy");
|
||||
//新版设计稿
|
||||
var todayData = transform.Find("TodayData");
|
||||
if (todayData)
|
||||
if (todayData)
|
||||
{
|
||||
Utils.DisplayHead(todayData.Find("Avatar").GetComponent<RawImage>(), App.CurrentUser.WxHeadImg);
|
||||
todayData.Find("Distance/Value").GetComponent<Text>().text = $"{summary.ContinuesDay}"+ (summary.ContinuesDay > 1 ? App.GetLocalString("DAYS") : App.GetLocalString("DAY"));
|
||||
todayData.Find("Datas/Distance/Value").GetComponent<Text>().text = $"{summary.ContinuesDay}" + (summary.ContinuesDay > 1 ? App.GetLocalString("DAYS") : App.GetLocalString("DAY"));
|
||||
todayData.Find("Datas/Climb/Value").GetComponent<Text>().text = $"{summary.ContinuesKm.ToString("#0.0")}";//$"{double.Parse(summary.TotalClimb, CultureInfo.InvariantCulture).ToString("0")}M";
|
||||
todayData.Find("Datas/Carlories/Value").GetComponent<Text>().text = $"{summary.ContinuesKcal.ToString("#0")}";
|
||||
//todayData.Find("Datas/Distance/Rank").GetComponent<Text>().text = summary.CurrentTotalDistance == 0 ? "——" : $"+{summary.CurrentTotalDistance.ToString("#0")}";
|
||||
@@ -270,7 +290,7 @@ public class NewHomeController : PFUIPanel
|
||||
//todayData.Find("ID").GetComponent<Text>().text = $"ID:{App.CurrentUser.Id.ToString("000000")}";
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
async void GetSummary()
|
||||
{
|
||||
@@ -304,21 +324,21 @@ public class NewHomeController : PFUIPanel
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
//maxt -= Time.deltaTime;
|
||||
//if (maxt <= 0)
|
||||
//{
|
||||
// GetMaxRanking();
|
||||
// maxt += 60f * 5;
|
||||
//}
|
||||
//if (maxdataTime > 0)
|
||||
//{
|
||||
// maxdataTime -= Time.deltaTime;
|
||||
//}
|
||||
//else if (maxdataTime < 0)
|
||||
//{
|
||||
// DORotateMaxData();
|
||||
// maxdataTime += 10f;
|
||||
//}
|
||||
maxt -= Time.deltaTime;
|
||||
if (maxt <= 0)
|
||||
{
|
||||
GetMaxRanking();
|
||||
maxt += 60f * 5;
|
||||
}
|
||||
if (maxdataTime > 0)
|
||||
{
|
||||
maxdataTime -= Time.deltaTime;
|
||||
}
|
||||
else if (maxdataTime < 0)
|
||||
{
|
||||
DORotateMaxData();
|
||||
maxdataTime += 10f;
|
||||
}
|
||||
}
|
||||
private async void GetMaxRanking()
|
||||
{
|
||||
@@ -341,7 +361,7 @@ public class NewHomeController : PFUIPanel
|
||||
//d.Find("NickName").GetComponent<Text>().text = list[0].NickName;
|
||||
//c.Find("NickName").GetComponent<Text>().text = list[2].NickName;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
transform.Find("MaxRankingData").gameObject.SetActive(false);
|
||||
}
|
||||
@@ -364,7 +384,7 @@ public class NewHomeController : PFUIPanel
|
||||
se.Append(s1);
|
||||
se.Append(t.DORotate(Vector3.zero, 0.5f));
|
||||
}
|
||||
void SetMessage(MapMaxRanking e)
|
||||
void SetMessage(MapMaxRanking e)
|
||||
{
|
||||
var m = transform.Find("MaxRankingData");
|
||||
Utils.DisplayHead(m.transform.Find("Avatar").GetComponent<RawImage>(), e.WxHeadImg);
|
||||
@@ -381,7 +401,7 @@ public class NewHomeController : PFUIPanel
|
||||
transform.MyDOFade();
|
||||
GetSummary();
|
||||
#if UNITY_STANDALONE_WIN
|
||||
//GetNotify();
|
||||
GetNotify();
|
||||
#endif
|
||||
//transform.Find("Panel (1)").GetComponent<test>().startPage();
|
||||
}
|
||||
@@ -389,15 +409,15 @@ public class NewHomeController : PFUIPanel
|
||||
private async Task GetNotify()
|
||||
{
|
||||
var r = await ConfigHelper.userApi.GetNotify();
|
||||
if (r.result)
|
||||
if (r.result)
|
||||
{
|
||||
var lm = transform.Find("LongMessage");
|
||||
if (r.data.Value<int>("Id") > 1)
|
||||
{
|
||||
lm.gameObject.SetActive(true);
|
||||
lm.GetComponent<LongMessageScript>().Initial(r.data["Content"].ToString().Replace("\r\n"," "));
|
||||
lm.GetComponent<LongMessageScript>().Initial(r.data["Content"].ToString().Replace("\r\n", " "));
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
lm.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user