切换移动端暂存

This commit is contained in:
Caiyanpeng committed 2021-08-13 17:19:02 +08:00
1 parent 11e9acdb14
commit 35b5ab59d3
15 files changed
+201 -46

No files matched your search

-1
View File
@@ -5,7 +5,6 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Assets.Scripts.Apis
{
internal class MapCompetitionApi : ApiBase
+7 -7
View File
@@ -11,7 +11,7 @@ using Assets.Scripts.Devices;
public static class App
{
public static string Host = "http://192.168.0.101:5084/";
public static string Host = "http://192.168.0.101:5083/";
public static string AppVersion = Application.version;
@@ -72,12 +72,12 @@ public static class App
static App()
{
#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 = "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://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);
#endif
}
}
@@ -14,8 +14,10 @@ namespace Assets.Scripts.Devices
private List<DeviceAdapter> adapters = new List<DeviceAdapter>();
public MainDeviceAdapter()
{
#if !(UNITY_IOS || UNITY_ANDROID)
this.CreateAntAdapter();
this.CreateBleAdapter();
#endif
}
private void CreateAntAdapter()
+23 -8
View File
@@ -21,7 +21,9 @@ using UnityEngine.Events;
using UnityEngine.EventSystems;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
#if !(UNITY_IOS || UNITY_ANDROID)
using ZenFulcrum.EmbeddedBrowser;
#endif
//记录:小f 是-457和-681
public class QUserInfo
@@ -86,7 +88,9 @@ public class LoginController : MonoBehaviour
//注册主页面
private UserResultModel userResult;
/*微信相关*/
#if !(UNITY_IOS || UNITY_ANDROID)
private Browser wxBrowser;
#endif
private string wxState;
private Transform wxLogin1;
private Transform wxLogin2;
@@ -252,6 +256,7 @@ public class LoginController : MonoBehaviour
var wechatLogin = loginContainer.Find("otherContainer").Find("Wechat").GetComponent<Button>();
UIManager.AddEvent(wechatLogin.gameObject, EventTriggerType.PointerClick, (b) =>
{
#if !(UNITY_IOS || UNITY_ANDROID)
if (wxLock) return;
wxLock = true;
//wxState = (DateTime.Now.ToUniversalTime().Ticks / 10000 * new System.Random().Next(1, 5)).ToString();
@@ -269,7 +274,7 @@ public class LoginController : MonoBehaviour
//Debug.Log(178 + "已经开启" + wx1.gameObject.activeSelf);
//wx1.GetComponent<CanvasGroup>().DOFade(1, 0.8f).onComplete = () => { wxLock = false; };
wxLogin1.DOLocalMoveY(0, 0.3f).onComplete = () => { wxLock = false; };
#endif
});
var login = loginContainer.Find("login").GetComponent<Button>();
@@ -311,6 +316,7 @@ public class LoginController : MonoBehaviour
{
wxReturnLogin();
});
#if !(UNITY_IOS || UNITY_ANDROID)
wxBrowser = wxLogin1.Find("Browser (GUI)").GetComponent<Browser>();
if (wxBrowser != null)
{
@@ -333,6 +339,7 @@ public class LoginController : MonoBehaviour
//browser.Zoom = 0.5f;
//browser.
}
#endif
}
wxLogin2 = mainContent.Find("FormContainer-wx2");
if (wxLogin2 != null)
@@ -519,6 +526,7 @@ public class LoginController : MonoBehaviour
/// </summary>
private void AdjustWxQrCode()
{
#if !(UNITY_IOS || UNITY_ANDROID)
wxBrowser.EvalJSCSP(@"
document.getElementsByClassName('qrcode')[0].style.marginTop = 0;
document.getElementsByClassName('title')[0].style.display = 'none';
@@ -528,8 +536,11 @@ public class LoginController : MonoBehaviour
document.body.style.transformOrigin = 'top left';
document.body.style.transform = 'scale(0.85106382978)';
document.body.style.padding = '0';").Done();
#endif
}
//浏览器加载回调
#if !(UNITY_IOS || UNITY_ANDROID)
private async void OnUserScan()
{
if (wxBrowser.Url.Contains("qrconnect"))
@@ -590,7 +601,9 @@ public class LoginController : MonoBehaviour
}
}
}
}
}
#endif
private void goThirdNext()
{
this.StartScrollPanel(4);
@@ -605,7 +618,7 @@ public class LoginController : MonoBehaviour
{
}
#region 倒计时获取验证码
#region 倒计时获取验证码
int time = 0;
float timer = 0f;
bool startCaptcha = false;
@@ -644,7 +657,7 @@ public class LoginController : MonoBehaviour
Utils.SetValidate(signFormDict, r.errFieldMsg);
}
}
#endregion
#endregion
void CaptchaTimerTick()
{
@@ -882,7 +895,9 @@ public class LoginController : MonoBehaviour
void wxReturnLogin()
{
wxLock = true;
#if !(UNITY_IOS || UNITY_ANDROID)
wxBrowser.LoadHTML("<div/>");
#endif
//wxBrowser.Url = "chrome://version/";
wxLogin1.DOLocalMoveY(-573, 0.3f).onComplete = () =>
{
@@ -1178,7 +1193,7 @@ public class LoginController : MonoBehaviour
}
//float adjTime = 0;
//bool startJs = false;
#region 主页面滑动逻辑
#region 主页面滑动逻辑
private int tmpImdex = 0;
private int scrollPanelIndex = 2;
//private float scrollValue = 0.5f;
@@ -1217,9 +1232,9 @@ public class LoginController : MonoBehaviour
}
}
}
#endregion
#endregion
#region 注册页面滑动逻辑
#region 注册页面滑动逻辑
private bool startScrollSign = false;
private int scrollSignIndex = 0;
@@ -1285,5 +1300,5 @@ public class LoginController : MonoBehaviour
}
}
}
#endregion
#endregion
}
@@ -175,9 +175,9 @@ namespace Assets.Scenes.Ride.Scripts
protected virtual void StartRide(BaseEventData baseEvent)
{
var checkAnt = cyclingController.CheckAnt();
#if UNITY_EDITOR
//#if UNITY_EDITOR
checkAnt = true;
#endif
//#endif
if (!checkAnt && !cyclingController.isWatch)
{
var alert = (GameObject)Instantiate(Resources.Load("UI/Prefab/Ride/Alert"), panel.transform);
@@ -55,9 +55,9 @@ namespace Assets.Scenes.Ride.Scripts
cadance = mainController.UpdateCadence();
weight = App.CurrentUser.Weight;
bicycleWeight = App.CurrentUser.BicycleWeight;
#if UNITY_EDITOR
//#if UNITY_EDITOR
power = 500;
#endif
//#endif
mainController.TrackResistance(currentSlope * App.RideSetting.Sensitivity / 100);
}
catch (Exception ex)
@@ -53,20 +53,8 @@ public class HomeController : PFUIPanel
BtnTraining = BtnContainer.Find("BtnTraining");
UIManager.AddEvent(BtnTraining.gameObject, EventTriggerType.PointerClick, (e) =>
{
var path = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\PowerFun\Rhino.PowerFun.exe";
//Debug.Log(System.IO.File.Exists(path + ));
if (!System.IO.File.Exists(path))
{
//TODO: auto update
UIManager.ShowDownloadWorkoutsPanel();
//Application.OpenURL("https://powerfun.oss-cn-shanghai.aliyuncs.com/Releases/PowerFunWorkouts.exe");
return;
}
UIManager.ShowConfirm("Switch to PowerFun Workouts?", "We will close the Powerfun and start PowerFun Workouts.", () =>
{
Utils.ExecFile(path);
Application.Quit();
});
Debug.Log(Application.platform);
goTraining(e);
});
UIManager.AddEvent(BtnTraining.gameObject, EventTriggerType.PointerEnter, OnHover);
UIManager.AddEvent(BtnTraining.gameObject, EventTriggerType.PointerExit, OnExit);
@@ -117,6 +105,27 @@ public class HomeController : PFUIPanel
}
OnExit(e);
}
void goTraining(BaseEventData e)
{
#if !(UNITY_IOS || UNITY_ANDROID)
var path = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\PowerFun\Rhino.PowerFun.exe";
//Debug.Log(System.IO.File.Exists(path + ));
if (!System.IO.File.Exists(path))
{
//TODO: auto update
UIManager.ShowDownloadWorkoutsPanel();
//Application.OpenURL("https://powerfun.oss-cn-shanghai.aliyuncs.com/Releases/PowerFunWorkouts.exe");
return;
}
UIManager.ShowConfirm("Switch to PowerFun Workouts?", "We will close the Powerfun and start PowerFun Workouts.", () =>
{
Utils.ExecFile(path);
Application.Quit();
});
#else
Application.OpenURL("powerfun://app");
#endif
}
//进入比赛
private void GoMatch(BaseEventData e)
{