wxr
2021-03-24 94bed925cf453e148bc5a7556a8a86e0bcb9ad6c
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddButton.cs
@@ -8,10 +8,11 @@
    {
        public AddButton()
        {
            Tag = "Pir";
            Tag = "PirView";
        }
        public void Show(Control control)
        {
            #region 界面布局
            this.BackgroundColor = CSS.CSS_Color.viewMiddle;
            PirDevice.View.TopView topView = new View.TopView();
@@ -122,23 +123,24 @@
                }
                //new引导界面
                View.ReplicationView replication = new View.ReplicationView();
                replication.Show();
                replication.Show(this);
                //添加数据对象
                Entity.AttributesStatus buttonObj = new Entity.AttributesStatus();
                buttonObj.key = "key" + control.status.Count.ToString();
                buttonObj.value = texts;
                PirSend.CodeStudy(control, buttonObj, (responsePackNew) =>
                PirSend.CodeStudy(control.deviceId, buttonObj, (responsePackNew) =>
                {
                    if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "")
                    {
                        Method method = new Method();
                        var mqttdate = method.MqttDate(control.sid, 20);
                        if (mqttdate !=null)
                        Method.buttondata = "";
                        var mqttdate = method.MqttDate("按键", control.sid, 25);
                        if (mqttdate != null)
                        {
                            //休眠是为显示引导界面
                           // System.Threading.Thread.Sleep(3000);
                            // System.Threading.Thread.Sleep(3000);
                            //移除添加按钮引导界面
                            replication.RemView();
                            var buttonName = control.status.Find((c) => c.value == buttonObj.value);
@@ -155,7 +157,7 @@
                                var view = MainPage.BasePageView.GetChildren(i);
                                if (view.GetType() == typeof(AddControl))
                                {
                                    new Intelligence.Automation.LogicView.TipPopView().FlashingBox(Language.StringByID(StringId.tianjiashibai));
                                    //new TipPopView().FlashingBox(Language.StringByID(StringId.tianjiachenggong));
                                    view.RemoveFromParent();
                                }
@@ -170,15 +172,15 @@
                        else
                        {
                            replication.RemView();
                            new Intelligence.Automation.LogicView.TipPopView().FlashingBox(Language.StringByID(StringId.tianjiashibai));
                            new TipPopView().FlashingBox(Language.StringByID(StringId.tianjiashibai));
                        }
                    }
                    else
                    {
                        Method method = new Method();
                        method.ErrorShow(responsePackNew);
                        method.ErrorShow(responsePackNew, "");
                    }
                });
@@ -187,5 +189,7 @@
            };
        }
    }
}