add
This commit is contained in:
parent
45899c03d0
commit
088b92a5b1
@ -1,7 +1,12 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
[System.Serializable]
|
||||
public struct Register
|
||||
{
|
||||
public string Phone;
|
||||
public string Code;
|
||||
}
|
||||
public class mount : MonoBehaviour
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
@ -29,11 +34,11 @@ public class mount : MonoBehaviour
|
||||
boxTypes[1] = new BoxType { Name = "verification_code", textName = " 验证码 ", prompt = "请输入验证码", Type = 0, is_required = true };
|
||||
boxTypes[2] = new BoxType { Name = "submit", textName = " 取消确定 ",Type = 2};
|
||||
GameObject gameObject = add_pop_up();
|
||||
//测试输入框回调处理
|
||||
List<GameObject> gameObjects = gameObject.GetComponent<input_box_pop_up_window>().updateUI(boxTypes, "注册");
|
||||
List<GameObject> gameObjects = gameObject.GetComponent<input_box_pop_up_window>().updateUI(boxTypes, "注册");//测试输入框回调处理
|
||||
|
||||
gameObjects[0].GetComponent<input_box_pop_up_window_item>().register_click((BoxType boxType,int type) =>//手机号获取验证码点击
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(boxType.content)) {
|
||||
if (boxType.is_required && string.IsNullOrWhiteSpace(boxType.content)) {
|
||||
Promptmgr.Instance.PromptBubble("请不要" + boxType.textName + "为空");
|
||||
return; }
|
||||
Debug.Log("获取验证码");
|
||||
@ -44,7 +49,11 @@ public class mount : MonoBehaviour
|
||||
Destroy(gameObject);
|
||||
}
|
||||
else if (type == 1){
|
||||
string response = await web.SendRequest("http://47.109.133.52/Player/Register", "POST");
|
||||
Register register = new Register();
|
||||
register.Phone = boxTypes[0].content;
|
||||
register.Code = boxTypes[0].content;
|
||||
string jsonString = JsonUtility.ToJson(register);
|
||||
string response = await web.SendRequest("http://47.109.133.52/Player/Register", "POST", jsonString);
|
||||
Debug.Log(response);
|
||||
}
|
||||
});
|
||||
|
@ -52,31 +52,4 @@ public class input_box_pop_up_window : MonoBehaviour
|
||||
return gameObjects;
|
||||
}
|
||||
|
||||
public void onClikeAsync()//点击事件
|
||||
{
|
||||
bool is_ret = true;
|
||||
foreach (var boxType in boxTypes)
|
||||
{
|
||||
switch (boxType.Type)
|
||||
{
|
||||
case 0:
|
||||
if (boxType.is_required && string.IsNullOrWhiteSpace(boxType.content))
|
||||
{
|
||||
is_ret = false;
|
||||
Promptmgr.Instance.PromptBubble("请不要"+boxType.textName+"为空");
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (boxType.is_required && string.IsNullOrWhiteSpace(boxType.content))
|
||||
{
|
||||
is_ret = false;
|
||||
Promptmgr.Instance.PromptBubble("请不要" + boxType.textName + "为空");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (is_ret) OnClike.Invoke(boxTypes);
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user