loading页&结果页面&代码结构微调
This commit is contained in:
1 parent
eb1803c9ef
commit
eed2d13624
99 files changed
+14567
-7299
No files matched your search
@@ -0,0 +1,60 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Assets.Scenes.Ride.Scripts.Model
|
||||
{
|
||||
public abstract class BaseRider
|
||||
{
|
||||
//internal static MapWorkoutService service = new MapWorkoutService();
|
||||
|
||||
public abstract RiderType riderType { get; }
|
||||
/// <summary>
|
||||
/// 用户Id
|
||||
/// </summary>
|
||||
public int UserId { get; set; }
|
||||
|
||||
public string InMapId
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.riderType.ToString() + "-" + UserId;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 用户姓名
|
||||
/// </summary>
|
||||
public string NickName { get; set; }
|
||||
/// <summary>
|
||||
/// 微信头像
|
||||
/// </summary>
|
||||
public string WxHeadImg { get; set; }
|
||||
/// <summary>
|
||||
/// 最后骑行的距离
|
||||
/// </summary>
|
||||
public double EndDistance { get; set; }
|
||||
/// <summary>
|
||||
/// 是否是当前登陆人
|
||||
/// </summary>
|
||||
public bool IsSelf
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.UserId == App.CurrentUser.Id;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 圆形头像
|
||||
/// </summary>
|
||||
public string CircHeadImg
|
||||
{
|
||||
get
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9a318f90ef1c36742a0ffa27baa04c98
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,61 @@
|
||||
using GeoJSON.Net.Geometry;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Assets.Scenes.Ride.Scripts.Model.RiderModels
|
||||
{
|
||||
public class OnlineRiderModel : BaseRider
|
||||
{
|
||||
public override RiderType riderType => RiderType.Online;
|
||||
|
||||
public double PreDistance { get; set; } = 0;
|
||||
public double WeightKg { get; set; } = 0;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public GeographicPosition Point { get; set; }
|
||||
|
||||
public OutUser GetOutUser(double preDistance, double currentDistance, TurfHelper turfHelper, CyclingStateEnum cyclingState)
|
||||
{
|
||||
if (this.IsSelf)
|
||||
{
|
||||
var newRealUser = new OutUser()
|
||||
{
|
||||
NickName = this.NickName,
|
||||
WxHeadImg = this.WxHeadImg,
|
||||
UserId = this.UserId,
|
||||
//targetData = targetData,
|
||||
InMapId = this.InMapId,
|
||||
PreDistance = preDistance,
|
||||
NextDistance = currentDistance,
|
||||
Point = turfHelper.Along(currentDistance),
|
||||
};
|
||||
if (cyclingState != CyclingStateEnum.Cycling)
|
||||
{
|
||||
newRealUser.NextDistance = preDistance;
|
||||
}
|
||||
return newRealUser;
|
||||
}
|
||||
else
|
||||
{
|
||||
var newRealUser = new OutUser()
|
||||
{
|
||||
NickName = this.NickName,
|
||||
WxHeadImg = this.WxHeadImg,
|
||||
UserId = this.UserId,
|
||||
//targetData = targetData,
|
||||
InMapId = this.InMapId,
|
||||
PreDistance = this.PreDistance,
|
||||
NextDistance = this.EndDistance,
|
||||
Point = this.Point, //turfHelper.Along(this.EndDistance)
|
||||
};
|
||||
return newRealUser;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 83879fd24afab69418f97cb56eaebda7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,55 @@
|
||||
using GeoJSON.Net.Geometry;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Assets.Scenes.Ride.Scripts.Model.RiderModels
|
||||
{
|
||||
/// <summary>
|
||||
/// 骑行伴侣
|
||||
/// </summary>
|
||||
public class ReviewRiderModel : BaseRider
|
||||
{
|
||||
public override RiderType riderType => RiderType.Review;
|
||||
|
||||
public GeographicPosition Point { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 骑行记录数据
|
||||
/// </summary>
|
||||
public string[] record { get; set; }
|
||||
|
||||
public OutUser GetOutUser(int ticks, TurfHelper turfHelper)
|
||||
{
|
||||
var reviewer = this;
|
||||
TargetData revierData = null;
|
||||
if (ticks >= reviewer.record.Length)
|
||||
{
|
||||
revierData = TargetData.Read(reviewer.record[reviewer.record.Length - 1]);
|
||||
}
|
||||
else if (ticks > 0)
|
||||
{
|
||||
revierData = TargetData.Read(reviewer.record[ticks - 1]);
|
||||
}
|
||||
//(Ticks >= reviewer.record.Length ? TargetData.Read(reviewer.record[reviewer.record.Length - 1]) :
|
||||
//TargetData.Read(reviewer.record[Ticks]));
|
||||
var reivewPreDistance = ticks == 1 || ticks == 0 ? 0 :
|
||||
(ticks >= reviewer.record.Length ? TargetData.Read(reviewer.record[reviewer.record.Length - 1])._Distance :
|
||||
TargetData.Read(reviewer.record[ticks - 2])._Distance);
|
||||
var result = new OutUser()
|
||||
{
|
||||
UserId = this.UserId,
|
||||
//targetData = revierData,
|
||||
InMapId = this.InMapId,
|
||||
PreDistance = reivewPreDistance,
|
||||
NextDistance = ticks == 0 ? 0 : revierData._Distance,
|
||||
NickName = this.NickName,
|
||||
WxHeadImg = this.WxHeadImg
|
||||
};
|
||||
result.Point = turfHelper.Along(result.NextDistance);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8d265479686613e418a745e888533ec5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in new issue
Block a user