请求公开线路;增加移动版

This commit is contained in:
Caiyanpeng committed 2022-03-03 15:06:13 +08:00
1 parent 01df299251
commit c3514df331
24 files changed
+4429 -1322

No files matched your search

+8
View File
@@ -225,6 +225,14 @@ namespace Assets.Scripts.Apis
return result;
}
public async Task<JsonResult<object>> ApplyOpenRoute(int id)
{
var result = await PostAsync<JsonResult<object>>($"Map/ApplyOpenRoute", new { id });
return result;
}
public async Task<JsonResult<List<MapRouteAreaItem>>> GetRecommendAreaList()
{
var result = await GetAsync<JsonResult<List<MapRouteAreaItem>>>($"MapRouteArea/GetRecommendAreaList");
+2
View File
@@ -118,5 +118,7 @@ namespace Assets.Scripts.Apis.Models
public int[] RouteIds { get; set; }
//最近骑行列表使用
public RouteResult RecentRecord { get; set; }
public bool IsEnabled { get; set; }
}
}
+7 -7
View File
@@ -20,7 +20,7 @@ public delegate void ChangeLanguageDelegate();
public static class App
{
public static string Host = "http://192.168.0.101:5087/";
public static string Host = "http://192.168.0.101:5083/";
public static string AppVersion = Application.version;
@@ -219,13 +219,13 @@ public static class App
InitLanguage();
#if !UNITY_EDITOR
//测试服务器
//Host = "http://pf.juze.pro/";
//UdpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 21000);
//TcpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 21001);
Host = "http://pf.juze.pro/";
UdpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 21000);
TcpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 21001);
//线上
Host = "https://wx.powerfun.com.cn/";
UdpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 11000);
TcpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 11001);
//Host = "https://wx.powerfun.com.cn/";
//UdpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 11000);
//TcpAddress = new IPEndPoint(IPAddress.Parse("47.97.84.8"), 11001);
//本地
//Host = "http://192.168.0.101:5085/";
//UdpAddress = new IPEndPoint(IPAddress.Parse("192.168.0.97"), 11000);
@@ -19,6 +19,8 @@ public class MailListController : PFUIPanel
scroll = transform.Find("Container/Content/Right/Scroll View").GetComponent<ScrollRect>();
#if UNITY_STANDALONE_WIN
mail = Resources.Load<GameObject>("UI/Prefab/Mail/MailItem");
#else
mail = Resources.Load<GameObject>("UI/Prefab/Mail/MailItem-mob");
#endif
}
public override void Show()
+4 -1
View File
@@ -92,7 +92,10 @@ public class MainNav : MonoBehaviour
private void ShowMailDot(object sender, EventArgs e)
{
transform.Find("Mail/Dot").gameObject.SetActive((bool)sender);
if (transform)
{
transform.Find("Mail/Dot").gameObject.SetActive((bool)sender);
}
}
public void ShowRowerTab()
+37 -2
View File
@@ -114,10 +114,21 @@ public class MapItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandler,
if (!isModal)
{
transform.Find("CollectImg").GetComponent<Button>().onClick.RemoveAllListeners();
transform.Find("CollectImg").GetComponent<Button>().onClick.AddListener(Collect);
if (App.CurrentRouteType == "My Upload")
{
transform.Find("CollectImg").GetComponent<Button>().onClick.AddListener(ApplyOpenRoute);
}
else
{
transform.Find("CollectImg").GetComponent<Button>().onClick.AddListener(Collect);
}
}
transform.Find("CollectImg").Find("Image").GetComponent<Image>().sprite =
UIManager.Instance.collectDict[myMap.IsFavorite];
App.CurrentRouteType != "My Upload"?UIManager.Instance.collectDict[myMap.IsFavorite]: UIManager.Instance.uploadDict[myMap.IsEnabled];
if (App.CurrentRouteType == "My Upload")
{
transform.Find("CollectImg").Find("Image").GetComponent<RectTransform>().sizeDelta = new Vector2(25, 20f);
}
#if !(UNITY_ANDROID || UNITY_IOS)
transform.Find("CollectImg").gameObject.SetActive(false);
#endif
@@ -165,6 +176,30 @@ public class MapItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandler,
}
}
void ApplyOpenRoute()
{
if (!map.IsEnabled)
{
UIManager.ShowConfirm(App.GetLocalString("Request to make the route public"), App.GetLocalString("Do you want to make the route public?"), async () =>
{
var res = await ConfigHelper.mapApi.ApplyOpenRoute(map.Id);
if (res.result)
{
Utils.showToast(null, App.GetLocalString("Submitted, please wait for background review."), type: 1);
UIManager.CloseConfirm();
}
else
{
Utils.showToast(null, res.errMsg);
}
});
}
else
{
Utils.showToast(null, App.GetLocalString("Route is public."), type: 1);
}
}
private void Ride()
{
App.RouteIdParam = map.Id;
+17 -2
View File
@@ -28,7 +28,7 @@ public class NewMainNav : MonoBehaviour
float delayTime = 0;
private List<string> typeArray = new List<string>()
{
"Back","Exit","Home","Device","Delay","Setting","Support","Avatar","Custom","Custom2"
"Back","Exit","Home","Device","Delay","Setting","Support","Avatar","Custom","Custom2","Mail"
};
private List<int> indexs = new List<int>();
private int? shrinkIndex = null;
@@ -42,6 +42,8 @@ public class NewMainNav : MonoBehaviour
public void SetButtonActive(List<int> indexs,int? shrinkIndex = null, CustomButton custom = null, CustomButton custom2 = null)
{
this.indexs = indexs;
//邮箱常驻
this.indexs.Add(10);
this.shrinkIndex = shrinkIndex;
this.custom = custom;
this.custom2 = custom2;
@@ -212,8 +214,21 @@ public class NewMainNav : MonoBehaviour
{
UIManager.ShowFeedBackModal();
});
UIManager.AddEvent(transform.Find("Mail").gameObject, EventTriggerType.PointerClick, x =>
{
UIManager.ShowMailListPanel();
});
App.HasNotReadChanged -= ShowMailDot;
App.HasNotReadChanged += ShowMailDot;
}
private void ShowMailDot(object sender, EventArgs e)
{
if (transform)
{
transform.Find("Mail/Dot").gameObject.SetActive((bool)sender);
}
}
public void ShowRowerTab()
{
+6
View File
@@ -534,6 +534,11 @@ public class UIManager : MonoBehaviour
{ false,Resources.Load<Sprite>("Images/p-4灰")},
{ true,Resources.Load<Sprite>("Images/p-4")},
};
uploadDict = new Dictionary<bool, Sprite>
{
{ false,Resources.Load<Sprite>("Images/upload/1")},
{ true,Resources.Load<Sprite>("Images/upload/2")},
};
//var a = Resources.Load<TextAsset>("UI/simpleCountry");
//var clist = JsonConvert.DeserializeObject<List<CountryInfo>>(a.text);
@@ -1199,6 +1204,7 @@ public class UIManager : MonoBehaviour
}
}
public Dictionary<bool, Sprite> collectDict { get; private set; }
public Dictionary<bool, Sprite> uploadDict { get; private set; }
private int _userInfoIndex;
public int userInfoIndex
{