设置页面,调些细节
This commit is contained in:
1 parent
4896fab824
commit
bb4fabc833
23 files changed
+5528
-1756
No files matched your search
@@ -200,21 +200,20 @@ public class EditUserController : PFUIPanel
|
||||
mPhone.Text = currentUser.ContactPhone;
|
||||
mAddr.Text = currentUser.ContactAddress;
|
||||
}
|
||||
|
||||
// Start is called before the first frame update
|
||||
protected override void Start()
|
||||
{
|
||||
base.Start();
|
||||
mConutryDropdown.ClearOptions();
|
||||
mConutryDropdown.AddOptions(UIManager.Instance.loginRegOptions.countrys);
|
||||
mConutryDropdown.SelectIndex(UIManager.Instance.loginRegOptions.countryDefaultValue);
|
||||
mConutryDropdown.transform.Find("RawImage").GetComponent<RawImage>().texture =
|
||||
UIManager.Instance.loginRegOptions.GetCountryImage(UIManager.Instance.loginRegOptions.countryDefaultValue);
|
||||
mConutryDropdown.OnValueChange = (int index) =>
|
||||
{
|
||||
mConutryDropdown.transform.Find("RawImage").GetComponent<RawImage>().texture =
|
||||
UIManager.Instance.loginRegOptions.GetCountryImage(index);
|
||||
};
|
||||
mConutryDropdown.SelectValue(App.CurrentUser.Country);
|
||||
//mConutryDropdown.transform.Find("RawImage").GetComponent<RawImage>().texture =
|
||||
// UIManager.Instance.loginRegOptions.GetCountryImage(UIManager.Instance.loginRegOptions.countryDefaultValue);
|
||||
var rect = ((RectTransform)mHeadImage.transform).rect;
|
||||
SetRounded(mHeadImage.transform, rect.height);
|
||||
UIManager.AddEvent(mSaveButton.gameObject, EventTriggerType.PointerClick, Save);
|
||||
|
||||
@@ -9,6 +9,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
@@ -46,7 +47,7 @@ public class MapListController : PFUIPanel
|
||||
//{
|
||||
// hardSelector.onValueChanged.AddListener(ChangeHard);
|
||||
//}
|
||||
ApiBase.SetCookie("15A37DF28842CBA8E4E550BFA24186C8222D392F3EE18D9E95A49CC32796D2E3F6E40385C6A114942546EE1DD793DF34880DE48090B91AD2460EB887B59664BB3965F3371DDA1F1401EC7F27C5A1084566E47069F12CB6BBC0BC7A84ADC5582B");
|
||||
//ApiBase.SetCookie("15A37DF28842CBA8E4E550BFA24186C8222D392F3EE18D9E95A49CC32796D2E3F6E40385C6A114942546EE1DD793DF34880DE48090B91AD2460EB887B59664BB3965F3371DDA1F1401EC7F27C5A1084566E47069F12CB6BBC0BC7A84ADC5582B");
|
||||
btnMapMode = this.transform.Find("SwitchMode").gameObject;
|
||||
SetRounded(btnMapMode.transform, 64);
|
||||
UIManager.AddEvent(btnMapMode, EventTriggerType.PointerClick, (e) =>
|
||||
@@ -104,6 +105,10 @@ public class MapListController : PFUIPanel
|
||||
GetList();
|
||||
if (scroll != null)
|
||||
{
|
||||
//scroll.GetComponent<ScrollRect>().onValueChanged.AddListener((v) =>
|
||||
//{
|
||||
// OnEndDrag(null);
|
||||
//});
|
||||
UIManager.AddEvent(scroll, UnityEngine.EventSystems.EventTriggerType.EndDrag, OnEndDrag);
|
||||
}
|
||||
//UIManager.AddEvent(transform.Find("Panel").Find("Panel"))
|
||||
@@ -146,10 +151,14 @@ public class MapListController : PFUIPanel
|
||||
searchInput = transform.Find("Panel").Find("Panel").Find("SearchInput");
|
||||
if (searchInput != null)
|
||||
{
|
||||
searchInput.GetComponent<InputField>().onEndEdit.AddListener((s) =>
|
||||
{
|
||||
Debug.Log(Input.GetKeyUp(KeyCode.A));
|
||||
//onEndEdit(s);
|
||||
});
|
||||
searchInput.Find("Button").GetComponent<Button>().onClick.AddListener(() =>
|
||||
{
|
||||
ftname = searchInput.GetComponent<InputField>().text;
|
||||
Refresh();
|
||||
onEndEdit();
|
||||
});
|
||||
}
|
||||
sorts = transform.Find("Panel").Find("Panel").Find("FilterOptions");
|
||||
@@ -187,7 +196,15 @@ public class MapListController : PFUIPanel
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void onEndEdit()
|
||||
{
|
||||
var t = searchInput.GetComponent<InputField>().text;
|
||||
if (!string.IsNullOrEmpty(t))
|
||||
{
|
||||
ftname = t;
|
||||
Refresh();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 绑定头像
|
||||
/// </summary>
|
||||
@@ -213,13 +230,13 @@ public class MapListController : PFUIPanel
|
||||
private void OnEndDrag(BaseEventData arg0)
|
||||
{
|
||||
var scrollrect = scroll.GetComponent<ScrollRect>();
|
||||
Debug.Log(scrollrect.verticalNormalizedPosition);
|
||||
if (scrollrect.verticalNormalizedPosition <= 0)
|
||||
{
|
||||
Debug.Log(scrollrect.verticalNormalizedPosition);
|
||||
pageIndex++;
|
||||
GetList();
|
||||
}
|
||||
if (scrollrect.verticalNormalizedPosition >= 1)
|
||||
if (scrollrect.verticalNormalizedPosition >= (pageIndex == 0 ? 1.2:1))
|
||||
{
|
||||
Refresh();
|
||||
}
|
||||
@@ -281,6 +298,7 @@ public class MapListController : PFUIPanel
|
||||
{
|
||||
content.transform.DestroyChildren();
|
||||
pageIndex = 0;
|
||||
isEnd = false;
|
||||
GetList();
|
||||
}
|
||||
void ResetList()
|
||||
@@ -291,9 +309,29 @@ public class MapListController : PFUIPanel
|
||||
Refresh();
|
||||
}
|
||||
// Update is called once per frame
|
||||
bool startMouse = false;
|
||||
void Update()
|
||||
{
|
||||
|
||||
if (Input.GetAxis("Mouse ScrollWheel") != 0)
|
||||
{
|
||||
if (scroll.GetComponent<ScrollRect>().verticalNormalizedPosition <= 0 ||
|
||||
scroll.GetComponent<ScrollRect>().verticalNormalizedPosition >= (pageIndex == 0 ? 1.2 : 1))
|
||||
{
|
||||
startMouse = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (startMouse)
|
||||
{
|
||||
startMouse = false;
|
||||
OnEndDrag(null);
|
||||
}
|
||||
}
|
||||
if (Input.GetKey(KeyCode.KeypadEnter) || Input.GetKey(KeyCode.Return))
|
||||
{
|
||||
onEndEdit();
|
||||
}
|
||||
}
|
||||
|
||||
public override void Show()
|
||||
|
||||
@@ -11,9 +11,8 @@ public class UserInfoController : PFUIPanel
|
||||
// Start is called before the first frame update
|
||||
UserApi userApi;
|
||||
Transform infoPanel,summaryPanel;
|
||||
protected override void Start()
|
||||
protected override void Awake()
|
||||
{
|
||||
userApi = ConfigHelper.userApi;
|
||||
this.transform.localPosition = new Vector3(0, 0, 0);
|
||||
|
||||
Button exitBtn = this.transform.Find("InfoPanel").Find("Button").GetComponent<Button>();
|
||||
@@ -42,16 +41,20 @@ public class UserInfoController : PFUIPanel
|
||||
// UIManager.ShowEditUserPanel();
|
||||
//});
|
||||
summaryPanel = transform.Find("SummaryPanel");
|
||||
}
|
||||
public override void Show()
|
||||
{
|
||||
base.Show();
|
||||
Load();
|
||||
}
|
||||
async void Load()
|
||||
void Load()
|
||||
{
|
||||
//if (!App.FromLogin)
|
||||
//{
|
||||
// var result = await userApi.Login("15651831367", "123456", "");
|
||||
// App.CurrentUser = result.data;
|
||||
//}
|
||||
var r = userApi.GetSummary();
|
||||
var r = ConfigHelper.userApi.GetSummary();
|
||||
if (r.result)
|
||||
{
|
||||
var summary = r.data;
|
||||
|
||||
Reference in new issue
Block a user