陈嘉乐
2020-05-06 a4d29f9f72452ccae2f607e6ad31cad493822da4
ZigbeeApp/Shared/Phone/Device/Logic/SoneLogicList.cs
@@ -108,48 +108,28 @@
                    TextSize = 16,
                };
                openModeFl.AddChidren(closeBtn);
                closeBtn.MouseUpEventHandler += (sender, e) =>
                closeBtn.MouseUpEventHandler += async (sender, e) =>
                {
                    var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Confirm,
                   Language.StringByID(MyInternationalizationString.doyouwanttodelete),
                   Language.StringByID(MyInternationalizationString.confrim));
                    alert.Show();
                    alert.ConfirmClickEvent += async () =>
                    var result = await UserCenter.DoorLock.DoorLockCommonInfo.DelNormallyOpenMode(Send.CurrentDoorLock);
                    if (result)
                    {
                        if (logic != null)
                        {
                            ///有可能只有常开模式,没有时效性自动化
                            ///没有判断的话,逻辑会为空,抛出异常;
                            Send.DelLogic(logic.LogicId);
                        }
                        this.RemoveFromParent();
                        var soneLogicList = new SoneLogicList();
                        UserView.HomePage.Instance.AddChidren(soneLogicList);
                        UserView.HomePage.Instance.PageIndex += 1;
                        soneLogicList.Show(() => { }, false);
                    }
                    else
                    {
                        ///提示失败
                    }
                     Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.DelNormallyOpenMode(Send.CurrentDoorLock, action);
                     Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.LogicAction += (d) => {
                            this.RemoveFromParent();
                            var soneLogicList = new SoneLogicList();
                            UserView.HomePage.Instance.AddChidren(soneLogicList);
                            UserView.HomePage.Instance.PageIndex += 1;
                            soneLogicList.Show(() => { }, false);
                        };
                        /////xm
                        //var result = await SkipView.OpenMode(false, Send.CurrentDoorLock);
                        //if (result)
                        //{
                        //    if (logic != null)
                        //    {
                        //        ///有可能只有常开模式,没有时效性自动化
                        //        ///没有判断的话,逻辑会为空,抛出异常;
                        //        Send.DelLogic(logic.LogicId);
                        //    }
                        //    this.RemoveFromParent();
                        //    var soneLogicList = new SoneLogicList();
                        //    UserView.HomePage.Instance.AddChidren(soneLogicList);
                        //    UserView.HomePage.Instance.PageIndex += 1;
                        //    soneLogicList.Show(()=>{ },false);
                        //}
                        //else {
                        //    ///提示失败
                        //}
                    };
                };
                ///显示失效设置时间文本控件
@@ -226,67 +206,53 @@
                };
                modeFl.AddChidren(nextIconBtn);
              nextIconBtn.MouseUpEventHandler += (sender, e) =>
               {
                   Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.NomallyOpenModeInvalidTimeDialog(Send.CurrentDoorLock, action);
                   Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.LogicAction += (d) => {
                       this.RemoveFromParent();
                       var soneLogicList = new SoneLogicList();
                       UserView.HomePage.Instance.AddChidren(soneLogicList);
                       UserView.HomePage.Instance.PageIndex += 1;
                       soneLogicList.Show(() => { }, true);
                   };
                   #region
                   /*
                   LogicView.TipView.ShowConfrimTip(() =>
                   {///再次确认
                nextIconBtn.MouseUpEventHandler += (sender, e) =>
                 {
                     LogicView.TipView.ShowConfrimTip(() =>
                     {///再次确认
                       LogicView.TipView.ShowInputTip(true, async (str) =>
                       {///确认发送命令
                         {///确认发送命令
                           try
                           {
                             {
                               ///xm
                               var result = await SkipView.OpenMode(true,Send.CurrentDoorLock);
                               if (!result)
                               {
                                   Application.RunOnMainThread(() =>
                                   {
                                     ///提示失败
                               var result = await UserCenter.DoorLock.DoorLockCommonInfo.SetNormallyOpenModeFuncAsync(Send.CurrentDoorLock);
                                 if (!result)
                                 {
                                     Application.RunOnMainThread(() =>
                                     {
                                       ///提示失败
                                   });
                                   return;
                               }
                               else
                               {
                                     return;
                                 }
                                 else
                                 {
                                   ///因为有常开模式下才可以创建失效逻辑;
                                   SkipView.GetLogicAll();//删除之前所有失效逻辑
                                   var addResult = await SkipView.LockAddModifyLogic(int.Parse(str), Send.CurrentDoorLock);//添加一条失效逻辑
                                   if (!addResult)
                                   {
                                     {
                                       ///提示失败
                                       return;
                                   }
                                   this.RemoveFromParent();
                                   var soneLogicList = new SoneLogicList();
                                   UserView.HomePage.Instance.AddChidren(soneLogicList);
                                   UserView.HomePage.Instance.PageIndex += 1;
                                   soneLogicList.Show(() => { }, true);
                                     }
                                     this.RemoveFromParent();
                                     var soneLogicList = new SoneLogicList();
                                     UserView.HomePage.Instance.AddChidren(soneLogicList);
                                     UserView.HomePage.Instance.PageIndex += 1;
                                     soneLogicList.Show(() => { }, true);
                               }
                           }
                           catch
                           {
                                 }
                             }
                             catch
                             {
                           }
                       });
                             }
                         });
                   });
                  */
                     });
                   #endregion
               };
                 };
            }
            #endregion