wjc
2023-04-11 f2b2a70331d574a345cab0906d4d4b0de48c38b1
HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/CommonMethod.cs
@@ -4,6 +4,7 @@
using Shared;
using HDL_ON.DAL.Server;
#if __IOS__
using Foundation;
#else
using Com.Videogo.Hdl;
#endif
@@ -50,34 +51,44 @@
            this.InitializationAndroidData((isEzChildAccessToken) =>
            {
                this.MainThread(() =>
                this.SunThread(() =>
                {
#if __IOS__
                    //跳转添加萤石设备
                    ezsdkDelegate = new IosIHdlInterface();
                    ezsdkDelegate.mAction += (serials) =>
                    var list = this.GetVideoDoorLockLockModelsList("notAllowedConfigNetworkModels");
                    this.MainThread(() =>
                    {
                        this.GetYingshiDeviceList(serials);
                    };
                    EZSDK.IOS.EZSDK.SharedInstance().Delegate = ezsdkDelegate;
                    EZSDK.IOS.EZSDK.SharedInstance().AddEzvizMonitorWithDeviceType(spk);
#if __IOS__
                        //跳转添加萤石设备
                        ezsdkDelegate = new IosIHdlInterface();
                        ezsdkDelegate.mAction += (serials) =>
                        {
                            this.GetYingshiDeviceList(serials);
                        };
                        EZSDK.IOS.EZSDK.SharedInstance().Delegate = ezsdkDelegate;
                        NSObject[] nSObject = new NSObject[list.Count];
                        for (int i = 0; i < list.Count; i++)
                        {
                            string strValue = list[i];
                            nSObject[i] = new NSString(strValue);
                        }
                        EZSDK.IOS.EZSDK.SharedInstance().ConnectTipModels = nSObject;
                        EZSDK.IOS.EZSDK.SharedInstance().AddEzvizMonitorWithDeviceType(spk);
#else
                HDLEzvizSdk.Instance.JumpToEZScanActivity(Application.Activity,spk);
                HDLEzvizSdk.SetAddCallback(new AndroidIHdlInterface((isBool, serials) =>
                {
                    if (isBool)
                    HDLEzvizSdk.Instance.JumpToEZScanActivity(Application.Activity, spk,list);
                        HDLEzvizSdk.SetAddCallback(new AndroidIHdlInterface((isBool, serials) =>
                    {
                        this.GetYingshiDeviceList(serials);
                    }
                        if (isBool)
                        {
                            this.GetYingshiDeviceList(serials);
                        }
                }));
                    }));
#endif
                    });
                });
            });
@@ -203,6 +214,7 @@
        public void InitializationAndroidData(Action<bool> action)
        {
            bool isBool = true;
            this.Loading.Start();
            this.SunThread(() =>
            {
                try
@@ -215,7 +227,7 @@
                        {
                            //Token
                            isBool = false;
                            this.ShowTip("先获取萤石云子账号token失败。");
                            this.ShowTip("获取萤石云子账号token失败。");
                            return;
                        }
@@ -249,6 +261,7 @@
                {
                    this.MainThread(() =>
                    {
                        this.Loading.Hide();
                        action?.Invoke(isBool);
                    });
                }
@@ -275,9 +288,9 @@
        /// 获取【门锁型号】列表
        /// </summary>
        /// <returns>返回结果不会为null</returns>
        public List<string> GetVideoDoorLockLockModelsList()
        public List<string> GetVideoDoorLockLockModelsList(string mode = "lockModels")
        {
            return VideDoorLockSend.Current.GetVideoDoorLockLockModelsList();
            return VideDoorLockSend.Current.GetVideoDoorLockLockModelsList(mode);
        }
        /// <summary>
        /// 门锁推送
@@ -382,6 +395,7 @@
        /// </summary>
        public string GetVideoDoorLockIcon(Comerom comerom)
        {
            if (comerom == Comerom.collect)
            {
                return "FunctionIcon/DoorLock/VideoDoorLockOpen.png";
@@ -531,13 +545,13 @@
            collect,//收藏
            room,//房间
            push,//推送
            sanfan,//三方
            sanfan,//添加第三方设备
        }
#if __IOS__
        IosIHdlInterface ezsdkDelegate;
        /// <summary>
        /// 专门定义给Ios回调用着,没有特殊含义
        /// 专门定义给Ios回调用,没有特殊含义
        /// </summary>
        public class IosIHdlInterface : EZSDK.IOS.EZSDKDelegate
        {
@@ -558,7 +572,7 @@
        }
#else
        /// <summary>
        /// 专门定义给安卓回调用着,没有特殊含义
        /// 专门定义给安卓回调用,没有特殊含义
        /// </summary>
        public class AndroidIHdlInterface : Java.Lang.Object, IHdlInterface
        {