修改细节
This commit is contained in:
1 parent
b9db3325a8
commit
6ab3ee19f2
9 files changed
+411
-210
No files matched your search
@@ -70,24 +70,26 @@ public class RaceHomeScript : RaceScript
|
||||
btnGoList = rightContainer.Find("Container-2/BtnGoList");
|
||||
UIManager.AddEvent(btnGoList.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, b =>
|
||||
{
|
||||
transform.GetComponent<CanvasGroup>().DOFade(0, 0.5f).onComplete = () =>
|
||||
{
|
||||
UIManager.ShowRaceListPanel();
|
||||
};
|
||||
UIManager.ShowRaceListPanel();
|
||||
});
|
||||
|
||||
}
|
||||
bool isEnter = false;
|
||||
|
||||
async void GetData()
|
||||
{
|
||||
var r = await ConfigHelper.mapCompetitionApi.GetCompetitionListV2("", 0, 7, order: 0);
|
||||
var activityList = await ConfigHelper.mapCompetitionApi.GetCompetitionListV2("", 0, 3, activity: 1, order: 1);
|
||||
var activityList = await ConfigHelper.mapCompetitionApi.GetCompetitionListV2("", 0, 3, activity: 1, order: 2);
|
||||
DisplayMaps(r.data, activityList.data);
|
||||
Initial();
|
||||
Utils.StartTimeUnLimit(10, () =>
|
||||
if (!isEnter)
|
||||
{
|
||||
goRight();
|
||||
});
|
||||
Utils.StartTimeUnLimit(10, () =>
|
||||
{
|
||||
goRight();
|
||||
});
|
||||
isEnter = true;
|
||||
}
|
||||
}
|
||||
private void DisplayMaps(List<MapCompetition> list, List<MapCompetition> activityList)
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@ public class RaceItemScript : MonoBehaviour, IPointerExitHandler, IPointerEnterH
|
||||
Utils.DisplayImage(transform.GetComponent<RawImage>(), mapCompetition.RouteCover, true);
|
||||
Utils.DisplayImage(transform.Find("AltitudeCurve").GetComponent<RawImage>(), mapCompetition.AltitudeGraph, true);
|
||||
transform.Find("InfoContainer/Text").GetComponent<Text>().SetTextWithEllipsis(mapCompetition.Title);
|
||||
transform.Find("GetReadyContainer").gameObject.SetActive(true);
|
||||
transform.Find("GetReadyContainer").gameObject.SetActive(mapCompetition.Status != 4);
|
||||
transform.Find("GetReadyContainer-2").gameObject.SetActive(mapCompetition.Status == 1);
|
||||
//transform.Find("Text").GetComponent<Text>().text = mapCompetition.Title;
|
||||
//props.Find("DistanceText").GetComponent<Text>().text = $"{myMap.Distance.ToString(myMap.Distance > 1000 ? "#0" : "#0.00")}KM";
|
||||
|
||||
@@ -26,10 +26,10 @@ public class RaceListScript : RaceScript
|
||||
{
|
||||
base.Show();
|
||||
handleAvatar();
|
||||
//Refresh();
|
||||
Refresh();
|
||||
}
|
||||
//筛选条件
|
||||
void Start()
|
||||
void Awake()
|
||||
{
|
||||
scroll = transform.Find("ListContainer/List").gameObject;
|
||||
if (scroll != null)
|
||||
@@ -155,13 +155,10 @@ public class RaceListScript : RaceScript
|
||||
{
|
||||
UIManager.AddEvent(btnReturn.gameObject, EventTriggerType.PointerClick, (b) =>
|
||||
{
|
||||
transform.GetComponent<CanvasGroup>().DOFade(0, 0.5f).onComplete = () =>
|
||||
{
|
||||
UIManager.ShowRaceHomePanel(true);
|
||||
};
|
||||
UIManager.ShowRaceHomePanel(true);
|
||||
});
|
||||
}
|
||||
Refresh();
|
||||
//Refresh();
|
||||
}
|
||||
|
||||
private async Task Login()
|
||||
|
||||
@@ -78,12 +78,12 @@ public class RaceScript : PFUIPanel
|
||||
var map = currentItem.GetComponent<RaceItemScript>().mapCompetition;
|
||||
if (map.Status == 1)
|
||||
{
|
||||
currentItem.Find("GetReadyContainer/Title").GetComponent<Text>().text = "Deadline for Registration";
|
||||
currentItem.Find("GetReadyContainer/Title").GetComponent<Text>().text = "Start for Registration";
|
||||
currentItem.Find("GetReadyContainer/Value").GetComponent<Text>().text =
|
||||
map.EndApplyTime.ToString("yyyy-MM-dd HH:mm");
|
||||
currentItem.Find("GetReadyContainer-2/Title").GetComponent<Text>().text = "Start Time";
|
||||
map.StartApplyTime.ToString("yyyy-MM-dd HH:mm");
|
||||
currentItem.Find("GetReadyContainer-2/Title").GetComponent<Text>().text = "Deadline for Registration";
|
||||
currentItem.Find("GetReadyContainer-2/Value").GetComponent<Text>().text =
|
||||
map.StartTime.ToString("yyyy-MM-dd HH:mm");
|
||||
map.EndApplyTime.ToString("yyyy-MM-dd HH:mm");
|
||||
|
||||
if ((map.StartApplyTime - UIManager.Now.GetDateTime()).TotalSeconds < 0 ||
|
||||
(map.StartTime - UIManager.Now.GetDateTime()).TotalSeconds < 0)
|
||||
@@ -101,13 +101,13 @@ public class RaceScript : PFUIPanel
|
||||
currentItem.Find("GetReadyContainer/Value").GetComponent<Text>().text =
|
||||
map.StartTime.ToString("yyyy-MM-dd HH:mm");
|
||||
}
|
||||
else if (map.Status == 4)
|
||||
{
|
||||
currentItem.Find("GetReadyContainer/Title").GetComponent<Text>().text = "End Time";
|
||||
currentItem.Find("GetReadyContainer/Value").GetComponent<Text>().text =
|
||||
map.FirstEndTime.HasValue ?
|
||||
map.FirstEndTime.Value.ToString("yyyy-MM-dd HH:mm") : map.EndTime.ToString("yyyy-MM-dd HH:mm");
|
||||
}
|
||||
//else if (map.Status == 4)
|
||||
//{
|
||||
// currentItem.Find("GetReadyContainer/Title").GetComponent<Text>().text = "End Time";
|
||||
// currentItem.Find("GetReadyContainer/Value").GetComponent<Text>().text =
|
||||
// map.FirstEndTime.HasValue ?
|
||||
// map.FirstEndTime.Value.ToString("yyyy-MM-dd HH:mm") : map.EndTime.ToString("yyyy-MM-dd HH:mm");
|
||||
//}
|
||||
else
|
||||
{
|
||||
//Dictionary<int,>
|
||||
|
||||
@@ -88,7 +88,9 @@ public class RouteItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandle
|
||||
{
|
||||
right = transform.Find("RightMatch");
|
||||
transform.Find("Right").gameObject.SetActive(false);
|
||||
right.Find("Value").GetComponent<Text>().text = result.Ranking.ToString();
|
||||
UIManager.AddEvent(right.Find("BtnDetail").gameObject, EventTriggerType.PointerClick, (b) => Detail());
|
||||
UIManager.AddEvent(right.Find("BtnRide").gameObject, EventTriggerType.PointerClick, (b) => Ride());
|
||||
//right.Find("Value").GetComponent<Text>().text = result.Ranking.ToString();
|
||||
}
|
||||
right.gameObject.SetActive(true);
|
||||
gameObject.GetComponent<Button>().onClick.AddListener(() =>
|
||||
@@ -103,7 +105,14 @@ public class RouteItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandle
|
||||
|
||||
this.index = index;
|
||||
}
|
||||
|
||||
void Detail()
|
||||
{
|
||||
Debug.Log("Detail");
|
||||
}
|
||||
void Ride()
|
||||
{
|
||||
Debug.Log("Ride");
|
||||
}
|
||||
private void Delete()
|
||||
{
|
||||
UIManager.ShowConfirm("Delete", "Delete this record?", async () =>
|
||||
@@ -186,11 +195,11 @@ public class RouteItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandle
|
||||
public void OnPointerExit(PointerEventData eventData)
|
||||
{
|
||||
transform.GetComponent<Image>().color = Utils.HexToColorHtml("#23232d");
|
||||
if (index == 1)
|
||||
{
|
||||
right.Find("Text").GetComponent<Text>().color = Utils.HexToColorHtml("#414251");
|
||||
right.Find("Value").GetComponent<Text>().color = Utils.HexToColorHtml("#5c5c6e");
|
||||
}
|
||||
//if (index == 1)
|
||||
//{
|
||||
// right.Find("Text").GetComponent<Text>().color = Utils.HexToColorHtml("#414251");
|
||||
// right.Find("Value").GetComponent<Text>().color = Utils.HexToColorHtml("#5c5c6e");
|
||||
//}
|
||||
if (left != null)
|
||||
{
|
||||
left.Find("Main").Find("Time").GetComponent<Text>().color = Utils.HexToColorHtml("#414251");
|
||||
@@ -213,11 +222,11 @@ public class RouteItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandle
|
||||
public void OnPointerEnter(PointerEventData eventData)
|
||||
{
|
||||
transform.GetComponent<Image>().color = Utils.HexToColorHtml("#353543");
|
||||
if (index == 1)
|
||||
{
|
||||
right.Find("Text").GetComponent<Text>().color = Utils.HexToColorHtml("#5c5c6e");
|
||||
right.Find("Value").GetComponent<Text>().color = Utils.HexToColorHtml("#ffffff");
|
||||
}
|
||||
//if (index == 1)
|
||||
//{
|
||||
// right.Find("Text").GetComponent<Text>().color = Utils.HexToColorHtml("#5c5c6e");
|
||||
// right.Find("Value").GetComponent<Text>().color = Utils.HexToColorHtml("#ffffff");
|
||||
//}
|
||||
if (left != null)
|
||||
{
|
||||
left.Find("Main").Find("Time").GetComponent<Text>().color = Utils.HexToColorHtml("#5c5c6e");
|
||||
|
||||
@@ -64,11 +64,7 @@ public class DownloadWorkoutsController : PFUIPanel
|
||||
UIManager.AddEvent(Btn.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, (b) =>
|
||||
{
|
||||
//Application.Quit();
|
||||
UIManager.ShowConfirm("Confirm", "Switch to PowerFun Workouts?\nWe will close the Powerfun and start PowerFun Workouts.", () =>
|
||||
{
|
||||
Utils.ExecFile(path);
|
||||
Application.Quit();
|
||||
});
|
||||
OpenFile(path);
|
||||
});
|
||||
UIManager.AddEvent(BtnStart.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick,async (_base) =>
|
||||
{
|
||||
@@ -152,12 +148,7 @@ public class DownloadWorkoutsController : PFUIPanel
|
||||
if (version == PlayerPrefs.GetString("exeVersion_w"))
|
||||
{
|
||||
//Application.Quit();
|
||||
UIManager.ShowConfirm("Confirm", "Switch to PowerFun Workouts?\nWe will close the Powerfun and start PowerFun Workouts.", () =>
|
||||
{
|
||||
Utils.ExecFile(desFileName);
|
||||
Application.Quit();
|
||||
});
|
||||
|
||||
OpenFile(desFileName);
|
||||
yield break;
|
||||
}
|
||||
else
|
||||
@@ -249,6 +240,14 @@ public class DownloadWorkoutsController : PFUIPanel
|
||||
return false;
|
||||
}
|
||||
}
|
||||
void OpenFile(string p)
|
||||
{
|
||||
UIManager.ShowConfirm("Confirm", "Switch to PowerFun Workouts?\nWe will close the Powerfun and start PowerFun Workouts.", () =>
|
||||
{
|
||||
Utils.ExecFile(p);
|
||||
Application.Quit();
|
||||
});
|
||||
}
|
||||
void SetType(int a)
|
||||
{
|
||||
switch (a)
|
||||
|
||||
Reference in new issue
Block a user