From 5b77d9d57a6cddb474a66ca54401ad5ab0892db3 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期三, 23 十一月 2022 14:23:42 +0800
Subject: [PATCH] Merge branch 'dev--wxr' into LcSdkV1

---
 HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/DeviceListPage.cs |   61 ++++++++++++++++++++++++++++++
 1 files changed, 60 insertions(+), 1 deletions(-)

diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/DeviceListPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/DeviceListPage.cs
index f6824e8..e98e1f7 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/DeviceListPage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/DeviceListPage.cs
@@ -108,12 +108,70 @@
             bool isFrist = true;
             foreach (var device in deviceList)
             {
-                FrameLayout row = new FrameLayout()
+                var row = new RowLayout()
                 {
                     Height = Application.GetRealHeight(50),
                     BackgroundColor = CSS_Color.MainBackgroundColor,
+                    LineColor = 0x00000000,
                 };
                 contentView.AddChidren(row);
+                if(device.spk == SPK.IpCam_Imou)
+                {
+                    var btnDel = new Button()
+                    {
+                        TextColor = CSS_Color.MainBackgroundColor,
+                        BackgroundColor = CSS_Color.WarningColor,
+                        TextID = StringId.Del,
+                        TextAlignment = TextAlignment.Center,
+                    };
+                    row.AddRightView(btnDel);
+
+                    btnDel.MouseUpEventHandler = (sender, e) => {
+                        Action action = () => {
+                            var waitPage = new Loading();
+                            this.AddChidren(waitPage);
+                            waitPage.Start("");
+                            new System.Threading.Thread(() =>
+                            {
+                                try
+                                {
+                                    var http = new HttpServerRequest();
+                                    var result = http.Delete3tyDevice( device.deviceId);
+                                    if (result.Code == StateCode.SUCCESS)
+                                    {
+                                        Application.RunOnMainThread(() =>
+                                        {
+                                            Load3tyBrandDeviceList();
+                                        });
+                                    }
+                                    else
+                                    {
+                                        Application.RunOnMainThread(() =>
+                                        {
+                                            new PublicAssmebly().TipMsgAutoClose(Language.StringByID(StringId.OperationFailed)+$"({result.Code})", true);
+                                        });
+                                    }
+                                }catch (Exception ex)
+                                {
+                                    MainPage.Log($"鍒犻櫎绗笁鏂硅澶囧け璐�:{ex.Message}");
+                                }
+                                finally
+                                {
+                                    Application.RunOnMainThread(() =>
+                                    {
+                                        if(waitPage!= null)
+                                        {
+                                            waitPage.RemoveFromParent();
+                                            waitPage = null;
+                                        }
+                                    });
+                                }
+                            })
+                            { IsBackground = true }.Start();
+                        };
+                        new PublicAssmebly().TipOptionMsg(StringId.Tip, Language.StringByID(StringId.AreYouSureToDeleteThisDevice), action);
+                    };
+                }
 
                 if (isFrist)
                 {
@@ -171,6 +229,7 @@
                                 contentView.BeginHeaderRefreshing();
                             });
                             break;
+                        case SPK.SensorMmvPose:
                         case SPK.SenesorMegahealth:
                         case SPK.SenesorMegahealth2:
                             var smPage = new SenesorMegahealthManagerPage();

--
Gitblit v1.8.0