From 23bbed132eea46eef51c6d01c21b346238e29ee2 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期四, 30 六月 2022 13:39:12 +0800
Subject: [PATCH] Merge branch 'wxr0114' into V1.5.9

---
 HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs |  329 +++++-------------------------------------------------
 1 files changed, 31 insertions(+), 298 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs b/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs
index b1c8fb3..b6fa2c9 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs
@@ -2,16 +2,14 @@
 using HDL_ON.UI.Music;
 using System.Collections.Generic;
 using Shared;
-using HDL_ON.UI.CSS;
+using HDL_ON.Stan;
+using ZXing.QrCode.Internal;
+using static HDL_ON.UI.UI2.FuntionControlView.Video.VideoMethod;
 
 namespace HDL_ON.UI.UI2.FuntionControlView.Video
 {
     public class VideoMainView : FrameLayout
     {
-
-        List<Video> ximoVideoList = new List<Video>();
-
-
         /// <summary>
         /// 鍔犺浇鍙瀵硅UI
         /// </summary>
@@ -19,14 +17,11 @@
         /// <param name="videoList">鍙瀵硅鍒楄〃</param>
         public void Show(List<CallView> listCall, List<Video> videoList)
         {
-            ximoVideoList = videoList.FindAll((obj) => obj.spk == "door.gate");
-
             #region 甯冨眬鐣岄潰
             this.BackgroundColor = MusicColor.ViewColor;
             var topView = new TopView();
             this.AddChidren(topView.TopFLayoutView());
             topView.topNameBtn.TextID = StringId.keshiduijiang;
-
 
             var pageView = new PageLayout()
             {
@@ -38,7 +33,9 @@
             var view1 = new FrameLayout();
             pageView.AddChidren(view1);
             var view2 = new FrameLayout();
-            pageView.AddChidren(view2);
+            if (!Entity.DB_ResidenceData.Instance.SupportFVDevice) {//闈炲叏瑙嗛�氬睍绀洪�氳瘽璁板綍
+                pageView.AddChidren(view2);
+            }
             View1(view1, videoList);
             View2(view2, listCall, videoList);
             Button btn11 = new Button
@@ -50,7 +47,7 @@
                 BackgroundColor = MusicColor.SelectedColor,
                 Radius = (uint)Application.GetRealHeight(4),
             };
-            view1.AddChidren(btn11);
+            //view1.AddChidren(btn11);
 
             Button btn12 = new Button
             {
@@ -61,7 +58,13 @@
                 BackgroundColor = 0x404484F4,
                 Radius = (uint)Application.GetRealHeight(4),
             };
-            view1.AddChidren(btn12);
+            //view1.AddChidren(btn12);
+            if (!Entity.DB_ResidenceData.Instance.SupportFVDevice)
+            {//闈炲叏瑙嗛�氬睍绀轰笅鏂归�夋嫨鎸夐挳
+                view1.AddChidren(btn11);
+                view1.AddChidren(btn12);
+            }
+
             Button btn21 = new Button
             {
                 X = Application.GetRealWidth(170),
@@ -195,17 +198,11 @@
             };
             bjFl.AddChidren(vv);
 
-            bool bol = haveQRCodeVideo(videoList);
+            bool bol = haveFlVideo(videoList);
             if (bol)
             {
                 //闂ㄧ浜岀淮鐮佸浐瀹氭湁鐨�,铏氭嫙涓�涓嚭鏉�
-                videoList.Add(new Video { deviceName = Language.StringByID(StringId.menjinerweima), interphoneType = "100",devType = "100" });
-            }
-            if (ximoVideoList.Count > 0)
-            {
-                //寰樺緤鎶ヨ
-                videoList.Add(new Video { deviceName = Language.StringByID(StringId.WanderingAlarm), interphoneType = "222", devType = "222" });
-                
+                videoList.Add(new Video { deviceName = Language.StringByID(StringId.menjinerweima), interphoneType = "100" });
             }
             //鏁扮粍涓暟
             //int value = 15;
@@ -227,13 +224,10 @@
             };
             vv.AddChidren(fL);
             int line = 0;
-
-
             #endregion
             for (int i = 1, j = 0; i <= videoList.Count; i++, j++)
             {
                 var video = videoList[i - 1];
-             
                 #region
                 var fLayout = new FrameLayout
                 {
@@ -252,7 +246,6 @@
                     UnSelectedImagePath = "VideoIcon/weiqiangji.png",
                 };
                 fLayout.AddChidren(iconBtn);
-
 
                 var deviceNameBtn = new Button
                 {
@@ -281,28 +274,19 @@
                 //闂ㄥ彛鏈虹殑鐐瑰嚮浜嬩欢
                 clickBtn.MouseUpEventHandler += (sender, e) =>
                 {
-                    if (video.devType == "VisitorQrCode")
-                    {
-
-                        return;
-                    }
-                    else if (video.devType == "FaceManagement")
-                    {
-
-                        return;
-                    }
-
                     var video2 = clickBtn.Tag as Video;
                     if (video2.devType == "100")
                     {
-                        ChooseVideoShowQRCode();
-
-                    }
-                    else if(video2.devType == "222")
-                    {
-                        ChooseAlarmShow();
-
-
+                        //闂ㄧ浜岀淮鐮佸浐瀹氭湁鐨�
+                        VideoSend.GetQRcode(this, video2, (tag, paw) =>
+                        {
+                            if (tag)
+                            {
+                                //娉ㄦ剰锛氬瘑鐮佹湁鍙兘寤舵椂1鍒嗛挓鐢熸晥
+                                View.ShowDialog showDialog = new View.ShowDialog();
+                                showDialog.QRcode(paw);
+                            }
+                        });
                     }
                     else
                     {
@@ -330,8 +314,10 @@
                             Lc_Psk = video.deviceId,//2021-10-15 PSK瀛楁涓嶈兘鍙杁eviceName
                             Lc_PlayToken = video.playToken,
                             deviceSipAccount = video.deviceSipAccount,
-                            HomeId = video.homeId
+                            HomeId = video.homeId,
+                            deviceCode=video.deviceCode
                         };
+                        
                         ESOnVideo.Current.ShowESVideoMonitor(eSVideoInfo, video.interphoneType);
                     }
                 };
@@ -567,273 +553,20 @@
 
 
         //鍒ゆ柇鏄惁鏈� 涓版灄鍙瀵硅
-        private bool haveQRCodeVideo(List<Video> videoList)
+        private bool haveFlVideo(List<Video> videoList)
         {
             bool bol = false;
 
             for (int i = 0; i < videoList.Count; i++)
             {
                 var _video = videoList[i];
-                if (_video.interphoneType == "FLVI"|| _video.spk == "door.gate")
-                {
+                if (_video.interphoneType == "FLVI")
                     return true;
-                }
             }
 
             return bol;
         }
 
-
-        /// <summary>
-        /// 鑾峰彇闂ㄧ浜岀淮鐮�
-        /// </summary>
-        public void ChooseVideoShowQRCode()
-        {
-            Dialog dialog = new Dialog()
-            {
-                BackgroundColor = CSS_Color.DialogTransparentColor1,
-            };
-
-            FrameLayout dialogView = new FrameLayout();
-            dialog.AddChidren(dialogView);
-            dialogView.MouseUpEventHandler = (sender, e) => {
-                dialog.Close();
-            };
-
-            var contentView = new FrameLayout()
-            {
-                Gravity = Gravity.Center,
-                Width = Application.GetRealWidth(270),
-                Height = Application.GetRealHeight(280),
-                BackgroundColor = CSS_Color.MainBackgroundColor,
-                BorderColor = 0x00000000,
-                BorderWidth = 0,
-                Radius = (uint)Application.GetMinRealAverage(10),
-            };
-            dialogView.AddChidren(contentView);
-
-            var btnTitle = new Button()
-            {
-                Height = Application.GetRealHeight(64),
-                TextAlignment = TextAlignment.Center,
-                TextColor = CSS_Color.FirstLevelTitleColor,
-                TextID = StringId.menjinerweima,
-                TextSize = CSS_FontSize.SubheadingFontSize,
-            };
-            contentView.AddChidren(btnTitle);
-
-            var listView = new VerticalScrolViewLayout()
-            {
-                Gravity = Gravity.CenterHorizontal,
-                Y = Application.GetRealHeight(70),
-                Width = Application.GetRealWidth(230),
-                Height = Application.GetRealHeight(200),
-            };
-            contentView.AddChidren(listView);
-
-            //if (ximoVideoList.Count == 1)
-            {
-                Loading loading = new Loading();
-                contentView.AddChidren(loading);
-                loading.Start("");
-                new System.Threading.Thread(() =>
-                {
-                    try
-                    {
-                        var pack = VideoSend.GetQRcode();
-                        var pairs = Newtonsoft.Json.JsonConvert.DeserializeObject<List<AccessControlQRode>>(pack.Data.ToString());
-                        if (pairs.Count > 0)
-                        {
-                            Application.RunOnMainThread(() =>
-                            {
-                                ImageView codeImage = new ImageView()
-                                {
-                                    Gravity = Gravity.Center,
-                                    Height = Application.GetRealWidth(320),
-                                    Width = Application.GetRealWidth(320),
-                                    ImageBytes = Scan.BytesFromText(pairs[0].qrcode, Application.GetRealWidth(200), Application.GetRealWidth(200)),
-                                };
-                                dialogView.AddChidren(codeImage);
-                            });
-                        }
-                    }
-                    catch (Exception ex)
-                    {
-                        MainPage.Log($"鑾峰彇闂ㄧ浜岀淮鐮佸紓甯革細{ex.Message}");
-                    }
-                    finally
-                    {
-                        Application.RunOnMainThread(() =>
-                        {
-                            if (loading != null)
-                            {
-                                loading.Hide();
-                                loading.RemoveFromParent();
-                            }
-                        });
-                    }
-                })
-                { IsBackground = true }.Start();
-            }
-            //else
-            //{
-
-            //    foreach (var v in ximoVideoList)
-            //    {
-            //        Button btnMsg = new Button()
-            //        {
-            //            Gravity = Gravity.CenterHorizontal,
-            //            Height = Application.GetRealHeight(50),
-            //            Width = Application.GetRealHeight(160),
-            //            TextAlignment = TextAlignment.Center,
-            //            TextColor = CSS_Color.TextualColor,
-            //            TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
-            //            Text = v.deviceName,
-            //            Radius = (uint)Application.GetRealWidth(5),
-            //            BackgroundColor = CSS_Color.DividingLineColor,
-            //            IsMoreLines = true,
-            //        };
-            //        listView.AddChidren(btnMsg);
-
-            //        listView.AddChidren(new Button() { Height = Application.GetRealHeight(12) });
-
-            //        btnMsg.MouseUpEventHandler = (sender, e) =>
-            //        {
-
-
-            //            if (v.spk == "door.gate")
-            //            {
-                          
-            //                return;
-            //            }
-
-            //            //闂ㄧ浜岀淮鐮佸浐瀹氭湁鐨�
-            //            VideoSend.GetQRcode(this, v, (tag, paw) =>
-            //            {
-            //                if (tag)
-            //                {
-            //                //娉ㄦ剰锛氬瘑鐮佹湁鍙兘寤舵椂1鍒嗛挓鐢熸晥
-            //                View.ShowDialog showDialog = new View.ShowDialog();
-            //                    showDialog.QRcode(paw);
-            //                }
-            //            });
-            //            dialog.Close();
-            //        };
-            //    }
-            //}
-            dialog.Show();
-
-        }
-
-        /// <summary>
-        /// 閫夋嫨寰樺緤鎶ヨ鍒楄〃鏄剧ず
-        /// </summary>
-        public void ChooseAlarmShow()
-        {
-            if (ximoVideoList.Count == 1)
-            {
-                var wanderingAlarmPage = new WanderingAlarmPage(ximoVideoList[0].deviceId);
-                MainPage.BasePageView.AddChidren(wanderingAlarmPage);
-                wanderingAlarmPage.LoadPage();
-                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
-
-            }
-            else
-            {
-                Dialog dialog = new Dialog()
-                {
-                    BackgroundColor = CSS_Color.DialogTransparentColor1,
-                };
-
-                FrameLayout dialogView = new FrameLayout();
-                dialog.AddChidren(dialogView);
-                dialogView.MouseUpEventHandler = (sender, e) =>
-                {
-                    dialog.Close();
-                };
-
-                var contentView = new FrameLayout()
-                {
-                    Gravity = Gravity.Center,
-                    Width = Application.GetRealWidth(270),
-                    Height = Application.GetRealHeight(280),
-                    BackgroundColor = CSS_Color.MainBackgroundColor,
-                    BorderColor = 0x00000000,
-                    BorderWidth = 0,
-                    Radius = (uint)Application.GetMinRealAverage(10),
-                };
-                dialogView.AddChidren(contentView);
-
-                var btnTitle = new Button()
-                {
-                    Height = Application.GetRealHeight(64),
-                    TextAlignment = TextAlignment.Center,
-                    TextColor = CSS_Color.FirstLevelTitleColor,
-                    TextID = StringId.WanderingAlarm,
-                    TextSize = CSS_FontSize.SubheadingFontSize,
-                };
-                contentView.AddChidren(btnTitle);
-
-                var listView = new VerticalScrolViewLayout()
-                {
-                    Gravity = Gravity.CenterHorizontal,
-                    Y = Application.GetRealHeight(70),
-                    Width = Application.GetRealWidth(230),
-                    Height = Application.GetRealHeight(200),
-                };
-                contentView.AddChidren(listView);
-
-
-                foreach (var v in ximoVideoList)
-                {
-                    Button btnMsg = new Button()
-                    {
-                        Gravity = Gravity.CenterHorizontal,
-                        Height = Application.GetRealHeight(50),
-                        Width = Application.GetRealHeight(160),
-                        TextAlignment = TextAlignment.Center,
-                        TextColor = CSS_Color.TextualColor,
-                        TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
-                        Text = v.deviceName,
-                        Radius = (uint)Application.GetRealWidth(5),
-                        BackgroundColor = CSS_Color.DividingLineColor,
-                        IsMoreLines = true,
-                    };
-                    listView.AddChidren(btnMsg);
-
-                    listView.AddChidren(new Button() { Height = Application.GetRealHeight(12) });
-
-                    btnMsg.MouseUpEventHandler = (sender, e) =>
-                    {
-
-
-                        var wanderingAlarmPage = new WanderingAlarmPage(v.deviceId);
-                        MainPage.BasePageView.AddChidren(wanderingAlarmPage);
-                        wanderingAlarmPage.LoadPage();
-                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
-
-                        dialog.Close();
-                    };
-                }
-                dialog.Show();
-            }
-
-        }
-
-
     }
-
-    public class AccessControlQRode
-    {
-        public string title = string.Empty;
-        public string codeType = string.Empty;
-        public string userName = string.Empty;
-        public string houseFullName = string.Empty;
-        public string communityName = string.Empty;
-        public string desc = string.Empty;
-        public string businessType = string.Empty;
-        public string qrcode = string.Empty;
-    }
-
 
 }

--
Gitblit v1.8.0