登录页调整 增加半圆角组件 基本完成路线列表功能 基本完成骑行列表 开始做编辑页

This commit is contained in:
Caiyanpeng committed 2021-04-14 17:57:52 +08:00
1 parent 5156473bb2
commit 10e738f958
100 files changed
+20085 -11852

No files matched your search

@@ -95,29 +95,29 @@ 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;
//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());
}
//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(mSaveButton.gameObject, EventTriggerType.PointerClick, Save);
}
@@ -115,7 +115,7 @@ public class HomeController : PFUIPanel
//App.CurrentUser.Distance = res.data.TotalDistance;
//App.CurrentUser.Climb = res.data.TotalClimb;
//App.CurrentUser.Carlories = res.data.Kcal;
SetCurrentUser();
//SetCurrentUser();
//Climb.text = $"{res.data.TotalClimb.ToString()}M";
//Calories.text = $"{res.data.Kcal.ToString()}KCAL";
//Calories.text = res.data.
@@ -1,6 +1,7 @@
using Assets.Cyp.Common;
using Assets.Scripts;
using Assets.Scripts;
using Assets.Scripts.Apis;
using Assets.Scripts.Apis.Models;
using Assets.Scripts.UI.Prefab.MapList;
using System;
using System.Collections;
using System.Collections.Generic;
@@ -20,7 +21,15 @@ public class MapListController : PFUIPanel
[HideInInspector] public int pageIndex = 0;
[HideInInspector] public int pageSize = 20;
[HideInInspector] public string hard = "全部";
private Transform distanceOptions;
private Transform diffOptions;
private Transform tdContainer;
private Transform favContainer;
private Transform sorts;
private Transform sortDir;
private Transform searchInput;
//private Transform distanceOption;
//private Transform distanceOption;
private Button returnBtn;
public GameObject Content {
get
@@ -31,6 +40,7 @@ public class MapListController : PFUIPanel
private bool isEnd = false;
protected override void Start()
{
ApiBase.SetCookie("73385F5F719B610D132C1ECF3E9143272BF15214D57ED91CD7A9DFD832407471535112AAEB8E9271F75D54FBBF2D99F18FA313C1EEA5676F5D722D7FBB07C926BEC5905591BF9AFDDC6336552DF273112C2DA1794E6FA2F465B11FECD2E82E52");
//if (hardSelector != null)
//{
// hardSelector.onValueChanged.AddListener(ChangeHard);
@@ -45,6 +55,44 @@ public class MapListController : PFUIPanel
// layout.cellSize = new Vector2((width - 120) / 5, (width - 120) / 5);
//}
}
distanceOptions = transform.Find("Panel").Find("Panel").Find("distanceOptions");
if (distanceOptions != null)
{
var dDropdown = distanceOptions.GetComponent<Dropdown>();
dDropdown.options = MapFilterOptions.distances;
dDropdown.onValueChanged.AddListener(ChangeDistance);
}
diffOptions = transform.Find("Panel").Find("Panel").Find("DifficultyContainer");
if (diffOptions != null)
{
foreach (Transform t in diffOptions)
{
var button = t.GetComponent<Button>();
var image = t.GetComponent<Image>();
var text = t.Find("Text").GetComponent<Text>();
button.onClick.AddListener(() =>
{
ColorUtility.TryParseHtmlString("#23232D", out Color c1);
if (image.color.r == c1.r && image.color.g == c1.g && image.color.b == c1.b)
{
ColorUtility.TryParseHtmlString("#F93086", out Color c);
image.color = c;
text.color = new Color(1, 1, 1,1);
hands.Add(MapFilterOptions.diffDict[text.text]);
}
else
{
ColorUtility.TryParseHtmlString("#6E6E7D", out Color c);
image.color = c1;
text.color = c;
hands.Remove(MapFilterOptions.diffDict[text.text]);
}
scroll.GetComponent<ScrollRect>().verticalNormalizedPosition = 1;
Refresh();
});
}
}
GetList();
if (scroll != null)
{
@@ -63,6 +111,73 @@ public class MapListController : PFUIPanel
UIManager.ShowHomePanel();
});
}
tdContainer = transform.Find("Panel").Find("Panel").Find("3dContainer");
favContainer = transform.Find("Panel").Find("Panel").Find("FavContainer");
if (tdContainer != null)
{
tdContainer.GetComponent<Button>().onClick.AddListener(() =>
{
var gou = tdContainer.Find("Gou").gameObject;
bool v = !gou.activeSelf;
gou.SetActive(v);
is3d = v;
Refresh();
});
}
if (favContainer != null)
{
favContainer.GetComponent<Button>().onClick.AddListener(() =>
{
var gou = favContainer.Find("Gou").gameObject;
bool v = !gou.activeSelf;
gou.SetActive(v);
isFav = v;
Refresh();
});
}
searchInput = transform.Find("Panel").Find("Panel").Find("SearchInput");
if (searchInput != null)
{
searchInput.Find("Button").GetComponent<Button>().onClick.AddListener(() =>
{
ftname = searchInput.GetComponent<InputField>().text;
Refresh();
});
}
sorts = transform.Find("Panel").Find("Panel").Find("FilterOptions");
if (sorts != null)
{
var drop = sorts.GetComponent<Dropdown>();
drop.options = MapFilterOptions.sorts;
drop.value = 3;
drop.onValueChanged.AddListener((int index)=>
{
sort = drop.options[index].text;
var image = sortDir.Find("Image").GetComponent<Image>();
image.sprite = Resources.Load<Sprite>("Images/DOWN");
sortDire = "desc";
Refresh();
});
}
sortDir = transform.Find("Panel").Find("Panel").Find("Dir");
if (sortDir)
{
var image = sortDir.Find("Image").GetComponent<Image>();
sortDir.GetComponent<Button>().onClick.AddListener(() =>
{
if (image.sprite.name == "DOWN")
{
image.sprite = Resources.Load<Sprite>("Images/UP");
sortDire = "asc";
}
else
{
image.sprite = Resources.Load<Sprite>("Images/DOWN");
sortDire = "desc";
}
Refresh();
});
}
}
private void OnEndDrag(BaseEventData arg0)
@@ -73,7 +188,6 @@ public class MapListController : PFUIPanel
Debug.Log(scrollrect.verticalNormalizedPosition);
pageIndex++;
GetList();
}
if (scrollrect.verticalNormalizedPosition >= 1)
{
@@ -81,28 +195,39 @@ public class MapListController : PFUIPanel
}
}
private void ChangeHard(int index)
private void ChangeDistance(int index)
{
var text = distanceOptions.GetComponent<Dropdown>().options[index].text;
distance = MapFilterOptions.distanceDict[text];
scroll.GetComponent<ScrollRect>().verticalNormalizedPosition = 1;
Refresh();
//var text = hardSelector.options[index].text;
//if (text == "全部难度")
//{
//}
}
//查询条件
string ftname = "";
string distance = "";
List<string> hands = new List<string>();
bool is3d = false,isFav = false;
string sort = "Hot",sortDire = "desc";
//string name = "";
//string name = "";
public void GetList()
{
if (isEnd) return;
var res = Global.mapApi.GetList(pageIndex, pageSize, "");
var res = ConfigHelper.mapApi.GetList(pageIndex, pageSize, ftname,distance,string.Join(",",hands),is3d,sort,sortDire,isFav);
if (res.result)
{
if (res.data.Count == 0)
if (res.data.Count == 0 && pageIndex != 0)
{
isEnd = true;
}
else
{
isEnd = false;
DisplayMaps(res.data);
}
}
@@ -128,6 +253,13 @@ public class MapListController : PFUIPanel
pageIndex = 0;
GetList();
}
void ResetList()
{
distance = "";
hands = new List<string>();
name = "";
Refresh();
}
// Update is called once per frame
void Update()
{