wjc
2022-09-14 9eec81850e418a3c16410b4870910bde142b06e3
HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs
@@ -2,15 +2,16 @@
using HDL_ON.UI.Music;
using System.Collections.Generic;
using Shared;
using HDL_ON.Stan;
using ZXing.QrCode.Internal;
using static HDL_ON.UI.UI2.FuntionControlView.Video.VideoMethod;
using HDL_ON.UI.CSS;
namespace HDL_ON.UI.UI2.FuntionControlView.Video
{
    public class VideoMainView : FrameLayout
    {
        List<Video> ximoVideoList = new List<Video>();
        List<Video> xiMoVideoList = new List<Video>();
        /// <summary>
        /// 加载可视对讲UI
@@ -19,14 +20,12 @@
        /// <param name="videoList">可视对讲列表</param>
        public void Show(List<CallView> listCall, List<Video> videoList)
        {
            ximoVideoList = videoList.FindAll((obj) => obj.spk == "door.gate");
            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 +37,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 +51,7 @@
                BackgroundColor = MusicColor.SelectedColor,
                Radius = (uint)Application.GetRealHeight(4),
            };
            view1.AddChidren(btn11);
            //view1.AddChidren(btn11);
            Button btn12 = new Button
            {
@@ -61,7 +62,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),
@@ -199,13 +206,13 @@
            if (bol)
            {
                //门禁二维码固定有的,虚拟一个出来
                videoList.Add(new Video { deviceName = Language.StringByID(StringId.menjinerweima), interphoneType = "100",devType = "100" });
                videoList.Add(new Video { deviceName = Language.StringByID(StringId.menjinerweima), interphoneType = "100" ,devType = "100" });
            }
            if (ximoVideoList.Count > 0)
            if (xiMoVideoList.Count > 0)
            {
                //徘徊报警
                videoList.Add(new Video { deviceName = Language.StringByID(StringId.WanderingAlarm), interphoneType = "222", devType = "222" });
            }
            //数组个数
            //int value = 15;
@@ -227,13 +234,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 +256,6 @@
                    UnSelectedImagePath = "VideoIcon/weiqiangji.png",
                };
                fLayout.AddChidren(iconBtn);
                var deviceNameBtn = new Button
                {
@@ -281,24 +284,23 @@
                //门口机的点击事件
                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();
                        ////门禁二维码固定有的
                        //VideoSend.GetQRcode(this, video2, (tag, paw) =>
                        //{
                        //    if (tag)
                        //    {
                        //        //注意:密码有可能延时1分钟生效
                        //        View.ShowDialog showDialog = new View.ShowDialog();
                        //        showDialog.QRcode(paw);
                        //    }
                        //});
                    }
                    else if(video2.devType == "222")
                    else if (video2.devType == "222")
                    {
                        ChooseAlarmShow();
@@ -330,8 +332,10 @@
                            Lc_Psk = video.deviceId,//2021-10-15 PSK字段不能取deviceName
                            Lc_PlayToken = video.playToken,
                            deviceSipAccount = video.deviceSipAccount,
                            HomeId = video.homeId
                            HomeId = video.homeId,
                            deviceCode=video.deviceCode
                        };
                        ESOnVideo.Current.ShowESVideoMonitor(eSVideoInfo, video.interphoneType);
                    }
                };
@@ -574,15 +578,12 @@
            for (int i = 0; i < videoList.Count; i++)
            {
                var _video = videoList[i];
                if (_video.interphoneType == "FLVI"|| _video.spk == "door.gate")
                {
                if (_video.interphoneType == "FLVI" || _video.spk == "door.gate")
                    return true;
                }
            }
            return bol;
        }
        /// <summary>
        /// 获取门禁二维码
@@ -604,7 +605,7 @@
            {
                Gravity = Gravity.Center,
                Width = Application.GetRealWidth(270),
                Height = Application.GetRealHeight(280),
                Height = Application.GetRealHeight(200),
                BackgroundColor = CSS_Color.MainBackgroundColor,
                BorderColor = 0x00000000,
                BorderWidth = 0,
@@ -703,7 +704,7 @@
            //            if (v.spk == "door.gate")
            //            {
            //                return;
            //            }
@@ -725,14 +726,15 @@
        }
        /// <summary>
        /// 选择徘徊报警列表显示
        /// </summary>
        public void ChooseAlarmShow()
        {
            if (ximoVideoList.Count == 1)
            if (xiMoVideoList.Count == 1)
            {
                var wanderingAlarmPage = new WanderingAlarmPage(ximoVideoList[0].deviceId);
                var wanderingAlarmPage = new WanderingAlarmPage(xiMoVideoList[0].deviceId);
                MainPage.BasePageView.AddChidren(wanderingAlarmPage);
                wanderingAlarmPage.LoadPage();
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
@@ -784,7 +786,7 @@
                contentView.AddChidren(listView);
                foreach (var v in ximoVideoList)
                foreach (var v in xiMoVideoList)
                {
                    Button btnMsg = new Button()
                    {
@@ -820,9 +822,11 @@
        }
    }
    /// <summary>
    /// 门禁二维码数据
    /// </summary>
    public class AccessControlQRode
    {
        public string title = string.Empty;