骑行页面消息通知

在线用户和影子选手用图片显示,缩放等功能按钮微调
This commit is contained in:
lishuo committed 2021-05-11 18:21:32 +08:00
1 parent 2b4b2c4f70
commit 8f0598580d
37 files changed
+5951 -3153

No files matched your search

@@ -30,7 +30,7 @@ namespace Assets.Scenes.Ride.Scripts
InputField startValue;
InputField endValue;
private int pageIndex = 0;
private int pageSize = 25;
private int pageSize = 8;
private int totalPages = 0;
private string seachName = string.Empty;
@@ -90,6 +90,26 @@ namespace Assets.Scenes.Ride.Scripts
//startValue.text = _startValue.ToString();
//endValue.text = _endValue.ToString();
}
bool startMouse = false;
private 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);
}
}
}
private void StartvalueChanged(string input)
{
if (!string.IsNullOrWhiteSpace(input))
@@ -176,7 +196,7 @@ namespace Assets.Scenes.Ride.Scripts
private void Refresh()
{
var list = mapApi.GetRouteRanking(App.RouteIdParam, "1", pageIndex, pageSize, seachName);
var list = mapApi.GetShadowList(App.RouteIdParam, seachName, pageIndex, pageSize);
totalPages = list.data.TotalPages;
var data = list.data.list;//.Where(c => c.WeightKg >= _startValue && c.WeightKg <= _endValue).ToList();
if (_startValue > 0)
@@ -199,14 +219,14 @@ namespace Assets.Scenes.Ride.Scripts
}
private void CreateGameObject(List<MapRouteRanking> list)
{
if (list.Count == 0)
{
noRecord.SetActive(true);
}
else
{
noRecord.SetActive(false);
}
//if (list.Count == 0)
//{
// noRecord.SetActive(true);
//}
//else
//{
// noRecord.SetActive(false);
//}
var parent = transform.Find("Panel/PlayerList/Scroll View/Viewport/Content");
int index = 0;
foreach (var item in list)
@@ -251,12 +271,13 @@ namespace Assets.Scenes.Ride.Scripts
}
seletedPlayerScript.Reset();
}
//TODO BUG
private void OnEndDrag(BaseEventData arg0)
{
var scrollrect = scroll.GetComponent<ScrollRect>();
if (scrollrect.verticalNormalizedPosition <= 0)
{
if (pageIndex < totalPages )
if (pageIndex < totalPages-1 )
{
pageIndex++;
Refresh();