From 9a4b76398009cf76c508d61f7e48fb6f5cb7ac2d Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期二, 21 七月 2020 09:46:53 +0800
Subject: [PATCH] 请合并最新多功能面板代码
---
ZigbeeApp/Shared/Phone/UserCenter/Suggestion/FeedbackForm.cs | 127 ++++++++++++++++++++++++++++++------------
1 files changed, 91 insertions(+), 36 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Suggestion/FeedbackForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Suggestion/FeedbackForm.cs
index 39e8883..2e36d6f 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Suggestion/FeedbackForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Suggestion/FeedbackForm.cs
@@ -53,8 +53,8 @@
bodyFrameLayout.AddChidren(frameInput);
//瀛楁暟
- var btnFild = new NormalViewControl(120, 60, true);
- btnFild.X = frameInput.Width - ControlCommonResourse.XXLeft - Application.GetRealWidth(80);
+ var btnFild = new NormalViewControl(150, 60, true);
+ btnFild.X = frameInput.Width - ControlCommonResourse.XXLeft - Application.GetRealWidth(150);
btnFild.Y = Application.GetRealHeight(503);
btnFild.TextColor = UserCenterColor.Current.TextGrayColor1;
btnFild.TextSize = 12;
@@ -63,12 +63,17 @@
frameInput.AddChidren(btnFild);
//鎮ㄧ殑鍙嶉鍜屾剰瑙佷細璁╂垜浠彉寰楁洿濂�
- var txtInput = new TextInputControl(bodyFrameLayout.Width - ControlCommonResourse.XXLeft * 2, Application.GetRealHeight(470), false);
+ var txtInput = new EditTextView();
+ txtInput.Width = bodyFrameLayout.Width - ControlCommonResourse.XXLeft * 2;
+ txtInput.Height = Application.GetRealHeight(470);
txtInput.Y = Application.GetRealHeight(32);
txtInput.TextAlignment = TextAlignment.TopLeft;
txtInput.Gravity = Gravity.CenterHorizontal;
+ txtInput.TextColor = UserCenterColor.Current.TextColor1;
+ txtInput.PlaceholderTextColor = UserCenterColor.Current.TextGrayColor1;
txtInput.PlaceholderText = Language.StringByID(R.MyInternationalizationString.uYouSuggestionMsg);
frameInput.AddChidren(txtInput);
+ txtInput.InitIosPlaceholderUILabelWithHeight(Application.GetRealHeight(60));
txtInput.TextChangeEventHandler += (sender, txtvalue) =>
{
if (this.suggestionCount <= 0)
@@ -77,21 +82,30 @@
}
int length = txtvalue.Length;
- if (length > 500)
- {
- if (btnSubmit.CanClick == true) { btnSubmit.CanClick = false; }
- btnFild.Text = "0";
- return;
- }
if (length == 0)
{
if (btnSubmit.CanClick == true) { btnSubmit.CanClick = false; }
}
else
{
- if (btnSubmit.CanClick == false) { btnSubmit.CanClick = true; }
+ if (btnSubmit.CanClick == false)
+ {
+ //鍙樼伆鑹插瓧浣�
+ btnFild.TextColor = UserCenterColor.Current.TextGrayColor1;
+ btnSubmit.CanClick = true;
+ }
}
btnFild.Text = (500 - length).ToString();
+
+ if (length > 500)
+ {
+ if (btnSubmit.CanClick == true)
+ {
+ btnSubmit.CanClick = false;
+ //鍙樼孩鑹插瓧浣�
+ btnFild.TextColor = Common.ZigbeeColor.Current.GXCTextRed;
+ }
+ }
};
var framType = new FrameLayout();
@@ -111,7 +125,7 @@
btnType.TextID = R.MyInternationalizationString.uSuggestionType;
framType.AddChidren(btnType);
//Bug
- var frameBug = new FrameLayoutControl();
+ var frameBug = new FrameLayoutStatuControl();
frameBug.UseClickStatu = false;
frameBug.Width = Application.GetRealWidth(200);
frameBug.X = Application.GetRealWidth(314);
@@ -139,7 +153,7 @@
}
};
//浼樺寲
- var frameOptimization = new FrameLayoutControl();
+ var frameOptimization = new FrameLayoutStatuControl();
frameOptimization.UseClickStatu = false;
frameOptimization.Width = Application.GetRealWidth(200);
frameOptimization.X = Application.GetRealWidth(524);
@@ -167,7 +181,7 @@
}
};
//鏂伴渶姹�
- var frameDemand = new FrameLayoutControl();
+ var frameDemand = new FrameLayoutStatuControl();
frameDemand.UseClickStatu = false;
frameDemand.Width = Application.GetRealWidth(200);
frameDemand.X = Application.GetRealWidth(734);
@@ -200,16 +214,16 @@
frameEmail.BackgroundColor = UserCenterColor.Current.White;
frameEmail.Y = framType.Bottom + Application.GetRealHeight(23);
bodyFrameLayout.AddChidren(frameEmail);
- //閭鍦板潃
- var btnEmail = new NormalViewControl(220, 60, true);
- btnEmail.X = ControlCommonResourse.XXLeft;
- btnEmail.Gravity = Gravity.CenterVertical;
- btnEmail.TextID = R.MyInternationalizationString.uEmailAddress;
- frameEmail.AddChidren(btnEmail);
- var txtEmail = new TextInputControl(500, 60, true);
+ //鑱旂郴鏂瑰紡
+ var btnContact = new NormalViewControl(220, 60, true);
+ btnContact.X = ControlCommonResourse.XXLeft;
+ btnContact.Gravity = Gravity.CenterVertical;
+ btnContact.TextID = R.MyInternationalizationString.uContactInformation;
+ frameEmail.AddChidren(btnContact);
+ var txtEmail = new TextInputControl(720, 60, true);
txtEmail.X = Application.GetRealWidth(314);
txtEmail.Gravity = Gravity.CenterVertical;
- txtEmail.PlaceholderText = Language.StringByID(R.MyInternationalizationString.uPleaseInputYouEmailAddress);
+ txtEmail.PlaceholderText = Language.StringByID(R.MyInternationalizationString.uPleaseInputYourContactInformation);
frameEmail.AddChidren(txtEmail);
//鎻愪氦
@@ -219,17 +233,16 @@
btnSubmit.CanClick = false;
btnSubmit.ButtonClickEvent += (sender, e) =>
{
+ //濡傛灉鏄櫄鎷熶綇瀹�,鍒欐鍔熻兘鏃犳晥
+ if (Common.Config.Instance.Home.IsVirtually == true)
+ {
+ return;
+ }
//涓婁紶鎰忚
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");
@@ -258,7 +271,7 @@
/// <param name="email"></param>
private void UploadSuggestion(string strContent, string email)
{
- HdlThreadLogic.Current.RunThread(async() =>
+ HdlThreadLogic.Current.RunThread(() =>
{
var pra = new
{
@@ -268,26 +281,68 @@
OpinionFeedbackType = this.typeMode,
Email = email
};
- var result = await UserCenterLogic.GetResultStatuByRequestHttps("App/AddOpinionFeedback", false, pra);
+ var result = UserCenterLogic.GetResultStatuByRequestHttps("App/AddOpinionFeedback", false, pra);
if (result == true)
{
//淇濆瓨娆℃暟
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(() =>
{
- this.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.uSubmitSuccessMsg));
- //鍏抽棴鐣岄潰
- this.CloseForm();
+ //鏄剧ず鎴愬姛鐨勭晫闈�
+ this.ShowSuccessMsg();
});
}
});
}
+ /// <summary>
+ /// 鏄剧ず鎴愬姛鐨勭晫闈�
+ /// </summary>
+ private void ShowSuccessMsg()
+ {
+ var frameBack = new FrameLayout();
+ frameBack.BackgroundColor = 0x80000000;
+ this.AddChidren(frameBack);
+
+ var frameMsg = new FrameLayout();
+ frameMsg.BackgroundColor = UserCenterColor.Current.White;
+ frameMsg.Width = Application.GetRealWidth(622);
+ frameMsg.Height = Application.GetRealHeight(317);
+ frameMsg.Radius = (uint)Application.GetRealHeight(17);
+ frameMsg.Gravity = Gravity.CenterHorizontal;
+ frameMsg.Y = Application.GetRealHeight(792);
+ frameBack.AddChidren(frameMsg);
+
+ //鎻愮ず
+ var btnTitle = new NormalViewControl(492, 65, true);
+ btnTitle.Y = Application.GetRealHeight(68);
+ btnTitle.Gravity = Gravity.CenterHorizontal;
+ btnTitle.TextID = R.MyInternationalizationString.NormalTip;
+ btnTitle.TextAlignment = TextAlignment.Center;
+ btnTitle.TextColor = 0xFF333443;
+ frameMsg.AddChidren(btnTitle);
+
+ //鎮ㄧ殑鍙嶉宸叉垚鍔熸彁浜�
+ var btnSuccess = new NormalViewControl(frameMsg.Width, Application.GetRealHeight(60), false);
+ btnSuccess.Y = Application.GetRealHeight(166);
+ btnSuccess.TextAlignment = TextAlignment.Center;
+ btnSuccess.TextColor = UserCenterColor.Current.TextGrayColor1;
+ btnSuccess.TextID = R.MyInternationalizationString.uSubmitSuccessMsg;
+ frameMsg.AddChidren(btnSuccess);
+
+ HdlThreadLogic.Current.RunThread(() =>
+ {
+ System.Threading.Thread.Sleep(2000);
+ HdlThreadLogic.Current.RunMain(() =>
+ {
+ this.CloseForm();
+ });
+ });
+ }
+
#endregion
}
}
--
Gitblit v1.8.0