请求公开线路;增加移动版

This commit is contained in:
Caiyanpeng committed 2022-03-03 15:06:13 +08:00
1 parent 01df299251
commit c3514df331
24 files changed
+4429 -1322

No files matched your search

+37 -2
View File
@@ -114,10 +114,21 @@ public class MapItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandler,
if (!isModal)
{
transform.Find("CollectImg").GetComponent<Button>().onClick.RemoveAllListeners();
transform.Find("CollectImg").GetComponent<Button>().onClick.AddListener(Collect);
if (App.CurrentRouteType == "My Upload")
{
transform.Find("CollectImg").GetComponent<Button>().onClick.AddListener(ApplyOpenRoute);
}
else
{
transform.Find("CollectImg").GetComponent<Button>().onClick.AddListener(Collect);
}
}
transform.Find("CollectImg").Find("Image").GetComponent<Image>().sprite =
UIManager.Instance.collectDict[myMap.IsFavorite];
App.CurrentRouteType != "My Upload"?UIManager.Instance.collectDict[myMap.IsFavorite]: UIManager.Instance.uploadDict[myMap.IsEnabled];
if (App.CurrentRouteType == "My Upload")
{
transform.Find("CollectImg").Find("Image").GetComponent<RectTransform>().sizeDelta = new Vector2(25, 20f);
}
#if !(UNITY_ANDROID || UNITY_IOS)
transform.Find("CollectImg").gameObject.SetActive(false);
#endif
@@ -165,6 +176,30 @@ public class MapItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandler,
}
}
void ApplyOpenRoute()
{
if (!map.IsEnabled)
{
UIManager.ShowConfirm(App.GetLocalString("Request to make the route public"), App.GetLocalString("Do you want to make the route public?"), async () =>
{
var res = await ConfigHelper.mapApi.ApplyOpenRoute(map.Id);
if (res.result)
{
Utils.showToast(null, App.GetLocalString("Submitted, please wait for background review."), type: 1);
UIManager.CloseConfirm();
}
else
{
Utils.showToast(null, res.errMsg);
}
});
}
else
{
Utils.showToast(null, App.GetLocalString("Route is public."), type: 1);
}
}
private void Ride()
{
App.RouteIdParam = map.Id;