赛事首页和列表
This commit is contained in:
1 parent
eed2d13624
commit
d9d66ab96c
51 files changed
+14690
-229
No files matched your search
@@ -60,6 +60,16 @@ namespace Assets.Scripts.Apis
|
||||
data = Newtonsoft.Json.JsonConvert.DeserializeObject<List<MapCompetitionModel>>(JsonConvert.SerializeObject(list.data))
|
||||
};
|
||||
}
|
||||
public async Task<JsonResult<List<MapCompetition>>> GetCompetitionListV2(string name, int pageIndex, int pageSize, string status = "", int order = 1, bool self = false)
|
||||
{
|
||||
var list = await GetAsync<JsonResult<dynamic>>($"/MapCompetition/v2/GetList?pageIndex={ pageIndex }&pageSize={ pageSize }&name={ name }&status={ status }&order={order}&self={self}");
|
||||
return new JsonResult<List<MapCompetition>>
|
||||
{
|
||||
result = list.result,
|
||||
errMsg = list.errMsg,
|
||||
data = Newtonsoft.Json.JsonConvert.DeserializeObject<List<MapCompetition>>(JsonConvert.SerializeObject(list.data))
|
||||
};
|
||||
}
|
||||
//查询比赛详情
|
||||
public JsonResult<MapCompetitionDetailModel> GetCompetitionDetail(int id)
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace Assets.Scripts.Apis.Models
|
||||
//public string EndTimeVlaue { get; set; }
|
||||
|
||||
public int Status { get; set; }
|
||||
public object StatusVlaue { get; set; }
|
||||
public string StatusVlaue { get; set; }
|
||||
public string Title { get; set; }
|
||||
public double TotalDistance { get; set; }
|
||||
public bool applyed { get; set; }
|
||||
@@ -56,7 +56,13 @@ namespace Assets.Scripts.Apis.Models
|
||||
public int MaxMembers { get; set; }
|
||||
//报名参赛的选手
|
||||
public List<CompetitionPlayer> UserList {get;set; }
|
||||
|
||||
public double Distance { get; set; }
|
||||
public double AverageGrade { get; set; }
|
||||
public double EleDifference { get; set; }
|
||||
public double? TotalClimb { get; set; }
|
||||
public double MaxElevation { get; set; }
|
||||
public string AltitudeGraph { get; set; }
|
||||
public string RouteCover { get; set; }
|
||||
}
|
||||
public class CompetitionPlayer
|
||||
{
|
||||
|
||||
@@ -11,7 +11,7 @@ using Assets.Scripts.Devices;
|
||||
|
||||
public static class App
|
||||
{
|
||||
public static string Host = "http://192.168.0.102:5082/";
|
||||
public static string Host = "http://192.168.0.101:5085/";
|
||||
|
||||
public static string AppVersion = Application.version;
|
||||
|
||||
|
||||
@@ -51,6 +51,15 @@ namespace Assets.Scripts
|
||||
return _thirdPartApi;
|
||||
}
|
||||
}
|
||||
private static MapCompetitionApi _mapCompetitionApi;
|
||||
internal static MapCompetitionApi mapCompetitionApi
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_mapCompetitionApi == null) _mapCompetitionApi = new MapCompetitionApi();
|
||||
return _mapCompetitionApi;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -103,7 +103,8 @@ public class HomeController : PFUIPanel
|
||||
private void GoMatch(BaseEventData e)
|
||||
{
|
||||
//TODO:进入比赛列表
|
||||
|
||||
UIManager.ShowRaceHomePanel();
|
||||
return;
|
||||
#region 测试比赛
|
||||
App.CompetionId = 1048;
|
||||
App.RouteIdParam = 1215;
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 557d024aa8d5ac647af08073ea3b1c42
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Assets.Scripts.UI.Prefab.Race
|
||||
{
|
||||
public class RaceFilterOptions
|
||||
{
|
||||
public static Dictionary<string, string> statusDict = new Dictionary<string, string>()
|
||||
{
|
||||
{"1","1" },
|
||||
{"2","2" },
|
||||
{"3","3" },
|
||||
{"4","4" },
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e4a09269b9088854c9c4323d9902216c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -127,7 +127,38 @@ public class UIManager : MonoBehaviour
|
||||
return this.GetPanelInstance("EditUserPanel", ref this.mEditUserController);
|
||||
}
|
||||
}
|
||||
|
||||
/*比赛首页*/
|
||||
private RaceHomeScript mRaceHomeScript;
|
||||
public RaceHomeScript RaceHomePanel
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.GetPanelInstance("RaceHomePanel", ref this.mRaceHomeScript);
|
||||
}
|
||||
}
|
||||
public static void ShowRaceHomePanel(bool fromRaceList = false)
|
||||
{
|
||||
if (fromRaceList)
|
||||
{
|
||||
UIManager.PopStack();
|
||||
}
|
||||
UIManager.Show(UIManager.Instance.RaceHomePanel, UIManager.Instance.MainPanel);
|
||||
}
|
||||
/*比赛首页*/
|
||||
/*比赛列表*/
|
||||
private RaceListScript mRaceListScript;
|
||||
public RaceListScript RaceListPanel
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.GetPanelInstance("RaceListPanel", ref this.mRaceListScript);
|
||||
}
|
||||
}
|
||||
public static void ShowRaceListPanel()
|
||||
{
|
||||
UIManager.Show(UIManager.Instance.RaceListPanel, UIManager.Instance.MainPanel);
|
||||
}
|
||||
/*比赛列表*/
|
||||
private PFUIPanel mModalsPanel;
|
||||
public PFUIPanel ModalsPanel
|
||||
{
|
||||
@@ -173,6 +204,7 @@ public class UIManager : MonoBehaviour
|
||||
|
||||
if(_now == null)
|
||||
{
|
||||
Debug.Log(123);
|
||||
InitNow();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -450,5 +450,26 @@ namespace Assets.Scripts
|
||||
DisplayImage(raw, s);
|
||||
}
|
||||
}
|
||||
public static void SetTextWithEllipsis(this Text textComponent, string value)
|
||||
{
|
||||
var generator = new TextGenerator();
|
||||
var rectTransform = textComponent.GetComponent<RectTransform>();
|
||||
var settings = textComponent.GetGenerationSettings(rectTransform.rect.size);
|
||||
generator.Populate(value, settings);
|
||||
var characterCountVisible = generator.characterCountVisible;
|
||||
var updatedText = value;
|
||||
if (value.Length > characterCountVisible && characterCountVisible != -1)
|
||||
{
|
||||
updatedText = value.Substring(0, characterCountVisible - 3);
|
||||
updatedText += "…";
|
||||
}
|
||||
textComponent.text = updatedText;
|
||||
}
|
||||
public static string GetCountDown(TimeSpan time)
|
||||
{
|
||||
var second = Math.Ceiling(time.TotalSeconds);
|
||||
var ts = TimeSpan.FromSeconds(second);
|
||||
return $"{ (int)ts.TotalHours }:{ts:mm}:{ts:ss}";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user