Merge remote-tracking branch 'origin/dev_combine' into dev_release
# Conflicts: # Assets/Scripts/App.cs
This commit is contained in:
commit
ae753e51cb
File diff suppressed because one or more lines are too long
@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3c41d883e82941f44a95fbb1bfe8c6b4
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -1,121 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Assets.Scripts.Apis.Models
|
||||
{
|
||||
public class RowerRecordModel
|
||||
{
|
||||
public string Id { get; set; }
|
||||
|
||||
public string ManufacturerName { get; set; }
|
||||
|
||||
public string DeviceNumber { get; set; }
|
||||
public double? Kj { get; set; }
|
||||
public int Ticks { get; set; }
|
||||
public double Weight { get; set; }
|
||||
public DateTime StartTime { get; set; }
|
||||
public DateTime CreateTime { get; set; }
|
||||
public int MaxPower { get; set; }
|
||||
public int MaxPace { get; set; }
|
||||
public uint MaxRate { get; set; }
|
||||
public double AvgPace { get; set; }
|
||||
public double AvgPower { get; set; }
|
||||
public double AvgRate { get; set; }
|
||||
public int MaxHeartRate { get; set; }
|
||||
public int AvgHeartRate { get; set; }
|
||||
public int StrokeCount { get; set; }
|
||||
public int TotalDistance { get; set; }
|
||||
public int TotalTime { get; set; }
|
||||
public double TrainingTime { get; set; }
|
||||
public int? Type { get; set; }
|
||||
public double? TypeValue { get; set; }
|
||||
public string ShadowIds { get; set; }
|
||||
}
|
||||
public class RowerChartModel
|
||||
{
|
||||
public int Power { get; set; }
|
||||
public ushort Pace { get; set; }
|
||||
public uint Rate { get; set; }
|
||||
public int HeartRate { get; set; }
|
||||
public int Distance { get; set; }
|
||||
public int StrokeCount { get; set; }
|
||||
}
|
||||
public class RowerResultModel
|
||||
{
|
||||
public string Id { get; set; }
|
||||
|
||||
public string ManufacturerName { get; set; }
|
||||
|
||||
public string DeviceNumber { get; set; }
|
||||
public double? Kj { get; set; }
|
||||
public DateTime StartTime { get; set; }
|
||||
public DateTime CreateTime { get; set; }
|
||||
public int MaxPower { get; set; }
|
||||
public ushort MaxPace { get; set; }
|
||||
public uint MaxRate { get; set; }
|
||||
public double AvgPace { get; set; }
|
||||
public double AvgPower { get; set; }
|
||||
public double AvgRate { get; set; }
|
||||
public int MaxHeartRate { get; set; }
|
||||
public int AvgHeartRate { get; set; }
|
||||
public ushort StrokeCount { get; set; }
|
||||
public uint TotalDistance { get; set; }
|
||||
public int TotalTime { get; set; }
|
||||
public List<RowerChartModel> ChartList { get; set; }
|
||||
public string Cover { get; set; }
|
||||
public int? Type { get; set; }
|
||||
public double? TypeValue { get; set; }
|
||||
public double Ticks { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class SegmentList
|
||||
{
|
||||
public double Ticks { get; set; }
|
||||
public int Distance { get; set; }
|
||||
public int Speed { get; set; }
|
||||
public int Power { get; set; }
|
||||
public int HeartRate { get; set; }
|
||||
public int StrokeCount { get; set; }
|
||||
public int Energy { get; set; }
|
||||
public int Rate { get; set; }
|
||||
}
|
||||
|
||||
public class RowerRank
|
||||
{
|
||||
public string Id { get; set; }
|
||||
public int UserId { get; set; }
|
||||
public double Time { get; set; }
|
||||
public int TotalDistance { get; set; }
|
||||
public string NickName { get; set; }
|
||||
public string WxHeadImg { get; set; }
|
||||
public DateTime CreateTime { get; set; }
|
||||
public bool isFinished { get; set; }
|
||||
public List<RowerChartModel> list { get; set; }
|
||||
public string Country { get; set; }
|
||||
public int Nid { get; set; }
|
||||
public double Ticks { get; set; }
|
||||
public int rankNum { get; set; }
|
||||
public string GradeStr { get; set; }
|
||||
}
|
||||
|
||||
public class Info
|
||||
{
|
||||
public string CreateTime { get; set; }
|
||||
public string MyRank { get; set; }
|
||||
public int? Type { get; set; }
|
||||
public string TypeStr { get; set; }
|
||||
public string MyRankLeft { get; set; }
|
||||
}
|
||||
|
||||
public class RowerSegmentData
|
||||
{
|
||||
public List<SegmentList> segmentList { get; set; }
|
||||
public List<RowerRank> ranks { get; set; }
|
||||
public Info info { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e4f2fe5f1bd49b143bbbca0b57371de9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -69,8 +69,6 @@ public static class App
|
||||
public static IPEndPoint TcpAddress { get; private set; } = new IPEndPoint(IPAddress.Parse("192.168.0.102"), 21001);
|
||||
public static UpdateModel UpdateObject { get; set; }
|
||||
public static int CompetionId { get; set; }//比赛id
|
||||
//public static string AppDownloadUrl { get; internal set; }
|
||||
//public static string AppVersionCode { get; internal set; }
|
||||
|
||||
public static List<JoinedCompetitionModel> JoinedCompetitionList { get; set; }//我参加的比赛
|
||||
public static List<int> CompetitionIdList = new List<int>();
|
||||
@ -187,9 +185,7 @@ public static class App
|
||||
}
|
||||
|
||||
public static string Model { get; set; }
|
||||
|
||||
public static List<MailModel> CurrentUserMails { get; set; }
|
||||
//public static event hasNotReadEvent;
|
||||
public static event EventHandler HasNotReadChanged;
|
||||
public static bool _hasNotRead;
|
||||
public static bool hasNotRead
|
||||
@ -218,30 +214,23 @@ public static class App
|
||||
static App()
|
||||
{
|
||||
InitLanguage();
|
||||
#if !UNITY_EDITOR
|
||||
//Host = "http://pf.juze.pro/";
|
||||
//UdpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 21000);
|
||||
//TcpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 21001);
|
||||
#if !UNITY_EDITOR
|
||||
//测试服务器 Host = "http://192.168.0.101:5083/";
|
||||
Host = "http://pf.juze.pro/";
|
||||
UdpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 21000);
|
||||
TcpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 21001);
|
||||
//线上
|
||||
//Host = "https://wx.powerfun.com.cn/";
|
||||
//UdpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 11000);
|
||||
//TcpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 11001);
|
||||
//线上
|
||||
Host = "https://wx.powerfun.com.cn/";
|
||||
UdpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 11000);
|
||||
TcpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 11001);
|
||||
//本地
|
||||
//Host = "http://192.168.0.101:5087/";
|
||||
//UdpAddress = new IPEndPoint(IPAddress.Parse("192.168.0.97"), 11000);
|
||||
//TcpAddress = new IPEndPoint(IPAddress.Parse("192.168.0.102"), 21001);
|
||||
//Debug.unityLogger.logEnabled = false;
|
||||
#else
|
||||
//Host = "http://pf.juze.pro/";
|
||||
//Host = "http://192.168.0.101:5087/";
|
||||
UdpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 11000);
|
||||
TcpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 11001);
|
||||
//UdpAddress = new IPEndPoint(IPAddress.Parse("192.168.0.102"), 21001);
|
||||
//TcpAddress = new IPEndPoint(IPAddress.Parse("192.168.0.102"), 21001);
|
||||
Debug.unityLogger.logEnabled = false;
|
||||
#else
|
||||
Host = "http://pf.juze.pro/";
|
||||
UdpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 21000);
|
||||
TcpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 21001);
|
||||
#endif
|
||||
var now = DateTime.Now;
|
||||
if (!FB.IsInitialized)
|
||||
|
||||
@ -38,7 +38,6 @@ namespace Assets.Scripts.Devices.Ant
|
||||
SpeedCadence,
|
||||
Trainer,
|
||||
VirtualPower,
|
||||
Rower,
|
||||
FtmsTrainer
|
||||
}
|
||||
|
||||
|
||||
@ -6,13 +6,6 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace Assets.Scripts.Ble.Commands
|
||||
{
|
||||
public enum RowerCommand
|
||||
{
|
||||
JustRow = 1,
|
||||
FixedDistance=2,
|
||||
FixedTime = 3,
|
||||
}
|
||||
|
||||
public enum CommandResponseCode
|
||||
{
|
||||
// Token: 0x04000FEB RID: 4075
|
||||
|
||||
@ -8,37 +8,6 @@ using UnityEngine;
|
||||
|
||||
public static class PFConstants
|
||||
{
|
||||
/// <summary>
|
||||
/// 划船机训练保存在本地的路径
|
||||
/// </summary>
|
||||
public static string RowerRecordFolder
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!Directory.Exists(Application.persistentDataPath + "/RowerRecords/"))
|
||||
{
|
||||
Directory.CreateDirectory(Application.persistentDataPath + "/RowerRecords/");
|
||||
}
|
||||
|
||||
return Application.persistentDataPath + "/RowerRecords/";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 划船机训练保存在本地的路径
|
||||
/// </summary>
|
||||
public static string RowerRecordCacheFolder
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!Directory.Exists(Application.persistentDataPath + "/RowerRecordCaches/"))
|
||||
{
|
||||
Directory.CreateDirectory(Application.persistentDataPath + "/RowerRecordCaches/");
|
||||
}
|
||||
|
||||
return Application.persistentDataPath + "/RowerRecordCaches/";
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 课程训练保存在本地的路径
|
||||
/// </summary>
|
||||
|
||||
@ -305,29 +305,7 @@ public class MainController : BaseScene
|
||||
await Login();
|
||||
}
|
||||
#endif
|
||||
//MainMenu.transform.Find("Home").GetComponent<Button>().onClick.AddListener(() =>
|
||||
//{
|
||||
// UIManager.ShowHomePanel();
|
||||
//});
|
||||
//#if UNITY_ANDROID || UNITY_IOS
|
||||
|
||||
// #region 划船机功能:隐藏骑行
|
||||
// UIManager.ShowRowerPanel();
|
||||
// return;
|
||||
// #endregion
|
||||
// if (!App.IsRowerMode.HasValue)
|
||||
// {
|
||||
// UIManager.ShowHomePanel();
|
||||
// UIManager.ShowRowerSelector();
|
||||
// return;
|
||||
// }
|
||||
// if (App.IsRowerMode == true)
|
||||
// {
|
||||
// UIManager.ShowHomePanel();
|
||||
// UIManager.ShowRowerPanel();
|
||||
// return;
|
||||
// }
|
||||
//#endif
|
||||
LastRide();//检查本地异常中断的骑行并弹窗提示继续
|
||||
if (App.MainSceneParam.ContainsKey("Name") && !string.IsNullOrEmpty(App.MainSceneParam["Name"]))
|
||||
{
|
||||
|
||||
@ -119,7 +119,6 @@ public class ActivityController : PFUIPanel
|
||||
case "Close": CloseFunc(); break;
|
||||
case "StartRide": StartRide(int.Parse(message.Args["id"]),message.Args.ContainsKey("routeResult")?message.Args["routeResult"]:null); break;
|
||||
case "Share": Share(int.Parse(message.Args["type"]),int.Parse(message.Args["id"])); break;
|
||||
case "ShareRower": ShareRower(int.Parse(message.Args["type"]), message.Args["url"], message.Args["title"]); break;
|
||||
case "OpenUrl": OpenUrl(message.Args["url"]); break;
|
||||
default:break;
|
||||
}
|
||||
@ -155,33 +154,6 @@ public class ActivityController : PFUIPanel
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="sharetype">0 1</param>
|
||||
/// <param name="id">记录id</param>
|
||||
/// <param name="type">rower ride</param>
|
||||
private void ShareRower(int type, string url, string title)
|
||||
{
|
||||
if (type < 2)
|
||||
{
|
||||
if (App.weChatController.IsWeChatAppInstalled())
|
||||
{
|
||||
App.weChatController.ShareWebpageToWX(type, url, title, "By " + App.CurrentUser.Nickname, null);
|
||||
RunJavaScript("window.postMessage(\"webview;Endshare\")");
|
||||
}
|
||||
else
|
||||
{
|
||||
Utils.showToast(null, "未安装微信");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
FB.ShareLink(contentURL: new Uri(url),
|
||||
contentTitle: title,
|
||||
contentDescription: $"By {App.CurrentUser.Nickname}");
|
||||
}
|
||||
}
|
||||
private void StartRide(int id,string routeResult)
|
||||
{
|
||||
App.RouteIdParam = id;
|
||||
|
||||
@ -236,12 +236,6 @@ public class DeviceView : MonoBehaviour
|
||||
sprite1 = Resources.Load<Sprite>("Images/Devices/Trainer_1");
|
||||
sprite3 = Resources.Load<Sprite>("Images/Devices/Trainer_4");
|
||||
}
|
||||
else if (SensorType == SensorType.Rower)
|
||||
{
|
||||
sprite0 = Resources.Load<Sprite>("Images/Rower/设备 - 划船机 - 未连接");
|
||||
sprite1 = Resources.Load<Sprite>("Images/Rower/设备 - 划船机 - 未连接");
|
||||
sprite3 = Resources.Load<Sprite>("Images/Rower/设备 - 划船机");
|
||||
}
|
||||
}
|
||||
|
||||
// Start is called before the first frame update
|
||||
@ -394,8 +388,6 @@ public class DeviceView : MonoBehaviour
|
||||
return App.GetLocalString("Speed Meter");
|
||||
case SensorType.Trainer:
|
||||
return App.GetLocalString("Smart Trainer");
|
||||
case SensorType.Rower:
|
||||
return "Rower Machine";
|
||||
case SensorType.VirtualPower:
|
||||
break;
|
||||
default:
|
||||
@ -469,8 +461,6 @@ public class DeviceView : MonoBehaviour
|
||||
return item;
|
||||
case SensorType.Speed:
|
||||
return devices.FirstOrDefault(d => d is ISpeedDevice);
|
||||
case SensorType.Rower:
|
||||
return devices.FirstOrDefault(d => d.Sensor == SensorType.Rower);
|
||||
case SensorType.Trainer:
|
||||
var item3 = devices.FirstOrDefault(d => d.Sensor == SensorType.Trainer);
|
||||
return item3;
|
||||
|
||||
@ -98,22 +98,6 @@ public class MainNav : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
public void ShowRowerTab()
|
||||
{
|
||||
if (transform.Find("Device"))
|
||||
{
|
||||
transform.Find("Device").gameObject.SetActive(false);
|
||||
}
|
||||
if (transform.Find("Exit"))
|
||||
{
|
||||
transform.Find("Exit").gameObject.SetActive(true);
|
||||
}
|
||||
if (transform.Find("Home"))
|
||||
{
|
||||
transform.Find("Home").gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
using Assets.Scripts;
|
||||
using Assets.Scripts.UI.Control;
|
||||
using DG.Tweening;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
@ -261,23 +259,7 @@ public class NewMainNav : MonoBehaviour
|
||||
transform.Find("Mail/Dot").gameObject.SetActive((bool)sender);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void ShowRowerTab()
|
||||
{
|
||||
if (transform.Find("Device"))
|
||||
{
|
||||
transform.Find("Device").gameObject.SetActive(false);
|
||||
}
|
||||
if (transform.Find("Exit"))
|
||||
{
|
||||
transform.Find("Exit").gameObject.SetActive(true);
|
||||
}
|
||||
if (transform.Find("Home"))
|
||||
{
|
||||
transform.Find("Home").gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
private bool isShrinkIndex(int ind)
|
||||
{
|
||||
return ind == 0 || ind == 2;
|
||||
|
||||
@ -42,11 +42,8 @@ public class HomeController : PFUIPanel
|
||||
|
||||
#if UNITY_ANDROID || UNITY_IOS
|
||||
var nav = transform.Find("MainNav-mobile").GetComponent<NewMainNav>();
|
||||
nav.SetButtonActive(new List<int> { 1, 3, 4, 6 },null,new NewMainNav.CustomButton(Resources.Load<Sprite>("Images/RowerNew/ICON_mode_44"), () =>
|
||||
{
|
||||
UIManager.ShowRowerSelector();
|
||||
},false));
|
||||
nav.HideButton("Custom");
|
||||
nav.SetButtonActive(new List<int> { 2, 3, 6, 7 });
|
||||
newNav = nav;
|
||||
UIManager.AddEvent(transform.Find("TodayData/Datas/Distance").gameObject, EventTriggerType.PointerClick, b =>
|
||||
{
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -164,7 +164,6 @@ namespace Assets.Scripts
|
||||
{"HeartRate","Heart Rate Monitor|Images/Devices/Heart Rate_3" },
|
||||
{"SpeedCadence","Cadence Sensor|Images/Devices/Cadence_3" },
|
||||
{"Speed","Speed Meter|Images/Devices/Speed_3" },
|
||||
{"Rower","Rowing Machine|Images/Rower/设备 - 划船机" }
|
||||
};
|
||||
}
|
||||
return _deviceDict;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user