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/Gateway/Add/MiniGatewaySelectNetworkForm.cs |  207 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 207 insertions(+), 0 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/MiniGatewaySelectNetworkForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/MiniGatewaySelectNetworkForm.cs
new file mode 100755
index 0000000..8b40176
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/MiniGatewaySelectNetworkForm.cs
@@ -0,0 +1,207 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Shared.Phone.UserCenter.GatewayAdd
+{
+    /// <summary>
+    /// Mini缃戝叧閫夋嫨缃戠粶鐨勭晫闈�
+    /// </summary>
+    public class MiniGatewaySelectNetworkForm : EditorCommonForm
+    {
+        #region 鈻� 鍙橀噺澹版槑___________________________
+
+        #endregion
+
+        #region 鈻� 鍒濆鍖朹____________________________
+
+        /// <summary>
+        /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
+        /// </summary>
+        public void ShowForm()
+        {
+            //璁剧疆澶撮儴淇℃伅
+            base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uAddMiniGateway));
+
+            //鍒濆鍖栦腑閮ㄤ俊鎭�
+            this.InitMiddleFrame();
+        }
+
+        /// <summary>
+        /// 鍒濆鍖栦腑閮ㄤ俊鎭�
+        /// </summary>
+        private void InitMiddleFrame()
+        {
+            bodyFrameLayout.RemoveAll();
+
+            var frameBack = new FrameLayout();
+            frameBack.Height = Application.GetRealHeight(409);
+            frameBack.BackgroundColor = UserCenterColor.Current.White;
+            bodyFrameLayout.AddChidren(frameBack);
+
+            //璇烽�夋嫨缃戠粶
+            var btnTitle = new NormalViewControl(600, 64, true);
+            btnTitle.X = ControlCommonResourse.XXLeft;
+            btnTitle.Y = Application.GetRealHeight(30);
+            btnTitle.TextSize = 15;
+            btnTitle.TextID = R.MyInternationalizationString.uPleaseSelectNetwork;
+            frameBack.AddChidren(btnTitle);
+
+            //WIFI
+            var rowWifi = new FrameCaptionInputControl("WiFi", "");
+            rowWifi.Y = Application.GetRealHeight(124);
+            frameBack.AddChidren(rowWifi);
+            rowWifi.InitControl();
+            rowWifi.AddBottomLine();
+            rowWifi.txtInput.PlaceholderText = Language.StringByID(R.MyInternationalizationString.uPleaseInputHomeWifiAccount);
+            //涓嬫媺鍥炬爣鏄亸鍙崇殑
+            rowWifi.RightOffset = -Application.GetRealWidth(18);
+            var btnDrop = rowWifi.AddMostRightEmptyIcon(58, 58);
+            btnDrop.UnSelectedImagePath = "Item/Down.png";
+            rowWifi.ChangedChidrenBindMode(btnDrop, ChidrenBindMode.NotBind);
+            btnDrop.ButtonClickEvent += (sender, e) =>
+            {
+                //鏄剧ずWifi涓嬫媺鍒楄〃
+                //this.ShowWifiListView(rowWifi);
+            };
+
+            //瀵嗙爜
+            var rowPsw = new FrameCaptionInputControl(Language.StringByID(R.MyInternationalizationString.uPassword), string.Empty);
+            rowPsw.Y = rowWifi.Bottom + Application.GetRealHeight(9);
+            frameBack.AddChidren(rowPsw);
+            rowPsw.InitControl();
+            rowPsw.txtInput.SecureTextEntry = true;
+            rowPsw.txtInput.PlaceholderText = Language.StringByID(R.MyInternationalizationString.uPleaseInputWifiPassword);
+            var btnView = rowPsw.AddMostRightEmptyIcon(81, 81);
+            btnView.UnSelectedImagePath = "Item/HidenPWD.png";
+            btnView.SelectedImagePath = "Item/UnHidenPWD.png";
+            rowPsw.ChangedChidrenBindMode(btnView, ChidrenBindMode.NotBind);
+            btnView.ButtonClickEvent += (sender, e) =>
+            {
+                btnView.IsSelected = !btnView.IsSelected;
+                rowPsw.txtInput.SecureTextEntry = !rowPsw.txtInput.SecureTextEntry;
+            };
+
+            var btnMsg = new NormalViewControl(rowPsw.txtInput.Width, false);
+            btnMsg.X = ControlCommonResourse.XXLeft;
+            btnMsg.Y = frameBack.Bottom + Application.GetRealHeight(23);
+            btnMsg.TextSize = 12;
+            btnMsg.Height = Application.GetRealHeight(40);
+            btnMsg.TextColor = UserCenterColor.Current.ErrorColor;
+            bodyFrameLayout.AddChidren(btnMsg);
+
+            //鏌ョ湅甯姪
+            var btnHelp = this.AddHelpControl();
+            btnHelp.ButtonClickEvent += (sender, e) =>
+            {
+                var form = new AddGatewayHelpForm();
+                form.AddForm("Mini");
+            };
+
+            //涓嬩竴姝�
+            var btnNext = new BottomClickButton();
+            btnNext.TextID = R.MyInternationalizationString.uNextway;
+            bodyFrameLayout.AddChidren(btnNext);
+
+            btnNext.MouseUpEventHandler += (sender, e) =>
+            {
+                btnMsg.Text = string.Empty;
+                if (rowWifi.Text == string.Empty)
+                {
+                    //璇疯緭鍏ュ搴璚IFI璐﹀彿
+                    btnMsg.Text = Language.StringByID(R.MyInternationalizationString.uPleaseInputHomeWifiAccount);
+                    return;
+                }
+                if (rowPsw.Text == string.Empty)
+                {
+                    //璇疯緭鍏ifi瀵嗙爜
+                    btnMsg.Text = Language.StringByID(R.MyInternationalizationString.uPleaseInputWifiPassword);
+                    return;
+                }
+                //鍙戦�佸瘑鐮�
+                var result = HdlWifiLogic.Current.SendApHomeWifiPassword(rowWifi.Text, rowPsw.Text);
+                if (result == false)
+                {
+                    //瀵嗙爜鍙戦�佸け璐�
+                    this.ShowMassage(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uSendPasswordFail));
+                    return;
+                }
+
+                this.CloseForm();
+                var form = new MiniGatewayDirection3Form();
+                form.AddForm();
+            };
+        }
+
+        #endregion
+
+        #region 鈻� 鏄剧ずWifi涓嬫媺鍒楄〃___________________
+
+        /// <summary>
+        /// 鏄剧ずWifi涓嬫媺鍒楄〃
+        /// </summary>
+        /// <param name="rowWifi"></param>
+        private void ShowWifiListView(FrameCaptionInputControl rowWifi)
+        {
+            //涓�涓彲浠ラ伄浣廈ody鐨勪笢瑗�
+            var frameTran = new NormalFrameLayout();
+            frameTran.Height = bodyFrameLayout.Height;
+            frameTran.BackgroundColor = UserCenterColor.Current.DialogBackColor;
+            bodyFrameLayout.AddChidren(frameTran);
+            frameTran.ButtonClickEvent += (sender, e) =>
+            {
+                frameTran.RemoveFromParent();
+            };
+            //鐧借壊鑳屾櫙妗�
+            var frameList = new NormalFrameLayout();
+            frameList.Y = rowWifi.Bottom;
+            frameList.Gravity = Gravity.CenterHorizontal;
+            frameList.Width = frameTran.Width - ControlCommonResourse.XXLeft * 2;
+            frameList.Height = this.GetPictrueRealSize(1200);
+            frameList.Radius = (uint)Application.GetRealWidth(17);
+            frameList.BackgroundColor = UserCenterColor.Current.White;
+            frameTran.AddChidren(frameList);
+            //鍒楄〃鎺т欢
+            var listView = new VerticalListControl();
+            listView.Height = frameList.Height;
+            frameList.AddChidren(listView);
+
+            for (int i = 1; i <= 10; i++)
+            {
+                var frameRow = new FrameRowControl();
+                listView.AddChidren(frameRow);
+                //wifi鍚嶅瓧
+                var btnWifi = new NormalViewControl(frameRow.Width, frameRow.Height - ControlCommonResourse.BottomLineHeight, false);
+                btnWifi.X = ControlCommonResourse.XXLeft;
+                btnWifi.Text = "Application Software" + i;
+                frameRow.AddChidren(btnWifi, ChidrenBindMode.BindEvent);
+                //搴曠嚎
+                var btnLine = new NormalViewControl(frameRow.Width, ControlCommonResourse.BottomLineHeight, false);
+                btnLine.BackgroundColor = UserCenterColor.Current.ButtomLine;
+                btnLine.Y = btnWifi.Bottom;
+                frameRow.AddChidren(btnLine, ChidrenBindMode.BindEvent);
+                frameRow.ButtonClickEvent += (sender, e) =>
+                {
+                    rowWifi.Text = btnWifi.Text;
+                    frameTran.RemoveFromParent();
+                };
+            }
+        }
+        #endregion
+
+        #region 鈻� 鐣岄潰鍏抽棴___________________________
+
+        /// <summary>
+        /// 鐣岄潰鍏抽棴
+        /// </summary>
+        public override void CloseFormBefore()
+        {
+            //鍏抽棴Tcp閾炬帴
+            HdlWifiLogic.Current.CloseApTcpConnection();
+
+            base.CloseFormBefore();
+        }
+
+        #endregion
+    }
+}

--
Gitblit v1.8.0