c2同步课程命令

This commit is contained in:
lishuo committed 2022-06-24 18:03:36 +08:00
1 parent 701ec3069b
commit 06b9051b3c
6 files changed
+44 -21

No files matched your search

@@ -98,14 +98,15 @@ public class ActivityController : PFUIPanel
webView.SetUserAgent($"UniWebView {Application.platform} {Application.version}");
webView.BackgroundColor = Utils.HexToColorHtml("#23232d");
//webView.CleanCache();
if (action == null)
{
webView.Load(url);
}
else
{
action.Invoke();
}
webView.Load(url);
//if (action == null)
//{
// webView.Load(url);
//}
//else
//{
// action.Invoke();
//}
// Show it.
webView.Show();
webView.OnMessageReceived -= FromJs;
@@ -508,7 +508,7 @@ public class RowerHomeScript : PFUIPanel
if (rowdata != RowerData)
return;
Debug.Log($"开始了:{openTimer}");
Debug.Log($"开始了:{openTimer}-{DateTime.Now}");
if (UIManager.Instance.confirm != null && UIManager.Instance.confirm.IsActive())
{
print("当前有弹窗");
@@ -561,9 +561,19 @@ public class RowerHomeScript : PFUIPanel
var power = RowerData.InstantaneousPower;
var rate = RowerData.StrokeRate;
KMText.text = "0";
records.Add($"{strokeCount},{RowerData.ElapsedTime},{rowerType.value},{RowerData.InstantaneousPower},{RowerData.InstantaneousPace},{RowerData.StrokeRate},{RowerData.ResistanceLevel},{heartRate},{energy},{RowerData.AveragePower},{RowerData.ElapsedTime}");
var tmpdata = new TempRowerCalc() { strokeCount = strokeCount, pace = RowerData.InstantaneousPace, power = power, rate = rate, heartRate = heartRate, distance = (int)rowerType.value, energy = energy };
if (rowerType.type == 1)
{
TimeText.text = $"{RowerData.ElapsedTime}";
KMText.text = "0";
}
else
{
TimeText.text = TimeSpan.FromSeconds(0).ToPFString();
KMText.text = $"{RowerData.TotalDistance}";
}
records.Add($"{strokeCount},{RowerData.ElapsedTime},{RowerData.TotalDistance},{RowerData.InstantaneousPower},{RowerData.InstantaneousPace},{RowerData.StrokeRate},{RowerData.ResistanceLevel},{heartRate},{energy},{RowerData.AveragePower},{RowerData.ElapsedTime}");
var tmpdata = new TempRowerCalc() { strokeCount = strokeCount, pace = RowerData.InstantaneousPace, power = power, rate = rate, heartRate = heartRate, distance = (int)RowerData.TotalDistance, energy = energy };
values.Add(tmpdata);
SendDataToRace(tmpdata);
HandleSaveDirect();
@@ -920,7 +930,7 @@ public class RowerHomeScript : PFUIPanel
TempRowerCalc tmpdata = null;
//解决C2里程训练无法结束的问题
var c2notStop = C2RowerData.IsEnabled && rowerType.type == 1 && (rowerType.value-totalDistance) <= 5;
var c2notStop = C2RowerData.IsEnabled && rowerType!=null && rowerType.type !=0 && (rowerType.value-totalDistance) <= 5;
//里程停止逻辑
if (totalDistance == RowerData.TotalDistance && !c2notStop)
{
@@ -934,6 +944,7 @@ public class RowerHomeScript : PFUIPanel
}
if (stopSeconds >= 2)
{
Debug.Log($"stopSeconds:{RowerData.TotalDistance}");
if (UIManager.Instance.confirm != null && UIManager.Instance.confirm.IsActive()) {
Debug.Log("stopSeconds >= 2");
transform.Find("Stopped").gameObject.SetActive(false);