gxc
2020-02-28 66a9965c44ecc32a6696abca876ab9d1cd091584
ZigbeeApp/Shared/Phone/Device/Logic/DelayTime.cs
@@ -17,9 +17,9 @@
            Tag = "Logic";
        }
        public void Show(int isInt=0, bool edit=false)
        public void Show(int isInt = 0, bool edit = false)
        {
            #region  最上面的布局代码
            var topRowLayout = new RowLayout
@@ -32,7 +32,7 @@
            var titleName = new Button
            {
                TextSize = 16,
                TextSize = 17,
                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
                TextAlignment = TextAlignment.CenterLeft,
                X = Application.GetRealWidth(176),
@@ -40,6 +40,7 @@
                Height = Application.GetRealHeight(69),
                Y = Application.GetRealHeight(92),
                TextID = MyInternationalizationString.adddelay,
                IsBold = true,
            };
            topRowLayout.AddChidren(titleName);
@@ -79,7 +80,6 @@
            };
            this.AddChidren(middle);
            var blancolor = new FrameLayout
            {
                Width = Application.GetMinRealAverage(200),
@@ -111,12 +111,14 @@
            color.AddChidren(btnicon);
            var titleText = new Button
            {
                Width = Application.GetMinRealAverage(480),
                Width = Application.GetMinRealAverage(580),
                Height = Application.GetMinRealAverage(60),
                X = Application.GetRealWidth(300),
                X = Application.GetRealWidth(250),
                Y = blancolor.Bottom + Application.GetRealHeight(50),
                TextID =MyInternationalizationString.createtimetext,
                TextID = MyInternationalizationString.createtimetext,
                TextColor = ZigbeeColor.Current.LogicTextBlackColor,
                TextSize = 15,
            };
            middle.AddChidren(titleText);
@@ -127,8 +129,7 @@
                BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor,
            };
            middle.AddChidren(PickerViewfra);
            PickerViewfra.SetCornerWithSameRadius(Application.GetRealHeight(50), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
            var mUIPickerView = new UIPickerView
            {
@@ -161,12 +162,22 @@
            int value = 0;
            if (edit)
            {
                timevalue = int.Parse(Common.Logic.CurrentLogic.Actions[isInt]["DelayTime"].ToString());
                var minutevalue1 = timevalue / 60;
                var secondvalue1 = timevalue % 60;
                //更新最新状态
                mUIPickerView.setCurrentItems(minutevalue1, secondvalue1, 0);
                if (timevalue > 3600)
                {
                    //更新最新状态
                    mUIPickerView.setCurrentItems(60, timevalue - 3600, 0);
                }
                else
                {
                    var minutevalue1 = timevalue / 60;
                    var secondvalue1 = timevalue % 60;
                    //更新最新状态
                    mUIPickerView.setCurrentItems(minutevalue1, secondvalue1, 0);
                }
                value = timevalue;
            }
            string selectde = "";
@@ -179,7 +190,6 @@
            };
            var btnsave = new Button
            {
                Y = PickerViewfra.Height - Application.GetRealHeight(260),
@@ -190,14 +200,18 @@
                BackgroundColor = ZigbeeColor.Current.LogicBtnSaveBackgroundColor,
                TextID = MyInternationalizationString.Save,
                TextColor = ZigbeeColor.Current.LogicBtnSaveTextColor,
                TextSize=16,
            };
            PickerViewfra.AddChidren(btnsave);
            ///完成点击事件
            btnsave.MouseUpEventHandler += (sender, e) =>
            {
                if (selectde != ""|| timevalue==5)
                if (timevalue == 0)
                {
                    return;
                }
                if (selectde != "" || timevalue == 5)
                {
                    Dictionary<string, object> actionsInfo = new Dictionary<string, object>();
                    actionsInfo.Add("LinkType", 7);
@@ -218,8 +232,8 @@
                    if (!edit)
                    {
                        var alert = new Alert(Language.StringByID(MyInternationalizationString.Prompt),
                                              Language.StringByID(MyInternationalizationString.selectdevicestatuscondition),
                                              Language.StringByID(MyInternationalizationString.complete));
                                               Language.StringByID(MyInternationalizationString.delaytip),
                                               Language.StringByID(MyInternationalizationString.confrim));
                        alert.Show();
                        return;
                    }
@@ -229,6 +243,7 @@
                UserView.HomePage.Instance.PageIndex += 1;
                logicCommunalPage.Show(() => { });
            };
        }
    }
}