修改细节
This commit is contained in:
1 parent
b3f6bb6861
commit
bac3334a01
44 files changed
+7061
-2427
No files matched your search
@@ -118,8 +118,29 @@ public class MapItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandler,
|
||||
|
||||
Utils.DisplayImageTempDict(transform.Find("MapTitleImg").GetComponent<RawImage>(), myMap.CoverImage, this.caches);
|
||||
Utils.DisplayImageTempDict(transform.Find("MapHBImg").GetComponent<RawImage>(), myMap.AltitudeGraph, this.caches);
|
||||
|
||||
|
||||
SetActive4Button(false);
|
||||
#if UNITY_ANDROID || UNITY_IOS
|
||||
var isRecent = App.CurrentRouteType == "Recent Routes" && myMap.RecentRecord != null && myMap.RecentRecord.ContinueCyclingParam != null;
|
||||
transform.Find("BtnContinue").gameObject.SetActive(isRecent);
|
||||
transform.Find("BtnReride").gameObject.SetActive(isRecent);
|
||||
transform.Find("MapHBImg").gameObject.SetActive(!isRecent);
|
||||
if (isRecent)
|
||||
{
|
||||
transform.Find("BtnContinue").GetComponent<Button>().onClick.RemoveAllListeners();
|
||||
transform.Find("BtnReride").GetComponent<Button>().onClick.RemoveAllListeners();
|
||||
transform.Find("BtnContinue").GetComponent<Button>().onClick.AddListener(() =>
|
||||
{
|
||||
if (myMap.RecentRecord != null && myMap.RecentRecord.ContinueCyclingParam != null)
|
||||
{
|
||||
App.RouteIdParam = myMap.RecentRecord.RouteId;
|
||||
App.routeResult = myMap.RecentRecord;
|
||||
SceneManager.LoadScene("Ride");
|
||||
}
|
||||
});
|
||||
transform.Find("BtnReride").GetComponent<Button>().onClick.AddListener(Ride);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
private void Ride()
|
||||
|
||||
@@ -28,35 +28,46 @@ public class NewMainNav : MonoBehaviour
|
||||
float delayTime = 0;
|
||||
private List<string> typeArray = new List<string>()
|
||||
{
|
||||
"Back","Exit","Home","Device","Delay","Setting","Support","Avatar","Custom"
|
||||
"Back","Exit","Home","Device","Delay","Setting","Support","Avatar","Custom","Custom2"
|
||||
};
|
||||
private List<int> indexs = new List<int>();
|
||||
private int? shrinkIndex = null;
|
||||
private CustomButton custom = null;
|
||||
private CustomButton custom = null,custom2 = null;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="indexs">仅展开显示的按钮:1:"Exit",3:"Device",4:"Delay",5:"Setting",6:"Support",7:"Avatar"</param>
|
||||
/// <param name="shrinkIndex">合上后仍显示的按钮:0:"Back",2:"Home",null:仅PF</param>
|
||||
/// <param name="custom">自定义按钮</param>
|
||||
public void SetButtonActive(List<int> indexs,int? shrinkIndex = null, CustomButton custom = null)
|
||||
/// <param name="custom">自定义按钮 8:c1 9:c2</param>
|
||||
public void SetButtonActive(List<int> indexs,int? shrinkIndex = null, CustomButton custom = null, CustomButton custom2 = null)
|
||||
{
|
||||
this.indexs = indexs;
|
||||
this.shrinkIndex = shrinkIndex;
|
||||
this.custom = custom;
|
||||
this.custom2 = custom2;
|
||||
if (custom != null)
|
||||
{
|
||||
transform.Find("Custom").GetComponent<Button>().onClick.RemoveAllListeners();
|
||||
transform.Find("Custom").GetComponent<Button>().onClick.AddListener(custom.action);
|
||||
transform.Find("Custom").GetComponent<Image>().sprite = custom.image;
|
||||
indexs.Add(8);
|
||||
}
|
||||
if (custom2 != null)
|
||||
{
|
||||
transform.Find("Custom2").GetComponent<Button>().onClick.RemoveAllListeners();
|
||||
transform.Find("Custom2").GetComponent<Button>().onClick.AddListener(custom2.action);
|
||||
transform.Find("Custom2").GetComponent<Image>().sprite = custom2.image;
|
||||
indexs.Add(9);
|
||||
}
|
||||
SetExpand(false);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// true:展开 false:关闭
|
||||
/// </summary>
|
||||
/// <param name="flag"></param>
|
||||
private void SetExpand(bool flag)
|
||||
public void SetExpand(bool flag)
|
||||
{
|
||||
List<string> types = new List<string>();
|
||||
if (indexs != null)
|
||||
@@ -82,7 +93,11 @@ public class NewMainNav : MonoBehaviour
|
||||
}
|
||||
else if (item.name == "Custom")
|
||||
{
|
||||
item.gameObject.SetActive(custom != null);
|
||||
item.gameObject.SetActive(custom != null && types.Contains(item.name));
|
||||
}
|
||||
else if (item.name == "Custom2")
|
||||
{
|
||||
item.gameObject.SetActive(custom2 != null && types.Contains(item.name));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -96,6 +111,30 @@ public class NewMainNav : MonoBehaviour
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void ShowButton(string v)
|
||||
{
|
||||
var i = typeArray.FindIndex((x)=>x == v);
|
||||
if (i == -1 || i == 0 || i == 2)
|
||||
{
|
||||
return;
|
||||
}
|
||||
indexs.Add(i);
|
||||
SetExpand(false);
|
||||
}
|
||||
public void HideButton(string v)
|
||||
{
|
||||
var i = typeArray.FindIndex((x) => x == v);
|
||||
if (i == -1 || i == 0 || i == 2)
|
||||
{
|
||||
return;
|
||||
}
|
||||
Debug.Log(i);
|
||||
indexs.RemoveAll(x => x == i);
|
||||
SetExpand(false);
|
||||
}
|
||||
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
Utils.DisplayHead(transform.Find("Avatar").GetComponent<Image>(), App.CurrentUser.WxHeadImg);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -12,7 +12,7 @@ using Assets.Scripts;
|
||||
//{
|
||||
public class PFUIPanel : UIBehaviour
|
||||
{
|
||||
|
||||
public NewMainNav newNav = null;
|
||||
public void OpenURL(string url)
|
||||
{
|
||||
Application.OpenURL(url);
|
||||
|
||||
@@ -75,6 +75,14 @@ public class RaceHomeScript : RaceScript
|
||||
btnGoList = rightContainer.Find("Container-2/BtnGoList");
|
||||
#else
|
||||
btnGoList = rightContainer.Find("BtnGoList");
|
||||
var nav = transform.Find("Tmp/MainNav-mobile").GetComponent<NewMainNav>();
|
||||
nav.SetButtonActive(new List<int> { 0, 3, 4, 6, 7 }, 0,
|
||||
custom: new NewMainNav.CustomButton(Resources.Load<Sprite>("Images/Race/back down"), () =>
|
||||
{
|
||||
//OpenFilter();
|
||||
UIManager.ShowRaceListPanel();
|
||||
}));
|
||||
newNav = nav;
|
||||
#endif
|
||||
if (btnGoList != null)
|
||||
{
|
||||
|
||||
@@ -245,6 +245,18 @@ public class RaceListScript : RaceScript
|
||||
mc.gameObject.SetActive(false);
|
||||
};
|
||||
});
|
||||
|
||||
var nav = transform.Find("Tmp/MainNav-mobile").GetComponent<NewMainNav>();
|
||||
nav.SetButtonActive(new List<int> { 0, 3, 4, 6, 7 }, 0,
|
||||
custom: new NewMainNav.CustomButton(Resources.Load<Sprite>("Images/Mobile/map_筛选"), () =>
|
||||
{
|
||||
//OpenFilter();
|
||||
conditions.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);
|
||||
}));
|
||||
newNav = nav;
|
||||
#else
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user