骑行界面按钮替换,界面&逻辑调整
This commit is contained in:
1 parent
9993752ff5
commit
ae55258b9b
28 files changed
+11438
-8086
No files matched your search
@@ -106,12 +106,12 @@ namespace Assets.Scenes.Ride.Scripts.Model
|
||||
|
||||
public int GlobalCyclingId { get; set; }
|
||||
|
||||
public Dictionary<MapInterruptRecord, List<string>> SaveLocal(CyclingModel cyclingModel, RouteResultParam selectParam, string imageName = "")
|
||||
public void SaveLocal(CyclingModel cyclingModel, RouteResultParam selectParam, string imageName,string recordId)
|
||||
{
|
||||
Dictionary<MapInterruptRecord, List<string>> recordData = new Dictionary<MapInterruptRecord, List<string>>();
|
||||
if (RiderDatas.Count <= 0)
|
||||
{
|
||||
return recordData;
|
||||
return ;
|
||||
}
|
||||
string newFileName = Guid.NewGuid().ToString();
|
||||
int FTP = Helper.GetFtp();
|
||||
@@ -123,7 +123,7 @@ namespace Assets.Scenes.Ride.Scripts.Model
|
||||
var averagePower = Helper.AveragePower(RiderDatas);
|
||||
|
||||
// AntManufacturer manufacturer = service.GetAntManufacturer(ManufacturerId).data;
|
||||
var recordId = Guid.NewGuid().ToString();
|
||||
//var recordId = Guid.NewGuid().ToString();
|
||||
var ticks = RiderDatas.Last().Ticks;
|
||||
var interruptRecord = new MapInterruptRecord
|
||||
{
|
||||
@@ -207,7 +207,8 @@ namespace Assets.Scenes.Ride.Scripts.Model
|
||||
System.IO.File.WriteAllText(recordFilePath, recordString);
|
||||
|
||||
recordData.Add(interruptRecord, files);
|
||||
return recordData;
|
||||
|
||||
SaveDataAysnc(recordData);
|
||||
}
|
||||
/// <summary>
|
||||
/// 保存数据
|
||||
@@ -218,12 +219,26 @@ namespace Assets.Scenes.Ride.Scripts.Model
|
||||
{
|
||||
if (data != null && data.Count > 0)
|
||||
{
|
||||
Task.Run(() => {
|
||||
var path = Helper.GetDataDir("MapWorkoutRecords");
|
||||
//Task.Run(() => {
|
||||
var record = data.FirstOrDefault();
|
||||
MapInterruptRecordApi service = new MapInterruptRecordApi();
|
||||
var result = service.Add(record.Key, record.Value);
|
||||
//return new JsonResult<AddMapRecordResultModel> { result = result.result, errMsg = result.errMsg, data = result.data };
|
||||
});
|
||||
|
||||
//删除文件
|
||||
try
|
||||
{
|
||||
path = path + "/" + record.Key.Id;
|
||||
if (result.result && Directory.Exists(path))
|
||||
{
|
||||
Helper.DelectDir(path);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Log(e.Message);
|
||||
}
|
||||
//});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user