保存优化&本地记录自动上传

This commit is contained in:
lishuo committed 2022-02-21 16:16:35 +08:00
1 parent f5294b0d39
commit 0c1c2ed382
3 files changed
+35 -23

No files matched your search

@@ -88,33 +88,41 @@ public class LocalRouteItem : MonoBehaviour, IPointerExitHandler, IPointerEnterH
listFileName.Add(item);
}
}
DeleteLocalRecord();
}
void DeleteLocalRecord(bool showMessage=false)
{
//自动上传
try
{
MapInterruptRecordApi service = ConfigHelper.mapInterruptRecordApi;
var result = service.Add(record, listFileName);
//删除文件
if (result.result)
{
Helper.DelectDir(path);
Destroy(gameObject);
}
if (showMessage)
{
Utils.showToast(gameObject, result.errMsg);
}
}
catch (Exception e)
{
Utils.showToast(gameObject, e.Message);
}
}
void GoUplaod()
{
UIManager.ShowConfirm("Upload", "Upload the local record?", () =>
{
try
{
MapInterruptRecordApi service = new MapInterruptRecordApi();
var result = service.Add(record, listFileName);
//删除文件
UIManager.CloseConfirm();
if (result.result)
{
Helper.DelectDir(path);
DestroyImmediate(gameObject);
}
else
{
Utils.showToast(gameObject, result.errMsg);
}
}
catch (Exception e)
{
Utils.showToast(gameObject, e.Message);
}
DeleteLocalRecord(true);
//删除文件
UIManager.CloseConfirm();
});
}
void GoDelete()
@@ -264,7 +264,7 @@ public class ResultListController : PFUIPanel
{
if (Directory.Exists(item))
{
var d = new DirectoryInfo(item);
//var d = new DirectoryInfo(item);
//var createTime = d.CreationTime;//create time
//var newTime = createTime.AddSeconds(30D);
//if (newTime < DateTime.Now)