Merge remote-tracking branch 'origin/dev_cyp' into dev_nonearth
# Conflicts: # Assets/Resources/UI/language.json
This commit is contained in:
commit
eece0cffa5
401 files changed
+51471
-4540
No files matched your search
@@ -150,7 +150,7 @@ public class LoginController : BaseScene
|
||||
var content = signScrollView.transform.Find("Viewport").Find("Content");
|
||||
signPage1 = content.Find("FirstPage");
|
||||
UIManager.AddEvent(signPage1.Find("next").GetComponent<Button>().gameObject,
|
||||
EventTriggerType.PointerClick, (b) => goRegNext());
|
||||
EventTriggerType.PointerClick, (b) => goRegNext(signType));
|
||||
UIManager.AddEvent(signPage1.Find("BtnModiPass").GetComponent<Button>().gameObject,
|
||||
EventTriggerType.PointerClick, (b) => goResetPassword());
|
||||
//signPage1.Find("next").GetComponent<Button>().onClick.AddListener(() => { goRegNext(); });
|
||||
@@ -405,16 +405,10 @@ public class LoginController : BaseScene
|
||||
{
|
||||
if (pageNums == 5)
|
||||
{
|
||||
#if UNITY_ANDROID || UNITY_IOS
|
||||
MobileAni(false);
|
||||
#endif
|
||||
StartScrollPanel(3);
|
||||
}
|
||||
else if (pageNums == 4)
|
||||
{
|
||||
#if UNITY_ANDROID || UNITY_IOS
|
||||
MobileAni(false);
|
||||
#endif
|
||||
StartScrollPanel(2);
|
||||
}
|
||||
else
|
||||
@@ -507,6 +501,67 @@ public class LoginController : BaseScene
|
||||
transform.Find("Panel").Find("Version").GetComponent<Text>().text = $"V{App.AppVersion}";
|
||||
#endif
|
||||
}
|
||||
private string fbUserId = "";
|
||||
private string fbToken = "";
|
||||
|
||||
public async void OnFacebookLoginCheck(string userId, string token)
|
||||
{
|
||||
fbUserId = userId;
|
||||
fbToken = token;
|
||||
signType = 3;
|
||||
var res = await ConfigHelper.userApi.OnFacebookLoginCheck(userId, token);
|
||||
if (res.result) //判断是否成功登录
|
||||
{
|
||||
var data = JObject.FromObject(res.data);
|
||||
if (data.ContainsKey("success") && data.Value<string>("success") == "False")
|
||||
{
|
||||
goSign();
|
||||
}
|
||||
else
|
||||
{
|
||||
RefreshWx3(data.ToObject<UserResultModel>(), 1);
|
||||
wxLogin3.gameObject.SetActive(true);
|
||||
signContainer.gameObject.SetActive(false);
|
||||
pageNums = 3;
|
||||
StartScrollPanel(2);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Utils.showToast(null, res.errMsg);
|
||||
}
|
||||
}
|
||||
|
||||
private string appleUserId = "";
|
||||
private string appleToken = "";
|
||||
private int signType { get; set; }
|
||||
public async void OnAppleIdLoginCheck(string userId,string token)
|
||||
{
|
||||
appleUserId = userId;
|
||||
appleToken = token;
|
||||
signType = 2;
|
||||
var res = await ConfigHelper.userApi.OnAppleIdLoginCheck(userId, token);
|
||||
if (res.result) //判断是否成功登录
|
||||
{
|
||||
var data = JObject.FromObject(res.data);
|
||||
if (data.ContainsKey("success") && data.Value<string>("success") == "False")
|
||||
{
|
||||
goSign();
|
||||
}
|
||||
else
|
||||
{
|
||||
RefreshWx3(data.ToObject<UserResultModel>(), 1);
|
||||
wxLogin3.gameObject.SetActive(true);
|
||||
signContainer.gameObject.SetActive(false);
|
||||
pageNums = 3;
|
||||
StartScrollPanel(2);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Utils.showToast(null, res.errMsg);
|
||||
}
|
||||
}
|
||||
|
||||
public void Test(string key)
|
||||
{
|
||||
@@ -514,8 +569,6 @@ public class LoginController : BaseScene
|
||||
}
|
||||
async void Init()
|
||||
{
|
||||
|
||||
Debug.Log(535);
|
||||
UIManager.Instance.ModalsPanel = this.transform.Find("ModalPanel").GetComponent<PFUIPanel>();
|
||||
userInfos = UIManager.Instance.userInfos;
|
||||
App.DefaultRotateTexture = Utils.ReadTextureFromPlayerPrefs("rotateImage");
|
||||
@@ -697,6 +750,7 @@ public class LoginController : BaseScene
|
||||
JObject data = JObject.FromObject(r.data);
|
||||
if (data.Value<string>("success") != null && data.Value<string>("success") == "False")
|
||||
{
|
||||
signType = 1;
|
||||
wxInfoJson = data;
|
||||
wxLogin2.gameObject.SetActive(true);
|
||||
Utils.DisplayImage(wxLogin2.Find("Avatar").GetComponent<RawImage>(),
|
||||
@@ -720,7 +774,6 @@ public class LoginController : BaseScene
|
||||
//wxLogin3.Find("NickName").GetComponent<Text>().text = wxInfoJson.Value<string>("nickname");
|
||||
signContainer.gameObject.SetActive(false);
|
||||
pageNums = 3;
|
||||
MobileAni(true);
|
||||
//this.goSign();
|
||||
StartScrollPanel(2);
|
||||
}
|
||||
@@ -759,7 +812,7 @@ public class LoginController : BaseScene
|
||||
//Timer t = new Ti
|
||||
if (r.result)
|
||||
{
|
||||
if (pageNums == 5)
|
||||
if (isThird())
|
||||
{
|
||||
if (r.data.Value<bool>("isExist"))
|
||||
{
|
||||
@@ -820,7 +873,7 @@ public class LoginController : BaseScene
|
||||
signForm.cpassword.text = "";
|
||||
StartScrollSign(0);
|
||||
}
|
||||
//0-普通 1-微信
|
||||
//0-普通 1-微信 2-苹果 3-facebook
|
||||
private async void goRegNext(int signType = 0)
|
||||
{
|
||||
var Email = signForm.email;
|
||||
@@ -851,6 +904,14 @@ public class LoginController : BaseScene
|
||||
wxInfoJson.Value<string>("unionId"),
|
||||
wxInfoJson.Value<string>("openId"));
|
||||
}
|
||||
else if (signType == 2)
|
||||
{
|
||||
r = await ConfigHelper.userApi.OnAppleIdLogin(appleUserId, appleToken, Email.text, Password.text, Captcha.text);
|
||||
}
|
||||
else
|
||||
{
|
||||
r = await ConfigHelper.userApi.OnFacebookLogin(fbUserId, fbToken, Email.text, Password.text, Captcha.text);
|
||||
}
|
||||
if (r != null && r.result)
|
||||
{
|
||||
var u = JObject.FromObject(r.data).ToObject<UserResultModel>();
|
||||
@@ -870,21 +931,36 @@ public class LoginController : BaseScene
|
||||
{
|
||||
var Email = signForm.email;
|
||||
var Captcha = signForm.captcha;
|
||||
var r = await ConfigHelper.userApi.OnWebWxLogin(Email.text,
|
||||
JsonResult<object> r = null;
|
||||
if (signType == 2)
|
||||
{
|
||||
//苹果登录
|
||||
r = await ConfigHelper.userApi.OnAppleIdLogin(appleUserId, appleToken, Email.text, "", Captcha.text);
|
||||
}
|
||||
else if (signType == 3)
|
||||
{
|
||||
r = await ConfigHelper.userApi.OnFacebookLogin(fbUserId, fbToken, Email.text, "", Captcha.text);
|
||||
}
|
||||
else
|
||||
{
|
||||
r = await ConfigHelper.userApi.OnWebWxLogin(Email.text,
|
||||
Captcha.text,
|
||||
"",
|
||||
wxInfoJson.Value<string>("unionId"),
|
||||
wxInfoJson.Value<string>("openId"));
|
||||
if (r.result)
|
||||
{
|
||||
var u = JObject.FromObject(r.data).ToObject<UserResultModel>();
|
||||
RefreshWx3(u, 1);
|
||||
MobileAni(true);
|
||||
StartScrollPanel(4);
|
||||
}
|
||||
else
|
||||
if (r != null)
|
||||
{
|
||||
Utils.showToast(gameObject, r.errMsg);
|
||||
if (r.result)
|
||||
{
|
||||
var u = JObject.FromObject(r.data).ToObject<UserResultModel>();
|
||||
RefreshWx3(u, 1);
|
||||
StartScrollPanel(4);
|
||||
}
|
||||
else
|
||||
{
|
||||
Utils.showToast(gameObject, r.errMsg);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
@@ -954,9 +1030,6 @@ public class LoginController : BaseScene
|
||||
void goRegEnd()
|
||||
{
|
||||
if (!UpdateInfo()) return;
|
||||
#if UNITY_ANDROID || UNITY_IOS
|
||||
MobileAni(true);
|
||||
#endif
|
||||
if (pageNums == 5)
|
||||
{
|
||||
this.StartScrollPanel(4);
|
||||
@@ -1041,9 +1114,9 @@ public class LoginController : BaseScene
|
||||
/// </summary>
|
||||
private void goLoginReturn2()
|
||||
{
|
||||
#if UNITY_ANDROID || UNITY_IOS
|
||||
MobileAni(true);
|
||||
#endif
|
||||
//#if UNITY_ANDROID || UNITY_IOS
|
||||
// MobileAni(true);
|
||||
//#endif
|
||||
if (wxLogin2.gameObject.activeSelf) wxLogin2.gameObject.SetActive(false);
|
||||
//if (wxLogin3.gameObject.activeSelf) wxLogin3.gameObject.SetActive(false);
|
||||
pageNums = 4;
|
||||
@@ -1053,7 +1126,7 @@ public class LoginController : BaseScene
|
||||
wxReturnLogin();
|
||||
}
|
||||
#else
|
||||
transform.GetComponent<LoginControllerMobile>().HideThirdLoginPage();
|
||||
//transform.GetComponent<LoginControllerMobile>().HideThirdLoginPage();
|
||||
#endif
|
||||
Canvas.ForceUpdateCanvases();
|
||||
this.StartScrollPanel(1);
|
||||
@@ -1082,6 +1155,11 @@ public class LoginController : BaseScene
|
||||
LoginBg.localPosition = Vector3.zero;
|
||||
LoginBg.GetComponent<RectTransform>().sizeDelta = new Vector2(360, 573);
|
||||
#endif
|
||||
imagedf.GetComponent<Image>().color = new Color(255, 255, 255, 0);
|
||||
imagexf.GetComponent<Image>().color = new Color(255, 255, 255, 0);
|
||||
LoginBg.GetComponent<RectTransform>().sizeDelta = new Vector2(354, 370);
|
||||
LoginBg.GetComponent<RectTransform>().localPosition = new Vector2(LoginBg.GetComponent<RectTransform>().localPosition.x, 0);
|
||||
|
||||
var scrollValue = 1f / (pageNums - 1);
|
||||
var value = 1 * scrollValue;
|
||||
scrollPanel.horizontalNormalizedPosition = value;
|
||||
@@ -1172,6 +1250,10 @@ public class LoginController : BaseScene
|
||||
//signPage1.Find("signThird").GetComponent<Button>().onClick.RemoveAllListeners();
|
||||
//signPage1.Find("signThird").GetComponent<Button>().onClick.AddListener(() => { ; });
|
||||
}
|
||||
bool isThird()
|
||||
{
|
||||
return signType > 0;
|
||||
}
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -1179,9 +1261,6 @@ public class LoginController : BaseScene
|
||||
/// <param name="type">0 注册 1 忘记密码</param>
|
||||
void goSign(bool isAccount = true, int type = 0)
|
||||
{
|
||||
#if UNITY_ANDROID || UNITY_IOS
|
||||
MobileAni(false);
|
||||
#endif
|
||||
if (!isAccount)
|
||||
{
|
||||
pageNums = 5;
|
||||
@@ -1201,6 +1280,10 @@ public class LoginController : BaseScene
|
||||
if (type == 0)
|
||||
{
|
||||
pageNums = 4;
|
||||
if (signType < 2)
|
||||
{
|
||||
signType = 0;
|
||||
}
|
||||
signContainer.Find("signText").GetComponent<Text>().text = App.GetLocalString("SIGN UP");
|
||||
wxLogin2.gameObject.SetActive(false);
|
||||
signPage1.Find("next").gameObject.SetActive(true);
|
||||
@@ -1401,7 +1484,22 @@ public class LoginController : BaseScene
|
||||
}
|
||||
//float adjTime = 0;
|
||||
//bool startJs = false;
|
||||
#region 主页面滑动逻辑
|
||||
#region 主页面滑动逻辑
|
||||
private void handleAnimate(int index)
|
||||
{
|
||||
if (pageNums == 3)
|
||||
{
|
||||
MobileAni(index == 0 || index == 2);
|
||||
}
|
||||
else if (pageNums == 4)
|
||||
{
|
||||
MobileAni(index == 0 || index == 3);
|
||||
}
|
||||
else if (pageNums == 5)
|
||||
{
|
||||
MobileAni(index == 0 || index == 2 || index == 4);
|
||||
}
|
||||
}
|
||||
private int tmpImdex = 0;
|
||||
private int scrollPanelIndex = 2;
|
||||
//private float scrollValue = 0.5f;
|
||||
@@ -1409,6 +1507,9 @@ public class LoginController : BaseScene
|
||||
private void StartScrollPanel(int index)
|
||||
{
|
||||
if (startScrollPanel) return;
|
||||
#if UNITY_ANDROID || UNITY_IOS
|
||||
handleAnimate(index);
|
||||
#endif
|
||||
scrollPanelIndex = index;
|
||||
startScrollPanel = true;
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ public class MainController : BaseScene
|
||||
protected override void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
Debug.Log("执行25");
|
||||
Version = this.transform.Find("GameObject").Find("Version").GetComponent<Text>();
|
||||
Version.text = "V"+App.AppVersion;
|
||||
DeviceCache.Init(PFConstants.DeviceCacheFolder);
|
||||
@@ -63,7 +64,7 @@ public class MainController : BaseScene
|
||||
FinishMessage(sender);
|
||||
}
|
||||
|
||||
CanvasGroup[] msgs;
|
||||
List<CanvasGroup> msgs;
|
||||
Vector3 msgLocation;
|
||||
int msgIndex = 0;
|
||||
CanvasGroup rightMessage;
|
||||
@@ -81,9 +82,10 @@ public class MainController : BaseScene
|
||||
msg3.transform.localPosition = 1 * msgLocation;
|
||||
msg3.transform.localScale = Vector3.one;
|
||||
msg3.alpha = 0;
|
||||
msgs = new CanvasGroup[] { msg, msg2, msg3 };
|
||||
msgs = List<CanvasGroup> { msg, msg2, msg3 };
|
||||
rightMessage = transform.Find("GameObject/MessageRight").GetComponent<CanvasGroup>();
|
||||
#else
|
||||
msgLocation = new Vector3(168, 37, 0);
|
||||
var go = transform.Find("GameObject");
|
||||
go.GetComponent<RectTransform>().anchorMin = Vector2.zero;
|
||||
go.GetComponent<RectTransform>().anchorMax = Vector2.one;
|
||||
@@ -96,7 +98,18 @@ public class MainController : BaseScene
|
||||
|
||||
rightMessage.transform.SetParent(go);
|
||||
rightMessage.transform.localScale = Vector3.one;
|
||||
rightMessage.transform.localPosition = new Vector3(-112, 164, 0);
|
||||
rightMessage.transform.localPosition = 1 * msgLocation;
|
||||
msgs = new List<CanvasGroup> { rightMessage };
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
var tmpm = Instantiate<CanvasGroup>(rightMessage);
|
||||
tmpm.transform.SetParent(rightMessage.transform.parent);
|
||||
tmpm.transform.localPosition = 1 * msgLocation;
|
||||
tmpm.transform.localScale = Vector3.one;
|
||||
tmpm.alpha = 0;
|
||||
msgs.Add(tmpm);
|
||||
}
|
||||
|
||||
Debug.Log(rightMessage.GetComponent<RectTransform>().localPosition);
|
||||
//rightMessage.transform.SetParent(transform.Find("GameObject"));
|
||||
#endif
|
||||
@@ -119,7 +132,7 @@ public class MainController : BaseScene
|
||||
#else
|
||||
if (App.currentPageIsHome)
|
||||
{
|
||||
DoMessageRight(e);
|
||||
DoMessage6(e);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -155,6 +168,38 @@ public class MainController : BaseScene
|
||||
}
|
||||
msgIndex++;
|
||||
}
|
||||
private void DoMessage6(LinkedMessageEvent e)
|
||||
{
|
||||
var selectIndex = msgIndex % 6;
|
||||
var m = msgs[selectIndex];
|
||||
if (msgIndex >= 6) //
|
||||
{
|
||||
//msgIndex = 0;
|
||||
m.DOFade(0, 0.5f).onComplete = () =>
|
||||
{
|
||||
SetMessage(m, e);
|
||||
m.transform.localPosition = 1 * msgLocation;
|
||||
m.DOFade(1, 0.5f);
|
||||
foreach (var item in msgs.Where((x, i) => i != selectIndex))
|
||||
{
|
||||
item.transform.DOLocalMoveY(item.transform.localPosition.y - 38, 0.5f);
|
||||
}
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log(191);
|
||||
SetMessage(m, e);
|
||||
for (int i = 0; i < msgIndex; i++)
|
||||
{
|
||||
var rect = msgs[i].GetComponent<RectTransform>();
|
||||
rect.DOLocalMoveY(rect.localPosition.y - 38, 0.5f);
|
||||
}
|
||||
m.DOFade(1, 0.5f);
|
||||
}
|
||||
msgIndex++;
|
||||
}
|
||||
|
||||
void FinishMessage(object sender)
|
||||
{
|
||||
#if UNITY_STANDALONE_WIN
|
||||
@@ -169,7 +214,7 @@ public class MainController : BaseScene
|
||||
#else
|
||||
if (!(bool)sender)
|
||||
{
|
||||
FinishMessageRight();
|
||||
FinishMessage6();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -177,9 +222,12 @@ public class MainController : BaseScene
|
||||
{
|
||||
#if UNITY_STANDALONE_WIN
|
||||
msgIndex = 0;
|
||||
foreach (var item in msgs)
|
||||
if (msgs != null)
|
||||
{
|
||||
item.DOFade(0, 0.3f);
|
||||
foreach (var item in msgs)
|
||||
{
|
||||
item.DOFade(0, 0.3f);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -189,8 +237,27 @@ public class MainController : BaseScene
|
||||
msgIndex = 0;
|
||||
rightMessage.DOFade(0, 0.3f);
|
||||
}
|
||||
void FinishMessage6()
|
||||
{
|
||||
msgIndex = 0;
|
||||
foreach (var m in msgs)
|
||||
{
|
||||
m.alpha = 0;
|
||||
m.GetComponent<RectTransform>().localPosition = 1 * msgLocation;
|
||||
}
|
||||
}
|
||||
private void SetMessage(CanvasGroup m,LinkedMessageEvent e)
|
||||
{
|
||||
m.GetComponent<Button>().onClick.RemoveAllListeners();
|
||||
m.GetComponent<Button>().onClick.AddListener(()=>
|
||||
{
|
||||
if (e.routeId > 0)
|
||||
{
|
||||
App.RouteIdParam = e.routeId;
|
||||
SceneManager.LoadScene("Ride");
|
||||
}
|
||||
//Debug.Log(e.routeId);
|
||||
});
|
||||
m.transform.Find("Avatar").GetComponent<RawImage>().texture = null;
|
||||
Utils.DisplayHead(m.transform.Find("Avatar").GetComponent<RawImage>(), e.avatar);
|
||||
m.transform.Find("Nickname").GetComponent<Text>().text = e.nickname;
|
||||
@@ -384,7 +451,7 @@ public class MainController : BaseScene
|
||||
{
|
||||
foreach (var item in res.data)
|
||||
{
|
||||
EventQueueSystem.QueueEvent(new LinkedMessageEvent(item.Id, item.Message, item.WxHeadImg, item.NickName));
|
||||
EventQueueSystem.QueueEvent(new LinkedMessageEvent(-1, item.Message, item.WxHeadImg, item.NickName));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
{
|
||||
if (App.weChatController.IsWeChatAppInstalled())
|
||||
{
|
||||
App.weChatController.ShareWebpageToWX(0, $"{App.CurrentUser.WebHost}Mine/MatchPreview?id={cyclingController.competitionId}&Token={App.CurrentUser.cookie}", cyclingController.competition.NickName, "By " + App.CurrentUser.Nickname);
|
||||
App.weChatController.ShareWebpageToWX(0, $"{App.CurrentUser.WebHost}Mine/MatchPreview?id={cyclingController.competitionId}&Token={App.CurrentUser.cookie}", cyclingController.competition.NickName, "By " + App.CurrentUser.Nickname, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -249,7 +249,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
{
|
||||
if (App.weChatController.IsWeChatAppInstalled())
|
||||
{
|
||||
App.weChatController.ShareWebpageToWX(1, $"{App.CurrentUser.WebHost}Mine/MatchPreview?id={cyclingController.competitionId}&Token={App.CurrentUser.cookie}", cyclingController.competition.NickName, "By " + App.CurrentUser.Nickname);
|
||||
App.weChatController.ShareWebpageToWX(1, $"{App.CurrentUser.WebHost}Mine/MatchPreview?id={cyclingController.competitionId}&Token={App.CurrentUser.cookie}", cyclingController.competition.NickName, "By " + App.CurrentUser.Nickname,null);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -93,7 +93,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
{
|
||||
if (App.weChatController.IsWeChatAppInstalled())
|
||||
{
|
||||
App.weChatController.ShareWebpageToWX(0, $"{App.CurrentUser.WebHost}Mine/MatchPreview?id={cyclingController.competitionId}&Token={App.CurrentUser.cookie}", cyclingController.competition.NickName, "By " + App.CurrentUser.Nickname);
|
||||
App.weChatController.ShareWebpageToWX(0, $"{App.CurrentUser.WebHost}Mine/MatchPreview?id={cyclingController.competitionId}&Token={App.CurrentUser.cookie}", cyclingController.competition.NickName, "By " + App.CurrentUser.Nickname,null);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -105,7 +105,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
{
|
||||
if (App.weChatController.IsWeChatAppInstalled())
|
||||
{
|
||||
App.weChatController.ShareWebpageToWX(1, $"{App.CurrentUser.WebHost}Mine/MatchPreview?id={cyclingController.competitionId}&Token={App.CurrentUser.cookie}", cyclingController.competition.NickName, "By " + App.CurrentUser.Nickname);
|
||||
App.weChatController.ShareWebpageToWX(1, $"{App.CurrentUser.WebHost}Mine/MatchPreview?id={cyclingController.competitionId}&Token={App.CurrentUser.cookie}", cyclingController.competition.NickName, "By " + App.CurrentUser.Nickname,null);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user