解决金额区域差异问题
This commit is contained in:
parent
17eaccb72e
commit
b6d70e6856
@ -1137,7 +1137,7 @@ namespace Mapbox.Unity.Map
|
|||||||
|
|
||||||
public virtual void SetCenterLatitudeLongitude(Vector2d centerLatitudeLongitude)
|
public virtual void SetCenterLatitudeLongitude(Vector2d centerLatitudeLongitude)
|
||||||
{
|
{
|
||||||
_options.locationOptions.latitudeLongitude = string.Format("{0}, {1}", centerLatitudeLongitude.x, centerLatitudeLongitude.y);
|
_options.locationOptions.latitudeLongitude = string.Format("{0}, {1}", centerLatitudeLongitude.x.ToString(CultureInfo.InvariantCulture), centerLatitudeLongitude.y.ToString(CultureInfo.InvariantCulture));
|
||||||
_centerLatitudeLongitude = centerLatitudeLongitude;
|
_centerLatitudeLongitude = centerLatitudeLongitude;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -53,19 +53,19 @@ namespace Assets.Scenes.Ride.Scripts.Model
|
|||||||
{
|
{
|
||||||
string[] split = data.Split(',');
|
string[] split = data.Split(',');
|
||||||
var target = new TargetData();
|
var target = new TargetData();
|
||||||
target.Ticks = int.Parse(split[0]);
|
target.Ticks = Convert.ToInt32(split[0], CultureInfo.InvariantCulture); //int.Parse(split[0]);
|
||||||
target._Power = double.Parse(split[1]);
|
target._Power = Convert.ToDouble(split[1], CultureInfo.InvariantCulture);
|
||||||
target._Speed = double.Parse(split[2]);
|
target._Speed = Convert.ToDouble(split[2], CultureInfo.InvariantCulture);// double.Parse(split[2]);
|
||||||
target._Distance = double.Parse(split[3]);
|
target._Distance = Convert.ToDouble(split[3], CultureInfo.InvariantCulture); //double.Parse(split[3]);
|
||||||
target._Cadence = double.Parse(split[4]);
|
target._Cadence = Convert.ToDouble(split[4], CultureInfo.InvariantCulture); //double.Parse(split[4]);
|
||||||
if (!string.IsNullOrWhiteSpace(split[5]) && split[5] != "null")
|
if (!string.IsNullOrWhiteSpace(split[5]) && split[5] != "null")
|
||||||
{
|
{
|
||||||
target._HeartRate = int.Parse(split[5]);
|
target._HeartRate = Convert.ToInt32(split[5], CultureInfo.InvariantCulture); //int.Parse(split[5]);
|
||||||
}
|
}
|
||||||
if (split.Length > 6)
|
if (split.Length > 6)
|
||||||
{
|
{
|
||||||
target._Lat = double.Parse(split[6]);
|
target._Lat = Convert.ToDouble(split[6], CultureInfo.InvariantCulture); //double.Parse(split[6]);
|
||||||
target._Lon = double.Parse(split[7]);
|
target._Lon = Convert.ToDouble(split[7], CultureInfo.InvariantCulture); //double.Parse(split[7]);
|
||||||
//target._Bearing = double.Parse(split[8]);
|
//target._Bearing = double.Parse(split[8]);
|
||||||
}
|
}
|
||||||
return target;
|
return target;
|
||||||
|
|||||||
@ -56,7 +56,7 @@ namespace Assets.Scenes.Ride.Scripts
|
|||||||
bicycleWeight = App.CurrentUser.BicycleWeight;
|
bicycleWeight = App.CurrentUser.BicycleWeight;
|
||||||
//#if UNITY_EDITOR
|
//#if UNITY_EDITOR
|
||||||
System.Random rd = new System.Random();
|
System.Random rd = new System.Random();
|
||||||
//power = 1000; //rd.Next(150, 300);//测试功率
|
power = 1000; //rd.Next(150, 300);//测试功率
|
||||||
//#endif
|
//#endif
|
||||||
mainController.TrackResistance(currentSlope * App.rideSetting.sensitivity / 100);
|
mainController.TrackResistance(currentSlope * App.rideSetting.sensitivity / 100);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,6 +3,7 @@ using Assets.Scenes.Ride.Scripts.Model;
|
|||||||
using Assets.Scripts.Apis.Models;
|
using Assets.Scripts.Apis.Models;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@ -91,7 +92,7 @@ namespace Assets.Scripts.Apis
|
|||||||
|
|
||||||
public async Task<JsonResult<List<NearRouteModel>>> GetNearRouteAsync(float lat, float lng, float zoom, string bounds)
|
public async Task<JsonResult<List<NearRouteModel>>> GetNearRouteAsync(float lat, float lng, float zoom, string bounds)
|
||||||
{
|
{
|
||||||
var res = await GetAsync<JsonResult<List<NearRouteModel>>>($"/Map/GetNearRoute?lat={ lat }&lng={ lng }&zoom={zoom}&bounds={ bounds }");
|
var res = await GetAsync<JsonResult<List<NearRouteModel>>>($"/Map/GetNearRoute?lat={ lat.ToString(CultureInfo.InvariantCulture) }&lng={ lng.ToString(CultureInfo.InvariantCulture) }&zoom={zoom.ToString(CultureInfo.InvariantCulture)}&bounds={ bounds }");
|
||||||
|
|
||||||
//var result = System.Text.Encoding.UTF8.GetString(res);
|
//var result = System.Text.Encoding.UTF8.GetString(res);
|
||||||
return res;
|
return res;
|
||||||
@ -142,7 +143,7 @@ namespace Assets.Scripts.Apis
|
|||||||
public async Task<JsonResult<object>> GetEarthData(double lat, double lon)
|
public async Task<JsonResult<object>> GetEarthData(double lat, double lon)
|
||||||
{
|
{
|
||||||
//CultureInfo.InvariantCulture
|
//CultureInfo.InvariantCulture
|
||||||
var result = await GetAsync<JsonResult<object>>($"Map/GetEarthData?lat={ lat }&lon={ lon }");
|
var result = await GetAsync<JsonResult<object>>($"Map/GetEarthData?lat={ lat.ToString(CultureInfo.InvariantCulture) }&lon={ lon.ToString(CultureInfo.InvariantCulture) }");
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -66,10 +66,10 @@ public static class App
|
|||||||
|
|
||||||
static App()
|
static App()
|
||||||
{
|
{
|
||||||
CultureInfo currentCulture = (CultureInfo)Thread.CurrentThread.CurrentCulture.Clone();
|
//CultureInfo currentCulture = (CultureInfo)Thread.CurrentThread.CurrentCulture.Clone();
|
||||||
currentCulture.NumberFormat.NumberDecimalSeparator = ".";
|
//currentCulture.NumberFormat.NumberDecimalSeparator = ".";
|
||||||
Thread.CurrentThread.CurrentCulture = currentCulture;
|
//Thread.CurrentThread.CurrentCulture = currentCulture;
|
||||||
System.Globalization.CultureInfo.DefaultThreadCurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
|
//System.Globalization.CultureInfo.DefaultThreadCurrentCulture = System.Globalization.CultureInfo.InvariantCulture;
|
||||||
#if !UNITY_EDITOR
|
#if !UNITY_EDITOR
|
||||||
// Host = "http://pf.juze.pro/";
|
// Host = "http://pf.juze.pro/";
|
||||||
// UdpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 21000);
|
// UdpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 21000);
|
||||||
|
|||||||
@ -16,6 +16,7 @@ using UnityEngine.EventSystems;
|
|||||||
using UnityEngine.SceneManagement;
|
using UnityEngine.SceneManagement;
|
||||||
using Mapbox.Examples;
|
using Mapbox.Examples;
|
||||||
using DG.Tweening;
|
using DG.Tweening;
|
||||||
|
using System.Globalization;
|
||||||
|
|
||||||
public class BigMapController : PFUIPanel
|
public class BigMapController : PFUIPanel
|
||||||
{
|
{
|
||||||
@ -241,7 +242,7 @@ public class BigMapController : PFUIPanel
|
|||||||
//Screen.width
|
//Screen.width
|
||||||
//map.WorldToGeoPosition(start)
|
//map.WorldToGeoPosition(start)
|
||||||
|
|
||||||
var bounds = $"{ start.y },{ start.x };{ end.y },{ end.x }";
|
var bounds = $"{ start.y.ToString(CultureInfo.InvariantCulture) },{ start.x.ToString(CultureInfo.InvariantCulture) };{ end.y.ToString(CultureInfo.InvariantCulture) },{ end.x.ToString(CultureInfo.InvariantCulture) }";
|
||||||
var res = await mapApi.GetNearRouteAsync((float)mapManager.CenterLatitudeLongitude.x, (float)mapManager.CenterLatitudeLongitude.y,
|
var res = await mapApi.GetNearRouteAsync((float)mapManager.CenterLatitudeLongitude.x, (float)mapManager.CenterLatitudeLongitude.y,
|
||||||
mapManager.Zoom, bounds);
|
mapManager.Zoom, bounds);
|
||||||
if(res.result == false)
|
if(res.result == false)
|
||||||
|
|||||||
@ -243,8 +243,8 @@ public class EarthController : PFUIPanel
|
|||||||
{
|
{
|
||||||
//Debug.Log("click");
|
//Debug.Log("click");
|
||||||
|
|
||||||
Vector2 latLon = Conversion.GetLatLonFromSpherePoint(sphereLocation);
|
//Vector2 latLon = Conversion.GetLatLonFromSpherePoint(sphereLocation);
|
||||||
Debug.Log("Clicked on Latitude: " + latLon.x + ", Longitude: " + latLon.y);
|
//Debug.Log("Clicked on Latitude: " + latLon.x + ", Longitude: " + latLon.y);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -7,6 +7,7 @@ using Newtonsoft.Json.Linq;
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Globalization;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
@ -308,12 +309,12 @@ public class EditUserController : PFUIPanel
|
|||||||
Utils.showToast(gameObject, "Please fill in the information");//请填写相关信息
|
Utils.showToast(gameObject, "Please fill in the information");//请填写相关信息
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
user.FTP = int.Parse(mFTP.Text);
|
user.FTP = Convert.ToInt32(mFTP.Text, CultureInfo.InvariantCulture); //int.Parse(mFTP.Text);
|
||||||
user.Height = int.Parse(mHeight.Text);
|
user.Height = Convert.ToInt32(mHeight.Text, CultureInfo.InvariantCulture); //int.Parse(mHeight.Text);
|
||||||
user.Weight = double.Parse(mWeight.Text);
|
user.Weight = Convert.ToDouble(mWeight.Text, CultureInfo.InvariantCulture); //double.Parse(mWeight.Text);
|
||||||
user.MaxHeartRate = int.Parse(mMHR.Text);
|
user.MaxHeartRate = Convert.ToInt32(mMHR.Text, CultureInfo.InvariantCulture); //int.Parse(mMHR.Text);
|
||||||
user.BicycleWeight = double.Parse(mBW.Text);
|
user.BicycleWeight = Convert.ToDouble(mBW.Text, CultureInfo.InvariantCulture); //double.Parse(mBW.Text);
|
||||||
user.WheelDiameter = int.Parse(mWD.Text);
|
user.WheelDiameter = Convert.ToInt32(mWD.Text, CultureInfo.InvariantCulture); //int.Parse(mWD.Text);
|
||||||
user.Unit = mUnitDropdown.SelectedIndex;
|
user.Unit = mUnitDropdown.SelectedIndex;
|
||||||
user.Contact = mName.Text;
|
user.Contact = mName.Text;
|
||||||
user.ContactPhone = mPhone.Text;
|
user.ContactPhone = mPhone.Text;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user