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

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.
@@ -178,13 +178,14 @@ export const getCameraConfigInfo = async function (deviceId) {
178
178
  intercomInfo.supportedIntercomModes = supportedIntercomModes.map(mode => intercomCallMode[mode]);
179
179
  // 获取APP当前存储的对讲模式, 因目前设置页对讲设置使用的还是原生页面,需要读取APP缓存保持一致
180
180
 
181
+ console.log(type, '=========');
181
182
  if (type === 'native') {
182
183
  const appIntercomCached = await getCurrentSupportedTalkMode(deviceId);
183
184
  if (appIntercomCached.code !== 0) {
184
185
  intercomInfo.cachedIntercomMode = intercomCallMode[supportedIntercomModes[0]];
185
186
  } else {
186
187
  var _appIntercomCached$da;
187
- intercomInfo.cachedIntercomMode = intercomCallMode[appIntercomCached === null || appIntercomCached === void 0 || (_appIntercomCached$da = appIntercomCached.data) === null || _appIntercomCached$da === void 0 ? void 0 : _appIntercomCached$da.talkbackMode];
188
+ intercomInfo.cachedIntercomMode = intercomCallMode[appIntercomCached === null || appIntercomCached === void 0 || (_appIntercomCached$da = appIntercomCached.data) === null || _appIntercomCached$da === void 0 ? void 0 : _appIntercomCached$da.talkbackMode] || defaultIntercomMode;
188
189
  }
189
190
  } else {
190
191
  // 针对mini程序,直接使用接口返回的第一项数据
@@ -229,10 +230,12 @@ export const getCameraConfigInfo = async function (deviceId) {
229
230
  setNativeStorage(`${deviceId}_microphone`, microphoneSettings);
230
231
  if (type === 'native') {
231
232
  const appIntercomCached = await getCurrentSupportedTalkMode(deviceId);
233
+ console.log(appIntercomCached, 'appIntercomCached');
232
234
  // 如果接口返回成功,则取接口返回值
233
235
  if (appIntercomCached.code === 0) {
234
236
  var _appIntercomCached$da2;
235
- intercomInfo.cachedIntercomMode = intercomCallMode[appIntercomCached === null || appIntercomCached === void 0 || (_appIntercomCached$da2 = appIntercomCached.data) === null || _appIntercomCached$da2 === void 0 ? void 0 : _appIntercomCached$da2.talkbackMode];
237
+ console.log(appIntercomCached, 'appIntercomCached====');
238
+ intercomInfo.cachedIntercomMode = intercomCallMode[appIntercomCached === null || appIntercomCached === void 0 || (_appIntercomCached$da2 = appIntercomCached.data) === null || _appIntercomCached$da2 === void 0 ? void 0 : _appIntercomCached$da2.talkbackMode] || defaultIntercomMode;
236
239
  }
237
240
  }
238
241
  setNativeStorage(`${deviceId}_intercom`, intercomInfo);
@@ -245,13 +248,14 @@ export const getCameraConfigInfo = async function (deviceId) {
245
248
  // 对于对讲缓存的方式每次需从APP获取更新
246
249
  const intercomStorageData = intercomStorage === null || intercomStorage === void 0 || (_intercomStorage$data2 = intercomStorage.data) === null || _intercomStorage$data2 === void 0 ? void 0 : _intercomStorage$data2.data;
247
250
  intercomInfo = intercomStorageData;
251
+ console.log(type, 'type=====');
248
252
  if (type === 'native') {
249
253
  const appIntercomCached = await getCurrentSupportedTalkMode(deviceId);
250
254
  if (appIntercomCached.code !== 0) {
251
- intercomInfo.cachedIntercomMode = intercomCallMode[supportedIntercomModes[0]];
255
+ intercomInfo.cachedIntercomMode = intercomCallMode[supportedIntercomModes[0]] || defaultIntercomMode;
252
256
  } else {
253
257
  var _appIntercomCached$da3;
254
- intercomInfo.cachedIntercomMode = intercomCallMode[appIntercomCached === null || appIntercomCached === void 0 || (_appIntercomCached$da3 = appIntercomCached.data) === null || _appIntercomCached$da3 === void 0 ? void 0 : _appIntercomCached$da3.talkbackMode];
258
+ intercomInfo.cachedIntercomMode = intercomCallMode[appIntercomCached === null || appIntercomCached === void 0 || (_appIntercomCached$da3 = appIntercomCached.data) === null || _appIntercomCached$da3 === void 0 ? void 0 : _appIntercomCached$da3.talkbackMode] || defaultIntercomMode;
255
259
  }
256
260
  if (intercomStorageData.cachedIntercomMode !== intercomInfo.cachedIntercomMode) {
257
261
  setNativeStorage(`${deviceId}_intercom`, intercomInfo);
@@ -335,15 +339,6 @@ export const updateCollectionPointsInfo = async (deviceId, id, name) => {
335
339
  export const delCollectionPointsInfo = async (deviceId, pointData) => {
336
340
  // 1. 先获取巡航状态,如果正在巡航,提示停止巡航
337
341
  const cruiseSwitchInfo = await getDpStateValue(deviceId, 'cruise_switch');
338
- if ((cruiseSwitchInfo === null || cruiseSwitchInfo === void 0 ? void 0 : cruiseSwitchInfo.code) === -1) {
339
- ty.showToast({
340
- title: cruiseSwitchInfo.msg
341
- });
342
- return {
343
- code: -1,
344
- msg: cruiseSwitchInfo.msg
345
- };
346
- }
347
342
  if (cruiseSwitchInfo.data) {
348
343
  ty.showToast({
349
344
  title: Strings.getLang('ipc_utils_cruise_ing_tip')
@@ -355,13 +350,13 @@ export const delCollectionPointsInfo = async (deviceId, pointData) => {
355
350
  }
356
351
  // 2. 下发DP删除收藏点 dpCode: memory_point_set
357
352
  const memoryPointSetDpId = await getDpIdByCode(deviceId, 'memory_point_set');
358
- if ((cruiseSwitchInfo === null || cruiseSwitchInfo === void 0 ? void 0 : cruiseSwitchInfo.code) === -1) {
353
+ if (cruiseSwitchInfo.data) {
359
354
  ty.showToast({
360
- title: cruiseSwitchInfo.msg
355
+ title: Strings.getLang('ipc_utils_cruise_ing_tip')
361
356
  });
362
357
  return {
363
358
  code: -1,
364
- msg: cruiseSwitchInfo.msg
359
+ msg: Strings.getLang('ipc_utils_cruise_ing_tip')
365
360
  };
366
361
  }
367
362
  const publishResult = publishDps(deviceId, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/ray-ipc-utils",
3
- "version": "1.1.8",
3
+ "version": "1.1.10",
4
4
  "description": "IPC 工具库",
5
5
  "main": "lib/index",
6
6
  "files": [