From d72ca686a3e262693f8a6e45e747e8e8da43335b Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期二, 06 七月 2021 09:39:03 +0800
Subject: [PATCH] 2021-07-06 1.更新

---
 HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/AddDevciePage.cs |   23 ++++++++++++++++++-----
 1 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/AddDevciePage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/AddDevciePage.cs
index a876af9..c7da6e2 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/AddDevciePage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/AddDevciePage.cs
@@ -1,5 +1,6 @@
 锘縰sing System;
 using System.Collections.Generic;
+using HDL_ON.DAL.Server;
 using HDL_ON.Entity;
 using HDL_ON.UI.CSS;
 using Shared;
@@ -17,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;
@@ -32,11 +33,16 @@
 
 
 
-            Load3tyBrandDeviceList();
+            Load3tyBrandDeviceList(refreshView);
 
+            contentView.BeginHeaderRefreshingAction = () =>
+            {
+                contentView.EndHeaderRefreshing();
+                Load3tyBrandDeviceList(refreshView);
+            };
         }
 
-        void Load3tyBrandDeviceList()
+        void Load3tyBrandDeviceList(VerticalRefreshLayout refreshView)
         {
             var waitPage = new Loading();
             waitPage.Start();
@@ -51,8 +57,12 @@
                         var revData = Newtonsoft.Json.JsonConvert.DeserializeObject<List<IntegratedBrandDevice>>(pack.Data.ToString());
                         Application.RunOnMainThread(() =>
                         {
-                            LoadRow(revData);
+                            LoadRow(revData, refreshView);
                         });
+                    }
+                    else
+                    {
+                        IMessageCommon.Current.ShowErrorInfoAlter(pack.Code);
                     }
                 }
                 catch (Exception ex)
@@ -67,7 +77,7 @@
             { IsBackground = true }.Start();
         }
 
-        void LoadRow(List<IntegratedBrandDevice> deviceList)
+        void LoadRow(List<IntegratedBrandDevice> deviceList, VerticalRefreshLayout refreshView)
         {
             contentView.RemoveAll();
             bool isFrist = true;
@@ -133,6 +143,9 @@
                         case SPK.IrModule:
                             var form = new AddMiniRemoteControlDirection1Page();
                             form.AddForm();
+                            form.AddDeviceEvent = (functionObj) => {
+                                refreshView.BeginHeaderRefreshing();
+                            }; 
                             break;
                     }
                 };

--
Gitblit v1.8.0