陈嘉乐
2021-03-29 232070c7a697bd5c7e3cd5115da22fd9a749e3e0
2021-3-29-11

实现可视对讲
2个文件已添加
1个文件已删除
7个文件已修改
14568 ■■■■ 已修改文件
.vs/HDL_APP_Project/xs/UserPrefs.xml 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Resources/Resource.designer.cs 13854 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Server/NewAPI.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/ThirdPartySdk/ESOnVideo.cs 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/HDL_ON.projitems 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Video/MainView.cs 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Video/Send.cs 115 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs 295 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Video/VideoSend.cs 141 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vs/HDL_APP_Project/xs/UserPrefs.xml
@@ -1,41 +1,27 @@
<Properties StartupConfiguration="{09712674-2A38-407B-B1E2-560B2C352F9A}|Default">
  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/Common/Utlis.cs">
  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/FuntionControlView/Video/MainView.cs">
    <Files>
      <File FileName="HDL_ON/Common/R.cs" Line="1156" Column="22" />
      <File FileName="HDL-ON_Android/Assets/Language.ini" />
      <File FileName="HDL_ON/UI/UI2/UserPage.cs" />
      <File FileName="HDL_ON/UI/UI2/UserPageBLL.cs" />
      <File FileName="HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs" Line="383" Column="49" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddButton.cs" Line="94" Column="42" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirSend.cs" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs" Line="121" Column="33" />
      <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/AddControl.cs" />
      <File FileName="HDL_ON/DAL/Mqtt/MqttClient.cs" Line="340" Column="86" />
      <File FileName="HDL_ON/Common/Utlis.cs" Line="120" Column="4" />
      <File FileName="HDL_ON/UI/UI2/FuntionControlView/Video/MainView.cs" Line="12" Column="7" />
      <File FileName="HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs" Line="35" Column="39" />
      <File FileName="HDL_ON/UI/UI2/FuntionControlView/Video/VideoSend.cs" Line="68" Column="44" />
    </Files>
    <Pads>
      <Pad Id="ProjectPad">
        <State name="__root__">
          <Node name="HDL_APP_Project" expanded="True">
            <Node name="HDL_ON" expanded="True">
              <Node name="Common" expanded="True">
                <Node name="Utlis.cs" selected="True" />
              </Node>
              <Node name="DAL" expanded="True">
                <Node name="Mqtt" expanded="True" />
              </Node>
              <Node name="Entity" expanded="True">
                <Node name="Function" expanded="True" />
              </Node>
              <Node name="UI" expanded="True">
                <Node name="UI2" expanded="True">
                  <Node name="1-HomePage" expanded="True" />
                  <Node name="3-Intelligence" expanded="True" />
                  <Node name="3-Intelligence" expanded="True">
                    <Node name="Automation" expanded="True" />
                  </Node>
                  <Node name="4-PersonalCenter" expanded="True">
                    <Node name="PirDevice" expanded="True" />
                  </Node>
                  <Node name="FuntionControlView" expanded="True">
                    <Node name="Video" expanded="True" />
                    <Node name="Video" expanded="True">
                      <Node name="MainView.cs" selected="True" />
                    </Node>
                  </Node>
                </Node>
              </Node>
@@ -54,7 +40,9 @@
  <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
  <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.4b65c4650918" />
  <MonoDevelop.Ide.DebuggingService.Breakpoints>
    <BreakpointStore />
    <BreakpointStore>
      <Breakpoint file="/Users/hdl/Desktop/wjc/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/Video/MainView.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/Video/MainView.cs" line="12" column="1" />
    </BreakpointStore>
  </MonoDevelop.Ide.DebuggingService.Breakpoints>
  <MultiItemStartupConfigurations />
</Properties>
HDL-ON_Android/Resources/Resource.designer.cs
Diff too large
HDL_ON/DAL/Server/NewAPI.cs
@@ -567,9 +567,13 @@
        /// 删除通话记录
        /// </summary>
        public const string API_POST_FL_DeleteCallInfo = "/home-wisdom/app/fl/vi/delete";
        /// <summary>
        /// 获取门口机列表
        /// </summary>
        public const string API_POST_FL_List = "http://112.74.164.111:180/api.php/Device/getmonitorUUID";
        #endregion
    }
    ///// <summary>
HDL_ON/DAL/ThirdPartySdk/ESOnVideo.cs
@@ -62,9 +62,11 @@
            this.esVideoInfo = mESVideoInfo;
#if __IOS__
             int roomID = 0;
            int.TryParse(mESVideoInfo.roomno, out roomID);
            ESOnMonitorViewController vc = new ESOnMonitorViewController();
            vc.MESVideoID = mESVideoInfo.ESVideoUUID;
            //vc.MESRoomID = mESVideoInfo.ESRoomID;
            vc.MESRoomID =roomID;
            vc.DeviceName = mESVideoInfo.DeviceName;
            //vc.RoomName = mESVideoInfo.RoomName;
            vc.MESCallDelegate = new OnESCallDelegate(this);
@@ -96,9 +98,11 @@
        {
            this.esVideoInfo = mESVideoInfo;
#if __IOS__
            int roomID = 0;
            int.TryParse(mESVideoInfo.roomno, out roomID);
            ESOnIntercomViewController vc = new ESOnIntercomViewController();
            vc.MESVideoID = mESVideoInfo.ESVideoUUID;
            //vc.MESRoomID = mESVideoInfo.ESRoomID;
            vc.MESRoomID = roomID;
            vc.DeviceName = mESVideoInfo.DeviceName;
            //vc.RoomName = mESVideoInfo.RoomName;
            //vc.MESCallDelegate = new OnESCallDelegate(this);
@@ -415,27 +419,27 @@
        /// <summary>
        /// 丰林请求的唯一id
        /// </summary>
        public string uuid;
        public string uuid = string.Empty;
        /// <summary>
        /// 丰林社区id
        /// </summary>
        public string cmtID;
        public string cmtID = string.Empty;
        /// <summary>
        /// 丰林房间号
        /// </summary>
        public string roomno;
        public string roomno = string.Empty;
        /// <summary>
        /// 丰林楼栋号
        /// </summary>
        public string unitno;
        public string unitno = string.Empty;
        ///// <summary>
        ///// 丰林住宅Id
        ///// </summary>
        //public string HomeID;
        //public string HomeID= string.Empty;
        /// <summary>
        /// 呼叫记录Id
        /// </summary>
        public string callId;
        public string callId = string.Empty;
    }
HDL_ON/HDL_ON.projitems
@@ -388,9 +388,10 @@
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\EnvironmentalScience\EchartsOption_Pie.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\SetPir.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\1ContorlPage\AcControlPage_AddIrButton.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Video\Send.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Energy\EnergyMainPage.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)DAL\ThirdPartySdk\ESOnVideo.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Video\VideoMethod.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Video\VideoSend.cs" />
  </ItemGroup>
  <ItemGroup>
    <Folder Include="$(MSBuildThisFileDirectory)DAL\" />
HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs
@@ -260,6 +260,12 @@
        {
            EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
            {
                var view = new UI2.FuntionControlView.Video.VideoMethod();// AddThirdPartyBrandListpage(); // BrandListPage();
                view.MianView();
                return;
                var page = new BrandListPage();// AddThirdPartyBrandListpage(); // BrandListPage();
                MainPage.BasePageView.AddChidren(page);
                page.LoadPage();
HDL_ON/UI/UI2/FuntionControlView/Video/MainView.cs
@@ -1,13 +1,15 @@
using System;
using HDL_ON.UI.Music;
using System.Collections.Generic;
using Shared;
using static HDL_ON.UI.UI2.FuntionControlView.Video.VideoMethod;
namespace HDL_ON.UI.UI2.FuntionControlView.Video
{
    public class MainView : FrameLayout
    {
        public void Show()
        public void Show(List<ESVideoInfo> listVideo, List<CallView> listCall)
        {
            this.BackgroundColor = MusicColor.ViewColor;
            var topView = new TopView();
            this.AddChidren(topView.TopFLayoutView());
@@ -28,8 +30,8 @@
            pageView.AddChidren(view1);
            var view2 = new FrameLayout();
            pageView.AddChidren(view2);
            View1(view1);
            View2(view2);
            View1(view1, listVideo);
            View2(view2, listCall);
            Button btn11 = new Button
            {
                X = Application.GetRealWidth(170),
@@ -91,9 +93,9 @@
        /// 第一个界面
        /// </summary>
        /// <param name="view1">父控件</param>
        void View1(FrameLayout view1)
        void View1(FrameLayout view1, List<ESVideoInfo> list)
        {
            var bjFl = new FrameLayout
            {
                Y = Application.GetRealHeight(24),
@@ -158,24 +160,25 @@
            };
            bjFl.AddChidren(intercomBtnIcon);
            var vv = new VerticalScrolViewLayout {
            var vv = new VerticalScrolViewLayout
            {
                Y = Application.GetRealHeight(306),
                Height = Application.GetRealHeight(220),
                Width = Application.GetRealWidth(327),
            };
            bjFl.AddChidren(vv);
            //数组个数
            int value = 15;
            //int value = 15;
            //先计算数据所需要的很高度;
            int l = 0;
            if (value % 3 == 0)
            if (list.Count % 3 == 0)
            {
                l = value / 3;
                l = list.Count / 3;
            }
            else
            {
                l = (value / 3) + 1;
                l = (list.Count / 3) + 1;
            }
            var fL = new FrameLayout
            {
@@ -184,8 +187,10 @@
            };
            vv.AddChidren(fL);
            int line = 0;
            for (int i = 1, j = 0; i <= value; i++, j++)
            for (int i = 1, j = 0; i <= list.Count; i++, j++)
            {
                var video = list[i - 1];
                var fLayout = new FrameLayout
                {
                    Width = Application.GetRealWidth(50),
@@ -213,11 +218,12 @@
                    TextSize = TextSize.Text10,
                    TextColor = CSS.CSS_Color.TextualColor,
                    TextAlignment = TextAlignment.Center,
                    Text="查看单元机"
                    Text = video.DeviceName,
                };
                fLayout.AddChidren(iconNameBtn);
                var clickBtn = new Button { Tag = i };
                var clickBtn = new Button { Tag = video };
                fLayout.AddChidren(clickBtn);
                if (i % 3 == 0)
                {
@@ -228,35 +234,9 @@
                // GetIconAndText(i, deviceIconBtn, iconNameBtn);
                clickBtn.MouseUpEventHandler += (sender, e) =>
                {
                    var eSVideoInfo = clickBtn.Tag as ESVideoInfo;
                    ESOnVideo.Current.ShowESVideoMonitor(eSVideoInfo);
                    ////1=空调;2=电视;3=风扇;4=机顶盒;5=DVD/EVD/VCD;6=投影仪;7=自定义;
                    //int if_value = int.Parse(clickBtn.Tag.ToString());
                    //if (if_value == 7)
                    //{
                    //    Method method = new Method();
                    //    method.AddControl(this, (control) =>
                    //    {
                    //        AddButton addButton = new AddButton();
                    //        MainPage.BasePageView.AddChidren(addButton);
                    //        addButton.Show(control);
                    //        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                    //    });
                    //}
                    //else
                    //{
                    //    if (DeviceTypeList.Count == 0)
                    //    {
                    //        GetDeviceTypeList(true, () =>
                    //        {
                    //            DeviceTypeViewClick(if_value);
                    //        });
                    //    }
                    //    else
                    //    {
                    //        DeviceTypeViewClick(if_value);
                    //    }
                    //}
                };
            }
@@ -266,9 +246,9 @@
        /// 第二个界面
        /// </summary>
        /// <param name="view2">父控件</param>
        void View2(FrameLayout view2)
        void View2(FrameLayout view2, List<CallView> listCall)
        {
            var bjFl = new FrameLayout
            {
                Y = Application.GetRealHeight(24),
@@ -317,24 +297,28 @@
                Width = Application.GetRealWidth(295),
            };
            bjFl.AddChidren(vv);
            for (int i = 0; i < 6; i++)
            for (int i = 0; i < listCall.Count; i++)
            {
                if (i == 0|| i == 2)
                var year = listCall[i];
                View.FrameLayout50 frameLayout50 = new View.FrameLayout50();
                vv.AddChidren(frameLayout50.FLayoutView());
                for (int j = 0; j < year.callList.Count; j++)
                {
                    View.FrameLayout50 frameLayout50 = new View.FrameLayout50();
                    vv.AddChidren(frameLayout50.FLayoutView());
                }
                else
                {
                    var call = year.callList[j];
                    View.FrameLayout60 frameLayout60 = new View.FrameLayout60();
                    vv.AddChidren(frameLayout60.FLayoutView());
                }
            }
        }
        public string getTime(string str)
        {
            var dd = Convert.ToDateTime(str);
            var time = dd.ToString("HH") + ":" + dd.ToString("mm");
            return time;
        }
    }
}
HDL_ON/UI/UI2/FuntionControlView/Video/Send.cs
File was deleted
HDL_ON/UI/UI2/FuntionControlView/Video/VideoMethod.cs
New file
@@ -0,0 +1,295 @@
using System;
using HDL_ON.DAL.Server;
using HDL_ON.UI.UI2.PersonalCenter.PirDevice;
using System.Collections.Generic;
using Shared;
namespace HDL_ON.UI.UI2.FuntionControlView.Video
{
    public class VideoMethod : FrameLayout
    {
        public void MianView()
        {
            var d = VideoSend.GetVideo();
            getVideo((video) =>
            {
                List<ESVideoInfo> listESVideoInfo = new List<ESVideoInfo>();
                List<CallView> listCall = new List<CallView>();
                new System.Threading.Thread(() =>
                {
                    try
                    {
                        listESVideoInfo = VideoSend.GetVideoInfoList(video);
                        listCall = getCall(video.id);
                    }
                    catch
                    {
                    }
                    finally
                    {
                        Application.RunOnMainThread(() =>
                        {
                            var mainView = new MainView();
                            MainPage.BasePageView.AddChidren(mainView);
                            mainView.Show(listESVideoInfo, listCall);
                            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                        });
                    }
                })
                { IsBackground = true }.Start();
            }, this, true);
        }
        /// <summary>
        /// 获取可视对讲
        /// </summary>
        /// <param name="action">回调函数</param>
        /// <param name="frame">log父控件</param>
        public void getVideo(Action<VideoObj> action, FrameLayout frame, bool tag)
        {
            ThreadSend(null, (responsePackNew) =>
             {
                 try
                 {
                     var str = responsePackNew.Data.ToString();
                     var videoObj = Newtonsoft.Json.JsonConvert.DeserializeObject<VideoObj>(str);
                     action(videoObj);
                 }
                 catch { }
             }, "获取可视对讲", "fram", frame, null, tag);
        }
        /// <summary>
        /// 获取历史通话记录
        /// </summary>
        /// <param name="id"></param>
        public List<CallView> getCall(string id)
        {
            List<CallView> callViewList = new List<CallView>();
            try
            {
                List<Call> listCall = new List<Call>();
                var responsePackNew = VideoSend.GetCall(id);
                if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "")
                {
                    var jobject = Newtonsoft.Json.Linq.JObject.Parse(responsePackNew.Data.ToString());
                    string list = jobject["list"].ToString();
                    listCall = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Call>>(list);
                }
                List<string> strYear = new List<string>();
                for (int i = 0; i < listCall.Count; i++)
                {
                    var call = listCall[i];
                    if (string.IsNullOrEmpty(call.callTime))
                    {
                        continue;
                    }
                    var dd = Convert.ToDateTime(call.callTime);
                    var year = dd.ToString("yyyy");
                    if (null == strYear.Find((c) => c == year))
                    {
                        strYear.Add(year);
                    }
                }
                for (int j = 0; j < strYear.Count; j++)
                {
                    var year = strYear[j];
                    CallView callView = new CallView();
                    callView.year = year;
                    for (int i = 0; i < listCall.Count; i++)
                    {
                        var call = listCall[i];
                        if (string.IsNullOrEmpty(call.callTime))
                        {
                            continue;
                        }
                        var dd = Convert.ToDateTime(call.callTime);
                        var y = dd.ToString("yyyy");
                        if (y == year)
                        {
                            callView.callList.Add(call);
                        }
                    }
                    callViewList.Add(callView);
                }
            }
            catch { }
            return callViewList;
        }
        /// <summary>
        /// 发送命令线程
        /// </summary>
        /// <param name="videoObj">数据对象</param>
        /// <param name="action">回调函数</param>
        /// <param name="str">判断字符</param>
        /// <param name="view">判断log父控件</param>
        /// <param name="frame">log父控件</param>
        /// <param name="dialog">log父控件</param>
        /// <param name="tag">是否要显示log</param>
        public static void ThreadSend(VideoObj videoObj, Action<ResponsePackNew> action, string str, string view, FrameLayout frame, Dialog dialog, bool tag = true)
        {
            //加载log
            Loading loading = new Loading();
            if (view == "dialog")
            {
                dialog.AddChidren(loading);
            }
            else
            {
                frame.AddChidren(loading);
            }
            if (tag)
            {
                loading.Start();
            }
            ResponsePackNew responsePackNew = null;
            new System.Threading.Thread(() =>
            {
                try
                {
                    if (str == "获取可视对讲")
                    {
                        responsePackNew = VideoSend.GetVideo();
                    }
                    else if (str == "获取通话记录")
                    {
                        responsePackNew = VideoSend.GetCall(videoObj.id);
                    }
                }
                catch { }
                finally
                {
                    Application.RunOnMainThread(() =>
                    {
                        if (tag)
                        {
                            loading.Hide();
                        }
                        if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "")
                        {
                            action(responsePackNew);
                        }
                        else
                        {
                            Method method = new Method();
                            //自定义错误提示文本
                            string eorroText = "";
                            if (str == "获取可视对讲")
                            {
                            }
                            method.ErrorShow(responsePackNew, eorroText);
                        }
                    });
                }
            })
            { IsBackground = true }.Start();
        }
        [Serializable]
        public class VideoObj
        {
            /// <summary>
            /// 丰林绑定id(flBindId)
            /// </summary>
            public string id = string.Empty;
            /// <summary>
            /// 住宅id
            /// </summary>
            public string homeId = string.Empty;
            /// <summary>
            /// 虚拟手机号
            /// </summary>
            public string phone = string.Empty;
            /// <summary>
            /// 虚拟身份证号码
            /// </summary>
            public string idCard = string.Empty;
            /// <summary>
            /// 社区主键Id
            /// </summary>
            public string communtiyId = string.Empty;
            /// <summary>
            /// 丰林楼栋号
            /// </summary>
            public string flBuildingId = string.Empty;
            /// <summary>
            /// 丰林楼栋名称
            /// </summary>
            public string flBuildingName = string.Empty;
            /// <summary>
            /// 丰林房间名称
            /// </summary>
            public string flRoomId = string.Empty;
            /// <summary>
            /// 丰林安全密钥
            /// </summary>
            public string flSecretKey = string.Empty;
            /// <summary>
            /// 丰林的小区Id
            /// </summary>
            public string flCmtId = string.Empty;
        }
        [Serializable]
        public class Call
        {
            /// <summary>
            ///记录主键Id
            /// </summary>
            public string id = string.Empty;
            /// <summary>
            /// 住宅id
            /// </summary>
            public string homeId = string.Empty;
            /// <summary>
            /// 呼叫时间
            /// </summary>
            public string callTime = string.Empty;
            /// <summary>
            /// 通话时长
            /// </summary>
            public string callDuration = string.Empty;
            /// <summary>
            /// 呼叫状态(0:未接;1:已接;2:拒接)
            /// </summary>
            public string callStatus = string.Empty;
            /// <summary>
            /// 是否开锁
            /// </summary>
            public bool isUnlock;
            /// <summary>
            /// 截图地址
            /// </summary>
            public string screenshotUrl = string.Empty;
            /// <summary>
            ///丰林绑定主键id(门口机主键Id)
            /// </summary>
            public string flBindId = string.Empty;
        }
        [Serializable]
        public class CallView
        {
            /// <summary>
            ///年
            /// </summary>
            public string year = string.Empty;
           public List<Call> callList = new List<Call>();
        }
    }
}
HDL_ON/UI/UI2/FuntionControlView/Video/VideoSend.cs
New file
@@ -0,0 +1,141 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using HDL_ON.DAL.Server;
using HDL_ON.UI.UI2.PersonalCenter.PirDevice;
using Newtonsoft.Json.Linq;
using Shared;
using static HDL_ON.UI.UI2.FuntionControlView.Video.VideoMethod;
namespace HDL_ON.UI.UI2.FuntionControlView.Video
{
    public class VideoSend
    {
        /// <summary>
        /// 检查住宅是否绑定丰林,并获取门口机列表
        /// </summary>
        /// <returns></returns>
        public static ResponsePackNew GetVideo()
        {
            var jObject = new JObject { { "homeId", PirSend.HomeId } };
            var responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_FL_Check);
            return responsePackNew;
        }
        /// <summary>
        /// 获取通话记录
        /// </summary>
        /// <returns></returns>
        public static ResponsePackNew GetCall(string flBindId)
        {
            var jObject = new JObject { { "homeId", PirSend.HomeId }, { "flBindId", flBindId }, { "pageSize", int.MaxValue } };
            var responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_FL_GetCallList);
            return responsePackNew;
        }
        /// <summary>
        /// 获取门口机列表(1室内机,2室外机,3围墙机,4管理机,5二次确认机)
        /// </summary>
        public static List<ESVideoInfo> GetVideoInfoList(VideoObj video)
        {
            List<ESVideoInfo> eSVideoInfosList = new List<ESVideoInfo>();
            var jobject = new JObject();
            jobject.Add("cmtID",video.flCmtId);
            jobject.Add("unitno", video.flBuildingId);
            jobject.Add("method", "getUUIDList");
            var str = HttpWebRequest(NewAPI.API_POST_FL_List, jobject.ToString(), "POST");
            if (string.IsNullOrEmpty(str))
            {
                return eSVideoInfosList;
            }
            var json = JObject.Parse(str);
            if (json == null)
            {
                return eSVideoInfosList;
            }
            if (json["resCode"].ToString() != "0")
            {
                return eSVideoInfosList;
            }
            var list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Dictionary<string, string>>>(json["list"].ToString());
            if (list.Count == 0)
            {
                return eSVideoInfosList;
            }
            foreach (var videoInfo in list)
            {
                ESVideoInfo eSVideoInfo = new ESVideoInfo();
                eSVideoInfo.DeviceName = videoInfo["aliasName"];
                if (videoInfo["uuid"].Contains(","))
                {
                    var uuid = videoInfo["uuid"].Split(',');
                    eSVideoInfo.ESVideoUUID = uuid[0];
                }
                else
                {
                    eSVideoInfo.ESVideoUUID = videoInfo["uuid"];
                }
                eSVideoInfo.uuid = videoInfo["uuid"];
                eSVideoInfo.roomno = video.flRoomId;
                eSVideoInfosList.Add(eSVideoInfo);
            }
            return eSVideoInfosList;
        }
        /// <summary>
        ///  请求服务器的方法(支持请求方式为POST/GET)
        /// </summary>
        /// <param name="getUrl">请求的地址</param>
        /// <param name="str">请求数据</param>
        /// <param name="method">请求方式为POST/GET</param>
        /// <param name="second">超时时间</param>
        /// <returns></returns>
        public static string HttpWebRequest(string getUrl, string str, string method, int second = 3)
        {
            try
            {
                HttpWebRequest request = WebRequest.Create(getUrl) as HttpWebRequest; //创建请求
                request.Method = method; //请求方式为POST/GET
                request.ContentType = "application/json";
                request.Timeout = second * 1000;//超时时间
                if (method == "POST")
                {
                    byte[] jsonbyte = System.Text.Encoding.UTF8.GetBytes(str);
                    request.ContentLength = jsonbyte.Length;
                    Stream postStream = request.GetRequestStream();
                    postStream.Write(jsonbyte, 0, jsonbyte.Length);
                    postStream.Close();
                }
                //发送请求并获取相应回应数据
                HttpWebResponse res;
                try
                {
                    res = (HttpWebResponse)request.GetResponse();
                }
                catch (WebException ex)
                {
                    res = (HttpWebResponse)ex.Response;
                }
                StreamReader sr = new StreamReader(res.GetResponseStream(), System.Text.Encoding.UTF8);
                string content = sr.ReadToEnd(); //获得响应字符串
                return content;
            }
            catch
            {
                return null;
            }
        }
        /// <summary>
        ///请求服务器(与住宅有关:例如;homeId)
        /// </summary>
        /// <returns></returns>
        public static ResponsePackNew RequestServerhomeId(object o, string api_Url, int mTimeout = 20)
        {
            var requestJson = HttpUtil.GetSignRequestJson(o);
            return HttpUtil.RequestHttpsPostFroHome(api_Url, requestJson, mTimeout);
        }
    }
}