苹果登录暂存
This commit is contained in:
1 parent
ebcc83ed6a
commit
05d2c74efa
18 files changed
+1651
-1197
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(); });
|
||||
@@ -507,6 +507,38 @@ public class LoginController : BaseScene
|
||||
transform.Find("Panel").Find("Version").GetComponent<Text>().text = $"V{App.AppVersion}";
|
||||
#endif
|
||||
}
|
||||
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 = res.data;
|
||||
|
||||
if (res.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;
|
||||
MobileAni(true);
|
||||
StartScrollPanel(2);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void Test(string key)
|
||||
{
|
||||
@@ -514,8 +546,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 +727,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>(),
|
||||
@@ -759,7 +790,7 @@ public class LoginController : BaseScene
|
||||
//Timer t = new Ti
|
||||
if (r.result)
|
||||
{
|
||||
if (pageNums == 5)
|
||||
if (signType == 1 || signType == 2)
|
||||
{
|
||||
if (r.data.Value<bool>("isExist"))
|
||||
{
|
||||
@@ -820,7 +851,7 @@ public class LoginController : BaseScene
|
||||
signForm.cpassword.text = "";
|
||||
StartScrollSign(0);
|
||||
}
|
||||
//0-普通 1-微信
|
||||
//0-普通 1-微信 2-苹果
|
||||
private async void goRegNext(int signType = 0)
|
||||
{
|
||||
var Email = signForm.email;
|
||||
@@ -851,6 +882,10 @@ 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);
|
||||
}
|
||||
if (r != null && r.result)
|
||||
{
|
||||
var u = JObject.FromObject(r.data).ToObject<UserResultModel>();
|
||||
@@ -870,21 +905,33 @@ 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
|
||||
{
|
||||
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);
|
||||
MobileAni(true);
|
||||
StartScrollPanel(4);
|
||||
}
|
||||
else
|
||||
{
|
||||
Utils.showToast(gameObject, r.errMsg);
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
@@ -1201,6 +1248,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);
|
||||
|
||||
@@ -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);
|
||||
@@ -176,9 +177,12 @@ public class MainController : BaseScene
|
||||
void FinishMessageLeft()
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user