@fonixtree/magic-design 2.0.140 → 2.0.143

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.
@@ -303,23 +303,24 @@ function isUrl(string) {
303
303
  }
304
304
 
305
305
  var clickUrl = function clickUrl(url, state) {
306
- var _a;
306
+ var _a, _b;
307
307
 
308
308
  if (url === void 0) {
309
309
  url = '';
310
310
  }
311
311
 
312
312
  console.log('clickUrl...', url, state); // 只读模式,设计模式,url为空,邮箱模版
313
- // if (window.magicDesign.readOnly || window.magicDesign.mode !== 'renderer' || !url || window.magicDesign.outputType == 'html') {
314
- // return;
315
- // }
316
313
 
317
- var _b = _typeof(url) === 'object' ? (0, _businessUtil.newParseUrl)(url) : (0, _businessUtil.parseUrl)(url),
318
- link = _b.link,
319
- data = _b.data;
314
+ if (window.magicDesign.readOnly || window.magicDesign.mode !== 'renderer' || !url || window.magicDesign.outputType == 'html') {
315
+ return;
316
+ }
317
+
318
+ var _c = _typeof(url) === 'object' ? (0, _businessUtil.newParseUrl)(url) : (0, _businessUtil.parseUrl)(url),
319
+ link = _c.link,
320
+ data = _c.data;
320
321
 
321
- var _c = data.params,
322
- params = _c === void 0 ? {} : _c; // console.log('clicked data:', data);
322
+ var _d = data.params,
323
+ params = _d === void 0 ? {} : _d; // console.log('clicked data:', data);
323
324
  // console.log({ type: 'jumpBrowser', params: { url: params.link } });
324
325
 
325
326
  /** 锚点跳转 */
@@ -334,7 +335,7 @@ var clickUrl = function clickUrl(url, state) {
334
335
  return;
335
336
  }
336
337
 
337
- if ((0, _androidUtil.browserVersion)().isAshitaApp) {
338
+ if ((0, _androidUtil.browserVersion)().isAshitaApp || (0, _androidUtil.browserVersion)().flutterApp) {
338
339
  (0, _androidUtil.sendToApp)(data);
339
340
  } else if ((0, _androidUtil.browserVersion)().isApp && params.link && params.link.startsWith('http')) {
340
341
  // 跳转链接是个绝对路径
@@ -351,6 +352,10 @@ var clickUrl = function clickUrl(url, state) {
351
352
  }
352
353
  });
353
354
  }
355
+ } else if ((0, _androidUtil.browserVersion)().isDitoApp && params.link && params.link.startsWith('http')) {
356
+ // pto 抽奖系统对接
357
+ var urlTemp = "" + params.link + (params.link.includes('?') ? '&' : '?') + "token=" + (localStorage.getItem('h5Token') || '');
358
+ window.location.href = urlTemp;
354
359
  } else {
355
360
  // 视频
356
361
  if (params.type === 'VIDEO') {
@@ -398,6 +403,29 @@ var clickUrl = function clickUrl(url, state) {
398
403
  }
399
404
  } else {
400
405
  (0, _commonUtil.navigateTo)(link, state);
406
+ } // 判断是否是pto, pto跳外链需要带token
407
+
408
+
409
+ if (((_b = window === null || window === void 0 ? void 0 : window.magicDesign) === null || _b === void 0 ? void 0 : _b.projectCode) === 'pto') {
410
+ // 输入的是完整的跳转地址
411
+ if (isUrl(link)) {
412
+ if (!link.includes(window.location.host)) {
413
+ // 跳转外链 需要把token带上
414
+ if (link.includes('?')) {
415
+ var a = link + "&token=" + (localStorage.getItem('h5Token') || '');
416
+ window.location.href = a;
417
+ } else {
418
+ var a = link + "?token=" + (localStorage.getItem('h5Token') || '');
419
+ window.location.href = a;
420
+ }
421
+ } else {
422
+ window.open(link);
423
+ }
424
+ } else {
425
+ (0, _commonUtil.navigateTo)(link, state);
426
+ }
427
+ } else {
428
+ (0, _commonUtil.navigateTo)(link, state);
401
429
  }
402
430
  }
403
431
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fonixtree/magic-design",
3
3
  "author": "Cylon Team",
4
- "version": "2.0.140",
4
+ "version": "2.0.143",
5
5
  "description": "Magic Design",
6
6
  "license": "MIT",
7
7
  "module": "es/index.js",