@ray-js/ray-ipc-utils 1.1.10 → 1.1.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -159,3 +159,12 @@ export declare const goToIpcSettingMini: <T>(deviceId: string, options?: {
159
159
  export declare const goToIpcServiceHallMini: <T>(options?: {
160
160
  position?: 'right' | 'bottom';
161
161
  }) => Promise<IRes<T>>;
162
+ /**
163
+ * 跳转 回放聚合页
164
+ * @param {string} deviceId - 设备ID
165
+ * @param {string} sdCardState - SD卡状态是否正常
166
+ * @param {Object} options - 可选配置项
167
+ */
168
+ export declare const goToIpcPlayBackHubNativePage: <T>(deviceId: string, sdCardState?: boolean, theme?: 'dark' | 'light', extraParams?: {
169
+ [key: string]: any;
170
+ } | undefined) => Promise<IRes<T>>;
@@ -3,6 +3,7 @@ import "core-js/modules/esnext.iterator.constructor.js";
3
3
  import "core-js/modules/esnext.iterator.map.js";
4
4
  import _find from 'lodash/find';
5
5
  import { getSystemInfoSync } from '@ray-js/ray';
6
+ import { getServiceIsOpen } from '../../service';
6
7
  // IPC Kit相关
7
8
  /**
8
9
  *
@@ -881,4 +882,33 @@ export const goToIpcServiceHallMini = async function () {
881
882
  msg: String(err)
882
883
  };
883
884
  }
885
+ };
886
+
887
+ /**
888
+ * 跳转 回放聚合页
889
+ * @param {string} deviceId - 设备ID
890
+ * @param {string} sdCardState - SD卡状态是否正常
891
+ * @param {Object} options - 可选配置项
892
+ */
893
+
894
+ export const goToIpcPlayBackHubNativePage = async function (deviceId, sdCardState) {
895
+ let theme = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
896
+ let extraParams = arguments.length > 3 ? arguments[3] : undefined;
897
+ try {
898
+ let result = null;
899
+ const serviceData = await getServiceIsOpen(deviceId, 'security_cloud_service');
900
+ if (serviceData.code === 0 && serviceData.data) {
901
+ result = await goToIpcPageNativeRoute('camera_cloud_panel', deviceId, theme, extraParams);
902
+ } else if (serviceData.code === 0 && !serviceData.data && sdCardState) {
903
+ result = await goToIpcPageNativeRoute('camera_playback_panel', deviceId, theme, extraParams);
904
+ } else {
905
+ result = await goToIpcPageNativeRoute('camera_cloud_panel', deviceId, theme, extraParams);
906
+ }
907
+ return result;
908
+ } catch (err) {
909
+ return {
910
+ code: -1,
911
+ msg: String(err)
912
+ };
913
+ }
884
914
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/ray-ipc-utils",
3
- "version": "1.1.10",
3
+ "version": "1.1.11",
4
4
  "description": "IPC 工具库",
5
5
  "main": "lib/index",
6
6
  "files": [