@fonixtree/magic-design 2.0.139 → 2.0.142

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.
@@ -17,6 +17,8 @@ var _currencyUtil = require("../../../utils/currencyUtil");
17
17
 
18
18
  var _businessUtil = require("../../../utils/businessUtil");
19
19
 
20
+ var _constants = require("../../../constants");
21
+
20
22
  require("./index.less");
21
23
 
22
24
  var _locale = require("../../../locale");
@@ -185,74 +187,82 @@ var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
185
187
  };
186
188
 
187
189
  var FilteredProductModal = function FilteredProductModal(props) {
190
+ var _a;
191
+
188
192
  var onDataChange = props.onDataChange,
189
193
  _fetch = props._fetch;
190
194
  var Option = _antd.Select.Option;
191
195
  var InputGroup = _antd.Input.Group;
192
196
 
193
- var _a = (0, _react.useState)([]),
194
- tValue = _a[0],
195
- settVal = _a[1];
196
-
197
197
  var _b = (0, _react.useState)([]),
198
- brandId = _b[0],
199
- settBrandId = _b[1];
198
+ tValue = _b[0],
199
+ settVal = _b[1];
200
200
 
201
- var _c = (0, _react.useState)({}),
202
- labelId = _c[0],
203
- settLabelId = _c[1];
201
+ var _c = (0, _react.useState)([]),
202
+ brandId = _c[0],
203
+ settBrandId = _c[1];
204
204
 
205
- var _d = (0, _react.useState)([]),
206
- treeData = _d[0],
207
- setTreeData = _d[1];
205
+ var _d = (0, _react.useState)({}),
206
+ labelId = _d[0],
207
+ settLabelId = _d[1];
208
208
 
209
209
  var _e = (0, _react.useState)([]),
210
- brandData = _e[0],
211
- setBrandData = _e[1];
210
+ treeData = _e[0],
211
+ setTreeData = _e[1];
212
212
 
213
213
  var _f = (0, _react.useState)([]),
214
- labelData = _f[0],
215
- setLabelData = _f[1];
214
+ brandData = _f[0],
215
+ setBrandData = _f[1];
216
216
 
217
- var _g = (0, _react.useState)(window.magicDesign.storeId >= 0 ? window.magicDesign.storeId : ''),
218
- storeId = _g[0],
219
- setStoreId = _g[1];
217
+ var _g = (0, _react.useState)([]),
218
+ labelData = _g[0],
219
+ setLabelData = _g[1];
220
220
 
221
- var _h = (0, _react.useState)([]),
222
- storeList = _h[0],
223
- setStoreList = _h[1];
221
+ var _h = (0, _react.useState)(window.magicDesign.storeId >= 0 ? window.magicDesign.storeId : ''),
222
+ storeId = _h[0],
223
+ setStoreId = _h[1];
224
224
 
225
- var _j = (0, _react.useState)(''),
226
- productName = _j[0],
227
- setProductName = _j[1];
225
+ var _j = (0, _react.useState)([]),
226
+ storeList = _j[0],
227
+ setStoreList = _j[1];
228
228
 
229
229
  var _k = (0, _react.useState)(''),
230
- minimum = _k[0],
231
- setMinimum = _k[1];
230
+ productName = _k[0],
231
+ setProductName = _k[1];
232
232
 
233
233
  var _l = (0, _react.useState)(''),
234
- maximum = _l[0],
235
- setMaximum = _l[1];
234
+ minimum = _l[0],
235
+ setMinimum = _l[1];
236
236
 
237
- var _m = (0, _react.useState)([]),
238
- dataSource = _m[0],
239
- setDataSource = _m[1];
237
+ var _m = (0, _react.useState)(''),
238
+ maximum = _m[0],
239
+ setMaximum = _m[1];
240
240
 
241
- var _o = (0, _react.useState)({}),
242
- promotions = _o[0],
243
- setPromotions = _o[1];
241
+ var _o = (0, _react.useState)([]),
242
+ dataSource = _o[0],
243
+ setDataSource = _o[1];
244
244
 
245
- var _p = (0, _react.useState)(false),
246
- loading = _p[0],
247
- setLoading = _p[1];
245
+ var _p = (0, _react.useState)({}),
246
+ promotions = _p[0],
247
+ setPromotions = _p[1];
248
248
 
249
- var _q = (0, _react.useState)({
249
+ var _q = (0, _react.useState)(false),
250
+ loading = _q[0],
251
+ setLoading = _q[1];
252
+
253
+ var _r = (0, _react.useState)({
250
254
  pageSize: 20,
251
255
  current: 1,
252
256
  total: 0
253
257
  }),
254
- paginationParams = _q[0],
255
- setPaginationParams = _q[1];
258
+ paginationParams = _r[0],
259
+ setPaginationParams = _r[1];
260
+
261
+ var FLASH_SALE = _constants.campaignTypes.FLASH_SALE,
262
+ GROUP_BY = _constants.campaignTypes.GROUP_BY,
263
+ SPECIAL_PRICE = _constants.campaignTypes.SPECIAL_PRICE,
264
+ OVER_SERIES = _constants.campaignTypes.OVER_SERIES;
265
+ var promotionOptions = ((_a = window.systemParams) === null || _a === void 0 ? void 0 : _a.projectCode) === _constants.projectCodes.MONPAY ? [FLASH_SALE, SPECIAL_PRICE, OVER_SERIES] : [FLASH_SALE, GROUP_BY, OVER_SERIES];
256
266
 
257
267
  var onChange = function onChange(value) {
258
268
  settVal(value);
@@ -452,7 +462,7 @@ var FilteredProductModal = function FilteredProductModal(props) {
452
462
  };
453
463
  return [4
454
464
  /*yield*/
455
- , fetch("/designer/v1/" + window.magicDesign.MBaseUrl + "/offers/es", params, 'POST')];
465
+ , _fetch("/designer/v1/" + window.magicDesign.MBaseUrl + "/offers/es", params, 'POST')];
456
466
 
457
467
  case 1:
458
468
  res = _a.sent();
@@ -627,13 +637,12 @@ var FilteredProductModal = function FilteredProductModal(props) {
627
637
  placeholder: (0, _locale.i18n)('PLEASE_SELECT'),
628
638
  size: "small",
629
639
  value: promotions.value
630
- }, /*#__PURE__*/_react["default"].createElement(Option, {
631
- key: "2",
632
- value: "Flash Sale"
633
- }, (0, _locale.i18n)('FLASH_SALE')), /*#__PURE__*/_react["default"].createElement(Option, {
634
- key: "4",
635
- value: "Group By"
636
- }, (0, _locale.i18n)('GROUP_BY')))), /*#__PURE__*/_react["default"].createElement("div", {
640
+ }, promotionOptions.map(function (m) {
641
+ return /*#__PURE__*/_react["default"].createElement(Option, {
642
+ key: m.KEY,
643
+ value: m.VALUE
644
+ }, m.VALUE);
645
+ }))), /*#__PURE__*/_react["default"].createElement("div", {
637
646
  className: "buttonStyle"
638
647
  }, /*#__PURE__*/_react["default"].createElement(_antd.Button, {
639
648
  onClick: function onClick() {
@@ -185,7 +185,9 @@
185
185
  font-size: 10px;
186
186
  font-weight: 800;
187
187
  width: 40px;
188
+ overflow: hidden;
188
189
  white-space: nowrap;
190
+ text-overflow: ellipsis;
189
191
  }
190
192
  }
191
193
  }
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.walletType = exports.urlTypeMap = exports.urlType = exports.tempTypeMap = exports.respCodeMap = exports.quickMenuCode = exports.personalInfoType = exports.partyTypeMap = exports.pageStateMap = exports.orderStatusType = exports.metaType = exports.metaInst = exports.metaInsType = exports.magicMode = exports.eventType = exports.deviceTypeWidthMap = exports.deviceTypeMap = exports.compInfoMap = exports.baseUrlMap = exports.STORE_KEY = exports.STORAGE_KEY = exports.ORDER_TYPE = exports.CREDIT_STATE = void 0;
6
+ exports.walletType = exports.urlTypeMap = exports.urlType = exports.tempTypeMap = exports.respCodeMap = exports.quickMenuCode = exports.projectCodes = exports.personalInfoType = exports.partyTypeMap = exports.pageStateMap = exports.orderStatusType = exports.metaType = exports.metaInst = exports.metaInsType = exports.magicMode = exports.eventType = exports.deviceTypeWidthMap = exports.deviceTypeMap = exports.compInfoMap = exports.campaignTypes = exports.baseUrlMap = exports.STORE_KEY = exports.STORAGE_KEY = exports.ORDER_TYPE = exports.CREDIT_STATE = void 0;
7
7
  var STORAGE_KEY = {
8
8
  LOCALE: 'ZSMART_LOCALE',
9
9
  MAGIC_RENDER_HTML: 'MAGIC_RENDER_HTML',
@@ -60,6 +60,30 @@ var personalInfoType = {
60
60
  VIEWED: 'Recently Viewed'
61
61
  };
62
62
  exports.personalInfoType = personalInfoType;
63
+ var projectCodes = {
64
+ MONPAY: 'MN',
65
+ PTO: 'pto'
66
+ };
67
+ exports.projectCodes = projectCodes;
68
+ var campaignTypes = {
69
+ FLASH_SALE: {
70
+ KEY: 2,
71
+ VALUE: 'Flash Sale'
72
+ },
73
+ GROUP_BY: {
74
+ KEY: 4,
75
+ VALUE: 'Group By'
76
+ },
77
+ SPECIAL_PRICE: {
78
+ KEY: 14,
79
+ VALUE: 'Special Price'
80
+ },
81
+ OVER_SERIES: {
82
+ KEY: 1,
83
+ VALUE: 'Over Series'
84
+ }
85
+ };
86
+ exports.campaignTypes = campaignTypes;
63
87
  var urlType = {
64
88
  PRODUCT_DETAIL: 'proDetail',
65
89
  CATG_PROD_LIST: 'catg',
@@ -157,8 +157,7 @@ var Renderer = function Renderer(props) {
157
157
  }
158
158
 
159
159
  return {
160
- overflowY: 'auto',
161
- overflowX: 'hidden'
160
+ overflow: 'hidden'
162
161
  };
163
162
  };
164
163
 
@@ -166,7 +165,6 @@ var Renderer = function Renderer(props) {
166
165
  className: "render_wrap",
167
166
  magic_design: "",
168
167
  style: __assign({
169
- height: '100%',
170
168
  background: pageBackground
171
169
  }, getRestStyle())
172
170
  }, floors.length > 0 && floors.map(function (nodeData, moduleIndex) {
@@ -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
  /** 锚点跳转 */
@@ -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
  };
@@ -17,6 +17,8 @@ var _currencyUtil = require("../../../utils/currencyUtil");
17
17
 
18
18
  var _businessUtil = require("../../../utils/businessUtil");
19
19
 
20
+ var _constants = require("../../../constants");
21
+
20
22
  require("./index.less");
21
23
 
22
24
  var _locale = require("../../../locale");
@@ -185,74 +187,82 @@ var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
185
187
  };
186
188
 
187
189
  var FilteredProductModal = function FilteredProductModal(props) {
190
+ var _a;
191
+
188
192
  var onDataChange = props.onDataChange,
189
193
  _fetch = props._fetch;
190
194
  var Option = _antd.Select.Option;
191
195
  var InputGroup = _antd.Input.Group;
192
196
 
193
- var _a = (0, _react.useState)([]),
194
- tValue = _a[0],
195
- settVal = _a[1];
196
-
197
197
  var _b = (0, _react.useState)([]),
198
- brandId = _b[0],
199
- settBrandId = _b[1];
198
+ tValue = _b[0],
199
+ settVal = _b[1];
200
200
 
201
- var _c = (0, _react.useState)({}),
202
- labelId = _c[0],
203
- settLabelId = _c[1];
201
+ var _c = (0, _react.useState)([]),
202
+ brandId = _c[0],
203
+ settBrandId = _c[1];
204
204
 
205
- var _d = (0, _react.useState)([]),
206
- treeData = _d[0],
207
- setTreeData = _d[1];
205
+ var _d = (0, _react.useState)({}),
206
+ labelId = _d[0],
207
+ settLabelId = _d[1];
208
208
 
209
209
  var _e = (0, _react.useState)([]),
210
- brandData = _e[0],
211
- setBrandData = _e[1];
210
+ treeData = _e[0],
211
+ setTreeData = _e[1];
212
212
 
213
213
  var _f = (0, _react.useState)([]),
214
- labelData = _f[0],
215
- setLabelData = _f[1];
214
+ brandData = _f[0],
215
+ setBrandData = _f[1];
216
216
 
217
- var _g = (0, _react.useState)(window.magicDesign.storeId >= 0 ? window.magicDesign.storeId : ''),
218
- storeId = _g[0],
219
- setStoreId = _g[1];
217
+ var _g = (0, _react.useState)([]),
218
+ labelData = _g[0],
219
+ setLabelData = _g[1];
220
220
 
221
- var _h = (0, _react.useState)([]),
222
- storeList = _h[0],
223
- setStoreList = _h[1];
221
+ var _h = (0, _react.useState)(window.magicDesign.storeId >= 0 ? window.magicDesign.storeId : ''),
222
+ storeId = _h[0],
223
+ setStoreId = _h[1];
224
224
 
225
- var _j = (0, _react.useState)(''),
226
- productName = _j[0],
227
- setProductName = _j[1];
225
+ var _j = (0, _react.useState)([]),
226
+ storeList = _j[0],
227
+ setStoreList = _j[1];
228
228
 
229
229
  var _k = (0, _react.useState)(''),
230
- minimum = _k[0],
231
- setMinimum = _k[1];
230
+ productName = _k[0],
231
+ setProductName = _k[1];
232
232
 
233
233
  var _l = (0, _react.useState)(''),
234
- maximum = _l[0],
235
- setMaximum = _l[1];
234
+ minimum = _l[0],
235
+ setMinimum = _l[1];
236
236
 
237
- var _m = (0, _react.useState)([]),
238
- dataSource = _m[0],
239
- setDataSource = _m[1];
237
+ var _m = (0, _react.useState)(''),
238
+ maximum = _m[0],
239
+ setMaximum = _m[1];
240
240
 
241
- var _o = (0, _react.useState)({}),
242
- promotions = _o[0],
243
- setPromotions = _o[1];
241
+ var _o = (0, _react.useState)([]),
242
+ dataSource = _o[0],
243
+ setDataSource = _o[1];
244
244
 
245
- var _p = (0, _react.useState)(false),
246
- loading = _p[0],
247
- setLoading = _p[1];
245
+ var _p = (0, _react.useState)({}),
246
+ promotions = _p[0],
247
+ setPromotions = _p[1];
248
248
 
249
- var _q = (0, _react.useState)({
249
+ var _q = (0, _react.useState)(false),
250
+ loading = _q[0],
251
+ setLoading = _q[1];
252
+
253
+ var _r = (0, _react.useState)({
250
254
  pageSize: 20,
251
255
  current: 1,
252
256
  total: 0
253
257
  }),
254
- paginationParams = _q[0],
255
- setPaginationParams = _q[1];
258
+ paginationParams = _r[0],
259
+ setPaginationParams = _r[1];
260
+
261
+ var FLASH_SALE = _constants.campaignTypes.FLASH_SALE,
262
+ GROUP_BY = _constants.campaignTypes.GROUP_BY,
263
+ SPECIAL_PRICE = _constants.campaignTypes.SPECIAL_PRICE,
264
+ OVER_SERIES = _constants.campaignTypes.OVER_SERIES;
265
+ var promotionOptions = ((_a = window.systemParams) === null || _a === void 0 ? void 0 : _a.projectCode) === _constants.projectCodes.MONPAY ? [FLASH_SALE, SPECIAL_PRICE, OVER_SERIES] : [FLASH_SALE, GROUP_BY, OVER_SERIES];
256
266
 
257
267
  var onChange = function onChange(value) {
258
268
  settVal(value);
@@ -452,7 +462,7 @@ var FilteredProductModal = function FilteredProductModal(props) {
452
462
  };
453
463
  return [4
454
464
  /*yield*/
455
- , fetch("/designer/v1/" + window.magicDesign.MBaseUrl + "/offers/es", params, 'POST')];
465
+ , _fetch("/designer/v1/" + window.magicDesign.MBaseUrl + "/offers/es", params, 'POST')];
456
466
 
457
467
  case 1:
458
468
  res = _a.sent();
@@ -627,13 +637,12 @@ var FilteredProductModal = function FilteredProductModal(props) {
627
637
  placeholder: (0, _locale.i18n)('PLEASE_SELECT'),
628
638
  size: "small",
629
639
  value: promotions.value
630
- }, /*#__PURE__*/_react["default"].createElement(Option, {
631
- key: "2",
632
- value: "Flash Sale"
633
- }, (0, _locale.i18n)('FLASH_SALE')), /*#__PURE__*/_react["default"].createElement(Option, {
634
- key: "4",
635
- value: "Group By"
636
- }, (0, _locale.i18n)('GROUP_BY')))), /*#__PURE__*/_react["default"].createElement("div", {
640
+ }, promotionOptions.map(function (m) {
641
+ return /*#__PURE__*/_react["default"].createElement(Option, {
642
+ key: m.KEY,
643
+ value: m.VALUE
644
+ }, m.VALUE);
645
+ }))), /*#__PURE__*/_react["default"].createElement("div", {
637
646
  className: "buttonStyle"
638
647
  }, /*#__PURE__*/_react["default"].createElement(_antd.Button, {
639
648
  onClick: function onClick() {
@@ -185,7 +185,9 @@
185
185
  font-size: 10px;
186
186
  font-weight: 800;
187
187
  width: 40px;
188
+ overflow: hidden;
188
189
  white-space: nowrap;
190
+ text-overflow: ellipsis;
189
191
  }
190
192
  }
191
193
  }
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.walletType = exports.urlTypeMap = exports.urlType = exports.tempTypeMap = exports.respCodeMap = exports.quickMenuCode = exports.personalInfoType = exports.partyTypeMap = exports.pageStateMap = exports.orderStatusType = exports.metaType = exports.metaInst = exports.metaInsType = exports.magicMode = exports.eventType = exports.deviceTypeWidthMap = exports.deviceTypeMap = exports.compInfoMap = exports.baseUrlMap = exports.STORE_KEY = exports.STORAGE_KEY = exports.ORDER_TYPE = exports.CREDIT_STATE = void 0;
6
+ exports.walletType = exports.urlTypeMap = exports.urlType = exports.tempTypeMap = exports.respCodeMap = exports.quickMenuCode = exports.projectCodes = exports.personalInfoType = exports.partyTypeMap = exports.pageStateMap = exports.orderStatusType = exports.metaType = exports.metaInst = exports.metaInsType = exports.magicMode = exports.eventType = exports.deviceTypeWidthMap = exports.deviceTypeMap = exports.compInfoMap = exports.campaignTypes = exports.baseUrlMap = exports.STORE_KEY = exports.STORAGE_KEY = exports.ORDER_TYPE = exports.CREDIT_STATE = void 0;
7
7
  var STORAGE_KEY = {
8
8
  LOCALE: 'ZSMART_LOCALE',
9
9
  MAGIC_RENDER_HTML: 'MAGIC_RENDER_HTML',
@@ -60,6 +60,30 @@ var personalInfoType = {
60
60
  VIEWED: 'Recently Viewed'
61
61
  };
62
62
  exports.personalInfoType = personalInfoType;
63
+ var projectCodes = {
64
+ MONPAY: 'MN',
65
+ PTO: 'pto'
66
+ };
67
+ exports.projectCodes = projectCodes;
68
+ var campaignTypes = {
69
+ FLASH_SALE: {
70
+ KEY: 2,
71
+ VALUE: 'Flash Sale'
72
+ },
73
+ GROUP_BY: {
74
+ KEY: 4,
75
+ VALUE: 'Group By'
76
+ },
77
+ SPECIAL_PRICE: {
78
+ KEY: 14,
79
+ VALUE: 'Special Price'
80
+ },
81
+ OVER_SERIES: {
82
+ KEY: 1,
83
+ VALUE: 'Over Series'
84
+ }
85
+ };
86
+ exports.campaignTypes = campaignTypes;
63
87
  var urlType = {
64
88
  PRODUCT_DETAIL: 'proDetail',
65
89
  CATG_PROD_LIST: 'catg',
@@ -157,8 +157,7 @@ var Renderer = function Renderer(props) {
157
157
  }
158
158
 
159
159
  return {
160
- overflowY: 'auto',
161
- overflowX: 'hidden'
160
+ overflow: 'hidden'
162
161
  };
163
162
  };
164
163
 
@@ -166,7 +165,6 @@ var Renderer = function Renderer(props) {
166
165
  className: "render_wrap",
167
166
  magic_design: "",
168
167
  style: __assign({
169
- height: '100%',
170
168
  background: pageBackground
171
169
  }, getRestStyle())
172
170
  }, floors.length > 0 && floors.map(function (nodeData, moduleIndex) {
@@ -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
  /** 锚点跳转 */
@@ -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.139",
4
+ "version": "2.0.142",
5
5
  "description": "Magic Design",
6
6
  "license": "MIT",
7
7
  "module": "es/index.js",