gxc
2019-12-25 944b87b6bcccb095cd73f13f4410fb20faf48f74
ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicCommunalPage.cs
@@ -32,7 +32,7 @@
            var titleName = new Button
            {
                TextSize = 16,
                TextSize = 17,
                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
                TextAlignment = TextAlignment.CenterLeft,
                X = Application.GetRealWidth(176),
@@ -109,6 +109,7 @@
                TextID = MyInternationalizationString.automationname,
                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
                Y = Application.GetRealHeight(35),
                TextSize = 15,
            };
            logicnamefl.AddChidren(text);
@@ -120,7 +121,7 @@
                X = text.Right,
                TextAlignment = TextAlignment.CenterLeft,
                TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
                TextSize = 13,
                TextSize = 14,
                Text = Common.Logic.CurrentLogic.LogicName,
                //TextID=MyInternationalizationString.automation1,
            };
@@ -163,7 +164,7 @@
                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
                Width = Application.GetRealWidth(300),
                Height = Application.GetRealHeight(60),
                TextSize = 16,
                TextSize = 15,
                Gravity = Gravity.CenterVertical,
            });
@@ -192,11 +193,7 @@
            ///添加条件的点击事件
            EventHandler<MouseEventArgs> conditionaddclick = (sender, e) =>
            {
                var addCondition = new AddCondition();
                addCondition.conditionsIndex = -1;
                UserView.HomePage.Instance.AddChidren(addCondition);
                UserView.HomePage.Instance.PageIndex += 1;
                addCondition.Show();
                AddCondition(-1);
            };
            conditionadd.MouseUpEventHandler += conditionaddclick;
            conditionadd1.MouseUpEventHandler += conditionaddclick;
@@ -229,22 +226,18 @@
                    var addtextbtn = new Button
                    {
                        Height = Application.GetRealHeight(58),
                        Width = Application.GetRealWidth(300),
                        Width = Application.GetRealWidth(500),
                        Y = Application.GetRealHeight(45 + 30),
                        TextColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
                        TextID = MyInternationalizationString.selectunlockingmode,
                        X = Application.GetRealWidth(390),
                        X = Application.GetRealWidth(290),
                        TextSize = 14,
                    };
                    addfl.AddChidren(addtextbtn);
                    EventHandler<MouseEventArgs> addconditionsclick = (sender, e) =>
                    {
                        var addCondition = new AddCondition();
                        ///记录索引
                        addCondition.conditionsIndex = -1;
                        UserView.HomePage.Instance.AddChidren(addCondition);
                        UserView.HomePage.Instance.PageIndex += 1;
                        addCondition.Show();
                        AddCondition(-1);
                    };
                    addbtn.MouseUpEventHandler += addconditionsclick;
                    addtextbtn.MouseUpEventHandler += addconditionsclick;
@@ -300,6 +293,7 @@
                                    TextAlignment = TextAlignment.CenterLeft,
                                    Text = deviceinof.DeviceEpointName,
                                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
                                    TextSize = 14,
                                };
                                conditionsRowLayout.AddChidren(btndevice);
@@ -323,17 +317,14 @@
                                    BackgroundColor = ZigbeeColor.Current.LogicEditBlackColor1,
                                    Text = Language.StringByID(MyInternationalizationString.edit),
                                    TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
                                    Tag=i,
                                    Tag = i,
                                };
                                conditionsRowLayout.AddRightView(deviceedit);
                                deviceedit.MouseUpEventHandler += (sender, e) =>
                                {
                                    var addCondition = new AddCondition();
                                    ///记录索引
                                    addCondition.conditionsIndex = int.Parse(deviceedit.Tag.ToString());
                                    UserView.HomePage.Instance.AddChidren(addCondition);
                                    UserView.HomePage.Instance.PageIndex += 1;
                                    addCondition.Show();
                                    int intvalue = int.Parse(deviceedit.Tag.ToString());
                                    AddCondition(intvalue);
                                };
                                ///显示设备条件状态控件
@@ -345,6 +336,7 @@
                                    TextAlignment = TextAlignment.CenterRight,
                                    X = Application.GetRealWidth(400),
                                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
                                    TextSize = 14,
                                };
                                conditionsRowLayout.AddChidren(devicestatus);
@@ -353,39 +345,17 @@
                                    case DeviceType.DoorLock:
                                        {
                                            conditionIcon.UnSelectedImagePath = "ZigeeLogic/doorlock.png";
                                            //for (int a = 0; a < Common.Logic.CurrentLogic.Accounts.Count; a++)
                                            //{
                                            //    if (Common.Logic.CurrentLogic.Accounts[a]["Type"] == "1")
                                            //    {
                                            //        if (Common.Logic.CurrentLogic.Accounts[a]["UserId"] == conditions["AttriButeData2"])
                                            //        {
                                            //            devicestatus.Text = Common.Logic.CurrentLogic.Accounts["Account"];
                                            //            break;
                                            //        }
                                            //    }
                                            //}
                                            //(0按键/3卡/15指纹)
                                            switch (conditions["AttriButeId"])
                                            for (int a = 0; a < Common.Logic.CurrentLogic.Accounts.Count; a++)
                                            {
                                                case "0":
                                                if (Common.Logic.CurrentLogic.Accounts[a]["Type"] == "1")
                                                {
                                                    if (Common.Logic.CurrentLogic.Accounts[a]["UserId"] == conditions["AttriButeData2"])
                                                    {
                                                        devicestatus.Text = Language.StringByID(MyInternationalizationString.lockpassword);
                                                        devicestatus.Text = Common.Logic.CurrentLogic.Accounts[a]["Account"];
                                                        break;
                                                    }
                                                    break;
                                                case "3":
                                                    {
                                                        devicestatus.Text = Language.StringByID(MyInternationalizationString.ic);
                                                    }
                                                    break;
                                                case "15":
                                                    {
                                                        devicestatus.Text = Language.StringByID(MyInternationalizationString.fingerprint);
                                                    }
                                                    break;
                                                }
                                            }
                                        }
                                        break;
                                }
@@ -400,10 +370,8 @@
                        Text = Language.StringByID(MyInternationalizationString.del),
                    };
                    conditionsRowLayout.AddRightView(del);
                    del.MouseUpEventHandler += (sender, e) =>
                    {
                        var alert = new Alert(Language.StringByID(MyInternationalizationString.tip), Language.StringByID(MyInternationalizationString.doyouwanttodelete),
                                              Language.StringByID(MyInternationalizationString.cancel), Language.StringByID(MyInternationalizationString.confrim));
                        alert.ResultEventHandler += (sender1, e1) =>
@@ -456,7 +424,7 @@
                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
                Width = Application.GetRealWidth(300),
                Height = Application.GetRealHeight(60),
                TextSize = 16,
                TextSize = 15,
                Gravity = Gravity.CenterVertical,
            };
            targetRowLayout.AddChidren(btntargettitle);
@@ -526,6 +494,7 @@
                        TextColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
                        TextID = MyInternationalizationString.lockaddaction,
                        X = Application.GetRealWidth(390),
                        TextSize = 14,
                    };
                    addfl.AddChidren(addtextbtn);
                    EventHandler<MouseEventArgs> addfunctionclick = (sender, e) =>
@@ -596,6 +565,7 @@
                                    TextAlignment = TextAlignment.CenterLeft,
                                    Text = deviceinof.DeviceEpointName,
                                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
                                    TextSize = 14,
                                };
                                actionsrowLayout.AddChidren(btndevicename);
@@ -621,6 +591,7 @@
                                    TextAlignment = TextAlignment.CenterRight,
                                    X = Application.GetRealWidth(450),
                                    TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
                                    TextSize = 14,
                                };
                                actionsrowLayout.AddChidren(devicestatus);
@@ -636,7 +607,7 @@
                                ///编辑点击事件
                                deviceedit.MouseUpEventHandler += (sender, e) =>
                                {
                                    var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
                                    this.AddChidren(flMain);
                                    LockAddDevice.CurrentDeviceStateView(flMain, deviceinof, true);
@@ -796,6 +767,7 @@
                                                        // devicestatus.Text = Language.StringByID(MyInternationalizationString.close);
                                                        ifclose = false;
                                                        break;
                                                    }
                                                    else if (status["Data1"].ToString() == "1")
                                                    {
@@ -911,6 +883,7 @@
                                    TextAlignment = TextAlignment.CenterLeft,
                                    Text = sceneinof.Name,
                                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
                                    TextSize = 14,
                                };
                                actionsrowLayout.AddChidren(btndevicename);
@@ -1001,6 +974,7 @@
                Height = Application.GetRealHeight(60),
                Gravity = Gravity.CenterVertical,
                TextID = MyInternationalizationString.pushswitch,
                TextSize = 14,
            };
            pushswitchRowlayout.AddChidren(btnswitchtxet);
@@ -1053,6 +1027,7 @@
                Width = Application.GetRealWidth(300),
                Height = Application.GetRealHeight(60),
                Gravity = Gravity.CenterVertical,
                TextSize = 14,
            };
            custompushRowLayout.AddChidren(btncustompush);
@@ -1098,6 +1073,7 @@
                BackgroundColor = ZigbeeColor.Current.LogicBtnSaveBackgroundColor,
                TextID = MyInternationalizationString.Save,
                TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
                TextSize = 16,
            };
            saveFrameLayout.AddChidren(btnsave);
            btnsave.MouseUpEventHandler += async (sender, e) =>
@@ -1145,5 +1121,14 @@
            };
        }
        public  void AddCondition(int value)
        {
            var addCondition = new AddCondition();
            addCondition.conditionsIndex = value;
            UserView.HomePage.Instance.AddChidren(addCondition);
            UserView.HomePage.Instance.PageIndex += 1;
            addCondition.Show();
        }
    }
}