修改细节

This commit is contained in:
Caiyanpeng committed 2021-12-29 14:23:37 +08:00
1 parent b3f6bb6861
commit bac3334a01
44 files changed
+7061 -2427

No files matched your search

@@ -70,6 +70,17 @@ public class BigMapController : PFUIPanel
begin = Resources.Load("UI/Prefab/BigMap/Begin");
StartCoroutine("Main");
#if UNITY_ANDROID || UNITY_IOS
var nav = transform.Find("Canvas/Tmp/MainNav-mobile").GetComponent<NewMainNav>();
nav.SetButtonActive(new List<int> { 2, 3, 4, 6, 7 }, 2,
custom: new NewMainNav.CustomButton(Resources.Load<Sprite>("Images/搜索"), () =>
{
mapManager.Destroy();
UIManager.PopStack();
UIManager.ShowNewRouteOverviewPanel();
}));
newNav = nav;
#endif
}
IEnumerator Main()
@@ -70,6 +70,13 @@ public class EarthController : PFUIPanel
panel = rootPanel.Find("Panel").gameObject;
#if UNITY_ANDROID || UNITY_IOS
SetRounded(panel.transform, 20);
var nav = transform.Find("Canvas/Panel/Tmp/MainNav-mobile").GetComponent<NewMainNav>();
nav.SetButtonActive(new List<int> { 2, 3, 4, 6, 7 }, 2,
custom: new NewMainNav.CustomButton(Resources.Load<Sprite>("Images/搜索"), () =>
{
UIManager.ShowNewRouteOverviewPanel();
}));
newNav = nav;
#else
SetRounded(panel.transform, 60);
#endif
@@ -38,10 +38,15 @@ public class HomeController : PFUIPanel
#if UNITY_ANDROID || UNITY_IOS
var nav = transform.Find("MainNav-mobile").GetComponent<NewMainNav>();
nav.SetButtonActive(new List<int> { 1, 3, 4, 6 });
newNav = nav;
UIManager.AddEvent(transform.Find("TodayData/Avatar").gameObject, EventTriggerType.PointerClick, b =>
{
UIManager.ShowUserInfoPanel();
});
UIManager.AddEvent(transform.Find("TodayData/Datas/Distance").gameObject, EventTriggerType.PointerClick, b =>
{
UIManager.ShowResultListPanel();
});
#else
mainNav = this.transform.Find("MainNav").GetComponent<MainNav>();
mainNav.ShowExit();
@@ -237,13 +242,17 @@ public class HomeController : PFUIPanel
: App.CurrentUser.LastUpdateWeightTime.ToString("dd.MM.yyyy");
//新版设计稿
var todayData = transform.Find("TodayData");
Utils.DisplayHead(todayData.Find("Avatar").GetComponent<RawImage>(), App.CurrentUser.WxHeadImg);
todayData.Find("Datas/Distance/Value").GetComponent<Text>().text = $"{summary.TotalDistance.ToString("#0")}KM";
todayData.Find("Datas/Climb/Value").GetComponent<Text>().text = $"{double.Parse(summary.TotalClimb, CultureInfo.InvariantCulture).ToString("0")}M";
todayData.Find("Datas/Carlories/Value").GetComponent<Text>().text = $"{summary.TotalKj.ToString("#0")}KCAL";
todayData.Find("Datas/Distance/Rank").GetComponent<Text>().text = summary.CurrentTotalDistance==0? "——" : $"+{summary.CurrentTotalDistance.ToString("#0")}";
todayData.Find("Datas/Climb/Rank").GetComponent<Text>().text = summary.CurrentTotalClimb == 0 ? "——" : $"+{summary.CurrentTotalClimb.ToString("#0")}";
todayData.Find("Datas/Carlories/Rank").GetComponent<Text>().text = summary.CurrentTotalKcal == 0 ? "——" : $"+{summary.CurrentTotalKcal.ToString("#0")}";
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/Climb/Value").GetComponent<Text>().text = $"{summary.TotalDistance.ToString("#0")}KM";//$"{double.Parse(summary.TotalClimb, CultureInfo.InvariantCulture).ToString("0")}M";
todayData.Find("Datas/Carlories/Value").GetComponent<Text>().text = $"{summary.TotalKj.ToString("#0")}KCAL";
//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/Carlories/Rank").GetComponent<Text>().text = summary.CurrentTotalKcal == 0 ? "——" : $"+{summary.CurrentTotalKcal.ToString("#0")}";
}
}
async void GetSummary()
{
@@ -44,6 +44,8 @@ public class MapListController : PFUIPanel
return content;
}
}
private bool isEnd = false;
private Transform topContainer;
void ResetPage()
@@ -82,10 +84,7 @@ public class MapListController : PFUIPanel
var mc = transform.Find("MC");
UIManager.AddEvent(transform.Find("SwitchMode/BtnFilter").gameObject, EventTriggerType.PointerClick, b =>
{
topContainer.DOLocalMoveX(App.topRectStartX.Value + topRect.rect.width, 0.3f);
mc.gameObject.SetActive(true);
mc.GetComponent<CanvasGroup>().alpha = 0;
mc.GetComponent<CanvasGroup>().DOFade(1, 0.3f);
OpenFilter();
});
UIManager.AddEvent(mc.gameObject, EventTriggerType.PointerClick, b =>
{
@@ -96,6 +95,14 @@ public class MapListController : PFUIPanel
};
});
map = Resources.Load<GameObject>("UI/Prefab/MapList/MapItem-Mobile");
Debug.Log(98);
var nav = transform.Find("Tmp/MainNav-mobile").GetComponent<NewMainNav>();
nav.SetButtonActive(new List<int> { 0, 3, 4, 6, 7 }, 0,
new NewMainNav.CustomButton(Resources.Load<Sprite>("Images/Mobile/map_筛选"), () =>
{
OpenFilter();
}));
newNav = nav;
#else
topContainer = transform.Find("Panel").Find("Top");
#endif
@@ -106,9 +113,10 @@ public class MapListController : PFUIPanel
{
Application.OpenURL("http://192.168.0.101:3081/Mine/Upload?token="+ App.CurrentUser.cookie);
});
#endif
transform.Find("MainNav").GetComponent<MainNav>().ShowBack();
#endif
sort = "Near";
sortDire = "asc";
//if (hardSelector != null)
@@ -278,6 +286,22 @@ public class MapListController : PFUIPanel
}
caches = new Dictionary<string, Texture>();
}
public void OpenFilter()
{
#if UNITY_ANDROID || UNITY_IOS
var topRect = transform.Find("Top").GetComponent<RectTransform>();
if (!App.topRectStartX.HasValue)
{
App.topRectStartX = topRect.localPosition.x;
}
topRect.DOLocalMoveX(App.topRectStartX.Value + topRect.rect.width, 0.3f);
var mc = transform.Find("MC");
mc.gameObject.SetActive(true);
mc.GetComponent<CanvasGroup>().alpha = 0;
mc.GetComponent<CanvasGroup>().DOFade(1, 0.3f);
#endif
topRect.Find("SearchInput").GetComponent<InputField>().OnPointerClick(new PointerEventData(EventSystem.current));
}
void onEndEdit()
{
var t = searchInput.GetComponent<InputField>().text;
@@ -40,6 +40,7 @@ public class MapListExtraController : PFUIPanel
typeSelector.Find("Collection").GetComponent<Text>().color = Utils.HexToColorHtml("#5c5c6e");
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 =>
{
@@ -47,6 +48,7 @@ public class MapListExtraController : PFUIPanel
typeSelector.Find("Collection").GetComponent<Text>().color = Utils.HexToColorHtml("#ffffff");
p1.DOLocalMoveX(p1originx - 764f, 0.5f);
p2.DOLocalMoveX(p2originx - 764f, 0.5f);
transform.Find("Tmp/MainNav-mobile").GetComponent<NewMainNav>().HideButton("Custom");
});
}
@@ -82,6 +84,7 @@ public class MapListExtraController : PFUIPanel
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");
transform.Find("Tmp/MainNav-mobile").GetComponent<NewMainNav>().ShowButton("Custom");
}
private async void GetList()
{
@@ -59,7 +59,7 @@ public class NewRouteDetailController : PFUIPanel
#if UNITY_ANDROID || UNITY_IOS
var nav = transform.Find("Tmp/MainNav-mobile").GetComponent<NewMainNav>();
nav.SetButtonActive(new List<int> { 0, 3, 4, 6, 7 }, 0);
newNav = nav;
UIManager.AddEvent(transform.Find("Container/Left/Fav").gameObject, EventTriggerType.PointerClick, async b =>
{
Assets.Scripts.Apis.JsonResult<object> res = null;
@@ -72,6 +72,7 @@ public class NewRouteOverviewController: PFUIPanel
//UIManager.ShowBigMapPanel();
UIManager.ShowEarthPanel(App.latitude, App.longitude);
}));
newNav = nav;
var rect = transform.GetComponent<RectTransform>();
rect.offsetMax = new Vector2(rect.offsetMax.x, 0);
rect.offsetMin = new Vector2(rect.offsetMin.x, 0);
@@ -110,6 +111,10 @@ public class NewRouteOverviewController: PFUIPanel
{
ToList("All Route");
});
UIManager.AddEvent(transform.Find("Container/BtnSearch").gameObject, EventTriggerType.PointerClick, b =>
{
GoSearch();
});
BindHeadImage();
//banner暂时注释
//#if !(UNITY_ANDROID || UNITY_IOS)
@@ -202,13 +207,22 @@ public class NewRouteOverviewController: PFUIPanel
}
/// <summary>
/// 绑定头像
///
/// </summary>
void ToList(string type)
{
App.CurrentRouteType = type;// "";
UIManager.ShowMapListPanel();
}
void GoSearch()
{
App.CurrentRouteType = "All Route";// "";
UIManager.ShowMapListPanel(panel=>
{
panel.OpenFilter();
});
}
public override void Show()
{
base.Show();
+1 -1
View File
@@ -12,7 +12,7 @@ using Assets.Scripts;
//{
public class PFUIPanel : UIBehaviour
{
public NewMainNav newNav = null;
public void OpenURL(string url)
{
Application.OpenURL(url);