发布前微调

This commit is contained in:
lishuo 2022-07-08 18:55:27 +08:00
parent bd9696cd81
commit fccc830f71
8 changed files with 14 additions and 39 deletions

View File

@ -62,7 +62,9 @@ namespace Assets.Scripts.Devices.Ble.Characteristic
public static RowerTaskPanel.RowerType rowerType { get; private set; } public static RowerTaskPanel.RowerType rowerType { get; private set; }
public void HandleAttributeReceived(byte[] data) public void HandleAttributeReceived(byte[] data)
{ {
if ((App.IsRowerMode?? false)) {
return;
}
if (data[0] == 0x35) if (data[0] == 0x35)
{ {
PeakDriveForce = LbsToNewton(Convert.ToDouble(BitConvertHelper.ToUInt16(data, 13)) / 10, true); PeakDriveForce = LbsToNewton(Convert.ToDouble(BitConvertHelper.ToUInt16(data, 13)) / 10, true);

View File

@ -598,7 +598,7 @@ namespace Assets.Scenes.Ride.Scripts.Model
try try
{ {
DateTime ? startTime = null;// string.IsNullOrEmpty(list[16]) ? null : Convert.ToDateTime(list[16], CultureInfo.InvariantCulture); DateTime ? startTime = null;// string.IsNullOrEmpty(list[16]) ? null : Convert.ToDateTime(list[16], CultureInfo.InvariantCulture);
if (!string.IsNullOrEmpty(list[16])) if (list.Length>= 16 && !string.IsNullOrEmpty(list[16]))
{ {
startTime = Convert.ToDateTime(list[16], CultureInfo.InvariantCulture); startTime = Convert.ToDateTime(list[16], CultureInfo.InvariantCulture);
} }

View File

@ -296,7 +296,7 @@ namespace Assets.Scenes.Ride.Scripts
currentSlope = currentSlope > 0? Math.Min(PreSlope, 15) : Math.Max(PreSlope, -15); currentSlope = currentSlope > 0? Math.Min(PreSlope, 15) : Math.Max(PreSlope, -15);
CurrentDistance = pointList[CurrentIndex].Distance; CurrentDistance = pointList[CurrentIndex].Distance;
//计算下一个海拔和坡度&当前区间距离 //计算下一个海拔和坡度&当前区间距离
nextSlope = pointList[nextIndex].Grade; nextSlope = pointList[nextIndex].Grade > 0 ? Math.Min(pointList[nextIndex].Grade, 15) : Math.Max(pointList[nextIndex].Grade, -15);
nextSlopeDistance = sumDistance - totalDistance * 1000; nextSlopeDistance = sumDistance - totalDistance * 1000;
NextSlopeTotalDistance = pointList[nextIndex].Distance; NextSlopeTotalDistance = pointList[nextIndex].Distance;
currentSlopeDistance = (totalDistance * 1000 - (sumDistance - pointList[index].Distance));// CurrentDistance-( totalDistance * 1000 - (sumDistance - pointList[index].Distance)); currentSlopeDistance = (totalDistance * 1000 - (sumDistance - pointList[index].Distance));// CurrentDistance-( totalDistance * 1000 - (sumDistance - pointList[index].Distance));

View File

@ -13,11 +13,13 @@ namespace Assets.Scenes.Ride.Scripts
{ {
public class DeviceServiceMonoBase: BaseScene public class DeviceServiceMonoBase: BaseScene
{ {
double pregrade = 0;
public void TrackResistance(double grade) public void TrackResistance(double grade)
{ {
var device = (CurrentTrainer as ITrainerDevice); var device = (CurrentTrainer as ITrainerDevice);
if (device != null) if (device != null && grade != pregrade)
{ {
pregrade = grade;
device.SetTrackResistance(grade); device.SetTrackResistance(grade);
} }
} }

View File

@ -53,6 +53,7 @@ namespace Assets.Scenes.Ride.Scripts
{ {
if (!_headUrl.Equals(url)) if (!_headUrl.Equals(url))
{ {
_headUrl = url;
//if (App.TextureCache.ContainsKey(url)) //if (App.TextureCache.ContainsKey(url))
//{ //{
// Head.texture = App.TextureCache[url]; // Head.texture = App.TextureCache[url];

View File

@ -111,10 +111,11 @@ namespace Assets.Scenes.Ride.Scripts
private async void shareToWx(BaseEventData b) private async void shareToWx(BaseEventData b)
{ {
UIManager.Instance.StartCoroutine(ShowLoading()); UIManager.Instance.StartCoroutine(ShowLoading());
var res = await ConfigHelper.mapInterruptRecordApi.GetRecordSnapShot(cyclingController.RankingId); //var res = await ConfigHelper.mapInterruptRecordApi.GetRecordSnapShot(cyclingController.RankingId);
if (App.weChatController.IsWeChatAppInstalled()) if (App.weChatController.IsWeChatAppInstalled())
{ {
App.weChatController.ShareImageToWX(0, res.data, Resources.Load<Sprite>("Images/pf").texture.EncodeToJPG()); App.weChatController.ShareWebpageToWX(0, $"{App.CurrentUser.WebHost}RoutesRecords/{cyclingController.RankingId}?Token={App.CurrentUser.cookie}", cyclingController.mapRoute.NickName, "By " + App.CurrentUser.Nickname, null);
//App.weChatController.ShareImageToWX(0, res.data, Resources.Load<Sprite>("Images/pf").texture.EncodeToJPG());
} }
else else
{ {
@ -124,7 +125,7 @@ namespace Assets.Scenes.Ride.Scripts
private IEnumerator ShowLoading() private IEnumerator ShowLoading()
{ {
Utils.showToast(null, "首次分享图片会消耗一些时间,请耐心等待", type: 1); //Utils.showToast(null, "首次分享图片会消耗一些时间,请耐心等待", type: 1);
yield return null; yield return null;
} }
private async void shareToWxGp(BaseEventData b) private async void shareToWxGp(BaseEventData b)

View File

@ -151,43 +151,13 @@ public class DeviceView : MonoBehaviour
{ {
return; return;
} }
var device = GetDevice(); mDisconnectButtonClick();
if (device != null && device.State == DeviceState.Connected)
{
UIManager.ShowConfirm(App.GetLocalString("Warning"), App.GetLocalString("Disconnect the device?"), () =>
{
device.Disconnect(false);
DeviceCache.Remove(device);
UIManager.CloseConfirm();
}, 2, () => {
UIManager.CloseConfirm();
});
}
else
{
mDisconnectButtonClick();
}
})); }));
#endif #endif
UIManager.AddEvent(mDisconnectButton, EventTriggerType.PointerClick, new UnityEngine.Events.UnityAction<BaseEventData>(e => { UIManager.AddEvent(mDisconnectButton, EventTriggerType.PointerClick, new UnityEngine.Events.UnityAction<BaseEventData>(e => {
#if UNITY_IOS || UNITY_ANDROID
var device = GetDevice();
if (device != null && device.State == DeviceState.Connected)
{
UIManager.ShowConfirm(App.GetLocalString("Warning"), App.GetLocalString("Disconnect the device?"), () =>
{
device.Disconnect(false);
DeviceCache.Remove(device);
UIManager.CloseConfirm();
}, 2, () => {
UIManager.CloseConfirm();
});
}
#else
mDisconnectButtonClick(); mDisconnectButtonClick();
#endif
})); }));
} }

View File

@ -73,7 +73,6 @@ public class QuickLoginUser : MonoBehaviour
private IEnumerator Loading() private IEnumerator Loading()
{ {
yield return null; yield return null;
DontDestroyOnLoad(loadingPanel);
Utils.showLoadingExtension(loadingPanel); Utils.showLoadingExtension(loadingPanel);
} }