修改细节
This commit is contained in:
1 parent
1002b0433a
commit
86a5b68317
39 files changed
+3489
-2760
No files matched your search
@@ -146,7 +146,7 @@ namespace Assets.Scripts.Devices.Ant
|
||||
private void Log(string str)
|
||||
{
|
||||
//System.IO.File.AppendAllText(@"D:\work\PowerFun\PowerFun-Unity\Build\log.txt", str+"\r\n");
|
||||
Debug.LogError(str);
|
||||
//Debug.LogError(str);
|
||||
}
|
||||
|
||||
private void antDevice_serialError(ANT_Device sender, ANT_Device.serialErrorCode error, bool isCritical)
|
||||
|
||||
@@ -431,6 +431,7 @@ public class LoginController : MonoBehaviour
|
||||
{ "Days",signForm.days},
|
||||
};
|
||||
avatar = Resources.Load<Texture>("Images/New Account");
|
||||
transform.Find("Version").GetComponent<Text>().text = $"V{App.AppVersion}";
|
||||
}
|
||||
|
||||
async void GetRotateImage()
|
||||
|
||||
@@ -72,11 +72,20 @@ namespace Assets.Scripts.UI.Control
|
||||
{
|
||||
mOnValueChange(i);
|
||||
}
|
||||
SetWhite(i);
|
||||
outline.enabled = false;
|
||||
|
||||
});
|
||||
SetWhite(this.GetComponent<Dropdown>().value);
|
||||
outline = transform.GetComponent<Outline>();
|
||||
}
|
||||
public void SetWhite(int index)
|
||||
{
|
||||
if (index != -1 && this.GetComponent<Dropdown>().interactable)
|
||||
{
|
||||
this.GetComponent<Dropdown>().captionText.color = Utils.HexToColorHtml("#ffffff");
|
||||
}
|
||||
}
|
||||
public void SetValidate()
|
||||
{
|
||||
outline.enabled = true;
|
||||
@@ -136,7 +145,7 @@ namespace Assets.Scripts.UI.Control
|
||||
|
||||
public void OnPointerClick(PointerEventData eventData)
|
||||
{
|
||||
if (GetComponent<Dropdown>().value == -1) return;
|
||||
if (GetComponent<Dropdown>().value == -1 || !GetComponent<Dropdown>().interactable) return;
|
||||
var x = transform.Find("Dropdown List").GetComponent<ScrollRect>().content;
|
||||
x.GetChild(SelectedIndex + 1).Find("Item Label").GetComponent<Text>().color = Utils.HexToColorHtml("#f93086");
|
||||
}
|
||||
|
||||
@@ -65,6 +65,7 @@ namespace Assets.Scripts.UI.Control
|
||||
if (!string.IsNullOrWhiteSpace(Tooltips))
|
||||
{
|
||||
//
|
||||
//tooltips.GetComponent<RectTransform>().localPosition.
|
||||
tooltips.transform.Find("Text").GetComponent<Text>().text = Tooltips;
|
||||
}
|
||||
tooltips.SetActive(false);
|
||||
|
||||
@@ -8,6 +8,7 @@ using UnityEngine.EventSystems;
|
||||
using UnityEngine.UI;
|
||||
using Assets.Scripts.Devices.Ant.Interfaces;
|
||||
using Assets.Scripts.UI.Control;
|
||||
using Assets.Scripts;
|
||||
|
||||
public class ConnectDeviceModal : PFUIPanel
|
||||
{
|
||||
@@ -21,7 +22,17 @@ public class ConnectDeviceModal : PFUIPanel
|
||||
{
|
||||
Debug.Log(value);
|
||||
mSensorType = value;
|
||||
Logo.sprite = Resources.Load<Sprite>("Images/Devices/Trainer_3");
|
||||
var deviceInfoStr = Utils.deviceDict[value.ToString()];
|
||||
if (deviceInfoStr != null)
|
||||
{
|
||||
var deviceInfo = deviceInfoStr.Split('|');
|
||||
if (deviceInfo.Length == 2)
|
||||
{
|
||||
Title.text = deviceInfo[0];
|
||||
Logo.sprite = Resources.Load<Sprite>(deviceInfo[1]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
private Image Logo;
|
||||
@@ -29,7 +40,7 @@ public class ConnectDeviceModal : PFUIPanel
|
||||
private VerticalLayoutGroup content;
|
||||
private PfUIButton connectBtn;
|
||||
private Dictionary<ushort, DeviceItem> deviceList;
|
||||
private Text noDevice;
|
||||
private Text noDevice,Title;
|
||||
private RectTransform searchIconRect;
|
||||
|
||||
protected override void Awake()
|
||||
@@ -41,6 +52,7 @@ public class ConnectDeviceModal : PFUIPanel
|
||||
var container = this.transform.Find("GameObject");
|
||||
var closeBtn = container.Find("CloseBtn");
|
||||
Logo = container.Find("Logo").GetComponent<Image>();
|
||||
Title = container.Find("Title").GetComponent<Text>();
|
||||
var panel = container.Find("Panel");
|
||||
content = panel.Find("Scroll View").Find("Viewport").Find("Content").GetComponent<VerticalLayoutGroup>();
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ public class FeedbackController : PFUIPanel
|
||||
{
|
||||
if (App.CurrentUser == null) return;
|
||||
main.Find("Email").Find("Value").Find("Text").GetComponent<Text>().text = App.CurrentUser.Phone;
|
||||
main.Find("ID").Find("Value").Find("Text").GetComponent<Text>().text = App.CurrentUser.Id.ToString();
|
||||
main.Find("ID").Find("Value").Find("Text").GetComponent<Text>().text = App.CurrentUser.Id.ToString("#000000");
|
||||
main.Find("Version").Find("Value").Find("Text").GetComponent<Text>().text = App.AppVersion;
|
||||
main.Find("Time").Find("Value").Find("Text").GetComponent<Text>().text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace Assets.Scripts.UI.Prefab.MapList
|
||||
{"HC","750-99999" },
|
||||
};
|
||||
public static List<Dropdown.OptionData> sorts = new string[] {
|
||||
"Distance","Name","Difficulty","Hot"//,"Times"
|
||||
"Hot","Name","Distance","Difficulty"//,"Times"
|
||||
}.Select(x => new Dropdown.OptionData(x)).ToList();
|
||||
public static Dictionary<string, string> diffDisplayDict = new Dictionary<string, string>()
|
||||
{
|
||||
|
||||
@@ -205,7 +205,7 @@ public class EditUserController : PFUIPanel
|
||||
mMonthDropdown.SelectValue(birthday.Month.ToString());
|
||||
mDayDropdown.SelectValue(birthday.Day.ToString());
|
||||
}
|
||||
mID.text = currentUser.Id.ToString();
|
||||
mID.text = currentUser.Id.ToString("000000");
|
||||
mNickName.Text = currentUser.Nickname;
|
||||
mFTP.Text = currentUser.FTP.ToString();
|
||||
mWeight.Text = currentUser.Weight.ToString();
|
||||
@@ -324,7 +324,8 @@ public class EditUserController : PFUIPanel
|
||||
userinfos[i].NickName = user.Nickname;
|
||||
UIManager.Instance.userInfos = userinfos;
|
||||
}
|
||||
UIManager.ShowAlert("Success");
|
||||
Utils.showToast(gameObject, "Success", type: 1);
|
||||
//UIManager.ShowAlert("Success");
|
||||
}
|
||||
LoadDataSync();
|
||||
//App.CurrentUser = user;
|
||||
@@ -346,11 +347,13 @@ public class EditUserController : PFUIPanel
|
||||
UIManager.Instance.userInfos = userinfos;
|
||||
}
|
||||
App.CurrentUser.WxHeadImg = img;
|
||||
UIManager.ShowAlert("Success");
|
||||
Utils.showToast(gameObject, "Success", type: 1);
|
||||
//UIManager.ShowAlert();
|
||||
}
|
||||
else
|
||||
{
|
||||
UIManager.ShowAlert(r.errMsg);
|
||||
Utils.showToast(gameObject, r.errMsg);
|
||||
//UIManager.ShowAlert();
|
||||
}
|
||||
}
|
||||
void Cancel(BaseEventData e)
|
||||
|
||||
@@ -169,7 +169,7 @@ public class MapListController : PFUIPanel
|
||||
{
|
||||
var drop = sorts.GetComponent<Dropdown>();
|
||||
drop.options = MapFilterOptions.sorts;
|
||||
drop.value = 3;
|
||||
drop.value = 0;
|
||||
drop.onValueChanged.AddListener((int index)=>
|
||||
{
|
||||
sort = drop.options[index].text;
|
||||
|
||||
@@ -84,7 +84,10 @@ public class UserInfoController : PFUIPanel
|
||||
infoPanel.Find("Weight").Find("Value").GetComponent<Text>().text = $"{user.Weight}KG";
|
||||
infoPanel.Find("BW").Find("Value").GetComponent<Text>().text = $"{user.BicycleWeight}KG";
|
||||
infoPanel.Find("WD").Find("Value").GetComponent<Text>().text = $"{user.WheelDiameter}MM";
|
||||
|
||||
if (user.Sex == 2)
|
||||
{
|
||||
infoPanel.Find("SexIcon").GetComponent<Image>().sprite = Resources.Load<Sprite>("Images/woman");
|
||||
}
|
||||
summaryPanel.Find("Number").Find("Value").GetComponent<Text>().text = summary.Count.ToString();
|
||||
summaryPanel.Find("Time").Find("Value").GetComponent<Text>().text = summary.TotalTicks.ToString();
|
||||
summaryPanel.Find("KM").Find("Value").GetComponent<Text>().text = summary.TotalDistance.ToString();
|
||||
|
||||
@@ -36,7 +36,7 @@ public class RouteItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandle
|
||||
row2 = left.Find("Main").Find("Row2");
|
||||
Utils.DisplayImage(StartCoroutine, transform.Find("CoverImage").GetComponent<RawImage>(), result.RouteImage);
|
||||
left.Find("Main").Find("Name").GetComponent<Text>().text = result.RouteName;
|
||||
left.Find("Main").Find("Time").GetComponent<Text>().text = result.CreateTime.ToString("yyyy-MM-dd HH-mm-ss");
|
||||
left.Find("Main").Find("Time").GetComponent<Text>().text = result.CreateTime.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
row1.Find("Time").GetComponent<Text>().text = $"<color={titleColor}>Riding time:</color>{result.TrainingTime}";
|
||||
row1.Find("Distance").GetComponent<Text>().text = $"<color={titleColor}>Mileage:</color>{result.EndDistance.ToString("#0.00")}KM";
|
||||
row1.Find("Times").GetComponent<Text>().text = $"<color={titleColor}>Times:</color>{result.Count}";
|
||||
|
||||
@@ -97,19 +97,43 @@ namespace Assets.Scripts
|
||||
_toastDict = value;
|
||||
}
|
||||
}
|
||||
private static Dictionary<string, string> _deviceDict;
|
||||
public static Dictionary<string, string> deviceDict
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_deviceDict == null)
|
||||
{
|
||||
_deviceDict = new Dictionary<string, string>
|
||||
{
|
||||
{"Trainer","Smart Trainer|Images/Devices/Trainer_3" },
|
||||
{"Power","Power Meter|Images/Devices/Power_3" },
|
||||
{"Cadence","Cadence Sensor|Images/Devices/Cadence_3" },
|
||||
{"HeartRate","Heart Rate Monitor|Images/Devices/Heart Rate_3" },
|
||||
{"SpeedCadence","Speed Meter|Images/Devices/Speed_3" },
|
||||
};
|
||||
}
|
||||
return _deviceDict;
|
||||
}
|
||||
private set
|
||||
{
|
||||
_deviceDict = value;
|
||||
}
|
||||
}
|
||||
public static void showToast(GameObject game,string text,int duration = 1,int type = 0)
|
||||
{
|
||||
//type 0错误 1正确
|
||||
var parent = Utils.FindUpParent(game.transform);
|
||||
var toast = parent.Find("ToastContainer");
|
||||
if (toast == null)
|
||||
if (toast != null)
|
||||
{
|
||||
var newToast = MonoBehaviour.Instantiate(Resources.Load<GameObject>("UI/Prefab/ToastContainer"));
|
||||
newToast.name = "ToastContainer";
|
||||
newToast.GetComponent<RectTransform>().position = new Vector3(Screen.width / 2, Screen.height / 2, 0);
|
||||
newToast.transform.parent = parent;
|
||||
toast = newToast.transform;
|
||||
MonoBehaviour.DestroyImmediate(toast.gameObject);
|
||||
}
|
||||
var newToast = MonoBehaviour.Instantiate(Resources.Load<GameObject>("UI/Prefab/ToastContainer"));
|
||||
newToast.name = "ToastContainer";
|
||||
newToast.GetComponent<RectTransform>().position = new Vector3(Screen.width / 2, Screen.height / 2, 0);
|
||||
newToast.transform.parent = parent;
|
||||
toast = newToast.transform;
|
||||
var toastStyle = toastDict[type].Split('|');
|
||||
toast.Find("Image").GetComponent<Image>().sprite = Resources.Load<Sprite>(toastStyle[0]);
|
||||
toast.GetComponent<Image>().color = HexToColorHtml(toastStyle[1]);
|
||||
|
||||
Reference in new issue
Block a user