_TheStrongestSnail/TheStrongestSnail/Assets/Scripts/lianghaoLL/ExchangePanel.cs

42 lines
956 B
C#
Raw Normal View History

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
using UnityEngine.UI;
2024-11-27 19:05:53 +08:00
public class ExchangePanel : Base
{
public TMP_InputField exchangeInput;
public Button CancelBtn;
public Button ConfirmBtn;
// Start is called before the first frame update
void Start()
{
2024-11-28 06:16:58 +08:00
//testLogo();
ConfirmBtn.onClick.AddListener(ConfrimPanel);
CancelBtn.onClick.AddListener(CancelPanel);
}
void CancelPanel()
{
Destroy(this.gameObject);
}
async void ConfrimPanel()
{
2024-11-27 19:05:53 +08:00
string response = "";//<2F><><EFBFBD><EFBFBD>
2024-12-09 12:00:50 +08:00
string body = "{\"exchangeCode\":\"" + exchangeInput.text + "\"}";
2024-11-27 19:05:53 +08:00
Debug.Log(body);
2024-12-09 12:00:50 +08:00
response = await web.SendRequest(web.URL + "/snail/snail/exchangeCode", "POST", body, Global.global.CreateHeaders());
2024-11-27 19:05:53 +08:00
Debug.Log(response);
}
// Update is called once per frame
void Update()
{
}
}