From 300a5d5370d10d97eb5dfdfa43bb0156c15d23e3 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期三, 03 一月 2024 17:36:15 +0800
Subject: [PATCH] packet类复原
---
HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/CombinedDimmingListPage.cs | 67 ++++++++++++++++++++++++++++++---
1 files changed, 61 insertions(+), 6 deletions(-)
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/CombinedDimmingListPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/CombinedDimmingListPage.cs
index 2aaa1dd..1c9c47a 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/CombinedDimmingListPage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/CombinedDimming/CombinedDimmingListPage.cs
@@ -4,6 +4,7 @@
using HDL_ON.DAL.Server;
using HDL_ON.Entity;
using HDL_ON.UI.CSS;
+using Newtonsoft.Json;
using Shared;
namespace HDL_ON.UI
@@ -21,7 +22,9 @@
public void LoadPage()
{
- new TopViewDiv(bodyView, Language.StringByID(StringId.GroupControl)).LoadTopView_AddIcon("CombinedDimming",
+ var topView = new TopViewDiv(bodyView, Language.StringByID(StringId.GroupControl));
+ topView.maginY = 10;
+ topView.LoadTopView_AddIcon("CombinedDimming",
(s, c) =>
{
try
@@ -29,7 +32,10 @@
var page = new AddGroupControlPage(null,
(newGC) =>
{
- ReadGroupControlList();
+ Application.RunOnMainThread(() =>
+ {
+ LoadGroupControlView();
+ });
}, () => { });
MainPage.BasePageView.AddChidren(page);
page.LoadPage();
@@ -40,8 +46,8 @@
contentView = new VerticalScrolViewLayout()
{
- Y = Application.GetRealHeight(64),
- Height = Application.GetRealHeight(667 - 64),
+ Y = Application.GetRealHeight(64+10),
+ Height = Application.GetRealHeight(667 - 64-10),
BackgroundColor = CSS_Color.MainBackgroundColor,
};
bodyView.AddChidren(contentView);
@@ -71,8 +77,57 @@
{
try
{
- FunctionList.List.groupControls.Clear();
- FunctionList.List.groupControls = Newtonsoft.Json.JsonConvert.DeserializeObject<List<GroupControl>>(pack.Data.ToString());
+ //FunctionList.List.groupControls.Clear();
+ //FunctionList.List.groupControls = Newtonsoft.Json.JsonConvert.DeserializeObject<List<GroupControl>>(pack.Data.ToString());
+
+ try
+ {
+ var groupControlList = JsonConvert.DeserializeObject<List<GroupControl>>(pack.Data.ToString());
+ var readSidList = new List<string>();
+ foreach (var temp in groupControlList)
+ {
+ FunctionList.List.groupControls.Clear();
+ readSidList.Add(temp.userDeviceGroupControlId);
+ if (readSidList.Count >= 20)
+ {
+ var data = ApiUtlis.Ins.HttpRequest.GetGroupControInfo(readSidList);
+ if (data != null)
+ {
+ if (data.Code == StateCode.SUCCESS)
+ {
+ var groupControlInfoList = JsonConvert.DeserializeObject<List<GroupControl>>(data.Data.ToString());
+ FunctionList.List.groupControls.AddRange(groupControlInfoList);
+ }
+ else
+ {
+ IMessageCommon.Current.ShowErrorInfoAlter(pack.Code);
+ }
+ }
+ readSidList.Clear();
+ }
+ }
+ if (readSidList.Count > 0)
+ {
+ var data = ApiUtlis.Ins.HttpRequest.GetGroupControInfo(readSidList);
+ if (data != null)
+ {
+ if (data.Code == StateCode.SUCCESS)
+ {
+ var groupControlInfoList = JsonConvert.DeserializeObject<List<GroupControl>>(data.Data.ToString());
+ FunctionList.List.groupControls.AddRange(groupControlInfoList);
+ }
+ else
+ {
+ IMessageCommon.Current.ShowErrorInfoAlter(pack.Code);
+ }
+ }
+ readSidList.Clear();
+ }
+ }
+ catch (Exception ex)
+ {
+ MainPage.Log($"璇诲彇缁勬帶鍒楄〃澶辫触:{ex.Message}");
+ }
Application.RunOnMainThread(() =>
{
--
Gitblit v1.8.0