2021-04-19 14:38:31 +08:00
|
|
|
|
using Assets.Scenes.Ride.Scripts.Model.RiderModels;
|
|
|
|
|
|
using Assets.Scripts;
|
|
|
|
|
|
using Assets.Scripts.Apis.Models;
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Assets.Scenes.Ride.Scripts.Model.CyclingModels
|
|
|
|
|
|
{
|
|
|
|
|
|
public class ReviewModel : BaseCycling
|
|
|
|
|
|
{
|
|
|
|
|
|
public List<MapRecordRanking> rankings;
|
|
|
|
|
|
|
|
|
|
|
|
public ReviewModel(Route route1, RouteResultParam param)
|
|
|
|
|
|
: base(route1, CyclingModel.Review)
|
|
|
|
|
|
{
|
2021-04-28 15:37:18 +08:00
|
|
|
|
//rankings = service.GetMapRecordRankingsFromServe(param.RankingsId);
|
2021-04-19 14:38:31 +08:00
|
|
|
|
riders = new List<BaseRider>();
|
2021-05-08 18:36:59 +08:00
|
|
|
|
//riders.Add(new OnlineRiderModel()
|
|
|
|
|
|
//{
|
|
|
|
|
|
// NickName = App.CurrentUser.Nickname,
|
|
|
|
|
|
// UserId = App.CurrentUser.Id,
|
|
|
|
|
|
// WxHeadImg = App.CurrentUser.WxHeadImg,
|
|
|
|
|
|
// Point = new GeoJSON.Net.Geometry.GeographicPosition(this.route.RouteInstance.Point[0], this.route.RouteInstance.Point[1])
|
|
|
|
|
|
//});
|
2021-04-28 15:37:18 +08:00
|
|
|
|
//foreach (var item in rankings)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// riders.Add(new ReviewRiderModel()
|
|
|
|
|
|
// {
|
|
|
|
|
|
// NickName = item.NickName,
|
|
|
|
|
|
// UserId = item.UserId,
|
|
|
|
|
|
// WxHeadImg = item.WxHeadImg,
|
|
|
|
|
|
// record = item.record,
|
|
|
|
|
|
// Point = new GeoJSON.Net.Geometry.GeographicPosition(this.route.RouteInstance.Point[0], this.route.RouteInstance.Point[1])
|
|
|
|
|
|
// });
|
|
|
|
|
|
//}
|
2021-04-19 14:38:31 +08:00
|
|
|
|
recorderData = new RecorderDataModel()
|
|
|
|
|
|
{
|
|
|
|
|
|
CurrentUser = App.CurrentUser,
|
2021-04-28 15:37:18 +08:00
|
|
|
|
//BelongUserId = PubCommData.CurrentUser.Id,
|
2021-04-19 14:38:31 +08:00
|
|
|
|
Competitionid = 0,
|
|
|
|
|
|
ContinueIndex = 0,
|
|
|
|
|
|
ContinueMark = Guid.NewGuid().ToString(),
|
|
|
|
|
|
EndDistance = 0,
|
|
|
|
|
|
PreDistance = 0,
|
|
|
|
|
|
IsCompleted = false,
|
|
|
|
|
|
IsNeedRanking = true,
|
|
|
|
|
|
CyclingState = CyclingStateEnum.Prepare,
|
2021-04-28 15:37:18 +08:00
|
|
|
|
//ManufacturerId = ManufacturerId,
|
2021-04-19 14:38:31 +08:00
|
|
|
|
CurrentRoute = route,
|
|
|
|
|
|
CurrentRouteStartDistance = 0,
|
2021-04-28 15:37:18 +08:00
|
|
|
|
//DeviceNumber = DeviceNumber,
|
|
|
|
|
|
//AntModelId = antModelId
|
2021-04-19 14:38:31 +08:00
|
|
|
|
};
|
2021-04-28 15:37:18 +08:00
|
|
|
|
|
|
|
|
|
|
//recorderData = recorderData1;
|
2021-04-19 14:38:31 +08:00
|
|
|
|
this.IsRecord = true;
|
2021-04-28 15:37:18 +08:00
|
|
|
|
//riders = riders1;
|
|
|
|
|
|
|
2021-04-19 14:38:31 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override void Run(TargetData targetData)
|
|
|
|
|
|
{
|
2021-05-11 18:21:32 +08:00
|
|
|
|
|
|
|
|
|
|
#region 获取当前路线在线用户
|
|
|
|
|
|
riders.RemoveAll(r => r.IsSelf == false);
|
|
|
|
|
|
var onlineUsers = MapUDPService.GetOnlineUsers(recorderData.CurrentRoute.RouteInstance.Id).Where(d => d.IsSelf == false)
|
|
|
|
|
|
.ToList();
|
|
|
|
|
|
foreach (var item in onlineUsers)
|
|
|
|
|
|
{
|
|
|
|
|
|
riders.Add(new OnlineRiderModel()
|
|
|
|
|
|
{
|
|
|
|
|
|
NickName = item.Name,
|
|
|
|
|
|
UserId = item.Id,
|
|
|
|
|
|
WxHeadImg = item.HeadImage,
|
|
|
|
|
|
Point = new GeoJSON.Net.Geometry.GeographicPosition(item.Point[0], item.Point[1]),
|
|
|
|
|
|
EndDistance = item.EndDistance,
|
|
|
|
|
|
PreDistance = item.PreDistance,
|
2021-05-12 18:51:03 +08:00
|
|
|
|
WeightKg = item.WeightKg,
|
2021-05-11 18:21:32 +08:00
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
2021-04-19 14:38:31 +08:00
|
|
|
|
base.Run(targetData);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|