跳上传线路网页;pc分两种消息弹窗
This commit is contained in:
1 parent
603efc7508
commit
24044ec772
19 files changed
+1642
-626
No files matched your search
+14
-1
@@ -162,7 +162,20 @@ public static class App
|
||||
//记录当前集合
|
||||
public static MapRouteAreaItem currentArea = null;
|
||||
internal static Dictionary<int,string> RouteNameDict = new Dictionary<int, string>();
|
||||
|
||||
public static bool _currentPageIsHome = false;
|
||||
public static event EventHandler isHomeChanged;
|
||||
public static bool currentPageIsHome
|
||||
{
|
||||
get => _currentPageIsHome;
|
||||
set
|
||||
{
|
||||
_currentPageIsHome = value;
|
||||
if (isHomeChanged != null)
|
||||
{
|
||||
isHomeChanged(value, new EventArgs());
|
||||
}
|
||||
}
|
||||
}
|
||||
static App()
|
||||
{
|
||||
InitLanguage();
|
||||
|
||||
@@ -52,11 +52,28 @@ public class MainController : BaseScene
|
||||
App.MainDeviceAdapter.StartScan();
|
||||
#endif
|
||||
EventQueueSystem.AddListener<LinkedMessageEvent>(LinkedMessageHandler);
|
||||
App.isHomeChanged -= OnIsHomeChanged;
|
||||
App.isHomeChanged += OnIsHomeChanged;
|
||||
}
|
||||
|
||||
#region 显示消息有关
|
||||
//切换页面后
|
||||
private void OnIsHomeChanged(object sender, EventArgs e)
|
||||
{
|
||||
DOTween.KillAll();
|
||||
if ((bool)sender)
|
||||
{
|
||||
FinishMessageRight();
|
||||
}
|
||||
else
|
||||
{
|
||||
FinishMessageLeft();
|
||||
}
|
||||
}
|
||||
|
||||
CanvasGroup[] msgs;
|
||||
Vector3 msgLocation;
|
||||
int msgIndex = 0;
|
||||
CanvasGroup rightMessage;
|
||||
private void InitialMessage()
|
||||
{
|
||||
msgLocation = 1 * msg.transform.localPosition;
|
||||
@@ -71,20 +88,51 @@ public class MainController : BaseScene
|
||||
msg3.transform.localScale = Vector3.one;
|
||||
msg3.alpha = 0;
|
||||
msgs = new CanvasGroup[] { msg, msg2, msg3 };
|
||||
|
||||
rightMessage = transform.Find("GameObject/MessageRight").GetComponent<CanvasGroup>();
|
||||
#if !UNITY_STANDALONE_WIN
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
private void LinkedMessageHandler(LinkedMessageEvent e)
|
||||
{
|
||||
//msg.transform.Find("Content")
|
||||
emptyt = 0;
|
||||
#if UNITY_STANDALONE_WIN
|
||||
Debug.Log(e.content);
|
||||
DoMessage(e);
|
||||
if (App.currentPageIsHome)
|
||||
{
|
||||
DoMessage(e);
|
||||
}
|
||||
else
|
||||
{
|
||||
DoMessageRight(e);
|
||||
}
|
||||
#else
|
||||
|
||||
#endif
|
||||
}
|
||||
private void DoMessageRight(LinkedMessageEvent e)
|
||||
{
|
||||
SetMessage(rightMessage, e);
|
||||
rightMessage.DOFade(1, 0.5f).onComplete = () =>
|
||||
{
|
||||
if (App.currentPageIsHome)
|
||||
{
|
||||
foreach (var item in msgs)
|
||||
{
|
||||
item.alpha = 0;
|
||||
}
|
||||
}
|
||||
Invoke("fade0", 0.8f);
|
||||
};
|
||||
}
|
||||
|
||||
private void DoMessage(LinkedMessageEvent e)
|
||||
{
|
||||
|
||||
var selectIndex = msgIndex % 3;
|
||||
var m = msgs[selectIndex];
|
||||
var m = msgs[selectIndex];
|
||||
if (msgIndex >= 3) //
|
||||
{
|
||||
//msgIndex = 0;
|
||||
@@ -107,8 +155,18 @@ public class MainController : BaseScene
|
||||
}
|
||||
msgIndex++;
|
||||
}
|
||||
|
||||
void FinishMessage()
|
||||
{
|
||||
if (App.currentPageIsHome)
|
||||
{
|
||||
FinishMessageLeft();
|
||||
}
|
||||
else
|
||||
{
|
||||
FinishMessageRight();
|
||||
}
|
||||
}
|
||||
void FinishMessageLeft()
|
||||
{
|
||||
msgIndex = 0;
|
||||
foreach (var item in msgs)
|
||||
@@ -116,6 +174,12 @@ public class MainController : BaseScene
|
||||
item.DOFade(0, 0.3f);
|
||||
}
|
||||
}
|
||||
|
||||
void FinishMessageRight()
|
||||
{
|
||||
msgIndex = 0;
|
||||
rightMessage.DOFade(0, 0.3f);
|
||||
}
|
||||
private void SetMessage(CanvasGroup m,LinkedMessageEvent e)
|
||||
{
|
||||
m.transform.Find("Avatar").GetComponent<RawImage>().texture = null;
|
||||
@@ -123,6 +187,12 @@ public class MainController : BaseScene
|
||||
m.transform.Find("Nickname").GetComponent<Text>().text = e.nickname;
|
||||
m.transform.Find("Content").GetComponent<Text>().text = e.content;
|
||||
}
|
||||
CanvasGroup msg;
|
||||
void fade0()
|
||||
{
|
||||
rightMessage.DOFade(0, 0.5f);
|
||||
}
|
||||
#endregion
|
||||
// Start is called before the first frame update
|
||||
async void Start()
|
||||
{
|
||||
@@ -301,11 +371,7 @@ public class MainController : BaseScene
|
||||
}
|
||||
}
|
||||
|
||||
CanvasGroup msg;
|
||||
void fade0()
|
||||
{
|
||||
msg.DOFade(0, 0.5f);
|
||||
}
|
||||
|
||||
private async Task Login()
|
||||
{
|
||||
var result = await ConfigHelper.userApi.Login("13115011550", "laozhong", "");
|
||||
@@ -331,4 +397,8 @@ public class MainController : BaseScene
|
||||
}
|
||||
}
|
||||
}
|
||||
private void OnDestroy()
|
||||
{
|
||||
App.isHomeChanged -= OnIsHomeChanged;
|
||||
}
|
||||
}
|
||||
@@ -103,7 +103,7 @@ public class BigMapController : PFUIPanel
|
||||
{
|
||||
mapManager.Destroy();
|
||||
UIManager.PopStack();
|
||||
UIManager.ShowMapListPanel();
|
||||
UIManager.ShowNewRouteOverviewPanel();
|
||||
//this.gameObject.SetActive(false);
|
||||
//DestroyImmediate(this.gameObject);
|
||||
});
|
||||
|
||||
@@ -83,9 +83,9 @@ public class EarthController : PFUIPanel
|
||||
SetRounded(goList, 64);
|
||||
#endif
|
||||
UIManager.AddEvent(goList.Find("GoList").gameObject, EventTriggerType.PointerClick, (e) =>
|
||||
{
|
||||
{
|
||||
//UIManager.PopStack();
|
||||
UIManager.ShowMapListPanel();
|
||||
UIManager.ShowNewRouteOverviewPanel();
|
||||
//this.gameObject.SetActive(false);
|
||||
//DestroyImmediate(this.gameObject);
|
||||
});
|
||||
|
||||
@@ -98,6 +98,15 @@ public class MapListController : PFUIPanel
|
||||
map = Resources.Load<GameObject>("UI/Prefab/MapList/MapItem-Mobile");
|
||||
#else
|
||||
topContainer = transform.Find("Panel").Find("Top");
|
||||
#endif
|
||||
#if UNITY_STANDALONE_WIN
|
||||
btnMapMode = this.transform.Find("SwitchMode").gameObject;
|
||||
SetRounded(btnMapMode.transform, 64);
|
||||
UIManager.AddEvent(btnMapMode.transform.Find("GoList").gameObject, EventTriggerType.PointerClick, (e) =>
|
||||
{
|
||||
Application.OpenURL("http://192.168.0.101:3081/Mine/Upload?token="+ App.CurrentUser.cookie);
|
||||
});
|
||||
|
||||
#endif
|
||||
transform.Find("MainNav").GetComponent<MainNav>().ShowBack();
|
||||
sort = "Near";
|
||||
@@ -107,15 +116,7 @@ public class MapListController : PFUIPanel
|
||||
// hardSelector.onValueChanged.AddListener(ChangeHard);
|
||||
//}
|
||||
//ApiBase.SetCookie("15A37DF28842CBA8E4E550BFA24186C8222D392F3EE18D9E95A49CC32796D2E3F6E40385C6A114942546EE1DD793DF34880DE48090B91AD2460EB887B59664BB3965F3371DDA1F1401EC7F27C5A1084566E47069F12CB6BBC0BC7A84ADC5582B");
|
||||
btnMapMode = this.transform.Find("SwitchMode").gameObject;
|
||||
|
||||
SetRounded(btnMapMode.transform, 64);
|
||||
UIManager.AddEvent(btnMapMode.transform.Find("GoList").gameObject, EventTriggerType.PointerClick, (e) =>
|
||||
{
|
||||
UIManager.PopStack();
|
||||
//UIManager.ShowBigMapPanel();
|
||||
UIManager.ShowEarthPanel(App.latitude, App.longitude);
|
||||
});
|
||||
if (content!=null)
|
||||
{
|
||||
//var transform = content.transform.GetComponent<RectTransform>();
|
||||
@@ -459,7 +460,10 @@ public class MapListController : PFUIPanel
|
||||
{
|
||||
isRecent = true;
|
||||
}
|
||||
transform.Find("Panel/Top/FavContainer").gameObject.SetActive(App.CurrentRouteType != "My Collection");
|
||||
#if UNITY_STANDALONE_WIN
|
||||
btnMapMode.SetActive(App.CurrentRouteType == "My Upload");
|
||||
#endif
|
||||
topContainer.Find("FavContainer").gameObject.SetActive(App.CurrentRouteType != "My Collection");
|
||||
}
|
||||
void ResetList()
|
||||
{
|
||||
|
||||
@@ -92,6 +92,8 @@ public class NewRouteDetailController : PFUIPanel
|
||||
.text = string.Empty;
|
||||
transform.Find("Container/Left/Infos/SlopeContainer/Text").GetComponent<Text>()
|
||||
.text = string.Empty;
|
||||
transform.Find("Container/Left/Desc").GetComponent<Text>()
|
||||
.text = string.Empty;
|
||||
if (area.BannerImage != null)
|
||||
{
|
||||
Utils.DisplayImageTempDict(left.Find("Icon").GetComponent<RawImage>(), area.BannerImage, caches);
|
||||
@@ -124,6 +126,8 @@ public class NewRouteDetailController : PFUIPanel
|
||||
.text = $"{res.data.TotalClimb.ToString("#0")}M";
|
||||
transform.Find("Container/Left/Infos/SlopeContainer/Text").GetComponent<Text>()
|
||||
.text = $"{res.data.AverageGrade.ToString("#0.00")}%";
|
||||
transform.Find("Container/Left/Desc").GetComponent<Text>()
|
||||
.text = res.data.Description;
|
||||
LayoutRebuilder.ForceRebuildLayoutImmediate(transform.Find("Container/Left/RideContainer").GetComponent<RectTransform>());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,6 +56,16 @@ public class NewRouteOverviewController: PFUIPanel
|
||||
tmpGroup = Resources.Load<Transform>("UI/Prefab/NewRoute/Mobile/RouteGroup");
|
||||
tmpItem = Resources.Load<Transform>("UI/Prefab/NewRoute/Mobile/RouteItem");
|
||||
#endif
|
||||
|
||||
var btnMapMode = this.transform.Find("SwitchMode").gameObject;
|
||||
SetRounded(btnMapMode.transform, 64);
|
||||
UIManager.AddEvent(btnMapMode.transform.Find("GoList").gameObject, EventTriggerType.PointerClick, (e) =>
|
||||
{
|
||||
UIManager.PopStack();
|
||||
//UIManager.ShowBigMapPanel();
|
||||
UIManager.ShowEarthPanel(App.latitude, App.longitude);
|
||||
});
|
||||
|
||||
collectionContent = transform.Find("Container/Right/Scroll View/Viewport/Content")
|
||||
.GetComponent<RectTransform>();
|
||||
Refresh();
|
||||
|
||||
@@ -590,6 +590,8 @@ public class UIManager : MonoBehaviour
|
||||
return;
|
||||
}
|
||||
|
||||
App.currentPageIsHome = panelToShow.Equals(UIManager.Instance.HomePanel);
|
||||
|
||||
if (modal)
|
||||
{
|
||||
parent = UIManager.Instance.ModalsPanel;
|
||||
|
||||
Reference in new issue
Block a user