| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- using AppUI.Manager.View;
- using AppUI.Util.Input;
- using JCUnityLib;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.SceneManagement;
- namespace AppUI.View.Home.UserCenter
- {
- public class BoxSecurity : MonoBehaviour
- {
- [SerializeField] AppUITMPInputField inputFieldEmail;
- [SerializeField] AppUITMPInputField inputFieldPassword;
- void OnEnable()
- {
- InitInfo();
- }
- void OnDisable()
- {
- }
- void InitInfo()
- {
- if (inputFieldEmail != null)
- inputFieldEmail.SetText(LoginMgr.myUserInfo.email);
- }
- // 点击绑定邮箱
- public void OnClick_BindEmail() {
- AudioMgr.ins.PlayBtn();
- RelateValidateView relateValidateView = ViewManager.ShowView(UIViewType.RelateValidateView).GetComponent<RelateValidateView>();
- //CanvasUtils.PlusSortOrder(gameObject.GetComponentInParent<Canvas>().gameObject, relateValidateView.gameObject, 1);
- relateValidateView.InitForEmail2();
- relateValidateView.onValidateSuccess = (a, b, c) => {
- relateValidateView?.BanButtons();
- StartCoroutine(UserController.Instance.SaveEmail(a, b, c, (res) => {
- if (res.code == 0)
- {
- PopupMgr.ins.ShowTip(TextAutoLanguage2.GetTextByKey("RelateValidateView-pass1"));
- LoginMgr.myUserInfo.email = a;
- inputFieldEmail.SetText(a);
- relateValidateView?.CloseView();
- }
- }));
- };
- }
- public void OnClick_SignOut()
- {
- AudioMgr.ins.PlayBtn();
- //logic
- PlayerPrefs.DeleteKey(LoginMgr.LoginTokenKey);
- UserPlayer.ins?.Close();
- //SceneManager.LoadScene("Login", LoadSceneMode.Single);
-
- if (AppleLoginHelper.ins.HasAppleKey())
- AppleLoginHelper.ins.DeleteAppleKey();
- SceneManager.LoadScene("Login", LoadSceneMode.Single);
- //CommonConfig.StandaloneMode = true;
- //SceneManager.LoadScene("Home", LoadSceneMode.Single);
- }
- // Start is called before the first frame update
- void Start()
- {
- }
- // Update is called once per frame
- void Update()
- {
- }
- }
- }
|