From eed381ca472abb06e386281e604569ebf80bbfe3 Mon Sep 17 00:00:00 2001
From: WJC <wjc@hdlchina.com.cn>
Date: 星期四, 26 三月 2020 17:51:41 +0800
Subject: [PATCH] 2020-03-26

---
 ZigbeeApp/GateWay.Droid/Assets/Language.ini                                |    1 
 ZigbeeApp/Home.Ios/Resources/Language.ini                                  |    1 
 ZigbeeApp/Shared/Phone/Device/Logic/AddLogicPage.cs                        |   54 ++--
 ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs                          |  322 ++++++++-----------------------
 ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml                                     |   22 +-
 ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs         |    1 
 ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicCommunalPage.cs |    2 
 ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs                   |   45 ----
 ZigbeeApp/Shared/Phone/Device/Logic/Method.cs                              |   17 +
 ZigbeeApp/Shared/R.cs                                                      |    1 
 ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs                            |   25 +
 ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs          |   74 ++-----
 ZigbeeApp/.vs/GateWay/xs/sqlite3/storage.ide                               |    0 
 ZigbeeApp/Shared/Phone/Device/Logic/WeekPage.cs                            |   11 
 .DS_Store                                                                  |    0 
 15 files changed, 181 insertions(+), 395 deletions(-)

diff --git a/.DS_Store b/.DS_Store
index b7aac53..02272ee 100644
--- a/.DS_Store
+++ b/.DS_Store
Binary files differ
diff --git a/ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml b/ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml
index ecc4e15..b47e6d2 100644
--- a/ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml
+++ b/ZigbeeApp/.vs/GateWay/xs/UserPrefs.xml
@@ -6,22 +6,20 @@
       <Pad Id="ProjectPad">
         <State name="__root__">
           <Node name="GateWay" expanded="True">
+            <Node name="GateWay.Droid" expanded="True">
+              <Node name="Assets" expanded="True" />
+            </Node>
+            <Node name="Home.IOS" expanded="True">
+              <Node name="Resources" expanded="True" />
+            </Node>
             <Node name="Shared" expanded="True">
               <Node name="Phone" expanded="True">
                 <Node name="Category" expanded="True" />
                 <Node name="Device" expanded="True">
-                  <Node name="Category" expanded="True" />
                   <Node name="Logic" expanded="True">
-                    <Node name="LogicView" expanded="True">
-                      <Node name="CompleteView.cs" selected="True" />
-                    </Node>
+                    <Node name="DoorLockLogic" expanded="True" />
+                    <Node name="LogicCommunalPage.cs" selected="True" />
                   </Node>
-                </Node>
-                <Node name="UserCenter" expanded="True">
-                  <Node name="DoorLock" expanded="True" />
-                </Node>
-                <Node name="ZigBee" expanded="True">
-                  <Node name="Device" expanded="True" />
                 </Node>
               </Node>
             </Node>
@@ -30,11 +28,11 @@
       </Pad>
     </Pads>
   </MonoDevelop.Ide.Workbench>
-  <MonoDevelop.Ide.ItemProperties.Home.IOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.00008020-001674E61438002E" />
+  <MonoDevelop.Ide.ItemProperties.Home.IOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneSimulatorTarget.9992EB40-E6DD-48F4-AFED-CEB5E811ACDD" />
   <MonoDevelop.Ide.DebuggingService.PinnedWatches>
     <Watch file="../../../Shared/Phone/Device/Logic/Method.cs" line="779" offsetX="-1" offsetY="-1" expression="Phone" liveUpdate="False" />
   </MonoDevelop.Ide.DebuggingService.PinnedWatches>
-  <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|iPhone" />
+  <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|iPhoneSimulator" />
   <MonoDevelop.Ide.DebuggingService.Breakpoints>
     <BreakpointStore />
   </MonoDevelop.Ide.DebuggingService.Breakpoints>
diff --git a/ZigbeeApp/.vs/GateWay/xs/sqlite3/storage.ide b/ZigbeeApp/.vs/GateWay/xs/sqlite3/storage.ide
index 2e03c9b..d271183 100644
--- a/ZigbeeApp/.vs/GateWay/xs/sqlite3/storage.ide
+++ b/ZigbeeApp/.vs/GateWay/xs/sqlite3/storage.ide
Binary files differ
diff --git a/ZigbeeApp/GateWay.Droid/Assets/Language.ini b/ZigbeeApp/GateWay.Droid/Assets/Language.ini
index 9c7a3d0..3c29d50 100755
--- a/ZigbeeApp/GateWay.Droid/Assets/Language.ini
+++ b/ZigbeeApp/GateWay.Droid/Assets/Language.ini
@@ -527,6 +527,7 @@
 5378=鎺ㄩ�佸唴瀹逛笉鑳戒负绌�.
 5379=鏆傛棤鑱斿姩浜嬩欢{\r\n} 璇风偣鍑诲彸涓婅娣诲姞
 5380=甯稿紑妯″紡
+5381=娣诲姞鏉′欢鎴栬�呮坊鍔犲姛鑳戒负绌�
 
 
 
diff --git a/ZigbeeApp/Home.Ios/Resources/Language.ini b/ZigbeeApp/Home.Ios/Resources/Language.ini
index 9c7a3d0..3c29d50 100755
--- a/ZigbeeApp/Home.Ios/Resources/Language.ini
+++ b/ZigbeeApp/Home.Ios/Resources/Language.ini
@@ -527,6 +527,7 @@
 5378=鎺ㄩ�佸唴瀹逛笉鑳戒负绌�.
 5379=鏆傛棤鑱斿姩浜嬩欢{\r\n} 璇风偣鍑诲彸涓婅娣诲姞
 5380=甯稿紑妯″紡
+5381=娣诲姞鏉′欢鎴栬�呮坊鍔犲姛鑳戒负绌�
 
 
 
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/AddLogicPage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/AddLogicPage.cs
index 3d0f6c6..7c9e2cb 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/AddLogicPage.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/AddLogicPage.cs
@@ -18,13 +18,12 @@
         }
         public void Show()
         {
-            #region  涓婇潰鐨勫竷灞�浠g爜
+            #region  鐣岄潰鐨勫竷灞�浠g爜
             TopView view = new TopView();
             this.AddChidren(view.TopRowView());
             view.toptitleNameBtn.TextID = MyInternationalizationString.selection;
             view.clickBtn.MouseDownEventHandler += (sender, e) => { RemoveFromParent(); };
-            #endregion
-            #region  鏈�涓嬮潰鐨勫竷灞�浠g爜
+           
             var middle = new FrameLayout
             {
                 Y = view.topRowLayout.Bottom,
@@ -37,41 +36,21 @@
             timeView.iconBtn.UnSelectedImagePath = "ZigeeLogic/time.png";
             timeView.funnameBtn.TextID = MyInternationalizationString.timecondition;
             middle.AddChidren(timeView.FunFrameView());
-            timeView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
-            {
-                TimeView();
-            };
+          
             ///璁惧
             FunView functionView = new FunView();
             functionView.funFrameLayout.Y = timeView.funFrameLayout.Bottom;
             functionView.iconBtn.UnSelectedImagePath = "ZigeeLogic/function.png";
             functionView.funnameBtn.TextID = MyInternationalizationString.device;
             middle.AddChidren(functionView.FunFrameView());
-            functionView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
-            {
-                var roomAndDeviceView = new RoomAndDeviceView();
-                UserView.HomePage.Instance.AddChidren(roomAndDeviceView);
-                UserView.HomePage.Instance.PageIndex += 1;
-                roomAndDeviceView.IfType = LogicView.IfString.Condition_Logic;
-                roomAndDeviceView.Show(Language.StringByID(MyInternationalizationString.devicestate));
-            };
+          
             ///瀹夐槻
             FunView securityView = new FunView();
             securityView.funFrameLayout.Y = functionView.funFrameLayout.Bottom;
             securityView.iconBtn.UnSelectedImagePath = "ZigeeLogic/security.png";
             securityView.funnameBtn.TextID = MyInternationalizationString.security;
             middle.AddChidren(securityView.FunFrameView());
-            securityView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
-            {
-                //CurtainPanel.ButtonSet buttonSet = new CurtainPanel.ButtonSet();
-                //UserView.HomePage.Instance.AddChidren(buttonSet);
-                //UserView.HomePage.Instance.PageIndex += 1;
-                //buttonSet.Show();
-                //return;
-                var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
-                this.AddChidren(flMain);
-                SecurityView(flMain, false);
-            };
+    
             ///鍦扮悊鍥存爮
             FunView positionView = new FunView();
             positionView.funFrameLayout.Y = securityView.funFrameLayout.Bottom;
@@ -80,15 +59,32 @@
             positionView.funnameBtn.TextID = MyInternationalizationString.location;
             positionView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor;
             middle.AddChidren(positionView.FunFrameView());
+            #endregion
+
+            timeView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
+            {
+                TimeView();
+            };
+            functionView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
+            {
+                var roomAndDeviceView = new RoomAndDeviceView();
+                UserView.HomePage.Instance.AddChidren(roomAndDeviceView);
+                UserView.HomePage.Instance.PageIndex += 1;
+                roomAndDeviceView.IfType = LogicView.IfString.Condition_Logic;
+                roomAndDeviceView.Show(Language.StringByID(MyInternationalizationString.devicestate));
+            };
+            securityView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
+            {
+                var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
+                this.AddChidren(flMain);
+                SecurityView(flMain, false);
+            };
             positionView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
             {
                 var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
                 this.AddChidren(flMain);
                 LocationView(flMain, false);
             };
-
-            #endregion
-
         }
 
         /// <summary>
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs
index fe3f767..061dbcc 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/AddCondition.cs
@@ -17,13 +17,12 @@
 
         public void Show()
         {
-            
-            #region  涓婇潰鐨勫竷灞�浠g爜
+
+            #region  鐣岄潰甯冨眬浠g爜 
             TopView view = new TopView();
             this.AddChidren(view.TopRowView());
             view.toptitleNameBtn.TextID = MyInternationalizationString.userlist;
             view.clickBtn.MouseDownEventHandler += (sender, e) => { RemoveFromParent(); };
-            #endregion
             middle = new VerticalRefreshLayout
             {
                 Y = view.topRowLayout.Bottom,
@@ -31,6 +30,7 @@
                 BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
             };
             this.AddChidren(middle);
+            #endregion
             middle.BeginHeaderRefreshingAction += () =>
             {
                 //閲嶆柊鍒锋柊logic鍒楄〃
@@ -95,7 +95,6 @@
         /// </summary>
         public void UserAllView(string macport)
         {
-            middle.RemoveAll();
             for (int i = 0; i < Send.LockList.Count; i++)
             {
                 var user = Send.LockList[i];
@@ -103,55 +102,24 @@
                 {
                     continue;
                 }
-                var userFramelayout = new FrameLayout
+
+                FunView userView = new FunView();
+                userView.iconBtn.Visible = false;
+                userView.funnameBtn.X = Application.GetRealWidth(81);
+                userView.funnameBtn.Text = user.UserName;
+                userView.funnextBtn.X = Application.GetRealWidth(1080 - 81 - 58);
+                userView.lineBtn.X = Application.GetRealWidth(81);
+                userView.lineBtn.Width = Application.GetRealWidth(1080 - 81 - 58);
+                if (Send.LockList.Count - 1 == i)
                 {
-                    Height = Application.GetRealHeight(160),
-                    BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                };
-                middle.AddChidren(userFramelayout);
-
-                var userRow = new RowLayout
-                {
-                    Y = Application.GetRealHeight(30),
-                    Width = Application.GetRealWidth(1080 - 58 - 58),
-                    Height = Application.GetRealHeight(130),
-                    X = Application.GetRealWidth(58),
-                    LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-                };
-                userFramelayout.AddChidren(userRow);
-
-                var usernameBtn = new Button
-                {
-                    Text = user.UserName,
-                    TextAlignment = TextAlignment.CenterLeft,
-                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                    Width = Application.GetRealWidth(600),
-                    Height = Application.GetRealHeight(130),
-                    Tag = Send.LockList[i],
-                    TextSize = 14,
-                };
-                userRow.AddChidren(usernameBtn);
-
-                var btntimeback = new Button
-                {
-                    Width = Application.GetRealWidth(58),
-                    Height = Application.GetRealHeight(58),
-                    UnSelectedImagePath = "ZigeeLogic/next.png",
-                    X = userRow.Width - Application.GetRealWidth(58),
-                    Gravity = Gravity.CenterVertical,
-                };
-                userRow.AddChidren(btntimeback);
-
-
-                EventHandler<MouseEventArgs> userclick = (sender, e) =>
+                    userView.funFrameLayout.Height = Application.GetRealHeight(160 + 20);//鏈�鍚庝竴琛屽鍔�20楂樺害;
+                    userView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor;
+                }
+                middle.AddChidren(userView.FunFrameView());
+                userView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
                 {
                     SelectedUserID(user);
                 };
-                usernameBtn.MouseUpEventHandler += userclick;
-                btntimeback.MouseUpEventHandler += userclick;
-                userFramelayout.MouseUpEventHandler += userclick;
-                userRow.MouseUpEventHandler += userclick;
-
 
             }
         }
@@ -249,6 +217,12 @@
             string attriButeId = "";
             string attriButeData2 = "";
             string modeName = "";
+
+            ///瀹氫袱涓彉閲忚褰曚箣鍓嶇殑鍙�硷紱
+            string userId = "";
+            string openMode = "";
+            string accountName = "";
+            string SelectedDeviceStatuscondition = "";
 
             for (int j = 0; j < membershipIfon.UserIdMode.Count; j++)
             {
@@ -448,6 +422,6 @@
                 lockLogicCommunalPage.Show(() => { });
             };
         }
-        
+       
     }
 }
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicCommunalPage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicCommunalPage.cs
index cf7a27a..b55fb3b 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicCommunalPage.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicCommunalPage.cs
@@ -35,7 +35,6 @@
             }
             view.clickBtn.MouseDownEventHandler += (sender, e) =>
             {
-                //UserView.HomePage.Instance.ScrollEnabled = true;//鎭㈠宸︽粦
                 action();
                 RemoveFromParent();
             };
@@ -618,7 +617,6 @@
             UserView.HomePage.Instance.AddChidren(addCondition);
             UserView.HomePage.Instance.PageIndex += 1;
             addCondition.Show();
-      
         }
     }
 }
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs
index a21475f..2e11072 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/DoorLockLogic/LockLogicList.cs
@@ -39,7 +39,6 @@
                 Common.Logic.CurrentLogic.LogicType = 1;//鏍囪鑷姩鍖栫被鍨�
                 Common.Logic.CurrentLogic.Relationship = 1;
                 Common.Logic.CurrentLogic.LogicName = Language.StringByID(MyInternationalizationString.automation1);
-                //Common.Logic.CurrentLogic.LogicCustomPushText = Common.Logic.CurrentLogic.LogicName + Language.StringByID(MyInternationalizationString.defaulttext);
                 var lockLogicCommunalPage = new LockLogicCommunalPage();
                 UserView.HomePage.Instance.AddChidren(lockLogicCommunalPage);
                 UserView.HomePage.Instance.PageIndex += 1;
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs
index 385d1e0..22f7e6d 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/LogicCommunalPage.cs
@@ -1324,50 +1324,7 @@
             };
 
         }
-        /// <summary>
-        /// 闂幇寮忔彁绀烘鐨勬柟娉�
-        /// </summary>
-        /// <param name="tipText">鎻愮ず鍐呭</param>
-        /// <param name="second">鍋滅暀鏃堕棿鍗曚綅涓簊</param>
-        public void TipView(string tipText, int second = 1)
-        {
-
-            var frameLayout = new FrameLayout { BackgroundColor = 0x50000000 };
-            this.AddChidren(frameLayout);
-
-            var btn = new Button
-            {
-                Gravity = Gravity.Center,
-                Text = tipText,
-                BackgroundColor = 0xff1f1f1f,
-                Width = Application.GetRealWidth(500),
-                Height = Application.GetRealHeight(100),
-                Radius = (uint)Application.GetRealHeight(50),
-            };
-            frameLayout.AddChidren(btn);
-
-            var dateTime1 = DateTime.Now;
-            new System.Threading.Thread(() =>
-            {
-                Application.RunOnMainThread(() =>
-                {
-                    while (true)
-                    {
-                        if ((DateTime.Now - dateTime1).TotalMilliseconds > second * 1000)
-                        {
-                            //榛樿涓�绉掑叧闂�
-                            frameLayout.RemoveFromParent();
-                            break;
-                        }
-                    }
-                });
-            })
-            { IsBackground = true }.Start();
-
-        }
-
-
-      
+    
 
     }
 }
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs b/ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs
index 44f682c..1ffb2b7 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/MemberList.cs
@@ -22,66 +22,23 @@
         {
             common = commondevice;
             editdeviceConditionsInfo = editdeviceConditions;
+
+            #region  鐣岄潰甯冨眬浠g爜 
             UserView.HomePage.Instance.ScrollEnabled = false;
             this.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
-            #region  鏈�涓婇潰鐨勫竷灞�浠g爜
-            var topRowLayout = new RowLayout
-            {
-                BackgroundColor = ZigbeeColor.Current.LogicTopBackgroundColor,
-                Height = Application.GetRealHeight(184),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutTopLineColor,
-            };
-            this.AddChidren(topRowLayout);
-
-            var titleName = new Button
-            {
-                TextSize = 17,
-                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                TextAlignment = TextAlignment.CenterLeft,
-                X = Application.GetRealWidth(176),
-                Width = Application.GetRealWidth(600),
-                Height = Application.GetRealHeight(69),
-                Y = Application.GetRealHeight(92),
-                TextID = MyInternationalizationString.userlist,
-                IsBold = true,
-            };
-            topRowLayout.AddChidren(titleName);
-
-            var clickBtn = new Button
-            {
-                Width = Application.GetRealWidth(81 + 51),
-                Height = Application.GetRealHeight(58 + 40),
-                Y = Application.GetRealHeight(98 - 40),
-            };
-            topRowLayout.AddChidren(clickBtn);
-            clickBtn.MouseDownEventHandler += (sender, e) =>
-            {
-                RemoveFromParent();
-            };
-
-            var back = new Button
-            {
-                Width = Application.GetRealWidth(30),
-                Height = Application.GetRealHeight(51),
-                X = Application.GetRealWidth(81),
-                Y = Application.GetRealHeight(98),
-                //Gravity = Gravity.CenterVertical;
-                UnSelectedImagePath = "ZigeeLogic/back.png",
-            };
-            topRowLayout.AddChidren(back);
-            back.MouseDownEventHandler += (sender, e) =>
-            {
-                RemoveFromParent();
-            };
-            #endregion
-
+            TopView view = new TopView();
+            this.AddChidren(view.TopRowView());
+            view.toptitleNameBtn.TextID = MyInternationalizationString.userlist;
+            view.clickBtn.MouseDownEventHandler += (sender, e) => { RemoveFromParent(); };
             middle = new VerticalRefreshLayout
             {
-                Y = topRowLayout.Bottom,
+                Y = view.topRowLayout.Bottom,
                 Height = Application.GetRealHeight(1920 - 184),
                 BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
             };
             this.AddChidren(middle);
+            #endregion
+
             middle.BeginHeaderRefreshingAction += () =>
             {
                 //閲嶆柊鍒锋柊logic鍒楄〃
@@ -149,222 +106,115 @@
         /// <param name="macport"></param>
         public void UserList(string macport)
         {
-            foreach (var user in Send.LockList)
+            for (int i=0;i<Send.LockList.Count;i++)
             {
+                var user = Send.LockList[i];
                 if (user.DoorLockMacPort != macport)
                 {
                     continue;
                 }
-                var userFramelayout = new FrameLayout
+
+                FunView userView = new FunView();
+                userView.iconBtn.Visible = false;
+                userView.funnameBtn.X = Application.GetRealWidth(81);
+                userView.funnameBtn.Text = user.UserName;
+                userView.funnextBtn.X = Application.GetRealWidth(1080 - 81 - 58);
+                userView.lineBtn.X = Application.GetRealWidth(81);
+                userView.lineBtn.Width = Application.GetRealWidth(1080 - 81 - 58);
+                if (Send.LockList.Count - 1 == i)
                 {
-                    Height = Application.GetRealHeight(160),
-                    BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                    // LineColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
-                };
-                middle.AddChidren(userFramelayout);
-
-
-                var userRow = new RowLayout
-                {
-                    Y = Application.GetRealHeight(30),
-                    Width = Application.GetRealWidth(1080 - 81 - 58),
-                    Height = Application.GetRealHeight(130),
-                    X = Application.GetRealWidth(81),
-                    LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-                };
-                userFramelayout.AddChidren(userRow);
-
-                var userBtn = new Button
-                {
-                    Text = user.UserName,
-                    TextAlignment = TextAlignment.CenterLeft,
-                    TextColor = ZigbeeColor.Current.LogicTextBlackColor,
-                    TextSize = 14,
-                };
-                userRow.AddChidren(userBtn);
-
-                var userBack = new Button
-                {
-                    Width = Application.GetRealWidth(58),
-                    Height = Application.GetRealHeight(58),
-                    UnSelectedImagePath = "ZigeeLogic/next.png",
-                    X = Application.GetRealWidth(1080 - 81 - 58 - 58),
-                    Gravity = Gravity.CenterVertical,
-                };
-                userRow.AddChidren(userBack);
-
-                EventHandler<MouseEventArgs> useridclick = (sender, e) =>
-                {
-                    User(user);
-
-                };
-                userBtn.MouseUpEventHandler += useridclick;
-                userBack.MouseUpEventHandler += useridclick;
-                userFramelayout.MouseUpEventHandler += useridclick;
-                userRow.MouseUpEventHandler += useridclick;
+                    userView.funFrameLayout.Height = Application.GetRealHeight(160 + 20);//鏈�鍚庝竴琛屽鍔�20楂樺害;
+                    userView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor;
+                }
+                middle.AddChidren(userView.FunFrameView());
+                userView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
+                 {
+                     User(user);
+                 };
 
             }
 
 
-        }          
+        }
         /// <summary>
         /// 褰撳墠鎴愬憳淇℃伅鐨勬柟娉�
         /// </summary>
         /// <param name="user"></param>
         public void User(Send.MembershipIfon user)
         {
-            var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicViewBackgroundColor };
-            this.AddChidren(flMain);
-            flMain.MouseUpEventHandler += (sender1, e1) =>
+          
+            //鍏冪礌瓒呭嚭9涓氨鐢ㄤ笂涓嬫粦鍔ㄦ帶浠�;
+            VerticalScrolViewLayout vV = null;
+            int count = user.UserIdMode.Count;
+            if (user.UserIdMode.Count > 9)
             {
-                flMain.RemoveFromParent();
-            };
-
-            var lockcolorfra = new FrameLayout
-            {
-                Width = Application.GetRealWidth(1080),
-                Height = Application.GetRealHeight(100),
-                Y = Application.GetRealHeight(1920 - 100),
-                BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
-            };
-            flMain.AddChidren(lockcolorfra);
-
-            var lockcolorfra1 = new FrameLayout
-            {
-
-                Width = Application.GetRealWidth(1080),
-                Height = Application.GetRealHeight(530),
-                Y = Application.GetRealHeight(1920 - 530),
-                BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
-                Radius = (uint)Application.GetRealHeight(60),
-            };
-            flMain.AddChidren(lockcolorfra1);
+                ///鍏冪礌瓒呭嚭9涓�;
+                count = 6;
+                //鍏冪礌瓒呭嚭9涓氨鐢ㄤ笂涓嬫粦鍔ㄦ帶浠�;
+                vV = new VerticalScrolViewLayout
+                {
+                    Y = Application.GetRealHeight(140 + 20),
+                    Height = Application.GetRealHeight(160 * count),
+                };
+                //娓呴櫎涔嬪墠鐨勬帶浠�;
+                vV.RemoveAll();
+            }
 
             #region  -------鍙栨秷   瀹屾垚
-            var lockRow = new RowLayout
+            var flMain = new FrameLayout { BackgroundColor = ZigbeeColor.Current.LogicTranslucentColor };
+            this.AddChidren(flMain);
+            CompleteView completeView = new CompleteView();
+            flMain.AddChidren(completeView.Show(count));
+            completeView.Btntitle.Text = user.UserName;
+            EventHandler<MouseEventArgs> clickcancel = (sender, e) =>
             {
-                Height = Application.GetRealHeight(140),
-                LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-            };
-            lockcolorfra1.AddChidren(lockRow);
-            var Btncancel = new Button
-            {
-                TextID = MyInternationalizationString.cancel,
-                TextColor = ZigbeeColor.Current.LogicBtnCancelColor,
-                Height = Application.GetRealHeight(140),
-                Width = Application.GetRealWidth(200),
-                X = Application.GetRealWidth(80),
-                TextAlignment = TextAlignment.CenterLeft,
-                TextSize = 14,
-            };
-            lockRow.AddChidren(Btncancel);
-            Btncancel.MouseUpEventHandler += (sender16, e16) =>
-            {
-                flMain.RemoveFromParent();
                 UserView.HomePage.Instance.ScrollEnabled = true;
+                flMain.RemoveFromParent();
             };
+            flMain.MouseUpEventHandler += clickcancel;
+            completeView.Btncancel.MouseUpEventHandler += clickcancel;
 
-            var Btntitle = new Button
-            {
-                TextID = MyInternationalizationString.security,
-                TextColor = ZigbeeColor.Current.LogicBtnTypeColor,
-                Height = Application.GetRealHeight(140),
-                Width = Application.GetRealWidth(320),
-                TextAlignment = TextAlignment.Center,
-                X = Btncancel.Right + Application.GetRealWidth(100),
-                TextSize = 16,
-                Text = user.UserName,
-            };
-            lockRow.AddChidren(Btntitle);
-            var Btncomplete = new Button
-            {
-                TextID = MyInternationalizationString.complete,
-                TextColor = ZigbeeColor.Current.LogicBtnCompleteColor,
-                Height = Application.GetRealHeight(140),
-                Width = Application.GetRealWidth(200),
-                TextAlignment = TextAlignment.CenterRight,
-                X = Btntitle.Right + Application.GetRealWidth(100),
-                TextSize = 14,
-
-            };
-            lockRow.AddChidren(Btncomplete);
             #endregion
             ///瀹氫袱涓彉閲忚褰曚箣鍓嶇殑鍙�硷紱
             string userId = "";
             string openMode = "";
-            string accountname = "";
+            string accountName = "";
             string SelectedDeviceStatuscondition = "";
-            lockcolorfra1.Y = Application.GetRealHeight(1920 - 140 - (160 * user.UserIdMode.Count) - 20 - 50);
-            lockcolorfra1.Height = Application.GetRealHeight(140 + (160 * user.UserIdMode.Count) + 20 + 50);
-            if (user.UserIdMode.Count > 9)
-            {
-                ///鍏冪礌瓒呭嚭10涓紝鏆傛椂榛樿鏄剧ず10;
-                lockcolorfra1.Y = Application.GetRealHeight(1920 - 140 - (160 * 9) - 20 - 50);
-                lockcolorfra1.Height = Application.GetRealHeight(140 + (160 * 9) + 20 + 50);
-            }
-         
             for (int i = 0; i < user.UserIdMode.Count; i++)
             {
                 var userifon = user.UserIdMode[i];
-                var doorlockfra = new FrameLayout
-                {
-                    Height = Application.GetRealHeight(160),
-                    Y = lockRow.Bottom + Application.GetRealHeight(20 + 160 * i),
-                };
-                lockcolorfra1.AddChidren(doorlockfra);
 
-                var doorlockRow = new RowLayout
+                mFunView lockView = new mFunView();
+                if (user.UserIdMode.Count > 9)
                 {
-                    Y = Application.GetRealHeight(30),
-                    Width = Application.GetRealWidth(920),
-                    Height = Application.GetRealHeight(130),
-                    X = Application.GetRealWidth(80),
-                    LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor,
-                };
-                doorlockfra.AddChidren(doorlockRow);
-
-                var doorlockBtn = new Button
+                    //鍏冪礌瓒呭嚭9涓氨鐢ㄤ笂涓嬫粦鍔ㄦ帶浠�;
+                    completeView.Show(count).AddChidren(vV);
+                    vV.AddChidren(lockView.Show());
+                }
+                else
                 {
-                    Width = Application.GetRealWidth(600),
-                    TextAlignment = TextAlignment.CenterLeft,
-                    TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor,
-                    Text = userifon.ModeName,
-                    TextSize = 14,
-                };
-                doorlockRow.AddChidren(doorlockBtn);
+                    lockView.frameLayout.Y = Application.GetRealHeight(140 + 20 + 160 * i);
+                    completeView.Show(count).AddChidren(lockView.Show());
+                }
+                lockView.titleBtn.Text = userifon.ModeName;
 
-                var doorlockSelected = new Button
-                {
-                    X = Application.GetRealWidth(860),
-                    Width = Application.GetMinRealAverage(60),
-                    Height = Application.GetMinRealAverage(60),
-                    UnSelectedImagePath = "ZigeeLogic/selected.png",
-                    Visible = false,
-                    Gravity = Gravity.CenterVertical,
-
-                };
-                doorlockRow.AddChidren(doorlockSelected);
                 if ((user.UserIdMode.Count - 1) == i)
                 {
-                    doorlockRow.LineColor = ZigbeeColor.Current.LogicBackgroundColor;
+                    lockView.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
                 }
-                EventHandler<MouseEventArgs> doorlockclick = (sender2, e2) =>
-                {
-                    SelectedDeviceStatuscondition = "DoorLock";
-                    selectedIcon.Visible = false;
-                    selectedIcon = doorlockSelected;
-                    doorlockSelected.Visible = true;
-                    userId = userifon.UserId;
-                    openMode = userifon.OpenMode.ToString();
-                    accountname = Btntitle.Text + doorlockBtn.Text;
-                    //doorlockBtn.TextColor = ZigbeeColor.Current.LogicBtnSelectedColor;
-                };
-                doorlockRow.MouseUpEventHandler += doorlockclick;
-                doorlockBtn.MouseUpEventHandler += doorlockclick;
-                doorlockSelected.MouseUpEventHandler += doorlockclick;
-                doorlockfra.MouseUpEventHandler += doorlockclick;
+                lockView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
+                 {
+                     SelectedDeviceStatuscondition = "DoorLock";
+                     selectedIcon.Visible = false;
+                     selectedIcon = lockView.selectedIconBtn;
+                     lockView.selectedIconBtn.Visible = true;
+                     userId = userifon.UserId;
+                     openMode = userifon.OpenMode.ToString();
+                     accountName = completeView.Btntitle.Text + lockView.titleBtn.Text;
+                 };
 
-                if (string.IsNullOrEmpty(doorlockBtn.Text))
+
+                if (string.IsNullOrEmpty(lockView.titleBtn.Text))
                 {
                     string strname = "";
                     switch (userifon.OpenMode)
@@ -385,7 +235,7 @@
                             }
                             break;
                     }
-                    doorlockBtn.Text = userifon.UserId + strname;
+                    lockView.titleBtn.Text = userifon.UserId + strname;
                 }
 
                 if (edit && editdeviceConditionsInfo != null)
@@ -394,15 +244,17 @@
                     if (editdeviceConditionsInfo["AttriButeData2"] == userifon.UserId.ToString())
                     {
                         selectedIcon.Visible = false;
-                        selectedIcon = doorlockSelected;
-                        doorlockSelected.Visible = true;
+                        selectedIcon = lockView.selectedIconBtn;
+                        lockView.selectedIconBtn.Visible = true;
                     }
 
                 }
 
             }
-            Btncomplete.MouseUpEventHandler += (sender3, e3) =>
+    
+            completeView.Btncomplete.MouseUpEventHandler += (sender, e) =>
             {
+
                 string userIdstr = "", openModestr = "";
                 var deviceConditionsInfo = new Dictionary<string, string>();
                 var userdictionary = new Dictionary<string, string>();
@@ -416,7 +268,7 @@
                 deviceConditionsInfo.Add("AttriButeId", openMode);
                 deviceConditionsInfo.Add("AttriButeData2", userId);
                 userdictionary.Add("Account", Config.Instance.Guid);
-                userdictionary.Add("AccountName", accountname);
+                userdictionary.Add("AccountName", accountName);
                 userdictionary.Add("Type", "1");
                 userdictionary.Add("UserId", userId);
                 if (edit)
@@ -491,7 +343,7 @@
 
             };
 
-
         }
+        
     }
 }
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/Method.cs b/ZigbeeApp/Shared/Phone/Device/Logic/Method.cs
index 354f6bd..2a048de 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/Method.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/Method.cs
@@ -719,9 +719,16 @@
         /// <param name="CurrentLogic">褰撳墠閫昏緫</param>
         public async static void SaveLogic(string if_logic, string name, bool tag, Common.Logic CurrentLogic)
         {
-            //璁板綍閫昏緫绫诲瀷
-            //鍙槸瀵硅烦杞晫闈㈡湁鐢紝鍩烘湰娌″暐鐢�
-            int Type = CurrentLogic.LogicType;
+
+            if (CurrentLogic.Conditions.Count == 0 || CurrentLogic.Actions.Count == 0)
+            {
+                var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal,
+                  Language.StringByID(MyInternationalizationString.addnull),
+                  Language.StringByID(MyInternationalizationString.confrim));
+                alert.Show();
+                return;
+            }
+
             if (string.IsNullOrEmpty(name))
             {
                 var alert = new UserCenter.ShowMsgControl(UserCenter.ShowMsgType.Normal,
@@ -779,7 +786,7 @@
 
             if (LogicView.IfString._Logic == if_logic)
             {
-                if (Type == 0)
+                if (CurrentLogic.LogicType == 0)
                 {
                    
                     UserView.HomePage.Instance.RemoveViewByTag("Logic");
@@ -787,7 +794,7 @@
                     Phone.Category.CategoryMainForm.instance?.RefreshBodyView();
                     // Category.Category.instance?.RefreshBodyView();
                 }
-                else if (Type == 2)
+                else if (CurrentLogic.LogicType == 2)
                 {
                     //鍒锋柊鏁翠釜鍒嗙被锛�
                     //闂ㄩ攣甯稿紑妯″紡鐗规畩;
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs b/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs
index 06fc920..8bb854a 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/SkipView.cs
@@ -358,10 +358,10 @@
                     refresview.BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor;
                 }
             }
-
+            int i = 1;//灞�閮ㄥ彉閲忥紝榛樿鏄涓�鏉¢�昏緫;
             foreach (var logic in Common.Logic.LogicList)
             {
-
+               
                 var fLayout = new FrameLayout
                 {
                     Height = Application.GetRealHeight(190 + 30),
@@ -369,7 +369,7 @@
                     BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor,
                 };
                 refresview.AddChidren(fLayout);
-
+            
                 var logicRowlayout = new RowLayout
                 {
                     Height = Application.GetRealHeight(190 + 30),
@@ -380,7 +380,14 @@
 
                 };
                 fLayout.AddChidren(logicRowlayout);
-
+                if (i == 1)
+                {
+                    //瀹炵幇android鏄剧ず閫昏緫鍒楄〃鐨勫渾瑙�;
+                    fLayout.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft);
+                    logicRowlayout.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft);
+                    i = 2;
+                }
+              
                 var logicnameBtn = new Button
                 {
                     Height = Application.GetRealHeight(58),
@@ -396,8 +403,8 @@
 
                 var logicswitchBtn = new Button
                 {
-                    Width = Application.GetRealWidth(104),
-                    Height = Application.GetRealHeight(63),
+                    Width = Application.GetMinRealAverage(104),
+                    Height = Application.GetMinRealAverage(63),
                     UnSelectedImagePath = "ZigeeLogic/logicclose.png",
                     SelectedImagePath = "ZigeeLogic/logicopen.png",
                     X = logicRowlayout.Width - Application.GetRealWidth(104 + 58),
@@ -421,7 +428,7 @@
                         logic.IsEnable = 0;
                         StatusColor(logic, logicRowlayout, 0);
                     }
-                    Device.Logic.Send.LogicControlSwitch(logic);
+                   Send.LogicControlSwitch(logic);
                     //Logic.Send.AddModifyLogic(logic);
                 };
                 if (logic.IsEnable == 1)
@@ -507,7 +514,7 @@
             logicRowlayout.AddChidren(logictimeBtn);
 
             ///鏄剧ず鎵ц鍛ㄦ湡
-            Device.Logic.Method.UpdateWeek(logictimeBtn, logic);
+            Method.UpdateWeek(logictimeBtn, logic);
 
 
             List<string> indexlist = new List<string>();
@@ -546,7 +553,7 @@
                     Height = Application.GetMinRealAverage(82),
                     X = Application.GetRealWidth(58) + Application.GetRealWidth(12 + (12 + 82 + 45 + 12) * i),
                     Y = Application.GetRealHeight(58 + 30 + 30),
-                    Radius = (uint)Application.GetRealHeight(41),
+                    Radius = (uint)Application.GetMinRealAverage(41),
                     BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
                 };
                 logicRowlayout.AddChidren(typebjBtn);
diff --git a/ZigbeeApp/Shared/Phone/Device/Logic/WeekPage.cs b/ZigbeeApp/Shared/Phone/Device/Logic/WeekPage.cs
index c30fa40..644affd 100644
--- a/ZigbeeApp/Shared/Phone/Device/Logic/WeekPage.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Logic/WeekPage.cs
@@ -15,15 +15,12 @@
   
         public void Show (string titlename)
         {
-            var weeklist = new List<string> ();
 
-            #region  涓婇潰鐨勫竷灞�浠g爜
+            #region  鐣岄潰鐨勫竷灞�浠g爜
             TopView view = new TopView();
             this.AddChidren(view.TopRowView());
             view.toptitleNameBtn.Text=titlename;
             view.clickBtn.MouseDownEventHandler += (sender, e) => { RemoveFromParent(); };
-            #endregion
-
             var middle = new VerticalScrolViewLayout
             {
                 Y = view.topRowLayout.Bottom,
@@ -31,11 +28,12 @@
                 BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor,
             };
             this.AddChidren(middle);
-
             LogicView.SaveView saveView = new LogicView.SaveView();
             saveView.frameLayout.Y = middle.Bottom;
             this.AddChidren(saveView.Show());
+            #endregion
 
+            var weeklist = new List<string>();
             if (Common.Logic.CurrentLogic.TimeAttribute.Repeat == 5)
             {
                 string len = "";
@@ -83,7 +81,6 @@
                     }
                 }
             }
-
             var cyclelist = new List<string> ();
             cyclelist.AddRange (new string [] {
                         Language.StringByID(MyInternationalizationString.mon),
@@ -138,8 +135,6 @@
                 };
 
             }
-
-
             saveView.clickviewBtn.MouseUpEventHandler += (sender, e) =>
             {
 
diff --git a/ZigbeeApp/Shared/R.cs b/ZigbeeApp/Shared/R.cs
old mode 100755
new mode 100644
index a7e6bdc..54e4865
--- a/ZigbeeApp/Shared/R.cs
+++ b/ZigbeeApp/Shared/R.cs
@@ -717,6 +717,7 @@
         public readonly static int tiptextnull = 5378;
         public readonly static int tiplocktextnull = 5379;
         public readonly static int openmode = 5380;
+        public readonly static int addnull = 5381;
 
         #region 鐧诲綍娉ㄥ唽
         /// <summary>

--
Gitblit v1.8.0