wxr
2021-07-01 43b0d5870d528f23ecd6aeceb6cfd4325188b46f
HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/AddDevciePage.cs
@@ -18,7 +18,7 @@
            brand = integratedBrand;
        }
        public void LoadPage()
        public void LoadPage(VerticalRefreshLayout refreshView)
        {
            new TopViewDiv(bodyView, Language.StringByID(StringId.AddDevice)).LoadTopView();
            bodyView.BackgroundColor = CSS_Color.BackgroundColor;
@@ -33,31 +33,30 @@
            Load3tyBrandDeviceList();
            Load3tyBrandDeviceList(refreshView);
            contentView.BeginHeaderRefreshingAction = () =>
            {
                contentView.EndHeaderRefreshing();
                Load3tyBrandDeviceList();
                Load3tyBrandDeviceList(refreshView);
            };
        }
        void Load3tyBrandDeviceList()
        void Load3tyBrandDeviceList(VerticalRefreshLayout refreshView)
        {
            var waitPage = new Loading();
            waitPage.Start();
            new System.Threading.Thread(() => {
                try
                {
                    var pm = new DAL.Server.HttpServerRequest();
                    //var result = pm.Get3tyBindBrandList
                    var pm = new HttpServerRequest();
                    var pack = pm.Get3TyBrandDeviceList(brand.productPlatform, brand.productBrand);
                    if (pack.Code == DAL.Server.StateCode.SUCCESS)
                    if (pack.Code == StateCode.SUCCESS)
                    {
                        var revData = Newtonsoft.Json.JsonConvert.DeserializeObject<List<IntegratedBrandDevice>>(pack.Data.ToString());
                        Application.RunOnMainThread(() =>
                        {
                            LoadRow(revData);
                            LoadRow(revData, refreshView);
                        });
                    }
                    else
@@ -77,7 +76,7 @@
            { IsBackground = true }.Start();
        }
        void LoadRow(List<IntegratedBrandDevice> deviceList)
        void LoadRow(List<IntegratedBrandDevice> deviceList, VerticalRefreshLayout refreshView)
        {
            contentView.RemoveAll();
            bool isFrist = true;
@@ -143,6 +142,17 @@
                        case SPK.IrModule:
                            var form = new AddMiniRemoteControlDirection1Page();
                            form.AddForm();
                            form.AddDeviceEvent = (functionObj) => {
                                refreshView.BeginHeaderRefreshing();
                            };
                            break;
                        case SPK.SenesorMegahealth:
                            var form1 = new AddSenesorMegahealthDirection1Page();
                            form1.AddForm(device);
                            form1.AddDeviceEvent = (functionObj) => {
                                refreshView.BeginHeaderRefreshing();
                                this.RemoveFromParent();
                            };
                            break;
                    }
                };