删除用户pc
This commit is contained in:
1 parent
bf3b0d2642
commit
3207d7b191
18 files changed
+1088
-67
No files matched your search
@@ -1,7 +1,9 @@
|
||||
using Assets.Scripts.UI.Control;
|
||||
using Assets.Scripts;
|
||||
using Assets.Scripts.UI.Control;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class DeleteAccount : PFUIPanel
|
||||
{
|
||||
@@ -10,13 +12,30 @@ public class DeleteAccount : PFUIPanel
|
||||
PFUIInputField password = transform.Find("Content/Password").GetComponent<PFUIInputField>();
|
||||
UIManager.AddEvent(transform.Find("Content/Delete").gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, b =>
|
||||
{
|
||||
print(password.Text);
|
||||
Delete(password.Text);
|
||||
});
|
||||
UIManager.AddEvent(transform.Find("Content/Cancel").gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, b =>
|
||||
{
|
||||
Close();
|
||||
});
|
||||
}
|
||||
async void Delete(string pwd)
|
||||
{
|
||||
var res = await ConfigHelper.userApi.DeleteAccount(pwd);
|
||||
if (res.result)
|
||||
{
|
||||
#if !(UNITY_ANDROID || UNITY_IOS)
|
||||
SceneManager.LoadScene("Login");
|
||||
#else
|
||||
SceneManager.LoadScene("Login-Mobile");
|
||||
#endif
|
||||
Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
Utils.showToast(null, res.errMsg);
|
||||
}
|
||||
}
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
@@ -307,6 +307,10 @@ public class EditUserController : PFUIPanel, INativeOnMobileImageSelect
|
||||
UIManager.AddEvent(mSaveButton.gameObject, EventTriggerType.PointerClick, Save);
|
||||
UIManager.AddEvent(mCancelButton.gameObject, EventTriggerType.PointerClick, Cancel);
|
||||
UIManager.AddEvent(mSwitchButton.gameObject, EventTriggerType.PointerClick, Switch);
|
||||
UIManager.AddEvent(transform.Find("LogoutButton").gameObject, EventTriggerType.PointerClick, b =>
|
||||
{
|
||||
UIManager.ShowDeleteAccount();
|
||||
});
|
||||
}
|
||||
public override void Show()
|
||||
{
|
||||
|
||||
@@ -34,6 +34,10 @@ public class UserInfoController : PFUIPanel
|
||||
//{
|
||||
// UIManager.ShowHomePanel();
|
||||
//});
|
||||
UIManager.AddEvent(transform.Find("InfoPanel/LogoutButton").gameObject, EventTriggerType.PointerClick, b =>
|
||||
{
|
||||
UIManager.ShowDeleteAccount();
|
||||
});
|
||||
UIManager.AddEvent(transform.Find("InfoPanel").Find("SwitchAccountButton").gameObject,
|
||||
EventTriggerType.PointerClick, (b) =>
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user