Merge remote-tracking branch 'origin/dev_combine' into dev_release
# Conflicts: # Assets/Scripts/App.cs
This commit is contained in:
commit
ae753e51cb
17 files changed
+16
-397
No files matched your search
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user