From c7698e163e43cea9e7f8ee45f8e3f91c9265cca4 Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期一, 04 十一月 2019 19:11:41 +0800 Subject: [PATCH] 合并了全部的代码 --- ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindTargetsPage.cs | 84 +++++++++++++++++++++++++---------------- 1 files changed, 51 insertions(+), 33 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindTargetsPage.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindTargetsPage.cs index 467fe87..bd43ae4 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindTargetsPage.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/BindTargetsPage.cs @@ -170,11 +170,11 @@ CommonPage.Loading.Start(""); #region 鏁版嵁澶勭悊 var tempDeata = await currentKey.ReadPanelConfigureInfoAsync(); + if (tempDeata != null && tempDeata.deviceStatusReportData != null) { currentClusterID = tempDeata.deviceStatusReportData.CluterID; - //if (currentClusterID == 6) - //{ + foreach (var attr in tempDeata.deviceStatusReportData.AttriBute) { currentKey.panelMode = attr.AttriButeData; @@ -183,44 +183,76 @@ var bindDeviceListTemp = new System.Collections.Generic.List<BindListResponseObj> { }; var bindSceneListTemp = new System.Collections.Generic.List<BindListResponseObj> { }; - if (getBindList != null) + if (getBindList != null && getBindList.getAllBindResponseData != null) { - if (getBindList.getAllBindResponseData != null) + foreach (var b in getBindList.getAllBindResponseData.BindList) { - foreach (var b in getBindList.getAllBindResponseData.BindList) + if (b.BindCluster == currentClusterID) { - if (b.BindCluster == currentClusterID) + if (b.BindCluster == 6) { - if (b.BindCluster == 6) - { - if (b.BindType == 2) - { - bindSceneListTemp.Add(b); - } - else - { - bindDeviceListTemp.Add(b); - } + if (b.BindType == 2) + { + bindSceneListTemp.Add(b); } else { - currentKey.bindList.Add(b); + bindDeviceListTemp.Add(b); } + } + else + { + currentKey.bindList.Add(b); } } } } + else + { + var btn = new Button() + { + Gravity = Gravity.Center, + }; + this.midFrameLayout.AddChidren(btn); + Application.RunOnMainThread(() => + { + new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btn); + }); + } + if (currentKey.panelMode == 1) { currentKey.bindList = bindSceneListTemp; + currentKey.currentKeySelectModeText = Language.StringByID(R.MyInternationalizationString.AddScene); } else if (currentKey.panelMode == 100 || currentKey.panelMode == 101 || currentKey.panelMode == 102) { currentKey.bindList = bindDeviceListTemp; + currentKey.currentKeySelectModeText = Language.StringByID(R.MyInternationalizationString.AddSwitch); + } + else if (currentKey.panelMode == 200 || currentKey.panelMode == 201 || currentKey.panelMode == 202 || currentKey.panelMode == 203 || currentKey.panelMode == 204 || currentKey.panelMode == 205) + { + currentKey.currentKeySelectModeText = Language.StringByID(R.MyInternationalizationString.AddDimmer); + } + else if (currentKey.panelMode == 300 || currentKey.panelMode == 301 || currentKey.panelMode == 302 || currentKey.panelMode == 303 || currentKey.panelMode == 304) + { + currentKey.currentKeySelectModeText = Language.StringByID(R.MyInternationalizationString.AddCurtain); } } #endregion + } + else + { + Application.RunOnMainThread(() => + { + var btn = new Button() + { + Gravity = Gravity.Center, + }; + this.midFrameLayout.AddChidren(btn); + new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btn); + }); } } catch @@ -296,20 +328,6 @@ midVerticalScrolViewLayout.Y = topMidVerticalScrolViewLayout.Bottom; midVerticalScrolViewLayout.Height = this.midFrameLayout.Height; BackgroundColor = Shared.Common.ZigbeeColor.Current.XMMidFrameLayout; - - //var tempDeata = await currentKey.ReadPanelConfigureInfoAsync(); - //if (tempDeata != null && tempDeata.deviceStatusReportData != null) - //{ - // currentClusterID = tempDeata.deviceStatusReportData.CluterID; - // if (currentClusterID == 6) - // { - // foreach (var attr in tempDeata.deviceStatusReportData.AttriBute) - // { - // curModeId = attr.AttriButeData; - // currentKey.panelMode = curModeId; - // } - // } - //} if (currentKey.panelMode == 1) { @@ -568,8 +586,8 @@ RefreshList(); //濡傛灉鏄満鏅紝鐢ㄦ埛鍒犻櫎娓呯┖褰撳墠鍒版埧闂村垪琛� currentKey.RoomId = ""; + currentKey.ReSave(); } - CommonPage.Loading.Hide(); } @@ -679,7 +697,6 @@ currentKey.currentKeySelectModeText = btnMethodText.Text; oldbuttonText.TextColor = Shared.Common.ZigbeeColor.Current.XMBlack; } - if (currentKey.currentKeySelectModeText == Language.StringByID(R.MyInternationalizationString.AddScene)) { if (currentKey.bindList.Count != 0) @@ -1000,6 +1017,7 @@ RefreshList(); //濡傛灉鏄満鏅紝鐢ㄦ埛鍒犻櫎娓呯┖褰撳墠鍒版埧闂村垪琛� currentKey.RoomId = ""; + currentKey.ReSave(); return 0; break; case 1: -- Gitblit v1.8.0