更新弹窗
This commit is contained in:
1 parent
c19b8630cf
commit
44ff898f8d
13 files changed
+2468
-1400
No files matched your search
@@ -306,7 +306,10 @@ namespace Assets.Scripts.Apis
|
||||
{
|
||||
return await GetAsync<JsonResult<JObject>>("/Home/GetNotify");
|
||||
}
|
||||
|
||||
public async Task<JsonResult<JObject>> GetVersions()
|
||||
{
|
||||
return await GetAsync<JsonResult<JObject>>("/home/getversions");
|
||||
}
|
||||
public async Task<JsonResult<JObject>> ResetPassword(string phone, string captcha, string newPwd)
|
||||
{
|
||||
return await PostAsync<JsonResult<JObject>>("NoAuth/v1/ResetPassword", new {phone,captcha,newPwd });
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Assets.Scripts;
|
||||
using Assets.Scripts.Mobile.Interface;
|
||||
using DG.Tweening;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
@@ -42,7 +43,53 @@ public class LoginControllerMobile : MonoBehaviour, INativeOnMobileWxLoginResp
|
||||
//App.weChatController.Init(App.WxAppId);
|
||||
//var s = App.weChatController.isApplicationAvilible("com.gugoumainapp","powerfun").ToString();
|
||||
//Utils.showToast(null, SystemInfo.batteryLevel.ToString());
|
||||
CheckUpdate();
|
||||
}
|
||||
|
||||
private async void CheckUpdate()
|
||||
{
|
||||
var r = await ConfigHelper.userApi.GetVersions();
|
||||
if (r.result)
|
||||
{
|
||||
|
||||
#if UNITY_ANDROID
|
||||
var info = r.data.Value<JObject>("UnityApk");
|
||||
Debug.Log(info.Value<string>("Version"));
|
||||
if (info.Value<string>("Version") != App.AppVersion)
|
||||
{
|
||||
transform.Find("Panel").gameObject.SetActive(false);
|
||||
transform.Find("Version").gameObject.SetActive(false);
|
||||
UIManager.ShowAndroidUpdate(info);
|
||||
}
|
||||
#elif UNITY_IOS
|
||||
var info = r.data.Value<JObject>("UnityIos");
|
||||
if (info.Value<string>("Version") != App.AppVersion)
|
||||
{
|
||||
Application.OpenURL(info.Value<string>("Url"));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
//if (r.result)
|
||||
//{
|
||||
// //#if !UNITY_EDITOR
|
||||
// var ver = r.data.Value<JObject>("Version").ToObject<UpdateModel>();
|
||||
// if (ver != null && ver.HasUpdate)
|
||||
// {
|
||||
// App.UpdateObject = ver;
|
||||
// Debug.Log(Application.persistentDataPath + "/PowerFun.exe");
|
||||
// UIManager.ShowDownloadModal();
|
||||
// }
|
||||
// //#endif
|
||||
// App.notifyContent = r.data.Value<string>("Content");
|
||||
|
||||
// if (r.data.Value<int>("Id") != notifyId)//r.data.Value<int>("Id") != notifyId
|
||||
// {
|
||||
// UIManager.ShowNewsModal();
|
||||
// PlayerPrefs.SetInt("notifyId", r.data.Value<int>("Id"));
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
@@ -509,11 +509,12 @@ public class LoginController : BaseScene
|
||||
//Task.Run(async () =>
|
||||
//{
|
||||
|
||||
//});
|
||||
#if !(UNITY_ANDROID || UNITY_IOS)
|
||||
//});
|
||||
var r = await ConfigHelper.userApi.GetNotify();
|
||||
|
||||
if (r.result)
|
||||
{
|
||||
#if !(UNITY_ANDROID || UNITY_IOS)
|
||||
//#if !UNITY_EDITOR
|
||||
var ver = r.data.Value<JObject>("Version").ToObject<UpdateModel>();
|
||||
if (ver != null && ver.HasUpdate)
|
||||
@@ -530,10 +531,32 @@ public class LoginController : BaseScene
|
||||
UIManager.ShowNewsModal();
|
||||
PlayerPrefs.SetInt("notifyId", r.data.Value<int>("Id"));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
GetRotateImage();
|
||||
#else
|
||||
var rr = await ConfigHelper.userApi.GetVersions();
|
||||
if (rr.result)
|
||||
{
|
||||
var info = rr.data.Value<JObject>("UnityApk");
|
||||
if (info.Value<string>("Url") != App.AppVersion) return;
|
||||
}
|
||||
|
||||
var ver = r.data.Value<JObject>("Version").ToObject<UpdateModel>();
|
||||
if (ver.UpdateLog.Count != notifyId) //ver.UpdateLog.Count != notifyId
|
||||
{
|
||||
var log = ver.UpdateLog.LastOrDefault();
|
||||
if (log != null)
|
||||
{
|
||||
App.notifyContent = log.Desc;
|
||||
}
|
||||
else
|
||||
{
|
||||
App.notifyContent = r.data.Value<string>("Content");
|
||||
}
|
||||
PlayerPrefs.SetInt("notifyId", ver.UpdateLog.Count);
|
||||
UIManager.ShowNewsModal();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
GetRotateImage();
|
||||
}
|
||||
|
||||
async void GetRotateImage()
|
||||
|
||||
@@ -304,6 +304,20 @@ public class UIManager : MonoBehaviour
|
||||
UIManager.Show(UIManager.Instance.CountDownAnimation, null, true);
|
||||
UIManager.Instance.CountDownAnimation.StartTime(action,action2);
|
||||
}
|
||||
//安卓下载页
|
||||
private AndroidUpdate mAndroidUpdate;
|
||||
public AndroidUpdate AndroidUpdate
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.GetPanelInstance("AndroidUpdate", ref this.mAndroidUpdate);
|
||||
}
|
||||
}
|
||||
public static void ShowAndroidUpdate(JObject jo)
|
||||
{
|
||||
UIManager.Show(UIManager.Instance.AndroidUpdate, null, true);
|
||||
UIManager.Instance.AndroidUpdate.StartDownload(jo);
|
||||
}
|
||||
#region 比赛点击弹窗
|
||||
private RaceModalScript mRaceModalScript;
|
||||
public RaceModalScript RaceDetailModal
|
||||
|
||||
Reference in new issue
Block a user