浏览器嵌入,国旗文件
This commit is contained in:
1 parent
e7a3214cb5
commit
07feba912c
552 files changed
+39279
-8128
No files matched your search
@@ -10,17 +10,17 @@ using UnityEngine.UI;
|
||||
|
||||
public class HomeController : PFUIPanel
|
||||
{
|
||||
[SerializeField] Text Ftp;
|
||||
[SerializeField] RawImage Avatar;
|
||||
[SerializeField] Text Weight;
|
||||
[SerializeField] Text WKG;
|
||||
[SerializeField] Text Calories;
|
||||
[SerializeField] Text KM;
|
||||
[SerializeField] Text Climb;
|
||||
[SerializeField] Text NickName;
|
||||
[SerializeField] Button More;
|
||||
//[SerializeField] Text Ftp;
|
||||
//[SerializeField] RawImage Avatar;
|
||||
//[SerializeField] Text Weight;
|
||||
//[SerializeField] Text WKG;
|
||||
//[SerializeField] Text Calories;
|
||||
//[SerializeField] Text KM;
|
||||
//[SerializeField] Text Climb;
|
||||
//[SerializeField] Text NickName;
|
||||
//[SerializeField] Button More;
|
||||
[SerializeField] Button BtnRide;
|
||||
|
||||
[SerializeField] Transform userInfo;
|
||||
// Start is called before the first frame update
|
||||
protected override void Start()
|
||||
{
|
||||
@@ -33,11 +33,10 @@ public class HomeController : PFUIPanel
|
||||
// toast.GetComponent<RectTransform>().position = new Vector3(Screen.width / 2, Screen.height / 2, 0);
|
||||
// toast.transform.parent = parent;
|
||||
//}
|
||||
//if (ConfigHelper.CurrentUser != null)
|
||||
//{
|
||||
// SetCurrentUser();
|
||||
// GetSummary();
|
||||
//}
|
||||
if (App.CurrentUser != null)
|
||||
{
|
||||
GetSummary();
|
||||
}
|
||||
//if (More != null)
|
||||
//{
|
||||
// More.onClick.AddListener(MoreFunc);
|
||||
@@ -50,7 +49,7 @@ public class HomeController : PFUIPanel
|
||||
UIManager.ShowDevicePanel();
|
||||
});
|
||||
|
||||
var avatar = this.transform.Find("UserInfo").Find("Image");
|
||||
var avatar = userInfo.Find("Avatar");
|
||||
UIManager.AddEvent(avatar.gameObject, EventTriggerType.PointerClick, x =>
|
||||
{
|
||||
UIManager.ShowUserInfoPanel();
|
||||
@@ -70,21 +69,31 @@ public class HomeController : PFUIPanel
|
||||
|
||||
void SetCurrentUser()
|
||||
{
|
||||
var user = ConfigHelper.CurrentUser;
|
||||
Ftp.text = user.FTP.ToString();
|
||||
Weight.text = user.Weight.ToString();
|
||||
WKG.text = $"{user.Weight}KG/{user.BicycleWeight}KG";
|
||||
NickName.text = user.Nickname;
|
||||
Utils.DisplayImage(StartCoroutine, Avatar, user.WxHeadImg);
|
||||
userInfo.Find("NickName").GetComponent<Text>().text = App.CurrentUser.NickName;
|
||||
userInfo.Find("GroupTop").Find("FtpContainer").Find("FtpValue").GetComponent<Text>().text = App.CurrentUser.Ftp.ToString();
|
||||
userInfo.Find("GroupTop").Find("WeightContainer").Find("WeightValue").GetComponent<Text>().text = App.CurrentUser.Weight.ToString();
|
||||
userInfo.Find("GroupTop").Find("WKGContainer").Find("WKGValue").GetComponent<Text>().text = $"{App.CurrentUser.Weight}kg/{App.CurrentUser.BicycleWeight}kg";
|
||||
userInfo.Find("CaloriesContainer").Find("CaloriesValue").GetComponent<Text>().text = App.CurrentUser.Carlories;
|
||||
userInfo.Find("KMContainer").Find("KMValue").GetComponent<Text>().text = App.CurrentUser.Distance.ToString("#0.00");
|
||||
userInfo.Find("ClimbContainer").Find("ClimbValue").GetComponent<Text>().text = App.CurrentUser.Climb;
|
||||
//var user = ConfigHelper.CurrentUser;
|
||||
//Ftp.text = user.FTP.ToString();
|
||||
//Weight.text = user.Weight.ToString();
|
||||
//WKG.text = $"{user.Weight}KG/{user.BicycleWeight}KG";
|
||||
//NickName.text = user.Nickname;
|
||||
Utils.DisplayImage(StartCoroutine, userInfo.Find("Avatar").GetComponent<RawImage>(), App.CurrentUser.Avatar);
|
||||
}
|
||||
void GetSummary()
|
||||
{
|
||||
var res = ConfigHelper.userApi.GetSummary();
|
||||
if (res.result)
|
||||
{
|
||||
KM.text = $"{res.data.TotalDistance.ToString("#0.00")}KM";
|
||||
Climb.text = $"{res.data.TotalClimb.ToString()}M";
|
||||
Calories.text = $"{res.data.Kcal.ToString()}KCAL";
|
||||
App.CurrentUser.Distance = res.data.TotalDistance;
|
||||
App.CurrentUser.Climb = res.data.TotalClimb;
|
||||
App.CurrentUser.Carlories = res.data.Kcal;
|
||||
SetCurrentUser();
|
||||
//Climb.text = $"{res.data.TotalClimb.ToString()}M";
|
||||
//Calories.text = $"{res.data.Kcal.ToString()}KCAL";
|
||||
//Calories.text = res.data.
|
||||
}
|
||||
else
|
||||
|
||||
Reference in new issue
Block a user