设置页面,调些细节
This commit is contained in:
1 parent
4896fab824
commit
bb4fabc833
23 files changed
+5528
-1756
No files matched your search
@@ -9,6 +9,7 @@ using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
@@ -231,22 +232,25 @@ public class LoginController : MonoBehaviour
|
||||
if (loginContainer != null)
|
||||
{
|
||||
var returnQuick = loginContainer.Find("returnQuick").GetComponent<Button>();
|
||||
returnQuick.onClick.AddListener(ReturnQuick);
|
||||
UIManager.AddEvent(returnQuick.gameObject, EventTriggerType.PointerClick, (b) =>
|
||||
{
|
||||
ReturnQuick();
|
||||
});
|
||||
var sign = loginContainer.Find("reg").GetComponent<Button>();
|
||||
sign.onClick.AddListener(() => goSign());
|
||||
remember = loginContainer.Find("rememberButton").GetComponent<Button>();
|
||||
remember.onClick.AddListener(() =>
|
||||
{
|
||||
var gou = remember.transform.Find("Gou");
|
||||
if (gou.gameObject.activeSelf)
|
||||
{
|
||||
gou.gameObject.SetActive(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
gou.gameObject.SetActive(true);
|
||||
}
|
||||
});
|
||||
UIManager.AddEvent(remember.gameObject, EventTriggerType.PointerClick, (b) =>
|
||||
{
|
||||
var gou = remember.transform.Find("Gou");
|
||||
if (gou.gameObject.activeSelf)
|
||||
{
|
||||
gou.gameObject.SetActive(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
gou.gameObject.SetActive(true);
|
||||
}
|
||||
});
|
||||
var wechatLogin = loginContainer.Find("otherContainer").Find("Wechat").GetComponent<Button>();
|
||||
wechatLogin.onClick.AddListener(() =>
|
||||
{
|
||||
@@ -277,26 +281,32 @@ public class LoginController : MonoBehaviour
|
||||
if (signContainer != null)
|
||||
{
|
||||
var loginr2 = signContainer.Find("loginr2").GetComponent<Button>();
|
||||
loginr2.onClick.AddListener(goLoginReturn2);
|
||||
UIManager.AddEvent(loginr2.gameObject, EventTriggerType.PointerClick, (b) =>
|
||||
{
|
||||
goLoginReturn2();
|
||||
});
|
||||
}
|
||||
if (exit != null)
|
||||
{
|
||||
exit.onClick.AddListener(() => Application.Quit());
|
||||
UIManager.AddEvent(exit.gameObject, EventTriggerType.PointerClick, (b) =>
|
||||
{
|
||||
Application.Quit();
|
||||
});
|
||||
}
|
||||
|
||||
wxLogin1 = mainContent.Find("FormContainer-Login").Find("Mask").Find("FormContainer-wx1");
|
||||
if (wxLogin1 != null)
|
||||
{
|
||||
wxLogin1.Find("Image").GetComponent<Button>().onClick.AddListener(() =>
|
||||
{
|
||||
wxLock = true;
|
||||
wxBrowser.Url = "chrome://version/";
|
||||
wxLogin1.DOLocalMoveY(-573, 0.3f).onComplete = () =>
|
||||
{
|
||||
wxLock = false;
|
||||
wxLogin1.gameObject.SetActive(false);
|
||||
};
|
||||
});
|
||||
UIManager.AddEvent(wxLogin1.Find("Image").gameObject, EventTriggerType.PointerClick, (b) =>
|
||||
{
|
||||
wxLock = true;
|
||||
wxBrowser.Url = "chrome://version/";
|
||||
wxLogin1.DOLocalMoveY(-573, 0.3f).onComplete = () =>
|
||||
{
|
||||
wxLock = false;
|
||||
wxLogin1.gameObject.SetActive(false);
|
||||
};
|
||||
});
|
||||
wxBrowser = wxLogin1.Find("Browser (GUI)").GetComponent<Browser>();
|
||||
if (wxBrowser != null)
|
||||
{
|
||||
@@ -323,14 +333,14 @@ public class LoginController : MonoBehaviour
|
||||
wxLogin2 = mainContent.Find("FormContainer-wx2");
|
||||
if (wxLogin2!=null)
|
||||
{
|
||||
wxLogin2.Find("return").GetComponent<Button>().onClick.AddListener(() => {
|
||||
wxLogin2.gameObject.SetActive(false);
|
||||
//wxLogin3.gameObject.SetActive(false);
|
||||
pageNums = 4;
|
||||
Canvas.ForceUpdateCanvases();
|
||||
StartScrollPanel(1);
|
||||
});
|
||||
|
||||
UIManager.AddEvent(wxLogin2.Find("return").gameObject, EventTriggerType.PointerClick, (b) =>
|
||||
{
|
||||
wxLogin2.gameObject.SetActive(false);
|
||||
//wxLogin3.gameObject.SetActive(false);
|
||||
pageNums = 4;
|
||||
Canvas.ForceUpdateCanvases();
|
||||
StartScrollPanel(1);
|
||||
});
|
||||
wxLogin2.Find("Next").GetComponent<Button>().onClick.AddListener(()=>
|
||||
{
|
||||
this.goSign(false);
|
||||
@@ -339,24 +349,29 @@ public class LoginController : MonoBehaviour
|
||||
wxLogin3 = mainContent.Find("FormContainer-wx3");
|
||||
if (wxLogin3 != null)
|
||||
{
|
||||
wxLogin3.Find("return").GetComponent<Button>().onClick.AddListener(() => {
|
||||
if (signContainer.gameObject.activeSelf)
|
||||
{
|
||||
StartScrollPanel(3);
|
||||
}
|
||||
else
|
||||
{
|
||||
signContainer.gameObject.SetActive(true);
|
||||
pageNums = 4;
|
||||
//wxLogin3.gameObject.SetActive(false);
|
||||
StartScrollPanel(1);
|
||||
}
|
||||
});
|
||||
wxLogin3.Find("rememberButton").GetComponent<Button>().onClick.AddListener(()=>
|
||||
{
|
||||
var gou = wxLogin3.Find("rememberButton").Find("Gou").gameObject;
|
||||
gou.SetActive(!gou.activeSelf);
|
||||
});
|
||||
UIManager.AddEvent(wxLogin3.Find("return").gameObject, EventTriggerType.PointerClick, (b) =>
|
||||
{
|
||||
if (signContainer.gameObject.activeSelf)
|
||||
{
|
||||
StartScrollPanel(3);
|
||||
}
|
||||
else
|
||||
{
|
||||
signContainer.gameObject.SetActive(true);
|
||||
pageNums = 4;
|
||||
//wxLogin3.gameObject.SetActive(false);
|
||||
StartScrollPanel(1);
|
||||
}
|
||||
});
|
||||
UIManager.AddEvent(wxLogin3.Find("rememberButton").gameObject, EventTriggerType.PointerClick, (b) =>
|
||||
{
|
||||
var gou = wxLogin3.Find("rememberButton").Find("Gou").gameObject;
|
||||
gou.SetActive(!gou.activeSelf);
|
||||
});
|
||||
//wxLogin3.Find("rememberButton").GetComponent<Button>().onClick.AddListener(()=>
|
||||
//{
|
||||
|
||||
//});
|
||||
wxLogin3.Find("Next").GetComponent<Button>().onClick.AddListener(() =>
|
||||
{
|
||||
goMain(wxLogin3.Find("rememberButton").Find("Gou"));
|
||||
@@ -368,14 +383,22 @@ public class LoginController : MonoBehaviour
|
||||
toolContainer = transform.Find("Panel").Find("ToolContainer");
|
||||
if (toolContainer != null)
|
||||
{
|
||||
toolContainer.Find("Setting").GetComponent<Button>().onClick.AddListener(() =>
|
||||
{
|
||||
UIManager.ShowSettingModal();
|
||||
});
|
||||
toolContainer.Find("Msg").GetComponent<Button>().onClick.AddListener(() =>
|
||||
UIManager.AddEvent(toolContainer.Find("Setting").gameObject, EventTriggerType.PointerClick, (b) =>
|
||||
{
|
||||
UIManager.ShowSettingModal();
|
||||
});
|
||||
//toolContainer.Find("Setting").GetComponent<Button>().onClick.AddListener(() =>
|
||||
//{
|
||||
// UIManager.ShowSettingModal();
|
||||
//});
|
||||
UIManager.AddEvent(toolContainer.Find("Msg").gameObject, EventTriggerType.PointerClick, (b) =>
|
||||
{
|
||||
UIManager.ShowNewsModal();
|
||||
});
|
||||
//toolContainer.Find("Msg").GetComponent<Button>().onClick.AddListener(() =>
|
||||
//{
|
||||
// UIManager.ShowNewsModal();
|
||||
//});
|
||||
}
|
||||
}
|
||||
private void AdjustWxQrCode()
|
||||
@@ -769,6 +792,7 @@ public class LoginController : MonoBehaviour
|
||||
userInfos.Remove(u);
|
||||
}
|
||||
UIManager.Instance.userInfos = userInfos;
|
||||
UIManager.Instance.userInfoIndex = 0;
|
||||
}
|
||||
App.CurrentUser = data;
|
||||
//App.CurrentUser = new UserModel
|
||||
@@ -786,8 +810,8 @@ public class LoginController : MonoBehaviour
|
||||
}
|
||||
public void SaveInfo(UserResultModel data)
|
||||
{
|
||||
var u = userInfos.Find(x => x.Id == data.Id);
|
||||
if (u == null)
|
||||
var index = userInfos.FindIndex(x => x.Id == data.Id);
|
||||
if (index == -1)
|
||||
{
|
||||
userInfos.Add(new QUserInfo
|
||||
{
|
||||
@@ -796,19 +820,27 @@ public class LoginController : MonoBehaviour
|
||||
Avatar = data.WxHeadImg,
|
||||
Cookie = data.cookie
|
||||
});
|
||||
index = userInfos.Count - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
userInfos.Insert(0, new QUserInfo
|
||||
{
|
||||
Id = data.Id,
|
||||
NickName = data.Nickname,
|
||||
Avatar = data.WxHeadImg,
|
||||
Cookie = data.cookie
|
||||
});
|
||||
userInfos.Remove(u);
|
||||
var u = userInfos[index];
|
||||
u.Id = data.Id;
|
||||
u.NickName = data.Nickname;
|
||||
u.Avatar = data.WxHeadImg;
|
||||
u.Cookie = data.cookie;
|
||||
//userInfos.Insert(0, new QUserInfo
|
||||
//{
|
||||
// Id = data.Id,
|
||||
// NickName = data.Nickname,
|
||||
// Avatar = data.WxHeadImg,
|
||||
// Cookie = data.cookie
|
||||
//});
|
||||
//userInfos.Remove(u);
|
||||
}
|
||||
UIManager.Instance.userInfos = userInfos;
|
||||
UIManager.Instance.userInfoIndex = index;
|
||||
//PlayerPrefs.SetInt("UserInfoIndex", index);
|
||||
}
|
||||
async void Submit()
|
||||
{
|
||||
@@ -844,6 +876,13 @@ public class LoginController : MonoBehaviour
|
||||
{
|
||||
loginForm.password.ActivateInputField();
|
||||
}
|
||||
if (Input.GetKey(KeyCode.KeypadEnter) || Input.GetKey(KeyCode.Return))
|
||||
{
|
||||
if (loginForm != null && !string.IsNullOrEmpty(loginForm.email.text) && !string.IsNullOrEmpty(loginForm.password.text))
|
||||
{
|
||||
Submit();
|
||||
}
|
||||
}
|
||||
if (startCaptcha)
|
||||
{
|
||||
CaptchaTimerTick();
|
||||
|
||||
Reference in new issue
Block a user