JLChen
2021-03-25 f5d70cb8d5407e1aeaa596976639837151c9c909
2021-03-25 1.增加相关接口
1个文件已添加
2个文件已删除
6个文件已修改
688 ■■■■■ 已修改文件
.vs/HDL_APP_Project/xs/UserPrefs.xml 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/.DS_Store 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/HDL-ON_Android.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Other/ESOnVideo.cs 106 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/HDL-ON_iOS.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Other/ESOnVideo.cs 117 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/FL/ESOnVideo.cs 394 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Server/NewAPI.cs 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/HDL_ON.projitems 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vs/HDL_APP_Project/xs/UserPrefs.xml
@@ -1,27 +1,21 @@
<Properties StartupConfiguration="{09712674-2A38-407B-B1E2-560B2C352F9A}|Default">
  <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneSimulatorTarget.08FD445C-3EE8-4ED2-BF28-B42ADD0DA92C" />
  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/Common/Constant.cs">
<Properties StartupConfiguration="{D998E133-F0DD-4760-BE3C-461632F54DA4}|Default">
  <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.00008030-00014C392121802E" />
  <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI1-Login/ForgetPasswordPage.cs">
    <Files>
      <File FileName="HDL-ON_iOS/Other/ESVideo.cs" Line="9" Column="27" />
      <File FileName="HDL-ON_Android/Application.cs" Line="30" Column="10" />
      <File FileName="HDL_ON/Common/HDLCommon.cs" Line="251" Column="23" />
      <File FileName="HDL-ON_Android/Other/JLCountrycode.cs" Line="67" Column="32" />
      <File FileName="HDL-ON_Android/Other/JPush/JPushService.cs" Line="1" Column="1" />
      <File FileName="HDL-ON_Android/Other/JPush/JPushReceiver.cs" Line="177" Column="52" />
      <File FileName="HDL_ON/Common/Constant.cs" Line="241" Column="32" />
      <File FileName="HDL_ON/UI/UI1-Login/ForgetPasswordPage.cs" Line="1" Column="1" />
    </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="Constant.cs" selected="True" />
              <Node name="DAL" expanded="True">
                <Node name="FL" expanded="True" />
              </Node>
            </Node>
            <Node name="HDL-ON_Android" expanded="True">
              <Node name="Other" expanded="True">
                <Node name="JPush" expanded="True" />
              <Node name="UI" expanded="True">
                <Node name="UI1-Login" expanded="True">
                  <Node name="ForgetPasswordPage.cs" selected="True" />
                </Node>
              </Node>
            </Node>
            <Node name="HDL-ON_iOS" expanded="True">
@@ -39,8 +33,8 @@
    <String>Shared.Droid.TouchID/Shared.Droid.TouchID.csproj</String>
    <String>Shared.IOS/Shared.IOS.csproj</String>
  </DisabledProjects>
  <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
  <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.822QECU5228FU" />
  <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|iPhone" />
  <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.Android_Accelerated_Oreo" />
  <MonoDevelop.Ide.DebuggingService.Breakpoints>
    <BreakpointStore />
  </MonoDevelop.Ide.DebuggingService.Breakpoints>
HDL-ON_Android/.DS_Store
Binary files differ
HDL-ON_Android/HDL-ON_Android.csproj
@@ -137,7 +137,6 @@
    <Compile Include="Other\JLCountrycode.cs" />
    <Compile Include="Other\JPush\JPushReceiver.cs" />
    <Compile Include="Other\JPush\JPushService.cs" />
    <Compile Include="Other\ESOnVideo.cs" />
  </ItemGroup>
  <ItemGroup>
    <None Include="Resources\AboutResources.txt" />
HDL-ON_Android/Other/ESOnVideo.cs
File was deleted
HDL-ON_iOS/HDL-ON_iOS.csproj
@@ -474,7 +474,6 @@
        <Compile Include="ZXingOverlayView.cs" />
        <Compile Include="Other\JLCountrycode.cs" />
        <Compile Include="BlueWifi.cs" />
        <Compile Include="Other\ESOnVideo.cs" />
    </ItemGroup>
    <ItemGroup>
      <BundleResource Include="Resources\Phone\LoginIcon\ShowPasswordIcon.png" />
HDL-ON_iOS/Other/ESOnVideo.cs
File was deleted
HDL_ON/DAL/FL/ESOnVideo.cs
New file
@@ -0,0 +1,394 @@
using System;
using HDL_ON;
using HDL_ON.DAL.Server;
using System.Threading;
using System.Collections.Generic;
#if __IOS__
using Shared.IOS.ESVideoOnSDK;
using UIKit;
using Foundation;
#endif
namespace Shared
{
    /// <summary>
    /// 丰林可视对讲
    /// </summary>
    public class ESOnVideo
    {
        /// <summary>
        ///
        /// </summary>
        private static ESOnVideo m_Current = null;
        /// <summary>
        ///
        /// </summary>
        public static ESOnVideo Current
        {
            get
            {
                if (m_Current == null)
                {
                    m_Current = new ESOnVideo();
                }
                return m_Current;
            }
        }
        /// <summary>
        ///
        /// </summary>
        public ESVideoInfo esVideoInfo;
        //public FLInfo mFLInfo;
        public void InitESVideoSDK()
        {
            //ESVideo.
        }
        /// <summary>
        /// 监控页面
        /// </summary>
        /// <param name="mESVideoInfo"></param>
        public void ShowESVideoMonitor(ESVideoInfo mESVideoInfo)
        {
            this.esVideoInfo = mESVideoInfo;
#if __IOS__
            ESOnMonitorViewController vc = new ESOnMonitorViewController();
            vc.MESVideoID = mESVideoInfo.ESVideoUUID;
            //vc.MESRoomID = mESVideoInfo.ESRoomID;
            vc.DeviceName = mESVideoInfo.DeviceName;
            //vc.RoomName = mESVideoInfo.RoomName;
            vc.MESCallDelegate = new OnESCallDelegate(this);
            Shared.Application.currentVC.NavigationController.PushViewController(vc, true);
#else
#endif
        }
        /// <summary>
        /// 被呼叫页面
        /// </summary>
        /// <param name="mESVideoInfo"></param>
        public void ShowESvideoVideoIntercom(ESVideoInfo mESVideoInfo)
        {
            this.esVideoInfo = mESVideoInfo;
#if __IOS__
            ESOnIntercomViewController vc = new ESOnIntercomViewController();
            vc.MESVideoID = mESVideoInfo.ESVideoUUID;
            //vc.MESRoomID = mESVideoInfo.ESRoomID;
            vc.DeviceName = mESVideoInfo.DeviceName;
            //vc.RoomName = mESVideoInfo.RoomName;
            vc.MESCallDelegate = new OnESCallDelegate(this);
            Shared.Application.currentVC.NavigationController.PushViewController(vc, true);
#else
#endif
        }
        #region 动作回调,提交记录到云端
        /// <summary>
        /// 判断callId是否为空
        /// </summary>
        /// <returns></returns>
        bool CheckESVideoInfoIsNullOrEmpty()
        {
            return (esVideoInfo == null || string.IsNullOrEmpty(esVideoInfo.callId));
        }
        /// <summary>
        /// 接听
        /// </summary>
        void AnswerAction()
        {
            Utlis.WriteLine("AnswerAction");
            if (CheckESVideoInfoIsNullOrEmpty()) return;
            new Thread(() =>
            {
                var requestJson = HttpUtil.GetSignRequestJson(esVideoInfo);
                var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_FL_Answer, requestJson);
                if (revertObj.Code == StateCode.SUCCESS)
                {
                    Utlis.WriteLine("POST 接听成功");
                }
                else
                {
                    Utlis.WriteLine("POST 接听失败");
                }
            })
            { IsBackground = true }.Start();
        }
        /// <summary>
        /// 挂断
        /// </summary>
        /// <param name="callDuration"></param>
        void HangUpAction(int callDuration)
        {
            Utlis.WriteLine("HangUpAction :" + callDuration);
            if (CheckESVideoInfoIsNullOrEmpty()) return;
            new Thread(() =>
            {
                Dictionary<string, object> dic = new Dictionary<string, object>();
                dic.Add("callId", esVideoInfo.callId);
                dic.Add("callDuration", callDuration);
                var requestJson = HttpUtil.GetSignRequestJson(dic);
                var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_FL_HangUp, requestJson);
                if (revertObj.Code == StateCode.SUCCESS)
                {
                    Utlis.WriteLine("POST 挂断成功");
                }
                else
                {
                    Utlis.WriteLine("POST 挂断失败");
                }
            })
            { IsBackground = true }.Start();
        }
        /// <summary>
        /// 拒接
        /// </summary>
        void RejectCallAction()
        {
            Utlis.WriteLine("RejectCallAction");
            if (CheckESVideoInfoIsNullOrEmpty()) return;
            new Thread(() =>
            {
                Dictionary<string, object> dic = new Dictionary<string, object>();
                dic.Add("callId", esVideoInfo.callId);
                var requestJson = HttpUtil.GetSignRequestJson(dic);
                var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_FL_Reject, requestJson);
                if (revertObj.Code == StateCode.SUCCESS)
                {
                    Utlis.WriteLine("POST 拒接成功");
                }
                else
                {
                    Utlis.WriteLine("POST 拒接失败");
                }
            })
            { IsBackground = true }.Start();
        }
        /// <summary>
        /// 截图成功
        /// </summary>
        void ScreenshotSuccessfulAction(byte[] dataBytes)
        {
            Utlis.WriteLine("ScreenshotSuccessfulAction");
            if (CheckESVideoInfoIsNullOrEmpty()) return;
            new Thread(() =>
            {
                var imageName = Guid.NewGuid().ToString();
                Dictionary<string, object> dic = new Dictionary<string, object>();
                dic.Add("callId", esVideoInfo.callId);
                dic.Add("images", dataBytes);
                dic.Add("imagesName", "FL" + imageName + "_ios.jpg");
                var requestJson = HttpUtil.GetSignRequestJson(dic);
                var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_FL_Screenshot, requestJson);
                if (revertObj.Code == StateCode.SUCCESS)
                {
                    Utlis.WriteLine("POST 截图上传成功");
                }
                else
                {
                    Utlis.WriteLine("POST 截图上传失败");
                }
            })
            { IsBackground = true }.Start();
        }
        /// <summary>
        /// 开锁成功
        /// </summary>
        void UnlockAction()
        {
            Utlis.WriteLine("UnlockAction");
            if (CheckESVideoInfoIsNullOrEmpty()) return;
            new Thread(() =>
            {
                Dictionary<string, object> dic = new Dictionary<string, object>();
                dic.Add("callId", esVideoInfo.callId);
                var requestJson = HttpUtil.GetSignRequestJson(dic);
                var revertObj = HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_FL_Unlock, requestJson);
                if (revertObj.Code == StateCode.SUCCESS)
                {
                    Utlis.WriteLine("POST 开锁成功");
                }
                else
                {
                    Utlis.WriteLine("POST 开锁失败");
                }
            })
            { IsBackground = true }.Start();
        }
        #endregion
#if __IOS__
        #region OnESCallDelegate
        /////// <summary>
        /////// OnESCallDelegate 继承响应事件
        /////// </summary>
        //OnESCallDelegate mOnESCallDelegate;
        public class OnESCallDelegate : ESCallDelegate
        {
            [Weak] ESOnVideo _ESOnVideo;
            public OnESCallDelegate(ESOnVideo mESOnVideo)
            {
                _ESOnVideo = mESOnVideo;
            }
            /// <summary>
            /// 接听
            /// </summary>
            public override void OnAnswerAction()
            {
                _ESOnVideo.AnswerAction();
            }
            /// <summary>
            /// 挂断
            /// </summary>
            /// <param name="callDuration"></param>
            public override void OnHangUpAction(int callDuration)
            {
                _ESOnVideo.HangUpAction(callDuration);
            }
            /// <summary>
            /// 拒接
            /// </summary>
            public override void OnRejectCallAction()
            {
                _ESOnVideo.RejectCallAction();
            }
            /// <summary>
            /// 截图成功
            /// </summary>
            /// <param name="image"></param>
            public override void OnScreenshotSuccessfulAction(UIImage image)
            {
                //NSData imageData = UIImagePNGRepresentation(image); UIImage
                NSData imageData = image.AsPNG();
                byte[] dataBytes = new byte[imageData.Length];
                System.Runtime.InteropServices.Marshal.Copy(imageData.Bytes, dataBytes, 0, Convert.ToInt32(imageData.Length));
                //image.g
                _ESOnVideo.ScreenshotSuccessfulAction(dataBytes);
            }
            /// <summary>
            /// 开锁成功
            /// </summary>
            public override void OnUnlockAction()
            {
                _ESOnVideo.UnlockAction();
            }
        }
        #endregion
#endif
        /// <summary>
        /// 测试方法
        /// </summary>
        /// <param name="isMonitor"></param>
        public void Test(bool isMonitor = true)
        {
            ESVideoInfo eSVideoInfo = new ESVideoInfo()
            {
                DeviceName = "室外机88",
                ESVideoUUID = "JJY000019VPLLF",
            };
            if (isMonitor)
            {
                ShowESVideoMonitor(eSVideoInfo);
            }
            else
            {
                ShowESvideoVideoIntercom(eSVideoInfo);
            }
        }
    }
    /// <summary>
    ///
    /// </summary>
    public class ESVideoInfo
    {
        /// <summary>
        /// 室外机的UUID
        /// 例:JJY000007FSEYX
        /// </summary>
        public string ESVideoUUID = string.Empty;
        /// <summary>
        /// 室外机的名称
        /// 例:室外机
        /// </summary>
        public string DeviceName = string.Empty;
        /// <summary>
        /// 丰林请求的唯一id
        /// </summary>
        public string uuid;
        /// <summary>
        /// 丰林社区id
        /// </summary>
        public string cmtID;
        /// <summary>
        /// 丰林房间号
        /// </summary>
        public string roomno;
        /// <summary>
        /// 丰林楼栋号
        /// </summary>
        public string unitno;
        /// <summary>
        /// 丰林住宅Id
        /// </summary>
        public string HomeID;
        /// <summary>
        /// 呼叫记录Id
        /// </summary>
        public string callId;
    }
}
HDL_ON/DAL/Server/NewAPI.cs
@@ -521,8 +521,43 @@
        /// 修改红外宝名称
        /// </summary>
        public const string API_POST_Ir_DeviceRename = "/home-wisdom/app/device/rename";
        #endregion
        #region  ■  -- 丰林相关相关接口___________________________
        ///// <summary>
        ///// 检查住宅是否绑定丰林,并获取门口机列表
        ///// </summary>
        //public const string API_POST_FL_Check = "/home-wisdom/app/fl/vi/answer";
        /// <summary>
        /// 接听
        /// </summary>
        public const string API_POST_FL_Answer = "/home-wisdom/app/fl/vi/answer";
        /// <summary>
        /// 拒接
        /// </summary>
        public const string API_POST_FL_Reject = "/home-wisdom/app/fl/vi/reject";
        /// <summary>
        /// 开锁成功
        /// </summary>
        public const string API_POST_FL_Unlock= "/home-wisdom/app/fl/vi/unlock";
        /// <summary>
        /// 通话视频截图上传
        /// </summary>
        public const string API_POST_FL_Screenshot = "/home-wisdom/app/fl/vi/screenshot";
        /// <summary>
        /// 通话视频截图上传
        /// </summary>
        public const string API_POST_FL_HangUp = "/home-wisdom/app/fl/vi/hang-up";
        /// <summary>
        /// 获取通话记录
        /// </summary>
        public const string API_POST_FL_GetCallList = "/home-wisdom/app/fl/vi/list";
        /// <summary>
        /// 删除通话记录
        /// </summary>
        public const string API_POST_FL_DeleteCallInfo = "/home-wisdom/app/fl/vi/delete";
        #endregion
    }
HDL_ON/HDL_ON.projitems
@@ -360,6 +360,7 @@
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\Matching.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\View\PirNameView.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\AddFunction\BrandListPage.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)DAL\FL\ESOnVideo.cs" />
  </ItemGroup>
  <ItemGroup>
    <Folder Include="$(MSBuildThisFileDirectory)UI\" />
@@ -399,5 +400,6 @@
    <Folder Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\ArmSensor\" />
    <Folder Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\" />
    <Folder Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\View\" />
    <Folder Include="$(MSBuildThisFileDirectory)DAL\FL\" />
  </ItemGroup>
</Project>