Race按钮恢复原样,增加是否创建比赛
This commit is contained in:
parent
44c1b771f7
commit
b4e97d5514
@ -928,9 +928,9 @@ RectTransform:
|
||||
m_Father: {fileID: 4994020441666303640}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 20, y: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 20, y: -9}
|
||||
m_SizeDelta: {x: 0, y: 16}
|
||||
m_Pivot: {x: 0.5, y: 1}
|
||||
--- !u!222 &2056250778738691887
|
||||
@ -4912,7 +4912,7 @@ GameObject:
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
m_IsActive: 0
|
||||
--- !u!224 &7594246243354940095
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -5080,7 +5080,7 @@ RectTransform:
|
||||
m_AnchorMin: {x: 0.5, y: 1}
|
||||
m_AnchorMax: {x: 0.5, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: -50}
|
||||
m_SizeDelta: {x: 0, y: 34}
|
||||
m_SizeDelta: {x: 40, y: 34}
|
||||
m_Pivot: {x: 0.5, y: 1}
|
||||
--- !u!222 &7250984511205769639
|
||||
CanvasRenderer:
|
||||
|
||||
@ -1593,8 +1593,8 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 1}
|
||||
m_AnchorMax: {x: 0.5, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: -205}
|
||||
m_SizeDelta: {x: 190, y: 90}
|
||||
m_AnchoredPosition: {x: 0, y: -215}
|
||||
m_SizeDelta: {x: 210, y: 90}
|
||||
m_Pivot: {x: 0.5, y: 1}
|
||||
--- !u!222 &5521075339293163153
|
||||
CanvasRenderer:
|
||||
|
||||
@ -73,5 +73,6 @@ namespace Assets.Scripts.Apis.Models
|
||||
public DateTime LastUpdateWheelStraight { get; set; }
|
||||
public DateTime UpdateTime { get; set; }
|
||||
public string WebHost { get; set; }//创建比赛url
|
||||
public bool CanCreateRace { get; set; }//是否可以创建比赛
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Assets.Scripts.Apis
|
||||
{
|
||||
@ -73,6 +74,7 @@ namespace Assets.Scripts.Apis
|
||||
user.Height = ret.data.Height;
|
||||
//todo: check local database, insert new user
|
||||
user.WebHost = ret.data.WebHost;
|
||||
user.CanCreateRace = ret.data.CanCreateRace;
|
||||
//PubCommData.CurrentUser = user;
|
||||
user.cookie = cookies[0].Value;
|
||||
return new JsonResult<UserResultModel>() { result = true, data = user };
|
||||
@ -244,8 +246,9 @@ namespace Assets.Scripts.Apis
|
||||
{
|
||||
return await GetAsync<JsonResult<AppDownloadModel>>("home/getversions");
|
||||
}
|
||||
public JsonResult<object> Update(UserResultModel currUser, string filePath = "")
|
||||
public JsonResult<object> Update(UserResultModel currUser, out string cookie, string filePath = "")
|
||||
{
|
||||
cookie = App.CurrentUser.cookie;
|
||||
//return await PostAsync<JsonResult<dynamic>>("User/UpdateUserSetting", new {
|
||||
// UID = currUser.Id,
|
||||
// Sex = currUser.Sex,
|
||||
@ -296,7 +299,7 @@ namespace Assets.Scripts.Apis
|
||||
currUser.Birthday
|
||||
//imgData = imgData
|
||||
}, files);
|
||||
|
||||
Debug.Log(cookie);
|
||||
return Newtonsoft.Json.JsonConvert.DeserializeObject<JsonResult<object>>(res);
|
||||
}
|
||||
public async Task<JsonResult<JObject>> GetNotify()
|
||||
|
||||
@ -859,7 +859,7 @@ public class LoginController : MonoBehaviour
|
||||
{
|
||||
userResult.Nickname = userResult.Phone;
|
||||
}
|
||||
var r = ConfigHelper.userApi.Update(userResult);
|
||||
var r = ConfigHelper.userApi.Update(userResult,out string cookie,"");
|
||||
return r.result;
|
||||
//userResult.Birthday.v
|
||||
}
|
||||
|
||||
@ -329,7 +329,7 @@ public class EditUserController : PFUIPanel
|
||||
user.Contact = mName.Text;
|
||||
user.ContactPhone = mPhone.Text;
|
||||
user.ContactAddress = mAddr.Text;
|
||||
var result = userApi.Update(user);
|
||||
var result = userApi.Update(user, out string cookie,"");
|
||||
App.isChanged = false;
|
||||
if (result.result == false)
|
||||
{
|
||||
@ -340,6 +340,7 @@ public class EditUserController : PFUIPanel
|
||||
else
|
||||
{
|
||||
App.CurrentUser = JObject.FromObject(result.data).ToObject<UserResultModel>();
|
||||
App.CurrentUser.cookie = cookie;
|
||||
if (App.CurrentUser.Birthday.HasValue)
|
||||
{
|
||||
App.CurrentUser.Birthday = App.CurrentUser.Birthday.Value.ToLocalTime();
|
||||
@ -359,7 +360,7 @@ public class EditUserController : PFUIPanel
|
||||
}
|
||||
void ChangeAvatar(string path)
|
||||
{
|
||||
var r = userApi.Update(App.CurrentUser, path);
|
||||
var r = userApi.Update(App.CurrentUser, out string cookie,path);
|
||||
App.isChanged = false;
|
||||
if (r.result)
|
||||
{
|
||||
@ -374,6 +375,7 @@ public class EditUserController : PFUIPanel
|
||||
}
|
||||
Debug.Log(img);
|
||||
App.CurrentUser.WxHeadImg = img;
|
||||
App.CurrentUser.cookie = cookie;
|
||||
Utils.showToast(gameObject, "Success", type: 1);
|
||||
//UIManager.ShowAlert();
|
||||
}
|
||||
|
||||
@ -121,6 +121,7 @@ public class HomeController : PFUIPanel
|
||||
private void GoMatch(BaseEventData e)
|
||||
{
|
||||
UIManager.ShowRaceHomePanel();
|
||||
OnExit(e);
|
||||
}
|
||||
private void OnHover(BaseEventData e)
|
||||
{
|
||||
|
||||
@ -62,6 +62,7 @@ public class UserInfoController : PFUIPanel
|
||||
{
|
||||
Application.OpenURL(App.CurrentUser.WebHost + "#/Mine/EditMatch?Token=" + App.CurrentUser.cookie);
|
||||
});
|
||||
|
||||
}
|
||||
public override void Show()
|
||||
{
|
||||
@ -84,6 +85,7 @@ public class UserInfoController : PFUIPanel
|
||||
{
|
||||
var summary = r.data;
|
||||
var user = App.CurrentUser;
|
||||
Debug.Log(user.CanCreateRace);
|
||||
Utils.DisplayHead(infoPanel.Find("Avatar").GetComponent<RawImage>(), user.WxHeadImg);
|
||||
|
||||
infoPanel.Find("Status").Find("Country").GetComponent<RawImage>().texture
|
||||
@ -117,6 +119,7 @@ public class UserInfoController : PFUIPanel
|
||||
summaryPanel.Find("KM").Find("Value").GetComponent<Text>().text = summary.TotalDistance.ToString();
|
||||
summaryPanel.Find("Climb").Find("Value").GetComponent<Text>().text = summary.TotalClimb.ToString();
|
||||
summaryPanel.Find("Calories").Find("Value").GetComponent<Text>().text = summary.TotalKj.ToString();
|
||||
summaryPanel.Find("CreateBtn").gameObject.SetActive(user.CanCreateRace);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user