HDL Home App 第二版本 旧平台金堂用 正在使用
黄学彪
2019-11-13 8b9ce384b26c414db32f98e94e088f5334869c2d
ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TimeSettignPage.cs
@@ -107,7 +107,6 @@
            this.btnBack.MouseUpEventHandler += eHandlerBack;
            this.btnBackFrameLayout.MouseUpEventHandler += eHandlerBack;
            this.MidFrameLayout(this);
            MidFrameLayoutContent();
        }
@@ -115,10 +114,12 @@
        {
            if (setTimeType == "DoorLockTime")
            {
                // 只有重新启动时会慢,然后其他时刻都是有值的
                new System.Threading.Thread(() =>
                {
                    while (this.Parent != null)
                    {
                        //读门锁时间
                        doorLock.ReadAttri(ZigBee.Device.Cluster_ID.DoorLock, ZigBee.Device.AttriButeId.DoorLock);
                        System.Threading.Thread.Sleep(5 * 1000);
                    }
@@ -135,6 +136,12 @@
            var dtNow = DateTime.Now;
            for (int i = 0; i < 2; i++)
            {
                var rowLayout = new FrameLayout()
                {
                    Height = Application.GetRealHeight(58),
                };
                MidTopFrameLayout.AddChidren(rowLayout);
                var btnDateTime = new Button()
                {
                    Width = Application.GetRealWidth(560),
@@ -144,7 +151,7 @@
                    TextAlignment = TextAlignment.CenterLeft,
                    TextSize = 12,
                };
                MidTopFrameLayout.AddChidren(btnDateTime);
                rowLayout.AddChidren(btnDateTime);
                var textDisplayDateFrameLayout = new FrameLayout()
                {
@@ -152,7 +159,7 @@
                    Height = Application.GetRealHeight(58),
                    X = Application.GetRealWidth(620),
                };
                MidTopFrameLayout.AddChidren(textDisplayDateFrameLayout);
                rowLayout.AddChidren(textDisplayDateFrameLayout);
                var btnNextFrameLayout = new FrameLayout()
                {
@@ -160,7 +167,7 @@
                    Height = Application.GetRealHeight(58),
                    X = Application.GetRealWidth(956),
                };
                MidTopFrameLayout.AddChidren(btnNextFrameLayout);
                rowLayout.AddChidren(btnNextFrameLayout);
                var btnNext = new Button()
                {
@@ -188,7 +195,7 @@
                if (i == 0)
                {
                    btnDateTime.Y = Application.GetRealHeight(50);
                    rowLayout.Y = Application.GetRealHeight(50);
                    btnLine.Y = Application.GetRealHeight(23 + 127);
                    textDisplayDate = new Button()
@@ -199,7 +206,7 @@
                        Text = "_" + Language.StringByID(R.MyInternationalizationString.Year) + "_" + Language.StringByID(R.MyInternationalizationString.Month) + "_" + Language.StringByID(R.MyInternationalizationString.Day),
                    };
                    textDisplayDateFrameLayout.AddChidren(textDisplayDate);
                    textDisplayDateFrameLayout.Y = btnNextFrameLayout.Y = btnDateTime.Y;
                    //textDisplayDateFrameLayout.Y = btnNextFrameLayout.Y = btnDateTime.Y;
                    if (setTimeType != "DoorLockTime")
                    {
@@ -212,7 +219,7 @@
                }
                else if (i == 1)
                {
                    btnDateTime.Y = Application.GetRealHeight(200);
                    rowLayout.Y = Application.GetRealHeight(200);
                    btnLine.Y = Application.GetRealHeight(40 + 127 + 127);
                    textDisplayTime = new Button()
                    {
@@ -222,7 +229,7 @@
                        Text = "00:00",
                    };
                    textDisplayDateFrameLayout.AddChidren(textDisplayTime);
                    textDisplayDateFrameLayout.Y = btnNextFrameLayout.Y = btnDateTime.Y;
                    //textDisplayDateFrameLayout.Y = btnNextFrameLayout.Y = btnDateTime.Y;
                    if (setTimeType != "DoorLockTime")
                    {
@@ -503,6 +510,7 @@
                        }
                    }
                };
                rowLayout.MouseDownEventHandler += hander;
                btnDateTime.MouseDownEventHandler += hander;
                textDisplayDateFrameLayout.MouseDownEventHandler += hander;
                btnNextFrameLayout.MouseDownEventHandler += hander;
@@ -523,14 +531,20 @@
                    {
                        CommonPage.Loading.Start("");
                        var rectifyResult = await doorLock.RectifyDoorLockTimeAsync(int.Parse(setTimestamp));
                        if (rectifyResult != null && rectifyResult.setWritableValueResponData != null && rectifyResult.setWritableValueResponData.Status == 0)
                        if (rectifyResult != null && rectifyResult.setWritableValueResponData != null)
                        {
                            this.shadowRadiusFrameLayout.RemoveFromParent();
                            // new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RectifySuccess), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinish);
                            if (rectifyResult.setWritableValueResponData.Status == 0)
                            {
                                this.shadowRadiusFrameLayout.RemoveFromParent();
                            }
                            else
                            {
                                new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RectifyFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinish);
                            }
                        }
                        else
                        {
                            new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.RectifyFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinish);
                            new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnFinish);
                        }
                    }
                    catch { }