fb分享;比赛页面箭头去了

This commit is contained in:
Caiyanpeng committed 2022-01-13 15:35:57 +08:00
1 parent 7a7c1ee55c
commit 4d5523e2ff
9 files changed
+547 -430

No files matched your search

+1 -1
View File
@@ -19,7 +19,7 @@ public delegate void ChangeLanguageDelegate();
public static class App
{
public static string Host = "http://192.168.0.101:5083/";
public static string Host = "http://192.168.0.101:5084/";
public static string AppVersion = Application.version;
@@ -7,6 +7,8 @@ using UnityEngine.EventSystems;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using DG.Tweening;
using System;
using Facebook.Unity;
namespace Assets.Scenes.Ride.Scripts
{
@@ -64,6 +66,8 @@ namespace Assets.Scenes.Ride.Scripts
WeChatGpButton = transform.Find("ToolBarPanel/GoogleButton").gameObject;
UIManager.AddEvent(WeChatButton, UnityEngine.EventSystems.EventTriggerType.PointerClick, ShareWechat);
UIManager.AddEvent(WeChatGpButton, UnityEngine.EventSystems.EventTriggerType.PointerClick, ShareWechatGp);
var fbButton = transform.Find("ToolBarPanel/FaceBookButton").gameObject;
UIManager.AddEvent(fbButton, EventTriggerType.PointerClick, shareFb);
#endif
SpriteTop = Resources.Load<Sprite>("Images/Ride/Match/top-1");
SpriteSecond = Resources.Load<Sprite>("Images/Ride/Match/top-2");
@@ -72,6 +76,7 @@ namespace Assets.Scenes.Ride.Scripts
UIManager.AddEvent(closeBtn, UnityEngine.EventSystems.EventTriggerType.PointerClick, Close);
}
float time = 1;
private void Update()
{
@@ -244,6 +249,14 @@ namespace Assets.Scenes.Ride.Scripts
Utils.showToast(null, "未安装微信");
}
}
private void shareFb(BaseEventData arg0)
{
//cyclingController.competition.Title, "By " + App.CurrentUser.Nickname, null)
FB.ShareLink(contentURL: new Uri($"{App.CurrentUser.WebHost}Mine/MatchPreview?id={cyclingController.competitionId}&Token={App.CurrentUser.cookie}"),
contentTitle: cyclingController.competition.Title,
contentDescription: "By " + App.CurrentUser.Nickname,
photoURL: new Uri(cyclingController.competition.CoverImage));
}
private void ShareWechatGp(BaseEventData baseEventData)
{
@@ -8,6 +8,7 @@ using System;
using DG.Tweening;
using UnityEngine.EventSystems;
using UnityEngine.SceneManagement;
using Facebook.Unity;
namespace Assets.Scenes.Ride.Scripts
{
@@ -90,9 +91,19 @@ namespace Assets.Scenes.Ride.Scripts
#if UNITY_ANDROID || UNITY_IOS
cyclingController.AddEvent(shareWxBtn, EventTriggerType.PointerClick, shareToWx);
cyclingController.AddEvent(shareWxGpButton, EventTriggerType.PointerClick, shareToWxGp);
var fbButton = transform.Find("ToolBarPanel/FaceBookButton").gameObject;
cyclingController.AddEvent(fbButton, EventTriggerType.PointerClick, shareToFb);
#endif
}
private void shareToFb(BaseEventData arg0)
{
FB.ShareLink(contentURL: new Uri($"{App.CurrentUser.WebHost}RoutesRecords/{cyclingController.RankingId}?Token={App.CurrentUser.cookie}"),
contentTitle: cyclingController.mapRoute.Name,
contentDescription: "By " + App.CurrentUser.Nickname,
photoURL: new Uri(cyclingController.mapRoute.CoverImage));
}
private void shareToWx(BaseEventData b)
{
if (App.weChatController.IsWeChatAppInstalled())
@@ -76,12 +76,7 @@ public class RaceHomeScript : RaceScript
#else
btnGoList = rightContainer.Find("BtnGoList");
var nav = transform.Find("Tmp/MainNav-mobile").GetComponent<NewMainNav>();
nav.SetButtonActive(new List<int> { 2, 3, 4, 6, 7 }, 2,
custom: new NewMainNav.CustomButton(Resources.Load<Sprite>("Images/Race/back down"), () =>
{
//OpenFilter();
UIManager.ShowRaceListPanel();
}));
nav.SetButtonActive(new List<int> { 2, 3, 4, 6, 7 }, 2);
newNav = nav;
#endif
if (btnGoList != null)
+31 -14
View File
@@ -232,37 +232,54 @@ public class RaceListScript : RaceScript
var mc = transform.Find("MC");
UIManager.AddEvent(transform.Find("SwitchMode/BtnFilter").gameObject, EventTriggerType.PointerClick, b =>
{
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);
});
transform.Find("Conditions/Return").gameObject.SetActive(false);
UIManager.AddEvent(mc.gameObject, EventTriggerType.PointerClick, b =>
{
conditions.DOLocalMoveX(App.topRectStartX.Value, 0.3f);
mc.GetComponent<CanvasGroup>().DOFade(0, 0.3f).onComplete = () =>
{
mc.gameObject.SetActive(false);
};
CloseFilter();
});
UIManager.AddEvent(transform.Find("Conditions/Return").gameObject, EventTriggerType.PointerClick, b =>
{
CloseFilter();
});
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);
}),custom2:new NewMainNav.CustomButton(Resources.Load<Sprite>("Images/Race/back up"),()=>
{
UIManager.ShowPrePanel();
OpenFilter();
}));
newNav = nav;
#else
#endif
}
private void OpenFilter()
{
var topRect = conditions.GetComponent<RectTransform>();
var mc = transform.Find("MC");
transform.Find("Conditions/Return").gameObject.SetActive(true);
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);
}
private void CloseFilter()
{
var mc = transform.Find("MC");
transform.Find("Conditions/Return").gameObject.SetActive(false);
conditions.DOLocalMoveX(App.topRectStartX.Value, 0.3f);
mc.GetComponent<CanvasGroup>().DOFade(0, 0.3f).onComplete = () =>
{
mc.gameObject.SetActive(false);
};
}
private async Task Login()
{
var result = await ConfigHelper.userApi.Login("13115011550", "laozhong", "");