@fonixtree/magic-design 2.0.23 → 2.0.25

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.
@@ -281,7 +281,7 @@ function (_super) {
281
281
  key: v.key,
282
282
  value: v.key
283
283
  }, v.value);
284
- })), /*#__PURE__*/_react["default"].createElement("div", {
284
+ })), window.magicDesign.needAi && /*#__PURE__*/_react["default"].createElement("div", {
285
285
  className: "ai-btn",
286
286
  onClick: this.onAiImageClick
287
287
  }, /*#__PURE__*/_react["default"].createElement(_Iconfont["default"], {
@@ -471,8 +471,7 @@ var FilteredProductModal = function FilteredProductModal(props) {
471
471
  , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/offers/es", params, 'POST')];
472
472
 
473
473
  case 1:
474
- res = _a.sent(); // const res = await commonFetch(`/designer/v1/products`, params, 'GET');
475
-
474
+ res = _a.sent();
476
475
  setLoading(false);
477
476
  paginationParams.total = res.total;
478
477
 
@@ -220,7 +220,7 @@ var ProductDetailPage = function ProductDetailPage(props) {
220
220
  productName = _e[0],
221
221
  setProductName = _e[1];
222
222
 
223
- var _f = (0, _react.useState)(window.magicDesign.storeId ? window.magicDesign.storeId : []),
223
+ var _f = (0, _react.useState)(''),
224
224
  storeId = _f[0],
225
225
  setStoreId = _f[1];
226
226
 
@@ -357,7 +357,7 @@ var ProductDetailPage = function ProductDetailPage(props) {
357
357
  setProductName('');
358
358
  setProductCode('');
359
359
  setBrandId([]);
360
- setStoreId(window.magicDesign.storeId ? window.magicDesign.storeId : []);
360
+ setStoreId('');
361
361
  };
362
362
 
363
363
  (0, _react.useEffect)(function () {
@@ -271,7 +271,7 @@ var ProductModal = function ProductModal(props) {
271
271
  productCode = _m[0],
272
272
  setProductCode = _m[1];
273
273
 
274
- var _o = (0, _react.useState)(window.magicDesign.storeId ? [window.magicDesign.storeId] : []),
274
+ var _o = (0, _react.useState)(''),
275
275
  storeId = _o[0],
276
276
  setStoreId = _o[1];
277
277
 
@@ -491,7 +491,7 @@ var ProductModal = function ProductModal(props) {
491
491
  setSelCatgsList([]);
492
492
  setSelLabelData([]);
493
493
  setProductName('');
494
- setStoreId(window.magicDesign.storeId ? [window.magicDesign.storeId] : []);
494
+ setStoreId('');
495
495
  setProductCode('');
496
496
  setMinPrice('');
497
497
  setMaxPrice('');
@@ -761,7 +761,7 @@ function (_super) {
761
761
  magic_design: ""
762
762
  }, /*#__PURE__*/_react["default"].createElement("div", {
763
763
  className: "designer-wrap"
764
- }, /*#__PURE__*/_react["default"].createElement(_ChatRobot["default"], null), /*#__PURE__*/_react["default"].createElement(_PageCompList["default"], {
764
+ }, window.magicDesign.needAi && /*#__PURE__*/_react["default"].createElement(_ChatRobot["default"], null), /*#__PURE__*/_react["default"].createElement(_PageCompList["default"], {
765
765
  onAdd: this.onAdd,
766
766
  pageData: MPageData,
767
767
  pageName: pageName,
@@ -303,9 +303,24 @@ var clickUrl = function clickUrl(url) {
303
303
 
304
304
  var _b = data.params,
305
305
  params = _b === void 0 ? {} : _b;
306
+ console.log('clicked data:', data);
307
+ console.log({
308
+ type: 'jumpBrowser',
309
+ params: {
310
+ url: params.link
311
+ }
312
+ });
306
313
 
307
314
  if ((0, _androidUtil.browserVersion)().isAshitaApp) {
308
315
  (0, _androidUtil.sendToApp)(data);
316
+ } else if ((0, _androidUtil.browserVersion)().isApp && params.link && params.link.startsWith('http')) {
317
+ // 兼容Nuri的 绝对路径跳转
318
+ (0, _androidUtil.sendToAndroid)({
319
+ type: 'jumpBrowser',
320
+ params: {
321
+ url: params.link
322
+ }
323
+ });
309
324
  } else {
310
325
  // 视频
311
326
  if (params.type === 'VIDEO') {
@@ -281,7 +281,7 @@ function (_super) {
281
281
  key: v.key,
282
282
  value: v.key
283
283
  }, v.value);
284
- })), /*#__PURE__*/_react["default"].createElement("div", {
284
+ })), window.magicDesign.needAi && /*#__PURE__*/_react["default"].createElement("div", {
285
285
  className: "ai-btn",
286
286
  onClick: this.onAiImageClick
287
287
  }, /*#__PURE__*/_react["default"].createElement(_Iconfont["default"], {
@@ -471,8 +471,7 @@ var FilteredProductModal = function FilteredProductModal(props) {
471
471
  , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/offers/es", params, 'POST')];
472
472
 
473
473
  case 1:
474
- res = _a.sent(); // const res = await commonFetch(`/designer/v1/products`, params, 'GET');
475
-
474
+ res = _a.sent();
476
475
  setLoading(false);
477
476
  paginationParams.total = res.total;
478
477
 
@@ -220,7 +220,7 @@ var ProductDetailPage = function ProductDetailPage(props) {
220
220
  productName = _e[0],
221
221
  setProductName = _e[1];
222
222
 
223
- var _f = (0, _react.useState)(window.magicDesign.storeId ? window.magicDesign.storeId : []),
223
+ var _f = (0, _react.useState)(''),
224
224
  storeId = _f[0],
225
225
  setStoreId = _f[1];
226
226
 
@@ -357,7 +357,7 @@ var ProductDetailPage = function ProductDetailPage(props) {
357
357
  setProductName('');
358
358
  setProductCode('');
359
359
  setBrandId([]);
360
- setStoreId(window.magicDesign.storeId ? window.magicDesign.storeId : []);
360
+ setStoreId('');
361
361
  };
362
362
 
363
363
  (0, _react.useEffect)(function () {
@@ -271,7 +271,7 @@ var ProductModal = function ProductModal(props) {
271
271
  productCode = _m[0],
272
272
  setProductCode = _m[1];
273
273
 
274
- var _o = (0, _react.useState)(window.magicDesign.storeId ? [window.magicDesign.storeId] : []),
274
+ var _o = (0, _react.useState)(''),
275
275
  storeId = _o[0],
276
276
  setStoreId = _o[1];
277
277
 
@@ -491,7 +491,7 @@ var ProductModal = function ProductModal(props) {
491
491
  setSelCatgsList([]);
492
492
  setSelLabelData([]);
493
493
  setProductName('');
494
- setStoreId(window.magicDesign.storeId ? [window.magicDesign.storeId] : []);
494
+ setStoreId('');
495
495
  setProductCode('');
496
496
  setMinPrice('');
497
497
  setMaxPrice('');
@@ -761,7 +761,7 @@ function (_super) {
761
761
  magic_design: ""
762
762
  }, /*#__PURE__*/_react["default"].createElement("div", {
763
763
  className: "designer-wrap"
764
- }, /*#__PURE__*/_react["default"].createElement(_ChatRobot["default"], null), /*#__PURE__*/_react["default"].createElement(_PageCompList["default"], {
764
+ }, window.magicDesign.needAi && /*#__PURE__*/_react["default"].createElement(_ChatRobot["default"], null), /*#__PURE__*/_react["default"].createElement(_PageCompList["default"], {
765
765
  onAdd: this.onAdd,
766
766
  pageData: MPageData,
767
767
  pageName: pageName,
@@ -303,9 +303,24 @@ var clickUrl = function clickUrl(url) {
303
303
 
304
304
  var _b = data.params,
305
305
  params = _b === void 0 ? {} : _b;
306
+ console.log('clicked data:', data);
307
+ console.log({
308
+ type: 'jumpBrowser',
309
+ params: {
310
+ url: params.link
311
+ }
312
+ });
306
313
 
307
314
  if ((0, _androidUtil.browserVersion)().isAshitaApp) {
308
315
  (0, _androidUtil.sendToApp)(data);
316
+ } else if ((0, _androidUtil.browserVersion)().isApp && params.link && params.link.startsWith('http')) {
317
+ // 兼容Nuri的 绝对路径跳转
318
+ (0, _androidUtil.sendToAndroid)({
319
+ type: 'jumpBrowser',
320
+ params: {
321
+ url: params.link
322
+ }
323
+ });
309
324
  } else {
310
325
  // 视频
311
326
  if (params.type === 'VIDEO') {
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.23",
4
+ "version": "2.0.25",
5
5
  "description": "Magic Design",
6
6
  "license": "MIT",
7
7
  "module": "es/index.js",