HDL Home App 第二版本 旧平台金堂用 正在使用
黄学彪
2020-06-10 dce6c3481a37216292724013ff9d2b75ceb82f86
ZigbeeApp/Shared/Phone/UserCenter/Device/Bind/ChooseKeyModePage.cs
@@ -115,15 +115,19 @@
            #region 数据处理
            KeyModeList();
            btnFinifh.MouseUpEventHandler += async (sender, e) =>
            btnFinifh.MouseUpEventHandler += (sender, e) =>
            {
                oldTargetList.Clear();
                bool isFinish = false;
                btnFinifh.Enable = false;
                btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect;
               System.Threading.Tasks.Task.Run(() =>
               {
                try
                {
                       Application.RunOnMainThread(() =>
                       {
                    CommonPage.Loading.Start("");
                       });
                    //1、清空所有目标
                    if (currentKey.bindList != null)
                    {
@@ -134,11 +138,11 @@
                            {
                                Application.RunOnMainThread(() =>
                                {
                                       btnFinifh.Enable = true;
                                       btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                                    CommonPage.Loading.Hide();
                                    new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.BindFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh);
                                });
                                btnFinifh.Enable = true;
                                btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                                return;
                            }
                            else
@@ -150,11 +154,11 @@
                        {
                            Application.RunOnMainThread(() =>
                            {
                                   btnFinifh.Enable = true;
                                   btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                                CommonPage.Loading.Hide();
                                new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh);
                            });
                            btnFinifh.Enable = true;
                            btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                            return;
                        }
                    }
@@ -262,20 +266,27 @@
                                    {
                                        currentKey.bindList = dev.addedDeviceBindResponseData.BindList;
                                    }
                                       Application.RunOnMainThread(() =>
                                       {
                                    if (action != null)
                                    {
                                        action(currentKey.bindList);
                                    }
                                    this.RemoveFromParent();
                                    targetList.Clear();
                                    CommonPage.Loading.Hide();
                                           this.RemoveFromParent();
                                    btnFinifh.Enable = true;
                                    btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                                           CommonPage.Loading.Hide();
                                       });
                                }
                                else if (dev.addedDeviceBindResponseData.Result == 1)
                                {
                                    Application.RunOnMainThread(() =>
                                    {
                                           btnFinifh.Enable = true;
                                           btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                                        CommonPage.Loading.Hide();
                                        new Tip()
                                        {
@@ -285,14 +296,14 @@
                                            CloseTime = 1
                                        }.Show(btnFinifh);
                                    });
                                    btnFinifh.Enable = true;
                                    btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                                    return;
                                }
                                else
                                {
                                    Application.RunOnMainThread(() =>
                                    {
                                           btnFinifh.Enable = true;
                                           btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                                        CommonPage.Loading.Hide();
                                        new Tip()
                                        {
@@ -302,8 +313,7 @@
                                            CloseTime = 1
                                        }.Show(btnFinifh);
                                    });
                                    btnFinifh.Enable = true;
                                    btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                                    return;
                                }
                            }
@@ -311,11 +321,11 @@
                            {
                                Application.RunOnMainThread(() =>
                                {
                                       btnFinifh.Enable = true;
                                       btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                                    CommonPage.Loading.Hide();
                                    new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinifh);
                                });
                                btnFinifh.Enable = true;
                                btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                                return;
                            }
                        }
@@ -323,11 +333,11 @@
                        {
                            Application.RunOnMainThread(() =>
                            {
                                   btnFinifh.Enable = true;
                                   btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                                CommonPage.Loading.Hide();
                                new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.ChangeBindMode), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnFinifh);
                            });
                            btnFinifh.Enable = true;
                            btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                            return;
                        }
                    }
@@ -335,20 +345,24 @@
                    {
                        Application.RunOnMainThread(() =>
                        {
                               btnFinifh.Enable = true;
                               btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                            CommonPage.Loading.Hide();
                            new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(btnFinifh);
                        });
                        btnFinifh.Enable = true;
                        btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                        return;
                    }
                }
                catch
                {
                    CommonPage.Loading.Hide();
                       Application.RunOnMainThread(() =>
                       {
                    btnFinifh.Enable = true;
                    btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack;
                           CommonPage.Loading.Hide();
                       });
                }
               });
            };
            #endregion 
        }