This commit is contained in:
Caiyanpeng committed 2022-01-06 17:51:17 +08:00
1 parent ba36014712
commit 2d38b63c91
27 files changed
+4562 -2172

No files matched your search

@@ -246,10 +246,10 @@ public class HomeController : PFUIPanel
{
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/Climb/Value").GetComponent<Text>().text = $"{summary.ContinuesKm.ToString("#0")}KM";//$"{double.Parse(summary.TotalClimb, CultureInfo.InvariantCulture).ToString("0")}M";
todayData.Find("Datas/Carlories/Value").GetComponent<Text>().text = $"{summary.ContinuesKcal.ToString("#0")}KCAL";
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")}";
todayData.Find("Datas/Climb/Rank").GetComponent<Text>().text = summary.CurrentTotalDistance == 0 ? "——" : $"+{summary.CurrentTotalDistance.ToString("#0")}";
todayData.Find("Datas/Climb/Rank").GetComponent<Text>().text = summary.CurrentTotalDistance == 0 ? "——" : $"+{summary.CurrentTotalDistance.ToString("#0.0")}";
todayData.Find("Datas/Carlories/Rank").GetComponent<Text>().text = summary.CurrentTotalKcal == 0 ? "——" : $"+{summary.CurrentTotalKcal.ToString("#0")}";
}
@@ -282,12 +282,38 @@ public class HomeController : PFUIPanel
// Utils.showToast(gameObject, res.errMsg);
//}
}
float maxt = 0f; //用于获取全服最值内容
// Update is called once per frame
void Update()
{
maxt -= Time.deltaTime;
if (maxt <= 0)
{
GetMaxRanking();
maxt += 60f;
}
}
private async void GetMaxRanking()
{
var res = await ConfigHelper.mapApi.GetMaxRanking();
if (res.result)
{
var list = res.data;
if (list.Count >= 3)
{
Transform p = transform.Find("MaxRankingData/Power"),
d = transform.Find("MaxRankingData/Distance"),
c = transform.Find("MaxRankingData/Climb");
Utils.DisplayHead(p.Find("Avatar").GetComponent<RawImage>(), list[1].WxHeadImg);
Utils.DisplayHead(d.Find("Avatar").GetComponent<RawImage>(), list[0].WxHeadImg);
Utils.DisplayHead(c.Find("Avatar").GetComponent<RawImage>(), list[2].WxHeadImg);
p.Find("NickName").GetComponent<Text>().text = list[1].NickName;
d.Find("NickName").GetComponent<Text>().text = list[0].NickName;
c.Find("NickName").GetComponent<Text>().text = list[2].NickName;
}
}
}
public override void Show()
{
base.Show();
@@ -34,18 +34,22 @@ public class MapListExtraController : PFUIPanel
#else
tmpCollectItem = Resources.Load<Transform>("UI/Prefab/NewRoute/RouteItem");
#endif
UIManager.AddEvent(typeSelector.Find("Route").gameObject, EventTriggerType.PointerClick, b =>
UIManager.AddEvent(typeSelector.Find("Container/Route").gameObject, EventTriggerType.PointerClick, b =>
{
typeSelector.Find("Route").GetComponent<Text>().color = Utils.HexToColorHtml("#ffffff");
typeSelector.Find("Collection").GetComponent<Text>().color = Utils.HexToColorHtml("#5c5c6e");
typeSelector.Find("Container/Route").GetComponent<Text>().color = Utils.HexToColorHtml("#ffffff");
typeSelector.Find("Container1/Collection").GetComponent<Text>().color = Utils.HexToColorHtml("#5c5c6e");
typeSelector.Find("Container/Line").gameObject.SetActive(true);
typeSelector.Find("Container1/Line").gameObject.SetActive(false);
p1.DOLocalMoveX(p1originx, 0.5f);
p2.DOLocalMoveX(p2originx, 0.5f);
transform.Find("Tmp/MainNav-mobile").GetComponent<NewMainNav>().ShowButton("Custom");
});
UIManager.AddEvent(typeSelector.Find("Collection").gameObject, EventTriggerType.PointerClick, b =>
UIManager.AddEvent(typeSelector.Find("Container1/Collection").gameObject, EventTriggerType.PointerClick, b =>
{
typeSelector.Find("Route").GetComponent<Text>().color = Utils.HexToColorHtml("#5c5c6e");
typeSelector.Find("Collection").GetComponent<Text>().color = Utils.HexToColorHtml("#ffffff");
typeSelector.Find("Container/Route").GetComponent<Text>().color = Utils.HexToColorHtml("#5c5c6e");
typeSelector.Find("Container1/Collection").GetComponent<Text>().color = Utils.HexToColorHtml("#ffffff");
typeSelector.Find("Container/Line").gameObject.SetActive(false);
typeSelector.Find("Container1/Line").gameObject.SetActive(true);
p1.DOLocalMoveX(p1originx - 764f, 0.5f);
p2.DOLocalMoveX(p2originx - 764f, 0.5f);
transform.Find("Tmp/MainNav-mobile").GetComponent<NewMainNav>().HideButton("Custom");
@@ -82,8 +86,10 @@ public class MapListExtraController : PFUIPanel
}
p1.localPosition = new Vector3(p1originx, p1.localPosition.y, p1.localPosition.z);
p2.localPosition = new Vector3(p2originx, p2.localPosition.y, p2.localPosition.z);
typeSelector.Find("Route").GetComponent<Text>().color = Utils.HexToColorHtml("#ffffff");
typeSelector.Find("Collection").GetComponent<Text>().color = Utils.HexToColorHtml("#5c5c6e");
typeSelector.Find("Container/Route").GetComponent<Text>().color = Utils.HexToColorHtml("#ffffff");
typeSelector.Find("Container1/Collection").GetComponent<Text>().color = Utils.HexToColorHtml("#5c5c6e");
typeSelector.Find("Container/Line").gameObject.SetActive(true);
typeSelector.Find("Container1/Line").gameObject.SetActive(false);
transform.Find("Tmp/MainNav-mobile").GetComponent<NewMainNav>().ShowButton("Custom");
}
private async void GetList()
@@ -147,7 +147,7 @@ public class NewRouteDetailController : PFUIPanel
.text = string.Empty;
transform.Find("Container/Left/Infos/SlopeContainer/Text").GetComponent<Text>()
.text = string.Empty;
transform.Find("Container/Left/Desc").GetComponent<Text>()
transform.Find("Container/Left/DescScroll/Viewport/Content/Desc").GetComponent<Text>()
.text = string.Empty;
if (area.CoverImage != null)
{
@@ -253,8 +253,9 @@ public class NewRouteDetailController : PFUIPanel
.text = $"{res.data.TotalClimb.ToString("#0")}M";
transform.Find("Container/Left/Infos/SlopeContainer/Text").GetComponent<Text>()
.text = $"{res.data.AverageGrade.ToString("#0.00")}%";
transform.Find("Container/Left/Desc").GetComponent<Text>()
transform.Find("Container/Left/DescScroll/Viewport/Content/Desc").GetComponent<Text>()
.text = res.data.Description;
LayoutRebuilder.ForceRebuildLayoutImmediate(transform.Find("Container/Left/DescScroll").GetComponent<ScrollRect>().content);
transform.Find("Container/Left/Fav").GetComponent<Image>().sprite = FavDict[res.data.IsFav];
LayoutRebuilder.ForceRebuildLayoutImmediate(transform.Find("Container/Left/RideContainer").GetComponent<RectTransform>());
}
@@ -112,9 +112,9 @@ public class UserInfoController : PFUIPanel
#if UNITY_IOS || UNITY_ANDROID
infoPanel.Find("Container/Ftp").Find("Value").GetComponent<Text>().text = user.FTP.ToString();
infoPanel.Find("Container/MHR").Find("Value").GetComponent<Text>().text = user.MaxHeartRate.ToString();
infoPanel.Find("Container/Weight").Find("Value").GetComponent<Text>().text = $"{user.Weight}KG";
infoPanel.Find("Container/BW").Find("Value").GetComponent<Text>().text = $"{user.BicycleWeight}KG";
infoPanel.Find("Container/WD").Find("Value").GetComponent<Text>().text = $"{user.WheelDiameter}MM";
infoPanel.Find("Container/Weight").Find("Value").GetComponent<Text>().text = $"{user.Weight}";
infoPanel.Find("Container/BW").Find("Value").GetComponent<Text>().text = $"{user.BicycleWeight}";
infoPanel.Find("Container/WD").Find("Value").GetComponent<Text>().text = $"{user.WheelDiameter}";
infoPanel.Find("Container/Ftp").Find("Time").GetComponent<Text>().text = user.LastUpdateFtpTime.ToLocalString("dd-MM-yyyy");
infoPanel.Find("Container/Weight").Find("Time").GetComponent<Text>().text = user.LastUpdateWeightTime.ToLocalString("dd-MM-yyyy");
infoPanel.Find("Container/BW").Find("Time").GetComponent<Text>().text = user.LastUpdateBicycleWeightTime.ToLocalString("dd-MM-yyyy");