From 9f326f4000847e6167d8166fa2f6a66f53cb3734 Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期四, 17 十二月 2020 09:07:13 +0800 Subject: [PATCH] 新云端Ver1.3 --- ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApSelectNetworkForm.cs | 127 ++++++++++++++++++++++++++++++++++++------ 1 files changed, 108 insertions(+), 19 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApSelectNetworkForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApSelectNetworkForm.cs index 1c4d446..5f06f89 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApSelectNetworkForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Gateway/Add/WirelessApSelectNetworkForm.cs @@ -38,51 +38,61 @@ //璇烽�夋嫨缃戠粶 var btnTitle = new NormalViewControl(600, 64, true); - btnTitle.X = ControlCommonResourse.XXLeft; + btnTitle.X = HdlControlResourse.XXLeft; btnTitle.Y = Application.GetRealHeight(30); btnTitle.TextSize = 15; btnTitle.TextID = R.MyInternationalizationString.uPleaseSelectNetwork; frameBack.AddChidren(btnTitle); //WIFI - var rowWifi = new FrameCaptionInputControl("WiFi", string.Empty); + 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 btnPsw = new FrameCaptionInputControl(Language.StringByID(R.MyInternationalizationString.uPassword), string.Empty); - btnPsw.Y = rowWifi.Bottom + Application.GetRealHeight(9); - frameBack.AddChidren(btnPsw); - btnPsw.InitControl(); - btnPsw.txtInput.SecureTextEntry = true; - btnPsw.txtInput.PlaceholderText = Language.StringByID(R.MyInternationalizationString.uPleaseInputWifiPassword); - var btnView = btnPsw.AddMostRightEmptyIcon(81, 81); + 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"; - btnPsw.ChangedChidrenBindMode(btnView, ChidrenBindMode.NotBind); + rowPsw.ChangedChidrenBindMode(btnView, ChidrenBindMode.NotBind); btnView.ButtonClickEvent += (sender, e) => { btnView.IsSelected = !btnView.IsSelected; - btnPsw.txtInput.SecureTextEntry = !btnPsw.txtInput.SecureTextEntry; + rowPsw.txtInput.SecureTextEntry = !rowPsw.txtInput.SecureTextEntry; }; - var btnMsg = new NormalViewControl(btnPsw.txtInput.Width, false); - btnMsg.X = ControlCommonResourse.XXLeft; + var btnMsg = new NormalViewControl(rowPsw.txtInput.Width, false); + btnMsg.X = HdlControlResourse.XXLeft; btnMsg.Y = frameBack.Bottom + Application.GetRealHeight(23); btnMsg.TextSize = 12; btnMsg.Height = Application.GetRealHeight(40); - btnMsg.TextColor = UserCenterColor.Current.Red; + btnMsg.TextColor = UserCenterColor.Current.ErrorColor; bodyFrameLayout.AddChidren(btnMsg); //鏌ョ湅甯姪 var btnHelp = this.AddHelpControl(); btnHelp.ButtonClickEvent += (sender, e) => { - var form = new DeviceDirection.DeviceDirectionHelpForm(); - form.AddForm("WirelessUdp"); + var form = new AddGatewayHelpForm(); + form.AddForm("Ap"); }; //涓嬩竴姝� @@ -99,17 +109,96 @@ btnMsg.Text = Language.StringByID(R.MyInternationalizationString.uPleaseInputHomeWifiAccount); return; } - if (btnPsw.Text == string.Empty) + if (rowPsw.Text == string.Empty) { //璇疯緭鍏ifi瀵嗙爜 btnMsg.Text = Language.StringByID(R.MyInternationalizationString.uPleaseInputWifiPassword); return; } - var form = new WirelessApDirection3Form(); - this.AddFromAndRemoveNowForm(form); + //鍙戦�佸瘑鐮� + 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 - HdlControlResourse.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 - HdlControlResourse.BottomLineHeight, false); + btnWifi.X = HdlControlResourse.XXLeft; + btnWifi.Text = "Application Software" + i; + frameRow.AddChidren(btnWifi, ChidrenBindMode.BindEvent); + //搴曠嚎 + var btnLine = new NormalViewControl(frameRow.Width, HdlControlResourse.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