@fonixtree/magic-design 1.0.34 → 1.0.36

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.
@@ -223,7 +223,7 @@ function (_super) {
223
223
  , 3];
224
224
 
225
225
  case 2:
226
- num = JSON.parse(localStorage.getItem('TEMP_CART') || []).length;
226
+ num = (JSON.parse(localStorage.getItem('TEMP_CART')) || []).length;
227
227
  _a.label = 3;
228
228
 
229
229
  case 3:
@@ -291,14 +291,22 @@ var navigateTo = function navigateTo(url) {
291
291
  return;
292
292
  }
293
293
 
294
- if (url.startsWith('/')) {
295
- if (window.magicDesign.history && !window.magicDesign.navigatePreUrl) {
296
- window.magicDesign.history.push(url);
297
- } else {
294
+ var _a = url.split(';'),
295
+ h5Url = _a[0],
296
+ appUrl = _a[1]; // 未配置App路径并且h5绝对路径时直接跳转,其他情况让业务层处理
297
+
298
+
299
+ if (!appUrl && !h5Url.startsWith('/')) {
300
+ window.location.href = h5Url;
301
+ } else if (window.magicDesign.history) {
302
+ window.magicDesign.history.push(url);
303
+ } else if (window.magicDesign.navigatePreUrl) {
304
+ // 预览模式跳转
305
+ if (h5Url.startsWith('/')) {
298
306
  window.location.href = "" + window.magicDesign.navigatePreUrl + url;
307
+ } else {
308
+ window.location.href = h5Url;
299
309
  }
300
- } else {
301
- window.location.href = url;
302
310
  }
303
311
  };
304
312
 
@@ -223,7 +223,7 @@ function (_super) {
223
223
  , 3];
224
224
 
225
225
  case 2:
226
- num = JSON.parse(localStorage.getItem('TEMP_CART') || []).length;
226
+ num = (JSON.parse(localStorage.getItem('TEMP_CART')) || []).length;
227
227
  _a.label = 3;
228
228
 
229
229
  case 3:
@@ -291,14 +291,22 @@ var navigateTo = function navigateTo(url) {
291
291
  return;
292
292
  }
293
293
 
294
- if (url.startsWith('/')) {
295
- if (window.magicDesign.history && !window.magicDesign.navigatePreUrl) {
296
- window.magicDesign.history.push(url);
297
- } else {
294
+ var _a = url.split(';'),
295
+ h5Url = _a[0],
296
+ appUrl = _a[1]; // 未配置App路径并且h5绝对路径时直接跳转,其他情况让业务层处理
297
+
298
+
299
+ if (!appUrl && !h5Url.startsWith('/')) {
300
+ window.location.href = h5Url;
301
+ } else if (window.magicDesign.history) {
302
+ window.magicDesign.history.push(url);
303
+ } else if (window.magicDesign.navigatePreUrl) {
304
+ // 预览模式跳转
305
+ if (h5Url.startsWith('/')) {
298
306
  window.location.href = "" + window.magicDesign.navigatePreUrl + url;
307
+ } else {
308
+ window.location.href = h5Url;
299
309
  }
300
- } else {
301
- window.location.href = url;
302
310
  }
303
311
  };
304
312
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fonixtree/magic-design",
3
3
  "author": "Cylon Team",
4
- "version": "1.0.34",
4
+ "version": "1.0.36",
5
5
  "description": "Magic Design",
6
6
  "license": "MIT",
7
7
  "module": "es/index.js",
Binary file
Binary file