移动端划船机移除

This commit is contained in:
lishuo committed 2022-07-15 14:28:37 +08:00
1 parent 4d0a383a88
commit 46b4c01730
17 files changed
+17 -398

No files matched your search

@@ -16,8 +16,8 @@ public class ResultListController : PFUIPanel
[SerializeField]Transform routeResult;
Transform localRouteItem;
Transform scrollContent;
Transform routeScroll, matchScroll, rowerScroll;
Transform routeContent, matchContent, rowerContent;
Transform routeScroll, matchScroll;
Transform routeContent, matchContent;
Transform btnRoute, btnMatch , searchInput;
Color c1, c2;
// Start is called before the first frame update
@@ -52,12 +52,7 @@ public class ResultListController : PFUIPanel
routeContent = routeScroll.Find("Viewport").Find("Content");
matchScroll = scrollContent.Find("MatchList");
matchContent = matchScroll.Find("Viewport").Find("Content");
rowerScroll = scrollContent.Find("RowerList");
if (rowerScroll)
{
rowerContent = rowerScroll.Find("Viewport").Find("Content");
}
contents = new Transform[] { routeContent, matchContent, rowerContent};
contents = new Transform[] { routeContent, matchContent};
if (btnRoute != null)
{
@@ -100,12 +95,7 @@ public class ResultListController : PFUIPanel
{
UIManager.AddEvent(matchScroll.gameObject, UnityEngine.EventSystems.EventTriggerType.EndDrag, OnEndDrag);
}
if (rowerScroll != null)
{
UIManager.AddEvent(rowerScroll.gameObject, UnityEngine.EventSystems.EventTriggerType.EndDrag, OnEndDrag);
}
scrolls = new Transform[] { routeScroll, matchScroll, rowerScroll };
scrolls = new Transform[] { routeScroll, matchScroll};
//GetList(0);
GetList(1);
#if UNITY_ANDROID || UNITY_IOS
@@ -235,11 +225,6 @@ public class ResultListController : PFUIPanel
{
obj.GetComponent<RouteItem>().Initial(item.ToObject<RouteResult>(), index, transform, true);
}
else
{
obj.GetComponent<RouteItem>().Initial(item.ToObject<RowerResultModel>(), index, transform,true);
}
//obj.SendMessage("Initial", );
obj.transform.SetParent(content);
obj.transform.localScale = new Vector3(1, 1, 1);
}
@@ -15,7 +15,6 @@ public class RouteItem : MonoBehaviour
#endif
{
RouteResult routeResult;
RowerResultModel rowerResult;
// Start is called before the first frame update
Transform left,row1,row2,right,rightDot;
Transform btnReRide, btnContinue, btnDelete;
@@ -66,81 +65,6 @@ public class RouteItem : MonoBehaviour
{
Initial((RouteResult)result, index, parent);
}
else
{
Initial((RowerResultModel)result, index, parent);
}
}
/// <summary>
/// 划船机初始化
/// </summary>
/// <param name="result"></param>
/// <param name="index"></param>
/// <param name="parent"></param>
public void Initial(RowerResultModel result, int index, Transform parent = null)
{
rowerResult = result;
row1.Find("Rank").gameObject.SetActive(false);
row1.Find("Times").gameObject.SetActive(false);
var raw = transform.Find("BigLeft/CoverImage").GetComponent<RawImage>();
if (string.IsNullOrEmpty(result.Cover))
{
raw.texture = Resources.Load<Texture>("Images/Rower/地图1");
}
else
{
Utils.DisplayImage(raw, result.Cover, true);
}
row1.Find("Time").GetComponent<Text>().text = $"<color=#5c5c6e>{App.GetLocalString("Rowing time")}:</color>{TimeSpan.FromSeconds(result.Ticks).ToString()}";
row1.Find("Distance").GetComponent<Text>().text = $"<color=#5c5c6e>{App.GetLocalString("row distance")}:</color>{result.TotalDistance}M";
row2.Find("Device").GetComponent<Text>().text = $"<color=#5c5c6e>{App.GetLocalString("Rowing equipment")}:</color>{result.ManufacturerName}";
left.Find("Progress").gameObject.SetActive(false);
string typeStr = "Free";
if (result.Type == 1)
{
typeStr = $"{result.TypeValue}M";
}
else if (result.Type == 2 && result.TypeValue.HasValue)
{
var ts = TimeSpan.FromSeconds(result.TypeValue.Value);
if (ts.TotalHours >= 1)
{
typeStr = ts.TotalHours.ToString("#0.0") + "h";
}
else if (ts.TotalMinutes >= 1)
{
typeStr = ts.TotalMinutes.ToString("#0.0") + "min";
}
else
{
typeStr = result.TypeValue.Value + "s";
}
}
left.Find("Main/Name").GetComponent<Text>().text = $"{result.CreateTime.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss")} {typeStr} Rowing";
left.Find("Main/Time").GetComponent<Text>().text = $"{result.StartTime.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss")} ~ {result.CreateTime.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss")}";
var rect = left.Find("Main").GetComponent<RectTransform>();
rect.sizeDelta = new Vector2(399,rect.sizeDelta.y);
SetButtonColor(false);
right = transform.Find("RightRower");
if (right != null)
{
btnDetail = right.Find("BtnDetail");
if (btnDetail)
{
UIManager.AddEvent(btnDetail.gameObject, EventTriggerType.PointerClick, b =>
{
//UIManager.ShowActivityPanel("http://192.168.0.101:3081/rower/record/27C0BE5C-3818-45D0-A2FD-681AC2ACFB64?UserId=16650");
#if UNITY_ANDROID || UNITY_IOS
UIManager.ShowActivityPanel($"{App.websiteDict[App.Host]}rower/record/{result.Id}?UserId={App.CurrentUser.Id}");
#else
Application.OpenURL($"{App.websiteDict[App.Host]}rower/record/{result.Id}?Token={App.CurrentUser.cookie}");
#endif
//Application.OpenURL($"{App.websiteDict[App.Host]}rower/record/{result.Id}?Token={App.CurrentUser.cookie}");
//UIManager.ShowRowerResult(result.Id);
});
}
}
//UIManager.AddEvent(transform.gameObject, EventTriggerType.PointerClick, b => UIManager.ShowRowerResult(result.Id));
}
public void Initial(RouteResult result,int index,Transform parent = null)
@@ -361,7 +285,6 @@ public class RouteItem : MonoBehaviour
{
if (!f)
{
transform.Find("RightRower").gameObject.SetActive(false);
transform.Find("Right").gameObject.SetActive(false);
transform.Find("RightMatch").gameObject.SetActive(false);
transform.Find("RightDot").gameObject.SetActive(true);
@@ -379,7 +302,6 @@ public class RouteItem : MonoBehaviour
}
transform.Find("RightMatch").gameObject.SetActive(index == 1);
transform.Find("RightRower").gameObject.SetActive(index == 2);
transform.Find("RightDot").gameObject.SetActive(false);
}
}