90 lines
3.2 KiB
C#
90 lines
3.2 KiB
C#
using System.Collections;
|
||
using System.Collections.Generic;
|
||
using UnityEngine;
|
||
using UnityEngine.UI;
|
||
using UnityEngine.SceneManagement;
|
||
using Newtonsoft.Json.Bson;
|
||
public class Customer_serviceTanchuang : mount
|
||
{
|
||
public Button Kfbtn;
|
||
public Transform canvas;
|
||
public Button LogoutBtn;
|
||
public Button TransferBtn;
|
||
|
||
public GameObject transferPassword;
|
||
// Start is called before the first frame update
|
||
void Start()
|
||
{
|
||
Kfbtn.onClick.AddListener(Display_pop_up_window);
|
||
LogoutBtn.onClick.AddListener(LogoutClick);
|
||
TransferBtn.onClick.AddListener(transferClick);
|
||
}
|
||
|
||
private void LogoutClick()
|
||
{
|
||
List<BoxType> boxTypes = new List<BoxType>();
|
||
boxTypes.Add(new BoxType { Name = "", prompt = "确认", Type = 13, content = "确认注销" });
|
||
boxTypes.Add(new BoxType { Name = "submit", textName = " 取消确定 ", prompt = "取消", Type = 2 });
|
||
GameObject gameObject = add_pop_up();
|
||
List<GameObject> gameObjects = gameObject.GetComponent<input_box_pop_up_window>().updateUI(boxTypes, "注销账号");//测试输入框回调处理
|
||
gameObjects[1].GetComponent<input_box_pop_up_window_item>().register_click(async (BoxType boxType, int type) =>//登录确定或取消
|
||
{
|
||
if (type == 0)//取消
|
||
{
|
||
gameObject.GetComponent<input_box_pop_up_window>().destroy();
|
||
}
|
||
else if (type == 1)//提交
|
||
{
|
||
bool issucceffull = await Scene_main_jiekou.instance.Cancellations();
|
||
if (issucceffull)
|
||
{
|
||
PlayerPrefs.DeleteKey("UserToken");
|
||
SceneManager.LoadScene(0);
|
||
}
|
||
else
|
||
{
|
||
Debug.Log("注销失败");
|
||
}
|
||
}
|
||
});
|
||
}
|
||
|
||
|
||
private void transferClick()
|
||
{
|
||
Instantiate(transferPassword, canvas);
|
||
}
|
||
|
||
|
||
private void Display_pop_up_window()//联系客服界面
|
||
{
|
||
|
||
|
||
List<BoxType> boxTypes = new List<BoxType>();
|
||
boxTypes.Add(new BoxType { Name = "", prompt = "", Type = 13, content = "客服联系方式:qq:5649846541654" });
|
||
boxTypes.Add(new BoxType { Name = "", prompt = "确认", Type = 11 });
|
||
GameObject gameObject = add_pop_up();
|
||
gameObject.transform.position = new Vector3(Screen.width / 2, Screen.height / 2, 0);
|
||
gameObject.transform.SetParent(canvas);
|
||
gameObject.GetComponent<input_box_pop_up_window>().minHeight = 300;//设置最低高度
|
||
gameObject.GetComponent<input_box_pop_up_window>().setScrollMode(0);//设置滚动模式为滚动
|
||
//gameObject.GetComponent<input_box_pop_up_window>().setScrollMode(0);//设置滚动模式为自动填充
|
||
List<GameObject> gameObjects = gameObject.GetComponent<input_box_pop_up_window>().updateUI(boxTypes, "联系客服");//测试输入框回调处理
|
||
Clipboard.CopyToClipboard("5649846541654");
|
||
|
||
gameObjects[1].GetComponent<input_box_pop_up_window_item>().register_click(async (BoxType boxType, int type) =>//登录确定或取消
|
||
{
|
||
if (type == 1)
|
||
{
|
||
|
||
gameObject.GetComponent<input_box_pop_up_window>().destroy();
|
||
}
|
||
});
|
||
}
|
||
// Update is called once per frame
|
||
void Update()
|
||
{
|
||
|
||
}
|
||
}
|