using Assets.Scripts; using Assets.Scripts.Apis.Models; using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.SceneManagement; using UnityEngine.UI; public class RouteItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandler { RouteResult routeResult; // Start is called before the first frame update Transform left,row1,row2,right; Transform btnReRide, btnContinue, btnDelete; void Start() { } // Update is called once per frame void Update() { } string titleColor = "#5c5c6e"; RouteResult data; //滑动索引 0route 1match int index; public void Initial(RouteResult result,int index) { routeResult = result; left = transform.Find("Left"); row1 = left.Find("Main").Find("Row1"); row2 = left.Find("Main").Find("Row2"); Utils.DisplayImage(transform.Find("CoverImage").GetComponent(), result.RouteImage, true); left.Find("Main").Find("Name").GetComponent().text = result.RouteName; left.Find("Main").Find("Time").GetComponent().text = result.CreateTime.ToString("yyyy-MM-dd HH:mm:ss"); row1.Find("Time").GetComponent().text = $"Riding time:{result.TrainingTime}"; row1.Find("Distance").GetComponent().text = $"Mileage:{result.EndDistance.ToString("#0.00")}KM"; row1.Find("Times").GetComponent().text = $"Times:{result.Count}"; if (index == 0) { row1.Find("Rank").GetComponent().text = $"Rank:{result.Ranking}"; } else { row1.Find("Rank").GetComponent().text = $""; } left.Find("Progress").Find("Image").GetComponent().fillAmount = (float)result.Progress; left.Find("Progress").Find("Value").GetComponent().text = (result.Progress * 100).ToString("#0"); row2.Find("Device").GetComponent().text = $"Cycling equipment:{result.ManufacturerName}"; if (index == 0) { right = transform.Find("Right"); btnContinue = right.Find("BtnContinue"); if (btnContinue) { bool enabled = result.ContinueCyclingParam != null; //btnContinue.gameObject.SetActive(false); //btnContinue.GetComponent