结果页面移除划船记录&设备断开扔保留之前的厂商序列号

This commit is contained in:
lishuo 2022-07-18 14:31:14 +08:00
parent 2697103479
commit 5b39dd985b
12 changed files with 92 additions and 87 deletions

View File

@ -95,7 +95,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &3111753855602397197
RectTransform:
m_ObjectHideFlags: 0
@ -1615,7 +1615,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &1724308109339741718
RectTransform:
m_ObjectHideFlags: 0

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: c3d55e1747cadce45aef1d770b8f95bd
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: a1e43bb033650884fa2d63c2b3705140
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,30 @@
using System;
namespace Assets.Scripts.Apis.Models
{
public class DeviceDetail
{
public int Id { get; set; }
public string Name { get; set; }
public int? AntManufacturerId { get; set; }
public int? AntModelId { get; set; }
public string AdvertisingData { get; set; }
public bool SupportsBluetooth { get; set; }
public bool SupportsAnt { get; set; }
//public SensorType SensorType { get; set; }
public int? PairingHelpId { get; set; }
public int? BestPracticesId { get; set; }
public DateTime Updated { get; set; }
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 7d697543a3cdf6f46adc75828232116d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -293,6 +293,10 @@ namespace Assets.Scripts.Apis
{
return await GetAsync<JsonResult<JObject>>("/home/getversions");
}
public async Task<JsonResult<List<DeviceDetail>>> GetDeviceList()
{
return await GetAsync<JsonResult<List<DeviceDetail>>>("/home/GetDeviceList");
}
public async Task<JsonResult<JObject>> ResetPassword(string phone, string captcha, string newPwd)
{
return await PostAsync<JsonResult<JObject>>("NoAuth/v1/ResetPassword", new {phone,captcha,newPwd });

View File

@ -1,21 +1,13 @@
using Assets.Scripts.Apis.Models;
using Assets.Scripts.UI.Prefab.Login;
using Assets.Scenes.Ride.Scripts.Model;
using System.Collections;
using Assets.Scenes.Ride.Scripts.Model;
using System.Collections.Generic;
using UnityEngine;
using System.Net;
using System.Globalization;
using System.Threading;
using Assets.Scripts.Devices;
using Assets.Scripts;
using System;
using System.Threading.Tasks;
using System.Timers;
using Newtonsoft.Json;
using Facebook.Unity;
using Assets.Scenes.Ride.Scripts;
using System.Linq;
public delegate void ChangeLanguageDelegate();
@ -61,6 +53,8 @@ public static class App
//全局用,弹多个广告
public static Queue<ActivityModel> adQueue;
public static List<DeviceDetail> deviceList;
public static RideSetting RideSetting = new RideSetting();
public static string pageName { get; set; }
public static int firstEnter { get; set; }

View File

@ -365,9 +365,17 @@ public class MainController : BaseScene
}
ShowGameRoomInviteConfirm();
UIManager.UpdateJoinCompetition();//查询当前我参加的赛事
//await GetDeviceListAsync(); PC品牌
}
private async Task GetDeviceListAsync()
{
var result = await ConfigHelper.userApi.GetDeviceList();
if (result != null && result.result)
{
App.deviceList = result.data;
}
}
float emptyt = 0;//用于无消息计时
float t = 1f;
float scanTicks = 0;

View File

@ -293,7 +293,7 @@ namespace Assets.Scenes.Ride.Scripts
currentSlope = pointList[CurrentIndex].Grade;
//格式化坡度最大不能超过15-15
PreSlope = PreSlope > 0 ?Math.Min(PreSlope, 15) : Math.Max(PreSlope, -15);
currentSlope = currentSlope > 0? Math.Min(PreSlope, 15) : Math.Max(PreSlope, -15);
currentSlope = currentSlope > 0? Math.Min(currentSlope, 15) : Math.Max(currentSlope, -15);
CurrentDistance = pointList[CurrentIndex].Distance;
//计算下一个海拔和坡度&当前区间距离
nextSlope = pointList[nextIndex].Grade > 0 ? Math.Min(pointList[nextIndex].Grade, 15) : Math.Max(pointList[nextIndex].Grade, -15);

View File

@ -38,25 +38,36 @@ namespace Assets.Scenes.Ride.Scripts
{
(_device as IRequiresRiderWeight).RiderWeight = App.CurrentUser.Weight;
}
if (_device.Network == NetworkType.ANT)
{
var antDevice = _device as AbstractAntDevice;
ManufacturerId = antDevice.ManufacturerId;
AntModelId = antDevice.AntModelId;
DeviceNumber = $"{ antDevice.DeviceNumber },{ antDevice.DeviceType}";
}
else
{
var bleDevice = _device as BleDevice;
DeviceNumber = $"{ Helper.FormateMacAddress(bleDevice.Address) },{ ServiceUuids.GetBySensor(bleDevice.Sensor) }";
ManufacturerName = bleDevice.Name + "," + bleDevice.Network + "," + bleDevice.Sensor;
}
SetDeviceInfo();
}
return _device;
}
}
private void SetDeviceInfo()
{
if (_device.Network == NetworkType.ANT)
{
var antDevice = _device as AbstractAntDevice;
if (antDevice != null)
{
ManufacturerId = antDevice.ManufacturerId > 0 ? antDevice.ManufacturerId : ManufacturerId;
AntModelId = antDevice.AntModelId > 0 ? antDevice.AntModelId : AntModelId;
DeviceNumber = $"{ antDevice.DeviceNumber },{ antDevice.DeviceType}";
}
}
else
{
var bleDevice = _device as BleDevice;
if (bleDevice != null)
{
DeviceNumber = $"{ Helper.FormateMacAddress(bleDevice.Address) },{ ServiceUuids.GetBySensor(bleDevice.Sensor) }";
ManufacturerName = bleDevice.Name + "," + bleDevice.Network + "," + bleDevice.Sensor;
}
}
}
/// <summary>
/// 更新速度(KM/H)
///
@ -130,6 +141,10 @@ namespace Assets.Scenes.Ride.Scripts
public bool CheckAnt()
{
//_antConnector = AntConnector.Instance();
if (_device == null || App.CurrentUser.FTP <= 0)
{
return false;
}
var devices = App.MainDeviceAdapter.GetDevices().Where(d => d.State == DeviceState.Connected && (d.Sensor == SensorType.Trainer || d.Sensor == SensorType.Power));
if (devices.Count() > 0)
{
@ -138,34 +153,12 @@ namespace Assets.Scenes.Ride.Scripts
{
(_device as IRequiresRiderWeight).RiderWeight = App.CurrentUser.Weight;
}
if (_device.Network == NetworkType.ANT)
{
var antDevice = _device as AbstractAntDevice;
ManufacturerId = antDevice.ManufacturerId;
AntModelId = antDevice.AntModelId;
DeviceNumber = $"{ antDevice.DeviceNumber },{ antDevice.DeviceType}";
}
else
{
var bleDevice =_device as BleDevice;
DeviceNumber = $"{ bleDevice.Address },{ bleDevice.Sensor }";
ManufacturerName = bleDevice.Name + " " + bleDevice.Network + " " + bleDevice.Sensor;
}
SetDeviceInfo();
}
else
{
return false;
}
if (App.CurrentUser.FTP <= 0)
{
return false;
}
if (_device == null)
{
return false;
}
return true;
}
//设备列表

View File

@ -1,13 +1,8 @@
using UnityEngine;
using Assets.Scenes.Ride.Scripts.Model;
using UnityEngine.SceneManagement;
using System.Collections.Generic;
using System.Linq;
using Assets.Scenes.Ride.Scripts.Model.RiderModels;
using System;
using ChartAndGraph;
using DG.Tweening;
using System.Collections;
using Assets.Scenes.Ride.Scripts.Model;
using Assets.Scenes.Ride.Scripts.Model.CyclingModels;
namespace Assets.Scenes.Ride.Scripts
@ -159,10 +154,6 @@ namespace Assets.Scenes.Ride.Scripts
}
#endregion
//public void InitGraph(int index)
//{
// chartDataSourceScript.InitHorizontalScrolling(index);
//}
//移动海拔图头像
protected override void MoveGraphHead(bool init = false)
{

View File

@ -96,26 +96,16 @@ public class ResultListController : PFUIPanel
UIManager.AddEvent(matchScroll.gameObject, UnityEngine.EventSystems.EventTriggerType.EndDrag, OnEndDrag);
}
scrolls = new Transform[] { routeScroll, matchScroll};
//GetList(0);
GetList(0);
GetList(1);
#if UNITY_ANDROID || UNITY_IOS
GetList(2);
#endif
}
public void Load()
{
Debug.Log("刷新show");
//Refresh(contents[0]);
if (contents != null && contents.Length == 3)
if (contents != null && contents.Length == 2)
{
Debug.Log("刷新show进入");
Refresh(contents[scrollIndex]);
}
//if (scroll!=null)
//{
// scroll.transform.Find("Error").gameObject.SetActive(false);
//}
}
private void OnEndDrag(BaseEventData e)