From 0d9f64668fd7350d6a21fd157e32009a96d98134 Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期三, 16 十二月 2020 13:09:08 +0800 Subject: [PATCH] 新云端代码Ver1.2 --- ZigbeeApp/Shared/Phone/UserCenter/Suggestion/FeedbackForm.cs | 55 +++++++++++++++++++++++++------------------------------ 1 files changed, 25 insertions(+), 30 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Suggestion/FeedbackForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Suggestion/FeedbackForm.cs index ea66313..2d50b95 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Suggestion/FeedbackForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Suggestion/FeedbackForm.cs @@ -12,9 +12,9 @@ #region 鈻� 鍙橀噺澹版槑___________________________ /// <summary> - /// 0:Bug銆�1:浼樺寲銆�2:鏂伴渶姹� + /// 1:BUG銆�2:浼樺寲(OPTIMIZE)銆�3:鏂伴渶姹�(REQUIRE) /// </summary> - private int typeMode = 0; + private string typeMode = string.Empty; /// <summary> /// 鎰忚鍙嶉鍓╀綑娆℃暟 /// </summary> @@ -54,7 +54,7 @@ //瀛楁暟 var btnFild = new NormalViewControl(150, 60, true); - btnFild.X = frameInput.Width - ControlCommonResourse.XXLeft - Application.GetRealWidth(150); + btnFild.X = frameInput.Width - HdlControlResourse.XXLeft - Application.GetRealWidth(150); btnFild.Y = Application.GetRealHeight(503); btnFild.TextColor = UserCenterColor.Current.TextGrayColor1; btnFild.TextSize = 12; @@ -64,7 +64,7 @@ //鎮ㄧ殑鍙嶉鍜屾剰瑙佷細璁╂垜浠彉寰楁洿濂� var txtInput = new EditTextView(); - txtInput.Width = bodyFrameLayout.Width - ControlCommonResourse.XXLeft * 2; + txtInput.Width = bodyFrameLayout.Width - HdlControlResourse.XXLeft * 2; txtInput.Height = Application.GetRealHeight(470); txtInput.Y = Application.GetRealHeight(32); txtInput.TextAlignment = TextAlignment.TopLeft; @@ -125,7 +125,7 @@ //鍙嶉绫诲瀷 var btnType = new NormalViewControl(220, 60, true); - btnType.X = ControlCommonResourse.XXLeft; + btnType.X = HdlControlResourse.XXLeft; btnType.Gravity = Gravity.CenterVertical; btnType.TextID = R.MyInternationalizationString.uSuggestionType; framType.AddChidren(btnType); @@ -154,7 +154,7 @@ btnBugIcon.IsSelected = true; btnOptimizationIcon.IsSelected = false; btnDemandIcon.IsSelected = false; - this.typeMode = 0; + this.typeMode = "BUG"; } }; //浼樺寲 @@ -182,7 +182,7 @@ btnBugIcon.IsSelected = false; btnDemandIcon.IsSelected = false; - this.typeMode = 1; + this.typeMode = "OPTIMIZE"; } }; //鏂伴渶姹� @@ -210,7 +210,7 @@ btnBugIcon.IsSelected = false; btnOptimizationIcon.IsSelected = false; - this.typeMode = 2; + this.typeMode = "REQUIRE"; } }; @@ -221,7 +221,7 @@ bodyFrameLayout.AddChidren(frameEmail); //鑱旂郴鏂瑰紡 var btnContact = new NormalViewControl(220, 60, true); - btnContact.X = ControlCommonResourse.XXLeft; + btnContact.X = HdlControlResourse.XXLeft; btnContact.Gravity = Gravity.CenterVertical; btnContact.TextID = R.MyInternationalizationString.uContactInformation; frameEmail.AddChidren(btnContact); @@ -247,7 +247,7 @@ this.UploadSuggestion(txtInput.Text, txtEmail.Text); }; - var data = HdlFileLogic.Current.ReadFileTextContent(DirNameResourse.SuggestionFile); + var data = HdlFileLogic.Current.ReadFileTextContent(HdlFileNameResourse.SuggestionFile); if (data != null) { var strNowData = DateTime.Now.ToString("yyyyMMdd"); @@ -278,28 +278,23 @@ { HdlThreadLogic.Current.RunThread(() => { - var pra = new + var pra = new { contactWay = email, content = strContent, feedbackType = this.typeMode }; + var result = HdlHttpLogic.Current.RequestResponseFromZigbeeHttps("home-wisdom/feedback/add", RestSharp.Method.POST, pra); + //妫�娴嬬姸鎬佺爜 + if (HdlCheckLogic.Current.CheckNetCode(result, ShowNetCodeMode.YES) == false) { - RequestVersion = Common.CommonPage.RequestVersion, - LoginAccessToken = Common.Config.Instance.Token, - Content = strContent, - OpinionFeedbackType = this.typeMode, - Email = email - }; - var result = UserCenterLogic.GetResultStatuByRequestHttps("App/AddOpinionFeedback", false, pra); - if (result == true) - { - //淇濆瓨娆℃暟 - this.suggestionCount--; - //鍐欏叆鍐呭 - HdlFileLogic.Current.SaveTextToFile(DirNameResourse.SuggestionFile, this.suggestionCount + DateTime.Now.ToString("yyyyMMdd")); - - HdlThreadLogic.Current.RunMain(() => - { - //鏄剧ず鎴愬姛鐨勭晫闈� - this.ShowSuccessMsg(); - }); + return; } + //淇濆瓨娆℃暟 + this.suggestionCount--; + //鍐欏叆鍐呭 + HdlFileLogic.Current.SaveTextToFile(HdlFileNameResourse.SuggestionFile, this.suggestionCount + DateTime.Now.ToString("yyyyMMdd")); + + HdlThreadLogic.Current.RunMain(() => + { + //鏄剧ず鎴愬姛鐨勭晫闈� + this.ShowSuccessMsg(); + }); }); } -- Gitblit v1.8.0