82 lines
2.8 KiB
C#
82 lines
2.8 KiB
C#
|
using Newtonsoft.Json;
|
|||
|
using System.Collections;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Threading.Tasks;
|
|||
|
using UnityEngine;
|
|||
|
//<2F><>̬<EFBFBD><CCAC><EFBFBD>Ŷ<EFBFBD><C5B6><EFBFBD>Ϣ
|
|||
|
public class treeTeamData : MonoBehaviour
|
|||
|
{
|
|||
|
public Dictionary<string, string> CreateHeaders()
|
|||
|
{
|
|||
|
if (string.IsNullOrEmpty(MyGlobal.global.loginResponse.Data.access_token))
|
|||
|
{
|
|||
|
Debug.LogWarning("<22><><EFBFBD>Դ<EFBFBD><D4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷʱ<CDB7><CAB1>token δ<><CEB4><EFBFBD>á<EFBFBD>");
|
|||
|
return new Dictionary<string, string>();
|
|||
|
}
|
|||
|
return new Dictionary<string, string>
|
|||
|
{
|
|||
|
|
|||
|
{ "Authorization","Bearer "+MyGlobal.global.loginResponse.Data.access_token },
|
|||
|
{ "client-info", "{\"platform\":\"ios\",\"phone_product\":\"apple\",\"phone_model\":\"iPhone_8\",\"system_version\":\"12.0\",\"screen_size\":\"750*1334\",\"device_no\":\"e3e277810fff9d955ebdd7037eff51a8\",\"version\":\"1.0.0\"}" }
|
|||
|
};
|
|||
|
}
|
|||
|
public async Task<TreeTeam> TreeTeamData()
|
|||
|
{
|
|||
|
string response = await myWeb.SendRequest(myWeb.URL + "/api/tree/team_data", "GET", "{}", CreateHeaders());
|
|||
|
Debug.Log("<22><>̬<EFBFBD><CCAC><EFBFBD>Ŷ<EFBFBD><C5B6><EFBFBD>Ϣ" + response);
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD> JSON
|
|||
|
TreeTeam TreeTeamResponse = JsonConvert.DeserializeObject<TreeTeam>(response);
|
|||
|
|
|||
|
//// <20><><EFBFBD>鷴<EFBFBD><E9B7B4><EFBFBD>л<EFBFBD><D0BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
//if (TreeTeamResponse != null && TreeTeamResponse.Data != null && TreeTeamResponse.Data.Info != null)
|
|||
|
//{
|
|||
|
// Debug.Log("<22>û<EFBFBD><C3BB>dz<EFBFBD>: " + TreeTeamResponse.Data.Info.Nickname);
|
|||
|
//}
|
|||
|
//else
|
|||
|
//{
|
|||
|
// Debug.LogError("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>գ<EFBFBD><D5A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>鷵<EFBFBD>ص<EFBFBD> JSON <20><>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD>ݡ<EFBFBD>");
|
|||
|
//}
|
|||
|
|
|||
|
return TreeTeamResponse;
|
|||
|
}
|
|||
|
}
|
|||
|
//===================================================================
|
|||
|
public class TreeTeam:myResponse
|
|||
|
{
|
|||
|
public TreeTeamData Data { get; set; }
|
|||
|
}
|
|||
|
|
|||
|
public class TreeTeamData
|
|||
|
{
|
|||
|
public TreeTeamInfo Info { get; set; }
|
|||
|
public List<TreeTeamItem> Items { get; set; }
|
|||
|
}
|
|||
|
|
|||
|
public class TreeTeamInfo
|
|||
|
{
|
|||
|
public string Uid { get; set; }
|
|||
|
public string Account { get; set; }
|
|||
|
public string Nickname { get; set; }
|
|||
|
public string AvatarUrl { get; set; }
|
|||
|
public string InviteCode { get; set; }
|
|||
|
public int CertifyStatus { get; set; }//ʵ<><CAB5>״̬ 0:δʵ<CEB4><CAB5> 1:<3A><>ʵ<EFBFBD><CAB5>
|
|||
|
public string CreateTime { get; set; }
|
|||
|
public string LastLoginTime { get; set; }
|
|||
|
public int TeamCount { get; set; }
|
|||
|
public int DirectlyCount { get; set; }
|
|||
|
public int TeamActiveCount { get; set; }
|
|||
|
public int DirectlyActiveCount { get; set; }
|
|||
|
public int Level { get; set; }
|
|||
|
public string LevelName { get; set; }
|
|||
|
public string LevelIcon { get; set; }
|
|||
|
}
|
|||
|
|
|||
|
public class TreeTeamItem
|
|||
|
{
|
|||
|
public string Title { get; set; }
|
|||
|
public string Desc { get; set; }
|
|||
|
public int NowVal { get; set; }
|
|||
|
public int ReqVal { get; set; }
|
|||
|
public string Percentage { get; set; }//<2F>ٷֱȽ<D6B1><C8BD><EFBFBD> 1 = 100%
|
|||
|
}
|