2024-11-26 15:50:49 +08:00
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using TMPro;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
using UnityEngine.UI;
|
|
|
|
|
|
|
|
|
|
public class DonatePanelItem : BaseUIPanel
|
|
|
|
|
{
|
|
|
|
|
public TMP_InputField Recipient;
|
|
|
|
|
public TMP_InputField GiftQuantity;
|
|
|
|
|
public Text NumberOfFreeSnailShells;
|
|
|
|
|
public Text Fees;
|
|
|
|
|
public Text Total;
|
2024-11-26 16:40:57 +08:00
|
|
|
|
public Button Button;
|
2024-11-26 15:50:49 +08:00
|
|
|
|
void Start()
|
|
|
|
|
{
|
|
|
|
|
GiftQuantity.onValueChanged.AddListener(GiftQuantityData);
|
2024-11-26 16:40:57 +08:00
|
|
|
|
Button.onClick.AddListener(buttonOnClick);
|
|
|
|
|
|
|
|
|
|
testLogo();
|
2024-11-26 15:50:49 +08:00
|
|
|
|
}
|
2024-11-26 16:54:06 +08:00
|
|
|
|
public class voluteCoinItem
|
2024-11-26 15:50:49 +08:00
|
|
|
|
{
|
2024-11-26 16:54:06 +08:00
|
|
|
|
public string toCuteNo;
|
|
|
|
|
public int voluteCoin;
|
|
|
|
|
}
|
|
|
|
|
async void buttonOnClick()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
voluteCoinItem body = new voluteCoinItem();
|
|
|
|
|
body.toCuteNo = Recipient.text;
|
|
|
|
|
body.voluteCoin = int.Parse(GiftQuantity.text);
|
|
|
|
|
string response = await web.SendRequest(web.URL + "/snail/transfer/voluteCoin", "POST", JsonUtility.ToJson(body), testhead);//<2F><><EFBFBD><EFBFBD>
|
|
|
|
|
Debug.Log(response);
|
2024-11-26 15:50:49 +08:00
|
|
|
|
}
|
|
|
|
|
async void GiftQuantityData(string userInput)
|
|
|
|
|
{
|
|
|
|
|
NumberOfFreeSnailShells.text = userInput;
|
|
|
|
|
await ButtonClickAnimationAsync(NumberOfFreeSnailShells.gameObject, 1.05f);
|
|
|
|
|
Fees.text = (int.Parse(userInput) * 0.08).ToString();
|
|
|
|
|
await ButtonClickAnimationAsync(Fees.gameObject, 1.05f);
|
|
|
|
|
Total.text = (int.Parse(userInput) + (int.Parse(userInput) * 0.08)).ToString();
|
|
|
|
|
await ButtonClickAnimationAsync(Total.gameObject, 1.05f);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|