黄学彪
2020-12-16 0d9f64668fd7350d6a21fd157e32009a96d98134
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();
                });
            });
        }