第一次进地球,登录页bug修改,主页面交互修改,其它细节
This commit is contained in:
1 parent
f7b33bf491
commit
333542a63a
30 files changed
+1990
-2007
No files matched your search
@@ -38,4 +38,6 @@ public static class App
|
||||
public static string notifyContent { get; internal set; }
|
||||
|
||||
public static RideSetting rideSetting = new RideSetting();
|
||||
public static string pageName { get; set; }
|
||||
public static int firstEnter { get; set; }
|
||||
}
|
||||
@@ -146,6 +146,8 @@ public class LoginController : MonoBehaviour
|
||||
signPage2 = content.Find("NextPage");
|
||||
UIManager.AddEvent(signPage2.Find("previous").GetComponent<Button>().gameObject,
|
||||
EventTriggerType.PointerClick, (b) => goRegPrev());
|
||||
signPage2.Find("previous").GetComponent<Button>().enabled = false;
|
||||
signPage2.Find("previous").GetComponent<Button>().interactable = false;
|
||||
//signPage2.Find("previous").GetComponent<Button>().onClick.AddListener(goRegPrev);
|
||||
UIManager.AddEvent(signPage2.Find("sign").GetComponent<Button>().gameObject,
|
||||
EventTriggerType.PointerClick, (b) => goRegEnd());
|
||||
@@ -252,15 +254,22 @@ public class LoginController : MonoBehaviour
|
||||
{
|
||||
if (wxLock) return;
|
||||
wxLock = true;
|
||||
|
||||
wxState = (DateTime.Now.ToUniversalTime().Ticks / 10000 * new System.Random().Next(1, 5)).ToString();
|
||||
wxBrowser.Url = $"https://open.weixin.qq.com/connect/qrconnect?appid={App.WxAppId}&redirect_uri=https%3A%2F%2Fwx.powerfun.com.cn%2FNoAuth%2Fv1%2FWxWebLogin&response_type=code&scope=snsapi_login&state={wxState}#wechat_redirect";
|
||||
AdjustWxQrCode();
|
||||
var wx1 = mainContent.Find("FormContainer-Login").Find("Mask").Find("FormContainer-wx1");
|
||||
wx1.gameObject.SetActive(true);
|
||||
Debug.Log(178 + "已经开启" + wx1.gameObject.activeSelf);
|
||||
//wxBrowser.RegisterFunction("isFinish", args =>
|
||||
//{
|
||||
// Debug.Log(331);
|
||||
// startJs = false;
|
||||
//});
|
||||
////AdjustWxQrCode();
|
||||
//startJs = true;
|
||||
//var wx1 = mainContent.Find("FormContainer-Login").Find("Mask").Find("FormContainer-wx1");
|
||||
wxLogin1.gameObject.SetActive(true);
|
||||
//Debug.Log(178 + "已经开启" + wx1.gameObject.activeSelf);
|
||||
//wx1.GetComponent<CanvasGroup>().DOFade(1, 0.8f).onComplete = () => { wxLock = false; };
|
||||
wx1.DOLocalMoveY(0, 0.3f).onComplete = () => { wxLock = false; };
|
||||
wxLogin1.DOLocalMoveY(0, 0.3f).onComplete = () => { wxLock = false; };
|
||||
|
||||
});
|
||||
|
||||
var login = loginContainer.Find("login").GetComponent<Button>();
|
||||
@@ -326,6 +335,7 @@ public class LoginController : MonoBehaviour
|
||||
// writable: false
|
||||
// }
|
||||
//});");
|
||||
|
||||
wxBrowser.onTextureUpdated += OnUserScan;
|
||||
//browser.Zoom = 0.5f;
|
||||
//browser.
|
||||
@@ -337,10 +347,12 @@ public class LoginController : MonoBehaviour
|
||||
{
|
||||
UIManager.AddEvent(wxLogin2.Find("return").gameObject, EventTriggerType.PointerClick, (b) =>
|
||||
{
|
||||
wxLogin1.gameObject.SetActive(false);
|
||||
wxLogin1.GetComponent<RectTransform>().localPosition = new Vector3(0, -573, 0);
|
||||
wxLogin2.gameObject.SetActive(false);
|
||||
//wxLogin3.gameObject.SetActive(false);
|
||||
pageNums = 4;
|
||||
Canvas.ForceUpdateCanvases();
|
||||
//Canvas.ForceUpdateCanvases();
|
||||
StartScrollPanel(1);
|
||||
});
|
||||
wxLogin2.Find("Next").GetComponent<Button>().onClick.AddListener(() =>
|
||||
@@ -451,6 +463,8 @@ public class LoginController : MonoBehaviour
|
||||
userInfos = UIManager.Instance.userInfos;
|
||||
App.DefaultRotateTexture = Utils.ReadTextureFromPlayerPrefs("rotateImage");
|
||||
var notifyId = PlayerPrefs.GetInt("notifyId");
|
||||
App.firstEnter = PlayerPrefs.GetInt("firstEnter");
|
||||
PlayerPrefs.SetInt("firstEnter", 1);
|
||||
var r = await ConfigHelper.userApi.GetNotify();
|
||||
if (r.result)
|
||||
{
|
||||
@@ -502,25 +516,26 @@ public class LoginController : MonoBehaviour
|
||||
/// </summary>
|
||||
private void AdjustWxQrCode()
|
||||
{
|
||||
wxBrowser.EvalJS(@"
|
||||
let time = null;
|
||||
let f = ()=>{
|
||||
document.getElementsByClassName('qrcode')[0].style.marginTop = 0;
|
||||
document.getElementsByClassName('title')[0].style.display = 'none';
|
||||
document.getElementById('wx_default_tip').childNodes[3].innerHTML = `""PowerFun""`;
|
||||
document.body.style.background = '#272732';
|
||||
document.body.style.overflow = 'hidden';
|
||||
document.body.style.transformOrigin = 'top left';
|
||||
document.body.style.transform = 'scale(0.85106382978)';
|
||||
document.body.style.padding = '0';
|
||||
if(document.body.style.padding === '0px' && time!=null){
|
||||
clearInterval(time);
|
||||
}
|
||||
}
|
||||
f();
|
||||
if(document.body.style.padding !== '0px'){
|
||||
time = setInterval(f,500);
|
||||
}");
|
||||
wxBrowser.EvalJSCSP(@"
|
||||
const f = ()=>{
|
||||
//if(document.body.style.padding === '0px')
|
||||
//{
|
||||
// console.log('停止');
|
||||
// isFinish();
|
||||
// return;
|
||||
//}
|
||||
console.log('js调整');
|
||||
document.getElementsByClassName('qrcode')[0].style.marginTop = 0;
|
||||
document.getElementsByClassName('title')[0].style.display = 'none';
|
||||
document.getElementById('wx_default_tip').childNodes[3].innerHTML = `""PowerFun""`;
|
||||
document.body.style.background = '#272732';
|
||||
document.body.style.overflow = 'hidden';
|
||||
document.body.style.transformOrigin = 'top left';
|
||||
document.body.style.transform = 'scale(0.85106382978)';
|
||||
document.body.style.padding = '0';
|
||||
|
||||
}
|
||||
f();").Done();
|
||||
}
|
||||
//浏览器加载回调
|
||||
private async void OnUserScan()
|
||||
@@ -529,12 +544,12 @@ public class LoginController : MonoBehaviour
|
||||
{
|
||||
//AdjustWxQrCode();
|
||||
}
|
||||
Debug.Log(wxBrowser.Url);
|
||||
//Debug.Log(wxBrowser.Url);
|
||||
var rgx = Regex.Match(wxBrowser.Url, @"https\:\/\/wx.powerfun.com.cn/NoAuth/v1/WxWebLogin\?code=(.*?)&state=(.*?)$");
|
||||
var groups = rgx.Groups;
|
||||
if (groups.Count == 3)
|
||||
{
|
||||
wxLogin1.gameObject.SetActive(false);
|
||||
wxBrowser.LoadHTML("<div />");
|
||||
var state = groups[2].Value;
|
||||
if (state == wxState)
|
||||
{
|
||||
@@ -547,6 +562,7 @@ public class LoginController : MonoBehaviour
|
||||
var r = await ConfigHelper.userApi.OnWebWxLoginCheckUnionId(unionId, openId);
|
||||
if (r.result)
|
||||
{
|
||||
|
||||
JObject data = JObject.FromObject(r.data);
|
||||
if (data.Value<string>("success") != null && data.Value<string>("success") == "False")
|
||||
{
|
||||
@@ -1129,8 +1145,19 @@ public class LoginController : MonoBehaviour
|
||||
}
|
||||
goScrollPanel();
|
||||
goScrollSign();
|
||||
//if (wxLogin1.gameObject.activeInHierarchy)
|
||||
//{
|
||||
// adjTime += Time.deltaTime;
|
||||
// if (adjTime >= 0.5 && wxLogin1.gameObject.activeInHierarchy && startJs)
|
||||
// {
|
||||
// Debug.Log("在调整");
|
||||
// adjTime = 0;
|
||||
// AdjustWxQrCode();
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
//float adjTime = 0;
|
||||
//bool startJs = false;
|
||||
#region 主页面滑动逻辑
|
||||
private int tmpImdex = 0;
|
||||
private int scrollPanelIndex = 2;
|
||||
|
||||
@@ -189,6 +189,7 @@ public class BigMapController : PFUIPanel
|
||||
maskImage.DOFade(1f, 0.9f).SetEase(Ease.InSine).OnComplete(() =>
|
||||
{
|
||||
this.Close();
|
||||
UIManager.PopStack();
|
||||
UIManager.ShowEarthPanel(mapManager.CenterLatitudeLongitude.x, mapManager.CenterLatitudeLongitude.y);
|
||||
});
|
||||
return;
|
||||
|
||||
@@ -204,6 +204,7 @@ public class EarthController : PFUIPanel
|
||||
maskImage.gameObject.SetActive(true);
|
||||
maskImage.DOFade(1f, 0.9f).SetEase(Ease.InSine).OnComplete(() => {
|
||||
Close();
|
||||
UIManager.PopStack();
|
||||
UIManager.ShowBigMapPanel(latLon.x, latLon.y);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ public class EditUserController : PFUIPanel
|
||||
mSexDropdown.ClearOptions();
|
||||
mSexDropdown.AddOptions(new List<string>
|
||||
{
|
||||
"男","女"
|
||||
"Male","Female"
|
||||
});
|
||||
mUnitDropdown.ClearOptions();
|
||||
mUnitDropdown.AddOptions(UIManager.Instance.loginRegOptions.units);
|
||||
@@ -195,11 +195,11 @@ public class EditUserController : PFUIPanel
|
||||
}
|
||||
if (currentUser.Sex == 1)
|
||||
{
|
||||
mSexDropdown.SelectValue("男");
|
||||
mSexDropdown.SelectIndex(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
mSexDropdown.SelectValue("女");
|
||||
mSexDropdown.SelectIndex(1);
|
||||
}
|
||||
mUnitDropdown.SelectIndex(currentUser.Unit);
|
||||
if (currentUser.Birthday.HasValue)
|
||||
@@ -297,7 +297,7 @@ public class EditUserController : PFUIPanel
|
||||
{
|
||||
var user = JsonConvert.DeserializeObject<UserResultModel>(JsonConvert.SerializeObject(App.CurrentUser));
|
||||
user.Birthday = new DateTime(int.Parse(mYearDropdown.SelectedItem), int.Parse(mMonthDropdown.SelectedItem), int.Parse(mDayDropdown.SelectedItem));
|
||||
user.Sex = mSexDropdown.SelectedItem == "男" ? 1 : 2;
|
||||
user.Sex = mSexDropdown.SelectedIndex == 0 ? 1 : 2;
|
||||
user.Nickname = mNickName.Text;
|
||||
user.Country = UIManager.Instance.loginRegOptions.GetCountryName(mConutryDropdown.SelectedIndex);
|
||||
var errorList = new List<object>();
|
||||
|
||||
@@ -26,8 +26,9 @@ public class HomeController : PFUIPanel
|
||||
//[SerializeField] Button More;
|
||||
[SerializeField] Button BtnRide;
|
||||
[SerializeField] Transform userInfo;
|
||||
|
||||
Transform BtnMatch, BtnTraining;
|
||||
private MainNav mainNav;
|
||||
private Dictionary<string, Sprite[]> dict;
|
||||
// Start is called before the first frame update
|
||||
protected override void Start()
|
||||
{
|
||||
@@ -35,10 +36,20 @@ public class HomeController : PFUIPanel
|
||||
|
||||
mainNav = this.transform.Find("MainNav").GetComponent<MainNav>();
|
||||
mainNav.ShowExit();
|
||||
|
||||
var BtnContainer = transform.Find("MainFuncContainer");
|
||||
UIManager.AddEvent(BtnRide.gameObject, EventTriggerType.PointerClick, GoRide);
|
||||
UIManager.AddEvent(BtnRide.gameObject, EventTriggerType.PointerEnter, OnHover);
|
||||
UIManager.AddEvent(BtnRide.gameObject, EventTriggerType.PointerExit, OnExit);
|
||||
BtnMatch = BtnContainer.Find("BtnMatch");
|
||||
//BtnMatch.GetComponent<Button>().onClick.AddListener(() =>
|
||||
//{
|
||||
// Debug.Log(45);
|
||||
//});
|
||||
UIManager.AddEvent(BtnMatch.gameObject, EventTriggerType.PointerEnter, OnHover);
|
||||
UIManager.AddEvent(BtnMatch.gameObject, EventTriggerType.PointerExit, OnExit);
|
||||
BtnTraining = BtnContainer.Find("BtnTraining");
|
||||
UIManager.AddEvent(BtnTraining.gameObject, EventTriggerType.PointerEnter, OnHover);
|
||||
UIManager.AddEvent(BtnTraining.gameObject, EventTriggerType.PointerExit, OnExit);
|
||||
var avatar = userInfo.Find("Avatar").GetComponent<RawImage>();
|
||||
var rect = ((RectTransform)avatar.transform).rect;
|
||||
SetRounded(avatar.transform, rect.height);
|
||||
@@ -54,16 +65,46 @@ public class HomeController : PFUIPanel
|
||||
//UIManager.ShowConfirm("Quit", "Do you want to quit PowerFun?", null);
|
||||
});
|
||||
//GetSummary();
|
||||
dict = new Dictionary<string, Sprite[]>
|
||||
{
|
||||
{
|
||||
"BtnMatch",new Sprite[]
|
||||
{
|
||||
Resources.Load<Sprite>("Images/home/Entrance - MATCH_soon"),
|
||||
Resources.Load<Sprite>("Images/home/Entrance - MATCH_soon_hover"),
|
||||
}
|
||||
},
|
||||
{
|
||||
"BtnTraining",new Sprite[]
|
||||
{
|
||||
Resources.Load<Sprite>("Images/home/Entrance - TRAINING_soon"),
|
||||
Resources.Load<Sprite>("Images/home/Entrance - TRAINING_soon_hover"),
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
private void GoRide(BaseEventData e)
|
||||
{
|
||||
UIManager.ShowMapListPanel();
|
||||
//UIManager.ShowEarthPanel(App.latitude, App.longitude);
|
||||
if (App.firstEnter == 0)
|
||||
{
|
||||
App.firstEnter = 1;
|
||||
UIManager.ShowEarthPanel(App.latitude, App.longitude);
|
||||
}
|
||||
else
|
||||
{
|
||||
UIManager.ShowMapListPanel();
|
||||
}
|
||||
OnExit(e);
|
||||
}
|
||||
private void OnHover(BaseEventData e)
|
||||
{
|
||||
var pe = (PointerEventData)e;
|
||||
var parent = pe.pointerEnter.transform.parent;
|
||||
if (dict.ContainsKey(parent.name))
|
||||
{
|
||||
parent.Find("Image").GetComponent<Image>().sprite = dict[parent.name][1];
|
||||
}
|
||||
//parent.Find("Image").GetComponent<Image>().sprite = Resources.Load<Sprite>("Images/home/Entrance - ROUTES_hover");
|
||||
//parent.Find("Text").GetComponent<Text>().color = Utils.HexToColorHtml("#ffffff");
|
||||
parent.DOScale(new Vector3(1.05f, 1.05f, 0), 0.3f);
|
||||
@@ -75,6 +116,10 @@ public class HomeController : PFUIPanel
|
||||
var parent = pe.pointerEnter.transform.parent;
|
||||
//parent.Find("Image").GetComponent<Image>().sprite = Resources.Load<Sprite>("Images/home/Entrance - ROUTES_nomal");
|
||||
//parent.Find("Text").GetComponent<Text>().color = Utils.HexToColorHtml("#5C5C6E");
|
||||
if (dict.ContainsKey(parent.name))
|
||||
{
|
||||
parent.Find("Image").GetComponent<Image>().sprite = dict[parent.name][0];
|
||||
}
|
||||
parent.DOScale(new Vector3(1f, 1f, 0), 0.3f);
|
||||
//parent.GetComponent<RectTransform>().localScale = new Vector3(1f, 1f, 0);
|
||||
}
|
||||
|
||||
@@ -60,6 +60,10 @@ public class ResultListController : MonoBehaviour
|
||||
{
|
||||
onEndEdit();
|
||||
});
|
||||
searchInput.GetComponent<InputField>().onValueChanged.AddListener((v) =>
|
||||
{
|
||||
name = v;
|
||||
});
|
||||
//searchInput.Find("Button").GetComponent<Button>().onClick.AddListener(() =>
|
||||
//{
|
||||
// name = searchInput.GetComponent<InputField>().text;
|
||||
|
||||
@@ -413,7 +413,14 @@ public class UIManager : MonoBehaviour
|
||||
var panel = stack.Pop();
|
||||
if (panel == null)
|
||||
{
|
||||
ShowBigMapPanel();
|
||||
if (App.pageName == "map")
|
||||
{
|
||||
ShowBigMapPanel();
|
||||
}
|
||||
else if (App.pageName == "earth")
|
||||
{
|
||||
ShowEarthPanel();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -436,7 +443,8 @@ public class UIManager : MonoBehaviour
|
||||
//var root = UIManager.Instance.MainPanel.transform.parent.parent;
|
||||
var bigMap = (GameObject)Instantiate(obj, UIManager.Instance.Root.transform);
|
||||
bigMap.GetComponent<BigMapController>().Show(lat, lon);
|
||||
stack.Push(bigMap.GetComponent<PFUIPanel>());
|
||||
stack.Push(null);
|
||||
App.pageName = "map";
|
||||
//prePanel = bigMap.GetComponent<PFUIPanel>();
|
||||
}
|
||||
|
||||
@@ -453,6 +461,8 @@ public class UIManager : MonoBehaviour
|
||||
//var root = UIManager.Instance.MainPanel.transform.parent.parent;
|
||||
earthPanel = (GameObject)Instantiate(obj, UIManager.Instance.Root.transform);
|
||||
}
|
||||
stack.Push(null);
|
||||
App.pageName = "earth";
|
||||
earthPanel.GetComponent<EarthController>().Show(lat, lon);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user