From c8c33200e43f05136eca9fc8ff4942f8def31cc6 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期三, 18 八月 2021 10:45:40 +0800
Subject: [PATCH] 2021-08-18 1.完善Android对接LinphoneSDK 2.完善SIP相关接口对接

---
 HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs |  123 +++++++++++++++++++++++++---------------
 1 files changed, 77 insertions(+), 46 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs b/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs
index 88f2e84..41d5dec 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Video/VideoMainView.cs
@@ -4,6 +4,7 @@
 using Shared;
 using HDL_ON.Stan;
 using ZXing.QrCode.Internal;
+using static HDL_ON.UI.UI2.FuntionControlView.Video.VideoMethod;
 
 namespace HDL_ON.UI.UI2.FuntionControlView.Video
 {
@@ -12,10 +13,9 @@
         /// <summary>
         /// 鍔犺浇鍙瀵硅UI
         /// </summary>
-        /// <param name="listVideo">闂ㄥ彛鏈哄垪琛�</param>
         /// <param name="listCall">閫氳瘽璁板綍鍒楄〃</param>
-        /// <param name="video">褰撳墠鐨勫彲瑙嗗璁�</param>
-        public void Show(List<FlVideo> listVideo, List<CallView> listCall, VideoClouds video)
+        /// <param name="videoList">鍙瀵硅鍒楄〃</param>
+        public void Show(List<CallView> listCall, List<Video> videoList)
         {
             #region 甯冨眬鐣岄潰
             this.BackgroundColor = MusicColor.ViewColor;
@@ -35,8 +35,8 @@
             pageView.AddChidren(view1);
             var view2 = new FrameLayout();
             pageView.AddChidren(view2);
-            View1(view1, listVideo, video);
-            View2(view2, listCall, video);
+            View1(view1, videoList);
+            View2(view2, listCall, videoList);
             Button btn11 = new Button
             {
                 X = Application.GetRealWidth(170),
@@ -107,14 +107,16 @@
             };
             #endregion
         }
+
         /// <summary>
         /// 绗竴涓晫闈�
         /// </summary>
         /// <param name="view1">鐖舵帶浠�</param>
-        /// <param name="list">闂ㄥ彛鏈哄垪琛�</param>
-        /// <param name="videoClouds">褰撳墠鐨勫彲瑙嗗璁�</param>
-        void View1(FrameLayout view1, List<FlVideo> list, VideoClouds videoClouds)
+        /// <param name="video">鍙瀵硅瀵硅薄</param>
+        void View1(FrameLayout view1, List<Video> videoList)
         {
+
+
             #region 甯冨眬鐣岄潰
             var bjFl = new FrameLayout
             {
@@ -188,23 +190,25 @@
                 Width = Application.GetRealWidth(327),
             };
             bjFl.AddChidren(vv);
-            if (list.Count > 0)
+
+            bool bol = haveFlVideo(videoList);
+            if (bol)
             {
                 //闂ㄧ浜岀淮鐮佸浐瀹氭湁鐨�,铏氭嫙涓�涓嚭鏉�
-                list.Add(new FlVideo { aliasName = Language.StringByID(StringId.menjinerweima), devType = "100" });
+                videoList.Add(new Video { deviceName = Language.StringByID(StringId.menjinerweima), interphoneType = "100" });
             }
             //鏁扮粍涓暟
             //int value = 15;
             //鍏堣绠楁暟鎹墍闇�瑕佺殑寰堥珮搴︼紱
             int l = 0;
-            if (list.Count % 3 == 0)
+            if (videoList.Count % 3 == 0)
             {
-                l = list.Count / 3;
+                l = videoList.Count / 3;
             }
             else
             {
 
-                l = (list.Count / 3) + 1;
+                l = (videoList.Count / 3) + 1;
             }
             var fL = new FrameLayout
             {
@@ -214,23 +218,22 @@
             vv.AddChidren(fL);
             int line = 0;
             #endregion
-            for (int i = 1, j = 0; i <= list.Count; i++, j++)
+            for (int i = 1, j = 0; i <= videoList.Count; i++, j++)
             {
-                var video = list[i - 1];
+                var video = videoList[i - 1];
                 #region
                 var fLayout = new FrameLayout
                 {
-                    Width = Application.GetRealWidth(50),
+                    Width = Application.GetRealWidth(96),
                     Height = Application.GetRealWidth(48),
-                    X = Application.GetRealWidth(31 + (58 + 50) * j),
+                    X = Application.GetRealWidth(20 + (26 + 28 + 42) * j),
                     Y = Application.GetRealHeight(20 + (48 + 24) * line),
-
                 };
                 fL.AddChidren(fLayout);
 
                 var iconBtn = new Button
                 {
-                    X = Application.GetRealWidth(11),
+                    Gravity=Gravity.CenterHorizontal,
                     Width = Application.GetRealWidth(28),
                     Height = Application.GetRealWidth(28),
                     UnSelectedImagePath = "VideoIcon/weiqiangji.png",
@@ -240,12 +243,13 @@
                 var deviceNameBtn = new Button
                 {
                     Y = iconBtn.Bottom + Application.GetRealHeight(6),
-                    Width = Application.GetRealWidth(50),
+                    X = Application.GetRealWidth(6),
+                    Width = Application.GetRealWidth(96-12),
                     Height = Application.GetRealHeight(14),
                     TextSize = TextSize.Text10,
                     TextColor = CSS.CSS_Color.TextualColor,
                     TextAlignment = TextAlignment.Center,
-                    Text = video.aliasName,
+                    Text = video.deviceName,
                 };
                 fLayout.AddChidren(deviceNameBtn);
 
@@ -263,11 +267,11 @@
                 //闂ㄥ彛鏈虹殑鐐瑰嚮浜嬩欢
                 clickBtn.MouseUpEventHandler += (sender, e) =>
                 {
-                    var flVideo = clickBtn.Tag as FlVideo;
-                    if (flVideo.devType == "100")
+                    var video2 = clickBtn.Tag as Video;
+                    if (video2.devType == "100")
                     {
                         //闂ㄧ浜岀淮鐮佸浐瀹氭湁鐨�
-                        VideoSend.GetQRcode(this, videoClouds, (tag, paw) =>
+                        VideoSend.GetQRcode(this, video2, (tag, paw) =>
                         {
                             if (tag)
                             {
@@ -279,36 +283,46 @@
                     }
                     else
                     {
-                        if (string.IsNullOrEmpty(flVideo.uuid))
+
+                        if (string.IsNullOrEmpty(video.deviceId))
                         {
                             new Intelligence.Automation.LogicView.TipPopView().FlashingBox(Language.StringByID(StringId.peizhicanshuyouyichang));
                             return;
                         }
+
+                        //Unitno = Intent.GetStringExtra("unitno");
+                        //HomeID = Intent.GetStringExtra("HomeID");
+
+
                         ESVideoInfo eSVideoInfo = new ESVideoInfo
                         {
-                            ESVideoUUID = getUuid(flVideo.uuid),
-                            DeviceName = flVideo.aliasName,
-                            roomno = videoClouds.flRoomId,
-                            unitno = videoClouds.flBuildingId,
+                            ESVideoUUID = getUuid(video.deviceId),
+                            DeviceName = video.deviceName,
+                            roomno = video.flRoomBindVO.flRoomId,
+                            unitno = video.flRoomBindVO.flBuildingId,
+                            uuid = getUuid(video.deviceId),
+                            cmtID = video.flRoomBindVO.flCmtId,
+                            Lc_AccessToken = video.subAccountToken,
+                            Lc_DeviceId = video.deviceId,
+                            Lc_Psk = video.deviceName,
+                            Lc_PlayToken = video.playToken,
+                            deviceSipAccount = video.deviceSipAccount,
+                            HomeId = video.homeId
                         };
-                        ESOnVideo.Current.ShowESVideoMonitor(eSVideoInfo);
+                        ESOnVideo.Current.ShowESVideoMonitor(eSVideoInfo, video.interphoneType);
                     }
-
-
                 };
             }
-
-
         }
+
         /// <summary>
         /// 绗簩涓晫闈�
         /// </summary>
         /// <param name="view2">鐖舵帶浠�</param>
         /// <param name="listCall">閫氳瘽璁板綍鍒楄〃</param>
-        /// <param name="video">褰撳墠鐨勫彲瑙嗗璁�</param>
-        void View2(FrameLayout view2, List<CallView> listCall, VideoClouds video)
+        /// <param name="videoList">鍙瀵硅鍒楄〃</param>
+        void View2(FrameLayout view2, List<CallView> listCall, List<Video> videoList)
         {
-
             var bjFl = new FrameLayout
             {
                 Y = Application.GetRealHeight(24),
@@ -347,20 +361,20 @@
                 TextAlignment = TextAlignment.CenterLeft,
                 TextID = StringId.baolu30,
             };
-            //bjFl.AddChidren(regionBtn);
+            bjFl.AddChidren(regionBtn);
 
             var vv = new VerticalRefreshLayout
             {
                 X = Application.GetRealWidth(16),
-                Y = Application.GetRealHeight(58),
-                Height = Application.GetRealHeight(458),
+                Y = Application.GetRealHeight(58 + 17),
+                Height = Application.GetRealHeight(458 - 17),
                 Width = Application.GetRealWidth(295),
             };
             bjFl.AddChidren(vv);
             vv.BeginHeaderRefreshingAction += () =>
             {
                 VideoMethod videoMethod = new VideoMethod();
-                var list = videoMethod.GetCall(video.id);
+                var list = videoMethod.GetCall();
                 RefreshView(vv, list);
                 //鍏抽棴鍒锋柊View锛�
                 vv.EndHeaderRefreshing();
@@ -368,6 +382,7 @@
             RefreshView(vv, listCall);
 
         }
+
         /// <summary>
         /// 閫氳瘽璁板綍鍒锋柊鐣岄潰
         /// </summary>
@@ -393,6 +408,7 @@
                     frameLayout60.btnTime.Text = getTime(call.callTime);
                     ///鍛煎彨鐘舵�侊紙0锛氭湭鎺ワ紱1锛氬凡鎺ワ紱2锛氭嫆鎺ワ級锛涙槸鍚﹀紑閿侊紱
                     frameLayout60.btnStateText.Text = getStateText(call.callStatus) + "," + getUnlockText(call.isUnlock);
+
                 }
 
             }
@@ -404,11 +420,11 @@
         /// </summary>
         /// <param name="flVideo"></param>
         /// <param name="iconBtn">鍥炬爣</param>
-        private void getIconAndText(FlVideo flVideo, Button iconBtn)
+        private void getIconAndText(Video Video, Button iconBtn)
         {
             //(1瀹ゅ唴鏈�,2瀹ゅ鏈猴紝3鍥村鏈猴紝4绠$悊鏈�,5浜屾纭鏈�)
             string iconstr = "";
-            switch (flVideo.devType)
+            switch (Video.devType)
             {
                 case "1":
                     {
@@ -459,10 +475,9 @@
         {
             var utcTime = Convert.ToDateTime(str);
             var dateTime = TimeZoneInfo.ConvertTimeFromUtc(utcTime, TimeZoneInfo.Local);
-            var monday = dateTime.ToString("MM") + Language.StringByID(StringId.month) + dateTime.ToString("dd") + Language.StringByID(StringId.day);
-            var time = dateTime.ToString("HH") + ":" + dateTime.ToString("mm");
-            return monday + " " + time;
+            return dateTime.ToString("MM-dd HH:mm");
         }
+
         /// <summary>
         /// 鑾峰彇鍛煎彨鐘舵�佹枃鏈�
         /// </summary>
@@ -527,6 +542,22 @@
             }
         }
 
+
+        //鍒ゆ柇鏄惁鏈� 涓版灄鍙瀵硅
+        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")
+                    return true;
+            }
+
+            return bol;
+        }
+
     }
 
 }

--
Gitblit v1.8.0