| | |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | break; |
| | | case SPK.CurtainRoller: |
| | | var rollingShutterView = new VenetianBlindsPage(function); |
| | | var rollingShutterView = new RollingShutterPage(function); |
| | | MainPage.BasePageView.AddChidren(rollingShutterView); |
| | | rollingShutterView.LoadPage(btnCollectionIcon, btnName, btnFromFloor); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | break; |
| | | case SPK.CurtainShades: |
| | | var curtainShadesView = new RollingShutterPage(function); |
| | | var curtainShadesView = new VenetianBlindsPage(function); |
| | | MainPage.BasePageView.AddChidren(curtainShadesView); |
| | | curtainShadesView.LoadPage(btnCollectionIcon, btnName, btnFromFloor); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | |
| | | doorLockPage.AddForm(function, btnCollectionIcon, btnName, btnFromFloor); |
| | | break; |
| | | case SPK.IpCam_Imou: |
| | | new System.Threading.Thread(() => |
| | | |
| | | #if __IOS__ |
| | | if (Shared.IOS.HDLCNVRSDK.HDLLCNVRSDK.SharedInstance().AccessToken==null) {//未初始化摄像头 |
| | | Shared.IOS.HDLCNVRSDK.HDLLCNVRSDK.SharedInstance().InitSDKWithAppKey("HDL-HOME-APP-TEST", "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss", OnAppConfig.Instance.RequestHttpsHost); |
| | | Shared.IOS.HDLCNVRSDK.HDLLCNVRSDK.SharedInstance().AccessToken = UserInfo.Current.LoginTokenString; |
| | | Shared.IOS.HDLCNVRSDK.HDLLCNVRSDK.SharedInstance().RefreshToken = UserInfo.Current.RefreshToken; |
| | | Shared.IOS.HDLCNVRSDK.HDLLCNVRSDK.SharedInstance().HomeId = DB_ResidenceData.Instance.CurrentRegion.id; |
| | | Shared.IOS.HDLCNVRSDK.HDLLCNVRSDK.SharedInstance().RefreshDeviceList(); |
| | | } |
| | | //跳转大华摄像头 |
| | | Shared.IOS.HDLCNVRSDK.HDLLCNVRSDK.SharedInstance().RefreshDeviceList(); |
| | | //Shared.IOS.HDLCNVRSDK.HDLLCNVRSDK.SharedInstance().ToMonitorViewWithDeviceId(function.extDevId, function.name); |
| | | |
| | | Shared.IOS.HDLCNVRSDK.HDLLCNVRSDK.SharedInstance().ToMonitorViewWithDeviceId(function.extDevId, function.name, Shared.Application.currentVC); |
| | | #else |
| | | FunctionList.List.GetIpCamImouList(); |
| | | if (string.IsNullOrEmpty(Com.Utils.HdlToLcUtils.Instance.SubAccessToken)) |
| | | { |
| | | var http = new HttpServerRequest(); |
| | | var pack = http.GetLcSubAccountToken(); |
| | | if (pack.Code == StateCode.SUCCESS) |
| | | var waitPage = new Loading(); |
| | | MainPage.BaseView.AddChidren(waitPage); |
| | | waitPage.Start(""); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | if (pack.Data == null || string.IsNullOrEmpty(pack.Data.ToString())) |
| | | try |
| | | { |
| | | var http = new HttpServerRequest(); |
| | | var pack = http.GetLcSubAccountToken(); |
| | | if (pack.Code == StateCode.SUCCESS) |
| | | { |
| | | if (pack.Data == null || string.IsNullOrEmpty(pack.Data.ToString())) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new PublicAssmebly().TipMsg(Language.StringByID(StringId.Tip), Language.StringByID(StringId.huoqushujushibao)); |
| | | }); |
| | | } |
| | | Application.RunOnMainThread(() =>{ |
| | | try |
| | | { |
| | | |
| | | Com.Utils.HdlToLcUtils.Instance.SubAccessToken = pack.Data.ToString(); |
| | | Com.Utils.HdlToLcUtils.Instance.Play(function.extDevId, function.name); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new PublicAssmebly().TipMsg(Language.StringByID(StringId.Tip), Language.StringByID(StringId.huoqushujushibao) + $"({pack.Code})"); |
| | | }); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log("加载乐橙摄像头异常"); |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new PublicAssmebly().TipMsg("", $"获取乐橙数据失败"); |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | }); |
| | | } |
| | | Com.Utils.HdlToLcUtils.Instance.InitData(Shared.Application.Activity, "HDL-HOME-APP-TEST", "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss", OnAppConfig.Instance.RequestHttpsHost); |
| | | Com.Utils.HdlToLcUtils.Instance.HomeId = DB_ResidenceData.Instance.CurrentRegion.id; |
| | | Com.Utils.HdlToLcUtils.Instance.Token = UserInfo.Current.AccessToken; |
| | | Com.Utils.HdlToLcUtils.Instance.SubAccessToken = pack.Data.ToString(); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | //Com.Utils.HdlToLcUtils.Instance.OpenActivity(); |
| | | Com.Utils.HdlToLcUtils.Instance.Play(function.extDevId,function.name); |
| | | }); |
| | | } |
| | | else |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | else |
| | | { |
| | | try |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new PublicAssmebly().TipMsg("", $"获取乐橙数据失败({pack.Code})"); |
| | | }); |
| | | |
| | | Com.Utils.HdlToLcUtils.Instance.Play(function.extDevId, function.name); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | } |
| | | } |
| | | #endif |
| | | break; |
| | | } |
| | | }; |