From f14dcfd967404e197e7ec995ca8d6f2b090d3b7d Mon Sep 17 00:00:00 2001 From: xm <1271024303@qq.com> Date: 星期五, 11 九月 2020 09:16:59 +0800 Subject: [PATCH] 优化多功能面板:绑定温湿度传感器目标,和设备列表回路显示。优化数据矫正功能温湿度度不设置的情况。优化门锁时间设置最后一天和最后最后一个月的时间显示等 细节 --- ZigbeeApp/Shared/Phone/UserCenter/Suggestion/FeedbackForm.cs | 49 +++++++++++++++++++++++-------------------------- 1 files changed, 23 insertions(+), 26 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Suggestion/FeedbackForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Suggestion/FeedbackForm.cs old mode 100755 new mode 100644 index 66bb4c1..e388a4f --- a/ZigbeeApp/Shared/Phone/UserCenter/Suggestion/FeedbackForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Suggestion/FeedbackForm.cs @@ -74,21 +74,35 @@ txtInput.PlaceholderText = Language.StringByID(R.MyInternationalizationString.uYouSuggestionMsg); frameInput.AddChidren(txtInput); txtInput.InitIosPlaceholderUILabelWithHeight(Application.GetRealHeight(60)); - txtInput.TextChangeEventHandler += (sender, txtvalue) => + //杈撳叆鍊兼敼鍙樹簨浠� + Action<View, string> txtInputChangedEvent = (sender, txtValue) => { if (this.suggestionCount <= 0) { return; } - int length = txtvalue.Length; + var newValue = txtValue; + //濡傛灉杈撳叆鐨勫��,宸茬粡澶т簬鎸囧畾鐨勬暟,鍒欐埅鍙� + if (newValue.Length > 500) + { + //鎴彇鎸囧畾鐨刡yte瀛楄妭 + newValue = newValue.Substring(0, 500); + txtInput.Text = newValue; +#if Android + //灏嗗厜鏍囪嚦浜庢渶鍚� + txtInput.SetSelectionEnd(); +#endif + } + + int length = newValue.Length; if (length == 0) { if (btnSubmit.CanClick == true) { btnSubmit.CanClick = false; } } else { - if (btnSubmit.CanClick == false) + if (btnSubmit.CanClick == false) { //鍙樼伆鑹插瓧浣� btnFild.TextColor = UserCenterColor.Current.TextGrayColor1; @@ -96,17 +110,8 @@ } } btnFild.Text = (500 - length).ToString(); - - if (length > 500) - { - if (btnSubmit.CanClick == true) - { - btnSubmit.CanClick = false; - //鍙樼孩鑹插瓧浣� - btnFild.TextColor = Common.ZigbeeColor.Current.GXCTextRed; - } - } }; + txtInput.TextChangeEventHandler += txtInputChangedEvent; var framType = new FrameLayout(); framType.Height = Application.GetRealHeight(150); @@ -242,13 +247,7 @@ this.UploadSuggestion(txtInput.Text, txtEmail.Text); }; - - var strFile = System.IO.Path.Combine(Shared.IO.FileUtils.RootPath, Common.Config.Instance.Guid, DirNameResourse.SuggestionFile); - if (System.IO.File.Exists(strFile) == false) - { - return; - } - var data = UserCenterLogic.LoadFileContent(strFile); + var data = HdlFileLogic.Current.ReadFileTextContent(DirNameResourse.SuggestionFile); if (data != null) { var strNowData = DateTime.Now.ToString("yyyyMMdd"); @@ -266,9 +265,9 @@ } } - #endregion +#endregion - #region 鈻� 涓婁紶鎰忚___________________________ +#region 鈻� 涓婁紶鎰忚___________________________ /// <summary> /// 涓婁紶鎰忚 @@ -292,10 +291,8 @@ { //淇濆瓨娆℃暟 this.suggestionCount--; - var strFile = System.IO.Path.Combine(Shared.IO.FileUtils.RootPath, Common.Config.Instance.Guid, DirNameResourse.SuggestionFile); - var byteData = System.Text.Encoding.UTF8.GetBytes(this.suggestionCount + DateTime.Now.ToString("yyyyMMdd")); //鍐欏叆鍐呭 - Shared.IO.FileUtils.WriteFileByBytes(strFile, byteData); + HdlFileLogic.Current.SaveTextToFile(DirNameResourse.SuggestionFile, this.suggestionCount + DateTime.Now.ToString("yyyyMMdd")); HdlThreadLogic.Current.RunMain(() => { @@ -351,6 +348,6 @@ }); } - #endregion +#endregion } } -- Gitblit v1.8.0