个人中心UI修改

This commit is contained in:
lq 2024-11-26 00:40:56 +08:00
parent 210351bef2
commit d28c6a4f82
9 changed files with 9512 additions and 9059 deletions

File diff suppressed because it is too large Load Diff

View File

@ -10,6 +10,7 @@ public class FriendInfo : MonoBehaviour
public Text phonrNumberTxt; public Text phonrNumberTxt;
public Text timeTxt; public Text timeTxt;
public GameObject sharePanel; public GameObject sharePanel;
public GameObject friendPanel;
// Start is called before the first frame update // Start is called before the first frame update
void Start() void Start()
{ {
@ -23,6 +24,6 @@ public class FriendInfo : MonoBehaviour
public void SetSharePanel() public void SetSharePanel()
{ {
sharePanel.gameObject.SetActive(true); sharePanel.gameObject.SetActive(true);
transform.gameObject.SetActive(false); friendPanel.gameObject.SetActive(false);
} }
} }

View File

@ -23,6 +23,7 @@ public class InviteFriendsPanel : MonoBehaviour
public void SetInviteFriendPanel() public void SetInviteFriendPanel()
{ {
invitefriendPanel.gameObject.SetActive(true); invitefriendPanel.gameObject.SetActive(true);
transform.gameObject.SetActive(false);
} }
public void SetInviteFriendsPanel() public void SetInviteFriendsPanel()
{ {

View File

@ -1,5 +1,7 @@
using Newtonsoft.Json;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks;
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
@ -8,16 +10,22 @@ public class PerSonalCenterPanel : MonoBehaviour
public Button invitefriendsBtn; public Button invitefriendsBtn;
public GameObject invitefriendsPanel; public GameObject invitefriendsPanel;
public GameObject editPanel; public GameObject editPanel;
public UserInfomation14 userInfomation14;
public Text nickName;
// Start is called before the first frame update // Start is called before the first frame update
void Start() void Start()
{ {
GetPlayerInfo();
} }
// Update is called once per frame // Update is called once per frame
void Update() void Update()
{ {
}
void SetPlayerName()
{
} }
public void SetInviteFriendsPanel() public void SetInviteFriendsPanel()
{ {
@ -32,4 +40,26 @@ public class PerSonalCenterPanel : MonoBehaviour
{ {
transform.gameObject.SetActive(false); transform.gameObject.SetActive(false);
} }
public async Task GetPlayerInfo() // 1.4
{
// 准备请求的头部信息,包含授权令牌
Dictionary<string, string> head14 = new Dictionary<string, string>
{
{ "Authorization", Global.global.serverResponse.data.token }
};
// 异步查询玩家信息
string response14 = await web.SendRequest(web.URL + "/snail/user/queryUserInfo", "POST", "{}", head14);
Debug.Log("1.4查询玩家信息" + response14);
userInfomation14 = JsonConvert.DeserializeObject<UserInfomation14>(response14);
Debug.Log("玩家剩余蜗蛋:" + userInfomation14.data.beansCoin);
//Money = userInfomation14.beansCoin;
Debug.Log("&&&&&&&&&&&&&&&&&&&&7" + userInfomation14.data.nickName);
nickName.text = userInfomation14.data.nickName;
// 解析服务器返回的数据
Global.global.response = JsonConvert.DeserializeObject<ServerResponse>(response14);
// 不需要返回值,只需表示异步操作完成
await Task.CompletedTask; // 或者直接返回,不使用 await
}
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff