_TheStrongestSnail/TheStrongestSnail/Assets/Scripts/RealNamePanel/ShiMingPanel.cs

92 lines
2.1 KiB
C#
Raw Normal View History

2024-11-27 19:04:12 +08:00
using System.Collections;
using System.Collections.Generic;
2024-11-27 23:18:16 +08:00
using System.Text.RegularExpressions;
2024-11-27 19:04:12 +08:00
using System.Threading.Tasks;
2024-11-27 23:18:16 +08:00
using TMPro;
2024-11-27 19:04:12 +08:00
using UnityEngine;
using UnityEngine.UI;
2024-11-27 23:18:16 +08:00
using UnityEngine.Windows;
2024-11-27 19:04:12 +08:00
using static OrderPanel;
2024-11-27 23:18:16 +08:00
//ʵ<><CAB5><EFBFBD><EFBFBD>֤<EFBFBD><D6A4>Ϣ<EFBFBD><CFA2>
public class RealName
{
//<2F><><EFBFBD><EFBFBD>֤
public string idCard;
//<2F><><EFBFBD>п<EFBFBD>
public string bank;
//<2F><><EFBFBD><EFBFBD>
public string realName;
}
2024-11-27 19:04:12 +08:00
public class ShiMingPanel : MonoBehaviour
{
//<2F><><EFBFBD><EFBFBD>
2024-11-27 23:18:16 +08:00
public TMP_InputField inputName;
2024-11-27 19:04:12 +08:00
//<2F><><EFBFBD><EFBFBD>֤<EFBFBD><D6A4>
2024-11-27 23:18:16 +08:00
public TMP_InputField inputIDNum;
2024-11-27 19:04:12 +08:00
//<2F><><EFBFBD>п<EFBFBD>
2024-11-27 23:18:16 +08:00
public TMP_InputField inputBankNum;
2024-11-27 19:04:12 +08:00
//<2F>ֻ<EFBFBD><D6BB><EFBFBD>
2024-11-27 23:18:16 +08:00
public TMP_InputField inputPhone;
2024-11-27 19:04:12 +08:00
//<2F><>֤<EFBFBD><D6A4>ť
public Button btnProve;
2024-11-27 23:18:16 +08:00
//ʵ<><CAB5><EFBFBD><EFBFBD>֤<EFBFBD><D6A4><EFBFBD><EFBFBD>ҳ<EFBFBD><D2B3>
public GameObject smFinishPanel;
private RealName realNameMsg = new RealName();
//׼<><D7BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD><C8A8><EFBFBD><EFBFBD>
Dictionary<string, string> headInfo = new Dictionary<string, string>();
2024-11-27 19:04:12 +08:00
// Start is called before the first frame update
void Start()
{
2024-11-27 23:18:16 +08:00
btnProve.onClick.AddListener(() =>
{
realNameMsg.realName = inputName.text;
realNameMsg.bank = inputBankNum.text;
realNameMsg.idCard = inputIDNum.text;
ReGetOrder();
});
2024-11-27 19:04:12 +08:00
}
// Update is called once per frame
void Update()
{
}
2024-11-27 23:18:16 +08:00
public class ReturnMsg
2024-11-27 19:04:12 +08:00
{
2024-11-27 23:18:16 +08:00
public int code;
public string message;
public string data;
}
2024-11-27 19:04:12 +08:00
public async Task ReGetOrder()
{
2024-11-27 23:18:16 +08:00
headInfo.Add("Authorization", Global.global.serverResponse.data.token);
2024-11-27 19:04:12 +08:00
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//<2F><EFBFBD><ECB2BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
2024-11-27 23:18:16 +08:00
string responsel6 = await web.SendRequest(web.URL + "/snail/user/cert", "POST", JsonUtility.ToJson(realNameMsg), headInfo);
ReturnMsg msg = JsonUtility.FromJson<ReturnMsg>(responsel6);
2024-11-27 19:04:12 +08:00
2024-11-27 23:18:16 +08:00
if (msg.code == 200)
{
Transform parentTransform = transform.parent;
GameObject go = Instantiate(smFinishPanel, parentTransform, false);
go.GetComponent<SMFinishPanel>().UpdatePanel(realNameMsg);
Destroy(this.gameObject);
}
Debug.Log(responsel6);
Debug.Log(msg);
2024-11-27 19:04:12 +08:00
}
}