_TheStrongestSnail/TheStrongestSnail/Assets/Scripts/LqUiScripts/PerSonalCenterPanel.cs

89 lines
2.5 KiB
C#
Raw Normal View History

2024-11-26 00:40:56 +08:00
using Newtonsoft.Json;
2024-11-26 21:49:37 +08:00
using System;
2024-11-25 20:50:33 +08:00
using System.Collections;
using System.Collections.Generic;
2024-11-26 00:40:56 +08:00
using System.Threading.Tasks;
2024-11-25 20:50:33 +08:00
using UnityEngine;
2024-11-25 22:18:57 +08:00
using UnityEngine.UI;
2024-11-25 20:50:33 +08:00
public class PerSonalCenterPanel : MonoBehaviour
{
2024-11-25 22:18:57 +08:00
public Button invitefriendsBtn;
public GameObject invitefriendsPanel;
public GameObject editPanel;
2024-11-26 00:40:56 +08:00
public UserInfomation14 userInfomation14;
public Text nickName;
2024-11-26 21:49:37 +08:00
//UI<55>߼<EFBFBD><DFBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
public Transform trans;
public Button editBtn;//<2F><EFBFBD><E0BCAD>ť
public Button myorderBtn;//<2F>ҵĶ<D2B5><C4B6><EFBFBD>
public Button realnameBtn;//ʵ<><CAB5><EFBFBD><EFBFBD>֤
public Button receivingaddressBtn;//<2F>ջ<EFBFBD><D5BB><EFBFBD>ַ
public Button conversionBtn;//ת<><D7AA>
public Button transformationBtn;//ת<><D7AA>
public Button exchangeBtn;//<2F>һ<EFBFBD>
public Button accountsecurityBtn;//<2F>˺Ű<CBBA>ȫ
public Button customerserviceBtn;//<2F>ͻ<EFBFBD>
2024-11-25 20:50:33 +08:00
// Start is called before the first frame update
void Start()
{
2024-11-26 00:40:56 +08:00
GetPlayerInfo();
2024-11-26 21:49:37 +08:00
editBtn.onClick.AddListener(EditBtn);
}
public void EditBtn()
{
2024-11-25 20:50:33 +08:00
}
// Update is called once per frame
void Update()
{
2024-11-26 00:40:56 +08:00
}
void SetPlayerName()
{
2024-11-25 20:50:33 +08:00
}
2024-11-25 22:18:57 +08:00
public void SetInviteFriendsPanel()
{
invitefriendsPanel.gameObject.SetActive(true);
transform.gameObject.SetActive(false);
}
public void SetEditPanel()
{
editPanel.gameObject.SetActive(true);
}
public void SetPerSonalCenterPanel()
{
transform.gameObject.SetActive(false);
}
2024-11-26 21:49:37 +08:00
public async void GetPlayerInfo() // 1.4
2024-11-26 00:40:56 +08:00
{
// ׼<><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> head14 = new Dictionary<string, string>
{
{ "Authorization", Global.global.serverResponse.data.token }
};
// <20><EFBFBD><ECB2BD>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
string response14 = await web.SendRequest(web.URL + "/snail/user/queryUserInfo", "POST", "{}", head14);
Debug.Log("1.4<EFBFBD><EFBFBD>ѯ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ" + response14);
userInfomation14 = JsonConvert.DeserializeObject<UserInfomation14>(response14);
Debug.Log("<22><><EFBFBD><EFBFBD>ʣ<EFBFBD><CAA3><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD>" + userInfomation14.data.beansCoin);
//Money = userInfomation14.beansCoin;
Debug.Log("&&&&&&&&&&&&&&&&&&&&7" + userInfomation14.data.nickName);
nickName.text = userInfomation14.data.nickName;
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>
Global.global.response = JsonConvert.DeserializeObject<ServerResponse>(response14);
// <20><><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5>ֻ<EFBFBD><D6BB><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><ECB2BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
2024-11-26 21:49:37 +08:00
//await Task.CompletedTask; // <20><><EFBFBD><EFBFBD>ֱ<EFBFBD>ӷ<EFBFBD><D3B7>أ<EFBFBD><D8A3><EFBFBD>ʹ<EFBFBD><CAB9> await
2024-11-26 00:40:56 +08:00
}
2024-11-25 20:50:33 +08:00
}