pc修改
This commit is contained in:
1 parent
d811eb8514
commit
5bf7635f1e
23 files changed
+4654
-1486
No files matched your search
@@ -35,19 +35,24 @@ public class HomeController : PFUIPanel
|
||||
protected override void Start()
|
||||
{
|
||||
base.Start();
|
||||
UIManager.AddEvent(transform.Find("TodayData/Avatar").gameObject, EventTriggerType.PointerClick, b =>
|
||||
{
|
||||
UIManager.ShowUserInfoPanel();
|
||||
});
|
||||
|
||||
#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
|
||||
UIManager.AddEvent(transform.Find("TodayData/Datas/Distance").gameObject, EventTriggerType.PointerClick, b =>
|
||||
{
|
||||
UIManager.ShowUserInfoPanel();
|
||||
});
|
||||
mainNav = this.transform.Find("MainNav").GetComponent<MainNav>();
|
||||
mainNav.ShowExit();
|
||||
#endif
|
||||
@@ -251,6 +256,10 @@ public class HomeController : PFUIPanel
|
||||
//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.0")}";
|
||||
todayData.Find("Datas/Carlories/Rank").GetComponent<Text>().text = summary.CurrentTotalKcal == 0 ? "——" : $"+{summary.CurrentTotalKcal.ToString("#0")}";
|
||||
#if UNITY_STANDALONE_WIN
|
||||
todayData.Find("NickName").GetComponent<Text>().text = App.CurrentUser.Nickname;
|
||||
todayData.Find("ID").GetComponent<Text>().text = $"ID:{App.CurrentUser.Id.ToString("000000")}";
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ public class MapListController : PFUIPanel
|
||||
}));
|
||||
newNav = nav;
|
||||
#else
|
||||
topContainer = transform.Find("Panel").Find("Top");
|
||||
topContainer = transform.Find("Panel/Top/Container");
|
||||
#endif
|
||||
#if UNITY_STANDALONE_WIN
|
||||
btnMapMode = this.transform.Find("SwitchMode").gameObject;
|
||||
@@ -318,11 +318,13 @@ public class MapListController : PFUIPanel
|
||||
mc.gameObject.SetActive(true);
|
||||
mc.GetComponent<CanvasGroup>().alpha = 0;
|
||||
mc.GetComponent<CanvasGroup>().DOFade(1, 0.3f);
|
||||
if (isFocusSearch)
|
||||
#else
|
||||
var topRect = topContainer;
|
||||
#endif
|
||||
if (isFocusSearch)
|
||||
{
|
||||
topRect.Find("SearchInput").GetComponent<InputField>().OnPointerClick(new PointerEventData(EventSystem.current));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
void onEndEdit()
|
||||
{
|
||||
@@ -508,6 +510,8 @@ public class MapListController : PFUIPanel
|
||||
}
|
||||
#if UNITY_STANDALONE_WIN
|
||||
btnMapMode.SetActive(App.CurrentRouteType == "My Upload");
|
||||
topContainer.Find("line2").gameObject.SetActive(App.CurrentRouteType == "All Route");
|
||||
topContainer.Find("SearchInput").gameObject.SetActive(App.CurrentRouteType == "All Route");
|
||||
#else
|
||||
transform.Find("Upload").gameObject.SetActive(App.CurrentRouteType == "My Upload");
|
||||
#endif
|
||||
|
||||
@@ -43,25 +43,27 @@ public class MapListExtraController : PFUIPanel
|
||||
{
|
||||
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);
|
||||
SetImageStyle(true);
|
||||
p1.DOLocalMoveX(p1originx, 0.5f);
|
||||
p2.DOLocalMoveX(p2originx, 0.5f);
|
||||
transform.Find("Tmp/MainNav-mobile").GetComponent<NewMainNav>().ShowButton("Custom");
|
||||
HandleMobileNavCustom(true);
|
||||
});
|
||||
UIManager.AddEvent(typeSelector.Find("Container1/Collection").gameObject, EventTriggerType.PointerClick, b =>
|
||||
{
|
||||
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");
|
||||
SetImageStyle(false);
|
||||
p1.DOLocalMoveX(p1originx - listWidth, 0.5f);
|
||||
p2.DOLocalMoveX(p2originx - listWidth, 0.5f);
|
||||
HandleMobileNavCustom(false);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
#if UNITY_STANDALONE_WIN
|
||||
float listWidth = 1480f;
|
||||
#else
|
||||
float listWidth = 764f;
|
||||
#endif
|
||||
protected override void Start()
|
||||
{
|
||||
|
||||
@@ -78,6 +80,40 @@ public class MapListExtraController : PFUIPanel
|
||||
|
||||
}
|
||||
private int pageIndex = 0;
|
||||
void HandleMobileNavCustom(bool b)
|
||||
{
|
||||
#if !UNITY_STANDALONE_WIN
|
||||
if (b)
|
||||
{
|
||||
transform.Find("Tmp/MainNav-mobile").GetComponent<NewMainNav>().ShowButton("Custom");
|
||||
}
|
||||
else
|
||||
{
|
||||
transform.Find("Tmp/MainNav-mobile").GetComponent<NewMainNav>().HideButton("Custom");
|
||||
}
|
||||
#else
|
||||
transform.Find("Panel/Top/Container").gameObject.SetActive(b);
|
||||
#endif
|
||||
}
|
||||
void SetImageStyle(bool b)
|
||||
{
|
||||
#if !UNITY_STANDALONE_WIN
|
||||
typeSelector.Find("Container/Line").gameObject.SetActive(b);
|
||||
typeSelector.Find("Container1/Line").gameObject.SetActive(!b);
|
||||
#else
|
||||
if (b)
|
||||
{
|
||||
typeSelector.Find("Container").GetComponent<Image>().color = Utils.HexToColorHtml("#f93086ff");
|
||||
typeSelector.Find("Container1").GetComponent<Image>().color = Utils.HexToColorHtml("#f9308600");
|
||||
}
|
||||
else
|
||||
{
|
||||
typeSelector.Find("Container").GetComponent<Image>().color = Utils.HexToColorHtml("#f9308600");
|
||||
typeSelector.Find("Container1").GetComponent<Image>().color = Utils.HexToColorHtml("#f93086ff");
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
public void HandleCollection()
|
||||
{
|
||||
if (App.CurrentRouteType == "My Collection")
|
||||
@@ -93,9 +129,8 @@ public class MapListExtraController : PFUIPanel
|
||||
p2.localPosition = new Vector3(p2originx, p2.localPosition.y, p2.localPosition.z);
|
||||
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");
|
||||
SetImageStyle(true);
|
||||
HandleMobileNavCustom(true);
|
||||
}
|
||||
private async void GetList()
|
||||
{
|
||||
|
||||
@@ -60,34 +60,35 @@ public class NewRouteDetailController : PFUIPanel
|
||||
}
|
||||
void Start()
|
||||
{
|
||||
UIManager.AddEvent(transform.Find("Container/Left/Fav").gameObject, EventTriggerType.PointerClick, async b =>
|
||||
{
|
||||
Assets.Scripts.Apis.JsonResult<object> res = null;
|
||||
var p = ((PointerEventData)b).pointerEnter;
|
||||
var act = ((PointerEventData)b).pointerEnter.GetComponent<Image>().sprite.name == "icon_heji_like";
|
||||
if (act)
|
||||
{
|
||||
res = await ConfigHelper.mapApi.CancelAreaFav(area.Id);
|
||||
}
|
||||
else
|
||||
{
|
||||
res = await ConfigHelper.mapApi.AddAreaFav(area.Id);
|
||||
}
|
||||
|
||||
if (res.result)
|
||||
{
|
||||
p.GetComponent<Image>().sprite = FavDict[!act];
|
||||
//Utils.showToast(null, App.GetLocalString("Success"), type: 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
Utils.showToast(null, res.errMsg);
|
||||
}
|
||||
});
|
||||
#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;
|
||||
var p = ((PointerEventData)b).pointerEnter;
|
||||
var act = ((PointerEventData)b).pointerEnter.GetComponent<Image>().sprite.name == "icon_heji_like";
|
||||
if (act)
|
||||
{
|
||||
res = await ConfigHelper.mapApi.CancelAreaFav(area.Id);
|
||||
}
|
||||
else
|
||||
{
|
||||
res = await ConfigHelper.mapApi.AddAreaFav(area.Id);
|
||||
}
|
||||
|
||||
if (res.result)
|
||||
{
|
||||
p.GetComponent<Image>().sprite = FavDict[!act];
|
||||
//Utils.showToast(null, App.GetLocalString("Success"), type: 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
Utils.showToast(null, res.errMsg);
|
||||
}
|
||||
});
|
||||
|
||||
#else
|
||||
transform.Find("MainNav").GetComponent<MainNav>().ShowBack();
|
||||
#endif
|
||||
@@ -115,18 +116,19 @@ public class NewRouteDetailController : PFUIPanel
|
||||
OnEndDrag(null);
|
||||
}
|
||||
}
|
||||
timer -= Time.deltaTime;
|
||||
while (timer < 0)
|
||||
{
|
||||
var list = MapUDPService.GetAllOnlineUserList();
|
||||
if (list.Count > 0 && routeIds != null)
|
||||
{
|
||||
//当前集合骑行人数
|
||||
var currentUserCount = list.Where(c => routeIds.Contains(c.RouteId)).Count();
|
||||
Debug.Log($"当前集合骑行人数{currentUserCount}");
|
||||
}
|
||||
timer += 1f;
|
||||
}
|
||||
//timer -= Time.deltaTime;
|
||||
//while (timer < 0)
|
||||
//{
|
||||
// var list = MapUDPService.GetAllOnlineUserList();
|
||||
// if (list.Count > 0 && routeIds != null)
|
||||
// {
|
||||
// var onlineUserList = list.Where(c => routeIds.Contains(c.RouteId)).ToList();
|
||||
// //当前集合骑行人数
|
||||
// var currentUserCount = onlineUserList.Count();
|
||||
// Debug.Log($"当前集合骑行人数{currentUserCount}");
|
||||
// }
|
||||
// timer += 1f;
|
||||
//}
|
||||
}
|
||||
MapRouteAreaItem area;
|
||||
int pageIndex = 0, pageSize = 10;
|
||||
@@ -261,6 +263,18 @@ public class NewRouteDetailController : PFUIPanel
|
||||
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>());
|
||||
var userinfo = Resources.Load<GameObject>("UI/Prefab/NewRoute/UserInfo");
|
||||
transform.Find("Container/Left/NOData").gameObject.SetActive(res.data.UserList.Count == 0);
|
||||
transform.Find("Container/Left/Users").DestroyChildren();
|
||||
foreach (var item in res.data.UserList)
|
||||
{
|
||||
var info = Instantiate<GameObject>(userinfo);
|
||||
Utils.DisplayImageTempDict(info.transform.Find("Avatar").GetComponent<Image>(), item.WxHeadImg, caches);
|
||||
info.transform.Find("NickName").GetComponent<Text>().text = item.NickName;
|
||||
|
||||
info.transform.SetParent(transform.Find("Container/Left/Users"));
|
||||
info.transform.localScale = Vector3.one;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ public class NewRouteOverviewController: PFUIPanel
|
||||
{
|
||||
caches = new Dictionary<string, Texture>();
|
||||
scroll = transform.Find("Container/Right/Scroll View").GetComponent<ScrollRect>();
|
||||
#if !UNITY_STANDALONE_WIN
|
||||
scroll.onValueChanged.RemoveAllListeners();
|
||||
scroll.onValueChanged.AddListener(p=>
|
||||
{
|
||||
@@ -35,6 +36,7 @@ public class NewRouteOverviewController: PFUIPanel
|
||||
DOTween.To(() => rect.offsetMax, x => rect.offsetMax = x, new Vector2(rect.offsetMax.x, -68), 0.5f);
|
||||
}
|
||||
});
|
||||
#endif
|
||||
UIManager.AddEvent(scroll.gameObject, UnityEngine.EventSystems.EventTriggerType.EndDrag, OnEndDrag);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user