This commit is contained in:
Caiyanpeng committed 2021-04-15 15:58:37 +08:00
1 parent 038720e7bd
commit c97bd50f3f
32 files changed
+9899 -3719

No files matched your search

@@ -13,6 +13,7 @@ using UnityEngine.UI;
public class EditUserController : PFUIPanel
{
private Button mSaveButton;
private Button mReturnButton;
private PFUIDropdown mSexDropdown;
private PFUIDropdown mDayDropdown;
private PFUIDropdown mMonthDropdown;
@@ -33,6 +34,7 @@ public class EditUserController : PFUIPanel
mMonthDropdown = panel.Find("MonthDropdown").GetComponent<PFUIDropdown>();
mDayDropdown = panel.Find("DayDropdown").GetComponent<PFUIDropdown>();
mSaveButton = this.transform.Find("SaveButton").GetComponent<Button>();
mReturnButton = transform.Find("CancelButton").GetComponent<Button>();
mHeadImage = this.transform.Find("HeadImage").GetComponent<RawImage>();
mSexDropdown.ClearOptions();
@@ -80,12 +82,17 @@ public class EditUserController : PFUIPanel
// new Dropdown.OptionData()
//});
LoadDataSync();
LoadDataSyncAsync();
}
async void LoadDataSync()
async System.Threading.Tasks.Task Login()
{
var result = await new UserApi().Login("13115011550", "laozhong", "");
App.CurrentUser = result.data;
}
async System.Threading.Tasks.Task LoadDataSyncAsync()
{
await Login();
Material material = null;
if (material == null)
{
@@ -95,33 +102,38 @@ public class EditUserController : PFUIPanel
material.SetVector(Shader.PropertyToID("_WidthHeightRadius"), new Vector4(rect.width, rect.height, rect.height, 0));
mHeadImage.material = material;
//var currentUser = App.CurrentUser;
//mIdText.text = "ID:" + currentUser.Id.ToString();
//mNameText.text = currentUser.Nickname;
//if (!string.IsNullOrWhiteSpace(currentUser.WxHeadImg))
//{
// Utils.DisplayImage(StartCoroutine, mHeadImage, currentUser.WxHeadImg);
//}
//if (currentUser.Sex == 1)
//{
// mSexDropdown.SelectValue("男");
//}
//else
//{
// mSexDropdown.SelectValue("女");
//}
//if (currentUser.Birthday.HasValue)
//{
// var birthday = currentUser.Birthday.Value;
// mYearDropdown.SelectValue(birthday.Year.ToString());
// mMonthDropdown.SelectValue(birthday.Month.ToString());
// mDayDropdown.SelectValue(birthday.Day.ToString());
//}
var currentUser = App.CurrentUser;
mIdText.text = "ID:" + currentUser.Id.ToString();
mNameText.text = currentUser.Nickname;
if (!string.IsNullOrWhiteSpace(currentUser.WxHeadImg))
{
Utils.DisplayImage(StartCoroutine, mHeadImage, currentUser.WxHeadImg);
}
if (currentUser.Sex == 1)
{
mSexDropdown.SelectValue("男");
}
else
{
mSexDropdown.SelectValue("女");
}
if (currentUser.Birthday.HasValue)
{
var birthday = currentUser.Birthday.Value;
mYearDropdown.SelectValue(birthday.Year.ToString());
mMonthDropdown.SelectValue(birthday.Month.ToString());
mDayDropdown.SelectValue(birthday.Day.ToString());
}
UIManager.AddEvent(mReturnButton.gameObject, EventTriggerType.PointerClick, Return);
UIManager.AddEvent(mSaveButton.gameObject, EventTriggerType.PointerClick, Save);
}
private void Return(BaseEventData arg0)
{
UIManager.ShowUserInfoPanel();
}
// Start is called before the first frame update
protected override void Start()
{
@@ -59,7 +59,10 @@ public class HomeController : PFUIPanel
{
UIManager.ShowAlert("test");
});
UIManager.AddEvent(transform.Find("MainNav").Find("Setting").gameObject, EventTriggerType.PointerClick, x =>
{
UIManager.ShowSettingModal();
});
GetSummary();
}
@@ -39,7 +39,7 @@ public class MapListController : PFUIPanel
}
}
private bool isEnd = false;
protected override void Start()
protected override void Start()
{
//if (hardSelector != null)
//{