Merge remote-tracking branch 'origin/dev_mobile' into dev_mobile_ble
# Conflicts: # Assets/Scenes/Login-Mobile.unity
This commit is contained in:
commit
939d6f1d0c
20 files changed
+1636
-1518
No files matched your search
@@ -11,7 +11,7 @@ using Assets.Scripts.Devices;
|
||||
|
||||
public static class App
|
||||
{
|
||||
public static string Host = "http://192.168.0.101:5085/";
|
||||
public static string Host = "http://192.168.0.101:5087/";
|
||||
|
||||
public static string AppVersion = Application.version;
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Assets.Scripts.Mobile.Interface
|
||||
{
|
||||
interface INativeOnMobileWxLoginResp
|
||||
{
|
||||
void OnMobileWxLoginResp(string res);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 95e502fb53efbff428f077e54f0d5f1d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,4 +1,5 @@
|
||||
using Assets.Scripts;
|
||||
using Assets.Scripts.Mobile.Interface;
|
||||
using DG.Tweening;
|
||||
using System;
|
||||
using System.Collections;
|
||||
@@ -6,7 +7,7 @@ using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class LoginControllerMobile : MonoBehaviour
|
||||
public class LoginControllerMobile : MonoBehaviour, INativeOnMobileWxLoginResp
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
ScrollRect loginScrollView;
|
||||
@@ -70,6 +71,13 @@ public class LoginControllerMobile : MonoBehaviour
|
||||
/// <param name="res"></param>
|
||||
public void OnMobileWxLoginResp(string res)
|
||||
{
|
||||
Utils.showToast(gameObject, res, type: 1);
|
||||
if (res.Contains("true;"))
|
||||
{
|
||||
GetComponent<LoginController>().goWxLoginWithCode(res.Replace("true;", ""), "mobile");
|
||||
}
|
||||
else
|
||||
{
|
||||
Utils.showToast(null, res.Replace("false;", ""));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -607,51 +607,55 @@ public class LoginController : BaseScene
|
||||
//var acjson = await ConfigHelper.thirdPartApi.GetWxAccessToken(groups[1].Value);
|
||||
//var infojson = await ConfigHelper.thirdPartApi.GetWxUserInfo(
|
||||
// acjson.Value<string>("access_token"), acjson.Value<string>("openid"));
|
||||
|
||||
|
||||
//string unionId = wxInfoJson.Value<string>("unionid"),
|
||||
// openId = wxInfoJson.Value<string>("openid");
|
||||
var r = await ConfigHelper.userApi.OnWebWxLoginCheckUnionIdByCode(groups[1].Value, groups[2].Value);
|
||||
if (r.result)
|
||||
{
|
||||
JObject data = JObject.FromObject(r.data);
|
||||
if (data.Value<string>("success") != null && data.Value<string>("success") == "False")
|
||||
{
|
||||
wxInfoJson = data;
|
||||
wxLogin2.gameObject.SetActive(true);
|
||||
Utils.DisplayImage(wxLogin2.Find("Avatar").GetComponent<RawImage>(),
|
||||
wxInfoJson.Value<string>("headimgurl"));
|
||||
wxLogin2.Find("NickName").GetComponent<Text>().text = wxInfoJson.Value<string>("nickname");
|
||||
wxLogin3.gameObject.SetActive(true);
|
||||
Utils.DisplayImage(wxLogin3.Find("Avatar").GetComponent<RawImage>(),
|
||||
wxInfoJson.Value<string>("headimgurl"));
|
||||
wxLogin3.Find("NickName").GetComponent<Text>().text = wxInfoJson.Value<string>("nickname");
|
||||
pageNums = 5;
|
||||
//this.goSign();
|
||||
StartScrollPanel(2);
|
||||
}
|
||||
else
|
||||
{
|
||||
RefreshWx3(data.ToObject<UserResultModel>(), 1);
|
||||
wxLogin3.gameObject.SetActive(true);
|
||||
//Utils.DisplayImage(StartCoroutine,
|
||||
//wxLogin3.Find("Avatar").GetComponent<RawImage>(),
|
||||
//wxInfoJson.Value<string>("headimgurl"));
|
||||
//wxLogin3.Find("NickName").GetComponent<Text>().text = wxInfoJson.Value<string>("nickname");
|
||||
signContainer.gameObject.SetActive(false);
|
||||
pageNums = 3;
|
||||
//this.goSign();
|
||||
StartScrollPanel(2);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Utils.showToast(gameObject, r.errMsg);
|
||||
}
|
||||
await goWxLoginWithCode(groups[1].Value, groups[2].Value);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
public async Task goWxLoginWithCode(string code, string state)
|
||||
{
|
||||
var r = await ConfigHelper.userApi.OnWebWxLoginCheckUnionIdByCode(code,state);
|
||||
if (r.result)
|
||||
{
|
||||
JObject data = JObject.FromObject(r.data);
|
||||
if (data.Value<string>("success") != null && data.Value<string>("success") == "False")
|
||||
{
|
||||
wxInfoJson = data;
|
||||
wxLogin2.gameObject.SetActive(true);
|
||||
Utils.DisplayImage(wxLogin2.Find("Avatar").GetComponent<RawImage>(),
|
||||
wxInfoJson.Value<string>("headimgurl"));
|
||||
wxLogin2.Find("NickName").GetComponent<Text>().text = wxInfoJson.Value<string>("nickname");
|
||||
wxLogin3.gameObject.SetActive(true);
|
||||
Utils.DisplayImage(wxLogin3.Find("Avatar").GetComponent<RawImage>(),
|
||||
wxInfoJson.Value<string>("headimgurl"));
|
||||
wxLogin3.Find("NickName").GetComponent<Text>().text = wxInfoJson.Value<string>("nickname");
|
||||
pageNums = 5;
|
||||
//this.goSign();
|
||||
StartScrollPanel(2);
|
||||
}
|
||||
else
|
||||
{
|
||||
RefreshWx3(data.ToObject<UserResultModel>(), 1);
|
||||
wxLogin3.gameObject.SetActive(true);
|
||||
//Utils.DisplayImage(StartCoroutine,
|
||||
//wxLogin3.Find("Avatar").GetComponent<RawImage>(),
|
||||
//wxInfoJson.Value<string>("headimgurl"));
|
||||
//wxLogin3.Find("NickName").GetComponent<Text>().text = wxInfoJson.Value<string>("nickname");
|
||||
signContainer.gameObject.SetActive(false);
|
||||
pageNums = 3;
|
||||
//this.goSign();
|
||||
StartScrollPanel(2);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Utils.showToast(gameObject, r.errMsg);
|
||||
}
|
||||
}
|
||||
private void goThirdNext()
|
||||
{
|
||||
this.StartScrollPanel(4);
|
||||
|
||||
@@ -155,6 +155,8 @@ public class MapItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandler,
|
||||
Cursor.SetCursor(null, Vector2.zero, CursorMode.Auto);
|
||||
//SetActive4Button(false);
|
||||
SetColor(false);
|
||||
#else
|
||||
transform.Find("Shadow").GetComponent<Image>().DOFade(0, 0.3f);
|
||||
#endif
|
||||
}
|
||||
public void OnPointerEnter(PointerEventData eventData)
|
||||
@@ -170,6 +172,8 @@ public class MapItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandler,
|
||||
Cursor.SetCursor(Resources.Load<Texture2D>("Images/PointerButtonHover"), Vector2.zero, CursorMode.Auto);
|
||||
//SetActive4Button(true);
|
||||
SetColor(true);
|
||||
#else
|
||||
transform.Find("Shadow").GetComponent<Image>().DOFade(1, 0.3f);
|
||||
#endif
|
||||
}
|
||||
void SetActive4Button(bool b)
|
||||
|
||||
@@ -433,6 +433,7 @@ public class EditUserController : PFUIPanel, INativeOnMobileImageSelect
|
||||
|
||||
public void OnMobileImageSelect(string res)
|
||||
{
|
||||
Debug.Log(res);
|
||||
if (res.IndexOf("true,") == 0)
|
||||
{
|
||||
var path = res.Replace("true,", "");
|
||||
|
||||
@@ -9,10 +9,7 @@ using UnityEngine.EventSystems;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class RaceItemScript : MonoBehaviour
|
||||
#if !(UNITY_ANDROID||UNITY_IOS)
|
||||
, IPointerExitHandler, IPointerEnterHandler, IPointerUpHandler
|
||||
#endif
|
||||
public class RaceItemScript : MonoBehaviour, IPointerExitHandler, IPointerEnterHandler, IPointerUpHandler
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
public enum ItemType { big, small }
|
||||
@@ -215,6 +212,7 @@ public class RaceItemScript : MonoBehaviour
|
||||
status.GetComponent<ContentFitterController>().Refresh();
|
||||
}
|
||||
}
|
||||
#if !(UNITY_ANDROID || UNITY_IOS)
|
||||
float? localY = null;
|
||||
public void OnPointerExit(PointerEventData eventData)
|
||||
{
|
||||
@@ -281,6 +279,28 @@ public class RaceItemScript : MonoBehaviour
|
||||
Cursor.SetCursor(null, Vector2.zero, CursorMode.Auto);
|
||||
|
||||
}
|
||||
#else
|
||||
public void OnPointerExit(PointerEventData eventData)
|
||||
{
|
||||
if (_from == "list")
|
||||
{
|
||||
transform.Find("Masking").GetComponent<CanvasGroup>().DOFade(0, 0.3f);
|
||||
}
|
||||
}
|
||||
|
||||
public void OnPointerEnter(PointerEventData eventData)
|
||||
{
|
||||
if (_from == "list")
|
||||
{
|
||||
transform.Find("Masking").GetComponent<CanvasGroup>().DOFade(1, 0.3f);
|
||||
}
|
||||
}
|
||||
|
||||
public void OnPointerUp(PointerEventData eventData)
|
||||
{
|
||||
|
||||
}
|
||||
#endif
|
||||
public void Join()
|
||||
{
|
||||
var res = ConfigHelper.mapCompetitionApi.ApplyMapCompetition(mapCompetition.Id);
|
||||
@@ -321,4 +341,6 @@ public class RaceItemScript : MonoBehaviour
|
||||
Utils.showToast(null, res.errMsg, type: 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -26,6 +26,8 @@ public class ResultListController : PFUIPanel
|
||||
{
|
||||
{0,"routes" },{1,"competition" }
|
||||
};
|
||||
//交互用
|
||||
public Transform currentItem { get; set; }
|
||||
void Awake()
|
||||
{
|
||||
//ApiBase.SetCookie("73385F5F719B610D132C1ECF3E9143272BF15214D57ED91CD7A9DFD832407471535112AAEB8E9271F75D54FBBF2D99F18FA313C1EEA5676F5D722D7FBB07C926BEC5905591BF9AFDDC6336552DF273112C2DA1794E6FA2F465B11FECD2E82E52");
|
||||
@@ -201,7 +203,7 @@ public class ResultListController : PFUIPanel
|
||||
foreach (var item in list)
|
||||
{
|
||||
var obj = Instantiate(routeResult);
|
||||
obj.GetComponent<RouteItem>().Initial(item, index);
|
||||
obj.GetComponent<RouteItem>().Initial(item, index, transform);
|
||||
//obj.SendMessage("Initial", );
|
||||
obj.transform.parent = content;
|
||||
obj.transform.localScale = new Vector3(1, 1, 1);
|
||||
|
||||
@@ -31,8 +31,14 @@ public class RouteItem : MonoBehaviour
|
||||
RouteResult data;
|
||||
//滑动索引 0route 1match
|
||||
int index;
|
||||
public void Initial(RouteResult result,int index)
|
||||
//交互用
|
||||
private Transform parent { get; set; }
|
||||
public void Initial(RouteResult result,int index,Transform parent = null)
|
||||
{
|
||||
if (parent)
|
||||
{
|
||||
this.parent = parent;
|
||||
}
|
||||
routeResult = result;
|
||||
this.index = index;
|
||||
left = transform.Find("BigLeft/Left");
|
||||
@@ -295,6 +301,12 @@ public class RouteItem : MonoBehaviour
|
||||
|
||||
public void OnPointerEnter(PointerEventData eventData)
|
||||
{
|
||||
var pController = parent.GetComponent<ResultListController>();
|
||||
if (pController.currentItem)
|
||||
{
|
||||
pController.currentItem.GetComponent<RouteItem>().OnPointerExit(null);
|
||||
}
|
||||
pController.currentItem = transform;
|
||||
transform.GetComponent<Image>().color = Utils.HexToColorHtml("#353543");
|
||||
//if (index == 1)
|
||||
//{
|
||||
|
||||
Reference in new issue
Block a user