wxr
2021-03-26 f676a4c180fc54cc82eecbfcd24d32fe7d8581db
Merge branch 'CJL' into temp-wxr
8个文件已添加
13个文件已删除
14个文件已修改
1026 ■■■■ 已修改文件
DLL/FL/Android/VideoLibs.dll 补丁 | 查看 | 原始文档 | blame | 历史
DLL/FL/Android/cloudp2p.dll 补丁 | 查看 | 原始文档 | blame | 历史
DLL/FL/Android/corelooper.dll 补丁 | 查看 | 原始文档 | blame | 历史
DLL/FL/Android/crypt.dll 补丁 | 查看 | 原始文档 | blame | 历史
DLL/FL/Android/http.dll 补丁 | 查看 | 原始文档 | blame | 历史
DLL/FL/Android/videophone.dll 补丁 | 查看 | 原始文档 | blame | 历史
DLL/FL/iOS/Shared.IOS.ESVideoOnSDK.dll 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/.DS_Store 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Assets/Phone/.DS_Store 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Other/JPush/JPushReceiver.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/libs/.DS_Store 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/AppDelegate.cs 118 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Assets.xcassets/.DS_Store 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/.DS_Store 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/HDL-ON_iOS.csproj 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Other/ESVideo.cs 84 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Phone/FunctionIcon/.DS_Store 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Phone/FunctionIcon/Electrical/.DS_Store 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/ViewController.cs 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/.DS_Store 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Common/HDLCommon.cs 78 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Mqtt/MqttClient.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Server/NewAPI.cs 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Server/NewApiRes.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/ThirdPartySdk/ESOnVideo.cs 445 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/HDL_ON.projitems 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/.DS_Store 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI1-Login/LoginPage.cs 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/.DS_Store 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/3-Intelligence/Automation/.DS_Store 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/AboutOnPage.cs 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs 169 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ThirdPartyIntegration/.DS_Store 补丁 | 查看 | 原始文档 | blame | 历史
ys/.DS_Store 补丁 | 查看 | 原始文档 | blame | 历史
DLL/FL/Android/VideoLibs.dll
Binary files differ
DLL/FL/Android/cloudp2p.dll
Binary files differ
DLL/FL/Android/corelooper.dll
Binary files differ
DLL/FL/Android/crypt.dll
Binary files differ
DLL/FL/Android/http.dll
Binary files differ
DLL/FL/Android/videophone.dll
Binary files differ
DLL/FL/iOS/Shared.IOS.ESVideoOnSDK.dll
Binary files differ
HDL-ON_Android/.DS_Store
Binary files differ
HDL-ON_Android/Assets/Phone/.DS_Store
Binary files differ
HDL-ON_Android/Other/JPush/JPushReceiver.cs
@@ -57,14 +57,17 @@
            if (jpushExpandData != null && jpushExpandData.messageType != null)
            {
                pushMes.messageType = jpushExpandData.messageType;
                pushMes.expantContent = jpushExpandData.expantContent;
                Utlis.WriteLine("PushMes messageType : " + pushMes.messageType);
            }
            Utlis.WriteLine("PushMes title : " + pushMes.Title);
            Utlis.WriteLine("PushMes message : " + pushMes.Content);
            Utlis.WriteLine("PushMes extras : " + pushMes.Extras);
            HDLCommon.Current.AdjustPushMessage(pushMes);
            Shared.Application.RunOnMainThread(() =>
            {
                HDLCommon.Current.AdjustPushMessage(pushMes);
            });
        }
        /// <summary>
@@ -157,6 +160,7 @@
                if (jpushExpandData != null && jpushExpandData.messageType != null)
                {
                    pushMes.messageType = jpushExpandData.messageType;
                    pushMes.expantContent = jpushExpandData.expantContent;
                    Utlis.WriteLine("PushMes messageType : " + pushMes.messageType);
                }
HDL-ON_Android/libs/.DS_Store
Binary files differ
HDL-ON_iOS/AppDelegate.cs
@@ -132,6 +132,8 @@
            }
            Console.WriteLine(userInfo);
            //HDLCommon.Current.ShowAlert("DidReceiveRemoteNotification:" + userInfo.ToString());
            if (application.ApplicationState == UIApplicationState.Active || application.ApplicationState == UIApplicationState.Background)
            {
@@ -215,17 +217,44 @@
        }
        /// <summary>
        /// 设置当前使用语言
        /// </summary>
        void SetCurrentLanguage()
        {
            if (string.IsNullOrEmpty(OnAppConfig.Instance.SetLanguage))
            {
                if (NSLocale.PreferredLanguages[0].Contains("zh-"))
                {
                    Language.CurrentLanguage = "Chinese";
                }
                else if (NSLocale.PreferredLanguages[0].Contains("cs-"))
                {
                    Language.CurrentLanguage = "Czech";
                }
                else
                {
                    Language.CurrentLanguage = "English";
                }
            }
            else
            {
                Language.CurrentLanguage = OnAppConfig.Instance.SetLanguage;
            }
        }
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            SetCurrentLanguage();
            //Shared.Application.FontSize = 12;
            //Bugly.Bugly.StartWithAppId("b58fb35436");
            //取消EditText默认密码输入方式
            //Shared.Application.IsEditTextContentTypePassword = false;
            //默认使用苹方字体
            Shared.Application.IsUsePingFang = true;
            //保持屏幕常亮或者自动锁屏
            application.IdleTimerDisabled = false;
            base.FinishedLaunching(application, launchOptions);
            Window = new UIWindow(UIScreen.MainScreen.Bounds);
            rootViewController = new UINavigationController(new ViewController()) { NavigationBarHidden = true };
@@ -234,59 +263,19 @@
            AppCenter.Start("e1add75a-82c6-4a5c-a902-4705b195748e", typeof(Analytics), typeof(Crashes));
            base.FinishedLaunching(application, launchOptions);
            SharedMethod.SharedMethod.sharedApp = application;
            //NSString* nsCount = [[NSLocale currentLocale] objectForKey: NSLocaleCountryCode];
            application.StatusBarStyle = UIStatusBarStyle.DarkContent;
            //string nsCount = NSLocale.CurrentLocale.CountryCode;
            //if ( UserInfo.Current != null && nsCount !=  UserInfo.Current.areaCode.ToString())
            //{
            //    //int.TryParse(nsCount,out  UserInfo.Current.areaCode);
            //    //2020-11-18
            //     UserInfo.Current.areaCode = nsCount;
            //    OnAppConfig.Instance.SaveUserConfig();
            //}
            application.RegisterForRemoteNotificationTypes(UIRemoteNotificationType.Alert | UIRemoteNotificationType.Badge | UIRemoteNotificationType.Sound);
            //window.AccessibilityNavigationStyle = UIAccessibilityNavigationStyle.Automatic;
            // check for a notification
            DealWithPushMes(launchOptions);
            if (UIDevice.CurrentDevice.CheckSystemVersion(8, 0))
            {
                var notificationSettings = UIUserNotificationSettings.GetSettingsForTypes(UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound, null);
                application.RegisterUserNotificationSettings(notificationSettings);
                application.RegisterForRemoteNotifications();
            }
            else
            {
                //==== register for remote notifications and get the device token
                // set what kind of notification types we want
                UIRemoteNotificationType notificationTypes = UIRemoteNotificationType.Alert | UIRemoteNotificationType.Badge;
                // register for remote notifications
                UIApplication.SharedApplication.RegisterForRemoteNotificationTypes(notificationTypes);
            }
            if (UIApplication.SharedApplication.ApplicationIconBadgeNumber > 0)
            {
                //RemoteInfo.Current.ReadMsgList(true);
            }
            //Harpy.Harpy.SharedInstance.PresentingViewController = this.Window.RootViewController;
            //Harpy.Harpy.SharedInstance.WeakDelegate = this;
            //Harpy.Harpy.SharedInstance.AlertType = Harpy.HarpyAlertType.Skip;
            //Harpy.Harpy.SharedInstance.DebugEnabled = false;
            //Harpy.Harpy.SharedInstance.ForceLanguageLocalization = Harpy.Constants.HarpyLanguageChineseSimplified;
            //if (UIApplication.SharedApplication.ApplicationIconBadgeNumber > 0)
            //{
            //    //RemoteInfo.Current.ReadMsgList(true);
            //}
            //中文国内key、英文海外key
            EZSDK.IOS.EZSDK.InitLibWithAppKey("1aa98a90489b4838b966b57018b4b04b", "1aa98a90489b4838b966b57018b4b04b");
            Console.WriteLine("FinishedLaunching");
            return true;
        }
@@ -306,6 +295,7 @@
                    var title = alert["title"] as NSString;
                    var expandData = "";
                    var messageType = "";
                    var expantContent = "";
                    if (userInfo.ContainsKey(new NSString("expandData")))
                    {
                        var expandDataStr = userInfo["expandData"] as NSString;
@@ -317,9 +307,15 @@
                                expandData = expandDataNSD.ToString();
                                if(expandDataNSD.ContainsKey(new NSString("messageType"))){
                                    messageType = expandDataNSD["messageType"] as NSString;
                                    Utlis.WriteLine("messageType: "+ messageType);
                                    Utlis.WriteLine("messageType: " + messageType);
                                }
                                if (expandDataNSD.ContainsKey(new NSString("expantContent")))
                                {
                                    expantContent = expandDataNSD["expantContent"] as NSString;
                                    Utlis.WriteLine("expantContent: " + expantContent);
                                }
                            }
                        }
                        else
@@ -333,7 +329,8 @@
                        Title = title,
                        Content = body,
                        Extras = expandData,
                        messageType = messageType
                        messageType = messageType,
                        expantContent = expantContent
                    };
                    Utlis.WriteLine("PushMes title : " + pushMes.Title);
                    Utlis.WriteLine("PushMes message : " + pushMes.Content);
@@ -341,14 +338,21 @@
                    if (bFinishedLaunching)
                    {
                        if (pushMes.Extras != null && pushMes.Extras.Contains("OffLine"))
                        if (pushMes.Extras != null)
                        {
                            //haveToSignOut = true;
                            //强制下线
                            UserInfo.Current.LastTime = DateTime.MinValue;
                            UserInfo.Current.headImagePagePath = "LoginIcon/2.png";//重置用户头像
                            UserInfo.Current.SaveUserInfo();
                            HDLCommon.Current.ShowAlert(Language.StringByID(StringId.LoggedOnOtherDevices));
                            if (pushMes.Extras.Contains("OffLine"))
                            {
                                //haveToSignOut = true;
                                //强制下线
                                UserInfo.Current.LastTime = DateTime.MinValue;
                                UserInfo.Current.headImagePagePath = "LoginIcon/2.png";//重置用户头像
                                UserInfo.Current.SaveUserInfo();
                                HDLCommon.Current.ShowAlert(Language.StringByID(StringId.LoggedOnOtherDevices));
                            }
                            else
                            {
                                HDLCommon.Current.AdjustPushMessage(pushMes);
                            }
                        }
                    }
                    else
@@ -360,7 +364,7 @@
            }
            catch
            {
                //HDLCommon.Current.ShowAlert("catch2222");
            }
        }
@@ -384,7 +388,7 @@
                    if (userInfo != null)
                    {
                        HandleNotificationMessageUserInfo(userInfo, true);
                        //HandleNotificationMessageUserInfo(userInfo, true);
                    }
                }
HDL-ON_iOS/Assets.xcassets/.DS_Store
Binary files differ
HDL-ON_iOS/Assets.xcassets/LaunchImage.launchimage/.DS_Store
Binary files differ
HDL-ON_iOS/HDL-ON_iOS.csproj
@@ -54,7 +54,7 @@
        <MtouchExtraArgs>-gcc_flags="-dead_strip -ObjC"</MtouchExtraArgs>
        <MtouchEnableSGenConc>false</MtouchEnableSGenConc>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
<CodesignProvision>ComHdlOnProDevelopment20210305-1</CodesignProvision>
<CodesignProvision>ComHdlOnProDevelopment20210225-1</CodesignProvision>
    </PropertyGroup>
    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
        <DebugType>none</DebugType>
@@ -91,6 +91,9 @@
        </Reference>
        <Reference Include="EZSDK.IOS">
          <HintPath>..\DLL\IOS\EZSDK.IOS.dll</HintPath>
        </Reference>
        <Reference Include="Shared.IOS.ESVideoOnSDK">
          <HintPath>..\DLL\FL\iOS\Shared.IOS.ESVideoOnSDK.dll</HintPath>
        </Reference>
    </ItemGroup>
    <ItemGroup>
@@ -470,7 +473,6 @@
        <Compile Include="ZXingOverlayView.cs" />
        <Compile Include="Other\JLCountrycode.cs" />
        <Compile Include="BlueWifi.cs" />
        <Compile Include="Other\ESVideo.cs" />
    </ItemGroup>
    <ItemGroup>
      <BundleResource Include="Resources\Phone\LoginIcon\ShowPasswordIcon.png" />
HDL-ON_iOS/Other/ESVideo.cs
File was deleted
HDL-ON_iOS/Resources/Phone/FunctionIcon/.DS_Store
Binary files differ
HDL-ON_iOS/Resources/Phone/FunctionIcon/Electrical/.DS_Store
Binary files differ
HDL-ON_iOS/ViewController.cs
@@ -26,26 +26,6 @@
        {
            base.ViewDidLoad();
            if (string.IsNullOrEmpty(OnAppConfig.Instance.SetLanguage))
            {
                if (NSLocale.PreferredLanguages[0].Contains("zh-"))
                {
                    Language.CurrentLanguage = "Chinese";
                }
                else if (NSLocale.PreferredLanguages[0].Contains("cs-"))
                {
                    Language.CurrentLanguage = "Czech";
                }
                else
                {
                    Language.CurrentLanguage = "English";
                }
            }
            else
            {
                Language.CurrentLanguage = OnAppConfig.Instance.SetLanguage;
            }
            HDL_ON.MainPage.Show();
            try
HDL_ON/.DS_Store
Binary files differ
HDL_ON/Common/HDLCommon.cs
@@ -248,44 +248,82 @@
        #region ■ 推送处理_______________________
        /// <summary>
        /// 推送消息处理
        /// 注意:Android要在主线程(UI线程)执行
        /// </summary>
        /// <param name="jpushMessageInfo"></param>
        public void AdjustPushMessage(JPushMessageInfo jpushMessageInfo)
        {
            try
            {
                if (jpushMessageInfo.Extras != null && jpushMessageInfo.Extras.Contains("OffLine"))
                {
                    Shared.Application.RunOnMainThread(() =>
                    {
                        ////账号在别处登陆,被踢下线 跳转到登录页面
                        //new Alert(Language.StringByID(StringId.Tip), Language.StringByID(StringId.LoggedOnOtherDevices), Language.StringByID(StringId.Close)).Show();
                        //退出登录操作
                        CheckLogout();
                //Extras为空不处理
                if (string.IsNullOrEmpty(jpushMessageInfo.Extras)) return;
                    });
                    return;
                if (jpushMessageInfo.Extras.Contains(PushMessageType.OffLine.ToString()))
                {
                    CheckLogout();
                }
                else
                {
                    Shared.Application.RunOnMainThread(() =>
                    GetPushMessageAction?.Invoke();
                    //messageType为空不处理
                    if (string.IsNullOrEmpty(jpushMessageInfo.messageType)) return;
                    //报警推送才弹窗提示(messageType包含Alarm关键字的)
                    if (jpushMessageInfo.messageType.Contains(PushMessageType.Alarm.ToString()))
                    {
                        GetPushMessageAction?.Invoke();
                        //报警推送才弹窗提示(messageType包含Alarm关键字的)
                        if (jpushMessageInfo.messageType != null && jpushMessageInfo.messageType.Contains("Alarm"))
                        //报警推送弹窗提示
                        ShowAlarmPushMessage(jpushMessageInfo);
                    }
                    else if (jpushMessageInfo.messageType.Contains(PushMessageType.FLCall.ToString()))
                    {
                        if (string.IsNullOrEmpty(jpushMessageInfo.expantContent)) return;
                        ESVideoInfo eSVideoInfo = GetESOnVideoJson(jpushMessageInfo.expantContent);
                        if (eSVideoInfo == null) return;
                        if (string.IsNullOrEmpty(eSVideoInfo.uuid)) return;
                        if (eSVideoInfo.uuid.Contains(","))
                        {
                            //报警推送弹窗提示
                            ShowAlarmPushMessage(jpushMessageInfo);
                            //new Alert(jpushMessageInfo.Title, jpushMessageInfo.Content, Language.StringByID(StringId.Close)).Show();
                            var uuid = eSVideoInfo.uuid.Split(',');
                            eSVideoInfo.ESVideoUUID = uuid[0];
                        }
                        else
                        {
                            eSVideoInfo.ESVideoUUID = eSVideoInfo.uuid;
                        }
                    });
                    return;
                        ESOnVideo.Current.ShowESvideoVideoIntercom(eSVideoInfo);
                    }
                }
            }
            catch(Exception EX)
            {
                Utlis.WriteLine("catch: " + EX.ToString());
            }
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="jsonStr"></param>
        /// <returns></returns>
        ESVideoInfo GetESOnVideoJson(string jsonStr)
        {
            try
            {
                if (!string.IsNullOrEmpty(jsonStr))
                {
                    return Newtonsoft.Json.JsonConvert.DeserializeObject<ESVideoInfo>(jsonStr);
                }
                return null;
            }
            catch
            {
                return null;
            }
        }
HDL_ON/DAL/Mqtt/MqttClient.cs
@@ -287,7 +287,7 @@
                            try
                            {
                                var topic = e.ApplicationMessage.Topic;
                                MainPage.Log($"收到mqtt主题:{topic}");
                                //MainPage.Log($"收到mqtt主题:{topic}");
                                //一端口主题处理
                                if (DB_ResidenceData.Instance.GatewayType == 0 && !DB_ResidenceData.Instance.CheckWhetherGatewayIdIsNull())
                                {
HDL_ON/DAL/Server/NewAPI.cs
@@ -532,7 +532,51 @@
        public const string API_POST_EZ_GetChildToken = "/home-wisdom/platform/childToken";
       
        
        /// <summary>
        /// 红外宝/遥控器删除
        /// </summary>
        public const string API_POST_Ir_DeviceDel= "/home-wisdom/app/device/remove";
        /// <summary>
        /// 修改红外宝名称
        /// </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/check";
        /// <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/DAL/Server/NewApiRes.cs
@@ -1434,6 +1434,11 @@
        /// 信息类型
        /// </summary>
        public string messageType = "";
        /// <summary>
        /// 扩展数据内容
        /// </summary>
        public string expantContent = "";
    }
HDL_ON/DAL/ThirdPartySdk/ESOnVideo.cs
New file
@@ -0,0 +1,445 @@
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;
#else
using Android.Content;
#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;
        /// <summary>
        ///
        /// </summary>
        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
            Intent intent = new Intent(Shared.Application.Activity, typeof(HDL_ON_Android.VideoActivity));
            intent.PutExtra("ESVideoUUID", mESVideoInfo.ESVideoUUID);
            intent.PutExtra("uuid", mESVideoInfo.uuid);
            intent.PutExtra("DeviceName", mESVideoInfo.DeviceName);
            intent.PutExtra("cmtID", mESVideoInfo.cmtID);
            intent.PutExtra("roomno", mESVideoInfo.roomno);
            intent.PutExtra("unitno", mESVideoInfo.unitno);
            intent.PutExtra("HomeID", mESVideoInfo.HomeID);
            intent.PutExtra("callId", mESVideoInfo.callId);
            intent.PutExtra("Type", 0);
            Shared.Application.Activity.StartActivity(intent);
#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);
            mOnESCallDelegate = new OnESCallDelegate(this);
            vc.MESCallDelegate = mOnESCallDelegate;
            Shared.Application.currentVC.NavigationController.PushViewController(vc, true);
#else
            Intent intent = new Intent(Shared.Application.Activity, typeof(HDL_ON_Android.VideoActivity));
            intent.PutExtra("ESVideoUUID", mESVideoInfo.ESVideoUUID);
            intent.PutExtra("uuid", mESVideoInfo.uuid);
            intent.PutExtra("DeviceName", mESVideoInfo.DeviceName);
            intent.PutExtra("cmtID", mESVideoInfo.cmtID);
            intent.PutExtra("roomno", mESVideoInfo.roomno);
            intent.PutExtra("unitno", mESVideoInfo.unitno);
            intent.PutExtra("HomeID", mESVideoInfo.HomeID);
            intent.PutExtra("callId", mESVideoInfo.callId);
            intent.PutExtra("Type", 1);
            Shared.Application.Activity.StartActivity(intent);
#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 接听失败 code: " + revertObj.Code);
                }
            })
            { IsBackground = false }.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 挂断失败 code: "+ revertObj.Code);
                }
            })
            { IsBackground = false }.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 拒接失败 code: " + revertObj.Code);
                }
            })
            { IsBackground = false }.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);
#if __IOS__
                dic.Add("imagesName", "_IOS.jpg");
#else
                dic.Add("imagesName", "_Android.jpg");
#endif
                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 截图上传失败 code: " + revertObj.Code);
                }
            })
            { IsBackground = false }.Start();
        }
        DateTime UnlockDateTime = DateTime.MinValue;
        /// <summary>
        /// 开锁成功
        /// </summary>
        void UnlockAction()
        {
            //Utlis.WriteLine("UnlockAction");
            if (CheckESVideoInfoIsNullOrEmpty()) return;
            //3S内不允许触发第二次
            if(UnlockDateTime.AddSeconds(3) > DateTime.Now)
            {
                Utlis.WriteLine("3S内不允许触发第二次");
                //丰林SDKbug,呼叫的时候开锁成功会有2次回调,
                return;
            }
            UnlockDateTime = DateTime.Now;
            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 开锁失败 code: " + revertObj.Code);
                }
            })
            { IsBackground = false }.Start();
        }
#endregion
#if __IOS__
#region OnESCallDelegate
        /////// <summary>
        /////// OnESCallDelegate 继承响应事件
        /////// </summary>
        OnESCallDelegate mOnESCallDelegate;
        /// <summary>
        ///
        /// </summary>
        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
            {
                eSVideoInfo.callId = "88888";
                ShowESvideoVideoIntercom(eSVideoInfo);
            }
        }
    }
    /// <summary>
    ///
    /// </summary>
    public class ESVideoInfo
    {
        /// <summary>
        /// 室外机的UUID
        /// 例:JJY000007FSEYX
        /// </summary>
        public string ESVideoUUID = string.Empty;
        /// <summary>
        /// 室外机的名称
        /// 例:室外机
        /// </summary>
        public string DeviceName = "室外机";
        /// <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/HDL_ON.projitems
@@ -391,6 +391,7 @@
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Video\Send.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)FengLinVideo\ESOnVideo.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Energy\EnergyMainPage.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)DAL\ThirdPartySdk\ESOnVideo.cs" />
  </ItemGroup>
  <ItemGroup>
    <Folder Include="$(MSBuildThisFileDirectory)DAL\" />
@@ -433,5 +434,6 @@
    <Folder Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Video\" />
    <Folder Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Video\View\" />
    <Folder Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Energy\" />
    <Folder Include="$(MSBuildThisFileDirectory)DAL\ThirdPartySdk\" />
  </ItemGroup>
</Project>
HDL_ON/UI/.DS_Store
Binary files differ
HDL_ON/UI/UI1-Login/LoginPage.cs
@@ -185,10 +185,17 @@
            };
            bodyView.AddChidren(btnIcon_bg);
            #if DEBUG
#if DEBUG
            btnIcon_bg.MouseUpEventHandler += (sender, e) =>
            {
                //ESOnVideo.Current.Test();
            };
            bool b = false;
            btnIcon.MouseUpEventHandler += (sender, e) =>
            {
                //ESOnVideo.Current.Test(false);
                //return;
                if (b)
                {
HDL_ON/UI/UI2/.DS_Store
Binary files differ
HDL_ON/UI/UI2/3-Intelligence/Automation/.DS_Store
Binary files differ
HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/AboutOnPage.cs
@@ -72,15 +72,15 @@
            bodyView.AddChidren(btnOnTitle);
#if DEBUG
            //btnOnIcon.MouseUpEventHandler += (sender, e) =>
            //{
            //    ESOnVideo.Current.Test();
            //};
            btnOnIcon.MouseUpEventHandler += (sender, e) =>
            {
                ESOnVideo.Current.Test();
            };
            //btnOnTitle.MouseUpEventHandler += (sender, e) =>
            //{
            //    ESOnVideo.Current.Test(false);
            //};
            btnOnTitle.MouseUpEventHandler += (sender, e) =>
            {
                ESOnVideo.Current.Test(false);
            };
#endif
HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs
@@ -265,16 +265,16 @@
                page.LoadPage();
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                //获取列表
                //HDL_ON.UI.UI2.PersonalCenter.PirDevice.Method.GetPirDeviceList(this, () =>
                //{
                //    Application.RunOnMainThread(() =>
                //    {
                //        var page = new UI2.PersonalCenter.PirDevice.PirMain();
                //        MainPage.BasePageView.AddChidren(page);
                //        page.Show();
                //        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                //    });
                //});
                HDL_ON.UI.UI2.PersonalCenter.PirDevice.Method.GetPirDeviceList(this, () =>
                {
                    Application.RunOnMainThread(() =>
                    {
                        var page = new UI2.PersonalCenter.PirDevice.PirMain();
                        MainPage.BasePageView.AddChidren(page);
                        page.Show();
                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                    });
                });
            };
            btnResidenceAddFunctionIcon.MouseUpEventHandler = eventHandler;
            btnResidenceAddFunctionText.MouseUpEventHandler = eventHandler;
HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/PirMain.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Text;
using HDL_ON.Entity;
using HDL_ON.UI.UI2.Intelligence.Automation.LogicView;
using Shared;
@@ -149,6 +150,174 @@
            UIView(vv);
        }
        void GoToShowSortSelection(List<string> dataList)
        {
            Dictionary<string, List<string>> dict = new Dictionary<string, List<string>>();
            foreach (var data in dataList)
            {
                //提取字符串第一位
                //string s = data.Substring(0, 1);
                var key = GetCharSpellCode(data);
                if (dict.ContainsKey(key))
                {
                    var value = dict[key];
                    if (value == null)
                    {
                        value = new List<string>();
                    }
                    value.Add(data);
                }
                else
                {
                    var value = new List<string>();
                    value.Add(data);
                    dict.Add(key, value);
                }
            }
            Application.RunOnMainThread(() =>
            {
                JLCountrycode.CountryCodeView.Current.ShowSortSelection("选择红外品牌", dict, (countryName) =>
                {
                    //Console.WriteLine("countryName: " + countryName);
                    Utlis.ShowTip("选中了:" + countryName);
                });
            });
        }
        /// <summary>
        /// 获取汉字首字母
        /// </summary>
        /// <param name="textValue"></param>
        /// <returns></returns>
        private string GetCharSpellCode(string textValue)
        {
            long iCnChar;
            byte[] ZW = Encoding.GetEncoding("gb2312").GetBytes(textValue);
            //如果是字母,则直接返回
            if (ZW.Length == 1)
            {
                return textValue.ToUpper();
            }
            else
            {
                // get the array of byte from the single char
                int i1 = (short)(ZW[0]);
                int i2 = (short)(ZW[1]);
                iCnChar = i1 * 256 + i2;
            }
            // iCnChar match the constant
            if ((iCnChar >= 45217) && (iCnChar <= 45252))
            {
                return "A";
            }
            else if ((iCnChar >= 45253) && (iCnChar <= 45760))
            {
                return "B";
            }
            else if ((iCnChar >= 45761) && (iCnChar <= 46317))
            {
                return "C";
            }
            else if ((iCnChar >= 46318) && (iCnChar <= 46825))
            {
                return "D";
            }
            else if ((iCnChar >= 46826) && (iCnChar <= 47009))
            {
                return "E";
            }
            else if ((iCnChar >= 47010) && (iCnChar <= 47296))
            {
                return "F";
            }
            else if ((iCnChar >= 47297) && (iCnChar <= 47613))
            {
                return "G";
            }
            else if ((iCnChar >= 47614) && (iCnChar <= 48118))
            {
                return "H";
            }
            else if ((iCnChar >= 48119) && (iCnChar <= 49061))
            {
                return "J";
            }
            else if ((iCnChar >= 49062) && (iCnChar <= 49323))
            {
                return "K";
            }
            else if ((iCnChar >= 49324) && (iCnChar <= 49895))
            {
                return "L";
            }
            else if ((iCnChar >= 49896) && (iCnChar <= 50370))
            {
                return "M";
            }
            else if ((iCnChar >= 50371) && (iCnChar <= 50613))
            {
                return "N";
            }
            else if ((iCnChar >= 50614) && (iCnChar <= 50621))
            {
                return "O";
            }
            else if ((iCnChar >= 50622) && (iCnChar <= 50905))
            {
                return "P";
            }
            else if ((iCnChar >= 50906) && (iCnChar <= 51386))
            {
                return "Q";
            }
            else if ((iCnChar >= 51387) && (iCnChar <= 51445))
            {
                return "R";
            }
            else if ((iCnChar >= 51446) && (iCnChar <= 52217))
            {
                return "S";
            }
            else if ((iCnChar >= 52218) && (iCnChar <= 52697))
            {
                return "T";
            }
            else if ((iCnChar >= 52698) && (iCnChar <= 52979))
            {
                return "W";
            }
            else if ((iCnChar >= 52980) && (iCnChar <= 53640))
            {
                return "X";
            }
            else if ((iCnChar >= 53689) && (iCnChar <= 54480))
            {
                return "Y";
            }
            else if ((iCnChar >= 54481) && (iCnChar <= 55289))
            {
                return "Z";
            }
            else return ("");
        }
        /// <summary>
        /// 加载UI界面
        /// </summary>
ThirdPartyIntegration/.DS_Store
Binary files differ
ys/.DS_Store
Binary files differ