修改细节

This commit is contained in:
Caiyanpeng committed 2021-04-28 18:41:54 +08:00
1 parent 614d067d25
commit b15a4fe2c1
18 files changed
+740 -402

No files matched your search

+3 -1
View File
@@ -26,7 +26,9 @@ namespace Assets.Scripts.Apis
}
public async Task<Stream> GetMapImage(IpToGeoModel locationInfo)
{
return await GetThirdPartStreamAsync($"https://api.mapbox.com/styles/v1/mapbox/dark-v10/static/{locationInfo.longitude},{locationInfo.latitude},12.14,0/1280x1280?access_token=pk.eyJ1IjoiYW5keXNqdCIsImEiOiJja2ZhajE5OGwwamRiMnltcW96bHk0ZWFuIn0.GvKanc6UveWSvIjS9HfBPA");
return await GetThirdPartStreamAsync($"https://api.mapbox.com/styles/v1/mapbox/dark-v10/static/{locationInfo.longitude},{locationInfo.latitude},12.14,0/1280x1280?access_token={App.MapBoxAccessToken}");
//pk.eyJ1IjoiYW5keXNqdCIsImEiOiJja2ZhajE5OGwwamRiMnltcW96bHk0ZWFuIn0.GvKanc6UveWSvIjS9HfBPA
//pk.eyJ1IjoiYW5keXNqdCIsImEiOiJja2ZhajE5OGwwamRiMnltcW96bHk0ZWFuIn0.GvKanc6UveWSvIjS9HfBPA
}
}
}
+1 -1
View File
@@ -7,7 +7,7 @@ using UnityEngine;
public static class App
{
public static string Host = "http://192.168.0.97:5082/";
public static string Host = "http://192.168.0.101:5082/";
public static string AppVersion = "1.0.0";
+13 -5
View File
@@ -541,7 +541,7 @@ public class LoginController : MonoBehaviour
}
else
{
RefreshWx3(data.ToObject<UserResultModel>());
RefreshWx3(data.ToObject<UserResultModel>(),1);
wxLogin3.gameObject.SetActive(true);
//Utils.DisplayImage(StartCoroutine,
//wxLogin3.Find("Avatar").GetComponent<RawImage>(),
@@ -670,7 +670,7 @@ public class LoginController : MonoBehaviour
if (r != null && r.result)
{
var u = JObject.FromObject(r.data).ToObject<UserResultModel>();
RefreshWx3(u);
RefreshWx3(u, signType);
LoadInfo();
StartScrollSign(1);
}
@@ -697,7 +697,7 @@ public class LoginController : MonoBehaviour
if (r.result)
{
var u = JObject.FromObject(r.data).ToObject<UserResultModel>();
RefreshWx3(u);
RefreshWx3(u,1);
StartScrollPanel(4);
}
else
@@ -730,11 +730,19 @@ public class LoginController : MonoBehaviour
Utils.showToast(gameObject, r.errMsg);
}
}
void RefreshWx3(UserResultModel data)
void RefreshWx3(UserResultModel data,int type)
{
Utils.DisplayImage(StartCoroutine,
if (string.IsNullOrEmpty(data.WxHeadImg))
{
wxLogin3.Find("Avatar").GetComponent<RawImage>().texture = Resources.Load<Texture>("Images/icon-1024");
}
else
{
Utils.DisplayImage(StartCoroutine,
wxLogin3.Find("Avatar").GetComponent<RawImage>(),
data.WxHeadImg);
}
wxLogin3.Find("Wx").gameObject.SetActive(type == 1);
wxLogin3.Find("NickName").GetComponent<Text>().text = data.Nickname;
userResult = data;
}
@@ -29,7 +29,14 @@ public class QuickLoginUser : MonoBehaviour
});
//transform.GetComponent<Button>().onClick.AddListener();
this.user = user;
Utils.DisplayImage(StartCoroutine, transform.Find("Avatar").GetComponent<RawImage>(),user.Avatar);
if (!string.IsNullOrEmpty(user.Avatar))
{
Utils.DisplayImage(StartCoroutine, transform.Find("Avatar").GetComponent<RawImage>(), user.Avatar);
}
else
{
transform.Find("Avatar").GetComponent<RawImage>().texture = Resources.Load<Texture>("Images/icon-1024");
}
transform.Find("NickNameText").GetComponent<Text>().text = user.NickName;
UIManager.AddEvent(transform.Find("BtnDelete").gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, (e) =>
{
+4 -4
View File
@@ -10,11 +10,11 @@ public class MainNav : MonoBehaviour
private GameObject home;
private void Awake()
{
var material = Instantiate(Resources.Load<Material>("UI/Material/RoundedCornersTextureMaterial"));
//var material = Instantiate(Resources.Load<Material>("UI/Material/RoundedCornersTextureMaterial"));
var rect = ((RectTransform)this.transform).rect;
material.SetVector(Shader.PropertyToID("_WidthHeightRadius"), new Vector4(rect.width, rect.height, rect.height, 0));
this.GetComponent<Image>().material = material;
//var rect = ((RectTransform)this.transform).rect;
//material.SetVector(Shader.PropertyToID("_WidthHeightRadius"), new Vector4(rect.width, rect.height, rect.height, 0));
//this.GetComponent<Image>().material = material;
var device = this.transform.Find("Device");
UIManager.AddEvent(device.gameObject, EventTriggerType.PointerClick, x =>
@@ -189,6 +189,10 @@ public class EditUserController : PFUIPanel
{
Utils.DisplayImage(StartCoroutine, mHeadImage, currentUser.WxHeadImg);
}
else
{
mHeadImage.texture = Resources.Load<Texture>("Images/icon-1024");
}
if (currentUser.Sex == 1)
{
mSexDropdown.SelectValue("男");
@@ -104,8 +104,15 @@ public class HomeController : PFUIPanel
{
userInfo.Find("SexIcon").GetComponent<Image>().sprite = Resources.Load<Sprite>("Images/man");
}
Utils.DisplayImage(StartCoroutine, userInfo.Find("Avatar").GetComponent<RawImage>(), App.CurrentUser.WxHeadImg);
if (!string.IsNullOrEmpty(App.CurrentUser.WxHeadImg))
{
Utils.DisplayImage(StartCoroutine, userInfo.Find("Avatar").GetComponent<RawImage>(), App.CurrentUser.WxHeadImg);
}
else
{
userInfo.Find("Avatar").GetComponent<RawImage>().texture = Resources.Load<Texture>("Images/icon-1024");
}
userInfo.Find("Country").GetComponent<RawImage>().texture = UIManager.Instance.loginRegOptions.GetCountryImageByName(App.CurrentUser.Country);
userInfo.Find("CaloriesContainer").Find("CaloriesValue").GetComponent<Text>().text = double.Parse(summary.Kcal).ToString("0") +" KCAL";
userInfo.Find("KMContainer").Find("KMValue").GetComponent<Text>().text = summary.TotalDistance.ToString("0") +" KM";
@@ -113,8 +120,10 @@ public class HomeController : PFUIPanel
userInfo.Find("GroupTop").Find("FtpContainer").Find("FtpTime").GetComponent<Text>().text = App.CurrentUser.LastUpdateFtpTime.ToString("yyyy.MM.dd");
userInfo.Find("GroupTop").Find("WeightContainer").Find("WeightTime").GetComponent<Text>().text = App.CurrentUser.LastUpdateWeightTime.ToString("yyyy.MM.dd");
userInfo.Find("GroupTop").Find("WKGContainer").Find("WKGTime").GetComponent<Text>().text =
DateTime.Compare(App.CurrentUser.LastUpdateFtpTime, App.CurrentUser.LastUpdateWeightTime)>0
? App.CurrentUser.LastUpdateFtpTime.ToString("yyyy.MM.dd")
: App.CurrentUser.LastUpdateWeightTime.ToString("yyyy.MM.dd");
}
void GetSummary()
{
@@ -70,7 +70,15 @@ public class UserInfoController : PFUIPanel
{
var summary = r.data;
var user = App.CurrentUser;
Utils.DisplayImage(StartCoroutine, infoPanel.Find("Avatar").GetComponent<RawImage>(), user.WxHeadImg);
if (!string.IsNullOrEmpty(user.WxHeadImg))
{
Utils.DisplayImage(StartCoroutine, infoPanel.Find("Avatar").GetComponent<RawImage>(), user.WxHeadImg);
}
else
{
infoPanel.Find("Avatar").GetComponent<RawImage>().texture = Resources.Load<Texture>("Images/icon-1024");
}
infoPanel.Find("Status").Find("Country").GetComponent<RawImage>().texture
= UIManager.Instance.loginRegOptions.GetCountryImageByName(user.Country);
infoPanel.Find("Status").Find("Wx").gameObject.SetActive(
-1
View File
@@ -142,7 +142,6 @@ public class UIManager : MonoBehaviour
stack = new Stack<PFUIPanel>();
loginRegOptions = new LoginRegOptions();
var userInfosJson = PlayerPrefs.GetString("UserInfos");
Debug.Log(userInfosJson);
userInfos = JsonConvert.DeserializeObject<List<QUserInfo>>(userInfosJson);
if (userInfos == null) userInfos = new List<QUserInfo>();