@fonixtree/magic-design 2.0.72 → 2.0.73
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.
- package/es/assets/fonts/.DS_Store +0 -0
- package/es/common/AffiliateProductModal/index.js +1 -1
- package/es/common/AffiliateProductModal/index.less +1 -1
- package/es/common/LinkModal/FilteredProductModal/index.js +154 -104
- package/es/common/LinkModal/FilteredProductModal/index.less +7 -0
- package/es/common/LinkModal/ProductDetailPage/index.js +92 -57
- package/es/common/LinkModal/ProductDetailPage/index.less +6 -1
- package/es/common/ProductModal/index.js +124 -87
- package/es/common/ProductModal/index.less +7 -1
- package/es/common/ProductSource/index.js +82 -21
- package/es/composite-comp/dito/components/Recommend/mobile/index.js +26 -23
- package/es/composite-comp/dito/second-config-panels/RecommendSecondConfig/index.js +4 -2
- package/es/locale/en/en.json +3 -2
- package/es/locale/es/es.json +3 -2
- package/es/locale/id/id.json +3 -2
- package/es/utils/commonUtil.js +14 -6
- package/lib/assets/fonts/.DS_Store +0 -0
- package/lib/common/AffiliateProductModal/index.js +1 -1
- package/lib/common/AffiliateProductModal/index.less +1 -1
- package/lib/common/LinkModal/FilteredProductModal/index.js +154 -104
- package/lib/common/LinkModal/FilteredProductModal/index.less +7 -0
- package/lib/common/LinkModal/ProductDetailPage/index.js +92 -57
- package/lib/common/LinkModal/ProductDetailPage/index.less +6 -1
- package/lib/common/ProductModal/index.js +124 -87
- package/lib/common/ProductModal/index.less +7 -1
- package/lib/common/ProductSource/index.js +82 -21
- package/lib/composite-comp/dito/components/Recommend/mobile/index.js +26 -23
- package/lib/composite-comp/dito/second-config-panels/RecommendSecondConfig/index.js +4 -2
- package/lib/locale/en/en.json +3 -2
- package/lib/locale/es/es.json +3 -2
- package/lib/locale/id/id.json +3 -2
- package/lib/utils/commonUtil.js +14 -6
- package/package.json +1 -1
|
@@ -15,7 +15,7 @@ var _commonUtil = require("../../utils/commonUtil");
|
|
|
15
15
|
|
|
16
16
|
var _Button = _interopRequireDefault(require("../Button"));
|
|
17
17
|
|
|
18
|
-
var _ProductModal =
|
|
18
|
+
var _ProductModal = _interopRequireWildcard(require("../ProductModal"));
|
|
19
19
|
|
|
20
20
|
require("./index.less");
|
|
21
21
|
|
|
@@ -27,6 +27,22 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
27
27
|
|
|
28
28
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
29
|
|
|
30
|
+
var __assign = void 0 && (void 0).__assign || function () {
|
|
31
|
+
__assign = Object.assign || function (t) {
|
|
32
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
33
|
+
s = arguments[i];
|
|
34
|
+
|
|
35
|
+
for (var p in s) {
|
|
36
|
+
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return t;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
return __assign.apply(this, arguments);
|
|
44
|
+
};
|
|
45
|
+
|
|
30
46
|
var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
|
|
31
47
|
function adopt(value) {
|
|
32
48
|
return value instanceof P ? value : new P(function (resolve) {
|
|
@@ -175,7 +191,8 @@ function ProductSource(_a) {
|
|
|
175
191
|
|
|
176
192
|
var value = _a.value,
|
|
177
193
|
onChange = _a.onChange,
|
|
178
|
-
isAffiliate = _a.isAffiliate
|
|
194
|
+
isAffiliate = _a.isAffiliate,
|
|
195
|
+
prodType = _a.prodType;
|
|
179
196
|
|
|
180
197
|
var _b = (0, _react.useState)([]),
|
|
181
198
|
selectedProds = _b[0],
|
|
@@ -187,27 +204,22 @@ function ProductSource(_a) {
|
|
|
187
204
|
|
|
188
205
|
var onSelectProduct = function onSelectProduct() {
|
|
189
206
|
return __awaiter(_this, void 0, void 0, function () {
|
|
190
|
-
var url, param, list;
|
|
207
|
+
var url, param, list, url, param, list, url, param, list_1;
|
|
191
208
|
return __generator(this, function (_a) {
|
|
192
209
|
switch (_a.label) {
|
|
193
210
|
case 0:
|
|
194
211
|
if (!(value && value.length > 0)) return [3
|
|
195
212
|
/*break*/
|
|
213
|
+
, 7];
|
|
214
|
+
if (!isAffiliate) return [3
|
|
215
|
+
/*break*/
|
|
196
216
|
, 2];
|
|
197
|
-
url = "/designer/v1/" + window.magicDesign.MBaseUrl + "/
|
|
217
|
+
url = "/designer/v1/" + window.magicDesign.MBaseUrl + "/distributor/product/list";
|
|
198
218
|
param = {
|
|
199
|
-
|
|
219
|
+
affiliateProductIds: value,
|
|
220
|
+
pageSize: value.length,
|
|
221
|
+
pageIndex: 1
|
|
200
222
|
};
|
|
201
|
-
|
|
202
|
-
if (isAffiliate) {
|
|
203
|
-
url = "/designer/v1/" + window.magicDesign.MBaseUrl + "/distributor/product/list";
|
|
204
|
-
param = {
|
|
205
|
-
affiliateProductIds: value,
|
|
206
|
-
pageSize: value.length,
|
|
207
|
-
pageIndex: 1
|
|
208
|
-
};
|
|
209
|
-
}
|
|
210
|
-
|
|
211
223
|
return [4
|
|
212
224
|
/*yield*/
|
|
213
225
|
, (0, _commonUtil.commonFetch)(url, param, 'GET')];
|
|
@@ -217,13 +229,61 @@ function ProductSource(_a) {
|
|
|
217
229
|
setSelectedProds(list || []);
|
|
218
230
|
return [3
|
|
219
231
|
/*break*/
|
|
220
|
-
,
|
|
232
|
+
, 6];
|
|
221
233
|
|
|
222
234
|
case 2:
|
|
223
|
-
|
|
224
|
-
|
|
235
|
+
if (!(prodType === 'sku')) return [3
|
|
236
|
+
/*break*/
|
|
237
|
+
, 4];
|
|
238
|
+
url = "/designer/v1/" + window.magicDesign.MBaseUrl + "/products";
|
|
239
|
+
param = {
|
|
240
|
+
products: value,
|
|
241
|
+
state: 'A'
|
|
242
|
+
};
|
|
243
|
+
return [4
|
|
244
|
+
/*yield*/
|
|
245
|
+
, (0, _commonUtil.commonFetch)(url, param, 'GET')];
|
|
225
246
|
|
|
226
247
|
case 3:
|
|
248
|
+
list = _a.sent().list;
|
|
249
|
+
setSelectedProds((0, _ProductModal.formatData)(list || []));
|
|
250
|
+
return [3
|
|
251
|
+
/*break*/
|
|
252
|
+
, 6];
|
|
253
|
+
|
|
254
|
+
case 4:
|
|
255
|
+
url = "/designer/v1/" + window.magicDesign.MBaseUrl + "/offers";
|
|
256
|
+
param = {
|
|
257
|
+
offers: value,
|
|
258
|
+
state: 'A',
|
|
259
|
+
isDefaultCover: 'Y',
|
|
260
|
+
onlyQryPublishSku: true,
|
|
261
|
+
auditState: 'S',
|
|
262
|
+
crmFlag: 'on'
|
|
263
|
+
};
|
|
264
|
+
return [4
|
|
265
|
+
/*yield*/
|
|
266
|
+
, (0, _commonUtil.commonFetch)(url, param, 'GET')];
|
|
267
|
+
|
|
268
|
+
case 5:
|
|
269
|
+
list_1 = _a.sent().list;
|
|
270
|
+
setSelectedProds((0, _ProductModal.formatData)((0, _commonUtil.ensure)(function () {
|
|
271
|
+
return list_1.map(function (m) {
|
|
272
|
+
return __assign(__assign({}, m.products[0]), m);
|
|
273
|
+
});
|
|
274
|
+
}, []), prodType));
|
|
275
|
+
_a.label = 6;
|
|
276
|
+
|
|
277
|
+
case 6:
|
|
278
|
+
return [3
|
|
279
|
+
/*break*/
|
|
280
|
+
, 8];
|
|
281
|
+
|
|
282
|
+
case 7:
|
|
283
|
+
setSelectedProds([]);
|
|
284
|
+
_a.label = 8;
|
|
285
|
+
|
|
286
|
+
case 8:
|
|
227
287
|
setVisbile(true);
|
|
228
288
|
return [2
|
|
229
289
|
/*return*/
|
|
@@ -233,7 +293,7 @@ function ProductSource(_a) {
|
|
|
233
293
|
});
|
|
234
294
|
};
|
|
235
295
|
|
|
236
|
-
var handleModalSave = function handleModalSave(list) {
|
|
296
|
+
var handleModalSave = function handleModalSave(list, type) {
|
|
237
297
|
var ids = '';
|
|
238
298
|
|
|
239
299
|
if (isAffiliate) {
|
|
@@ -242,11 +302,11 @@ function ProductSource(_a) {
|
|
|
242
302
|
}).join(',');
|
|
243
303
|
} else {
|
|
244
304
|
ids = list.map(function (prod) {
|
|
245
|
-
return prod.
|
|
305
|
+
return prod.id;
|
|
246
306
|
}).join(',');
|
|
247
307
|
}
|
|
248
308
|
|
|
249
|
-
onChange(ids);
|
|
309
|
+
onChange(ids, type);
|
|
250
310
|
};
|
|
251
311
|
|
|
252
312
|
var getLength = function getLength() {
|
|
@@ -281,6 +341,7 @@ function ProductSource(_a) {
|
|
|
281
341
|
defaultList: selectedProds,
|
|
282
342
|
handleModalSave: handleModalSave,
|
|
283
343
|
maxSelect: 100,
|
|
344
|
+
prodType: prodType,
|
|
284
345
|
visible: visible
|
|
285
346
|
})));
|
|
286
347
|
}
|
|
@@ -308,14 +308,14 @@ function (_super) {
|
|
|
308
308
|
|
|
309
309
|
_this.getProductList = function (index) {
|
|
310
310
|
return __awaiter(_this, void 0, void 0, function () {
|
|
311
|
-
var panelProps, groupSource, recommendId, pageId, cache, _a, _b, sourceType, _c, prodIds, _d,
|
|
311
|
+
var panelProps, groupSource, recommendId, pageId, cache, _a, _b, sourceType, _c, prodIds, _d, prodType, _e, intelligentType, _f, intelligentValue, _g, maxProdNum, newData, params, res, res, e_1, _cache;
|
|
312
312
|
|
|
313
|
-
var
|
|
313
|
+
var _h, _j, _k;
|
|
314
314
|
|
|
315
315
|
var _this = this;
|
|
316
316
|
|
|
317
|
-
return __generator(this, function (
|
|
318
|
-
switch (
|
|
317
|
+
return __generator(this, function (_l) {
|
|
318
|
+
switch (_l.label) {
|
|
319
319
|
case 0:
|
|
320
320
|
panelProps = this.props.panelProps;
|
|
321
321
|
groupSource = this.state.groupSource;
|
|
@@ -327,7 +327,7 @@ function (_super) {
|
|
|
327
327
|
|
|
328
328
|
if (cache) {
|
|
329
329
|
if ("products" + index in cache) {
|
|
330
|
-
this.setState((
|
|
330
|
+
this.setState((_h = {}, _h["products" + index] = cache["products" + index], _h), function () {
|
|
331
331
|
_this.resetLayout();
|
|
332
332
|
});
|
|
333
333
|
/** 如果数据未过期 */
|
|
@@ -339,12 +339,12 @@ function (_super) {
|
|
|
339
339
|
}
|
|
340
340
|
}
|
|
341
341
|
|
|
342
|
-
_a = groupSource[index] || {}, _b = _a.sourceType, sourceType = _b === void 0 ? '' : _b, _c = _a.prodIds, prodIds = _c === void 0 ? '' : _c, _d = _a.
|
|
342
|
+
_a = groupSource[index] || {}, _b = _a.sourceType, sourceType = _b === void 0 ? '' : _b, _c = _a.prodIds, prodIds = _c === void 0 ? '' : _c, _d = _a.prodType, prodType = _d === void 0 ? '' : _d, _e = _a.intelligentType, intelligentType = _e === void 0 ? '' : _e, _f = _a.intelligentValue, intelligentValue = _f === void 0 ? [] : _f, _g = _a.maxProdNum, maxProdNum = _g === void 0 ? 10 : _g;
|
|
343
343
|
newData = [];
|
|
344
|
-
|
|
344
|
+
_l.label = 1;
|
|
345
345
|
|
|
346
346
|
case 1:
|
|
347
|
-
|
|
347
|
+
_l.trys.push([1, 9,, 10]);
|
|
348
348
|
|
|
349
349
|
if (!(groupSource.length > 0)) return [3
|
|
350
350
|
/*break*/
|
|
@@ -352,22 +352,25 @@ function (_super) {
|
|
|
352
352
|
if (!(sourceType === 'select')) return [3
|
|
353
353
|
/*break*/
|
|
354
354
|
, 3];
|
|
355
|
+
if (!prodIds) return [2
|
|
356
|
+
/*return*/
|
|
357
|
+
];
|
|
358
|
+
params = {
|
|
359
|
+
state: 'A'
|
|
360
|
+
};
|
|
355
361
|
|
|
356
|
-
if (
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
362
|
+
if (prodType === 'spu') {
|
|
363
|
+
params.offers = prodIds;
|
|
364
|
+
} else {
|
|
365
|
+
params.products = prodIds;
|
|
360
366
|
}
|
|
361
367
|
|
|
362
368
|
return [4
|
|
363
369
|
/*yield*/
|
|
364
|
-
, (0, _commonUtil.commonFetch)('/designer/v1/h5/products',
|
|
365
|
-
products: prodIds,
|
|
366
|
-
state: 'A'
|
|
367
|
-
}, 'GET')];
|
|
370
|
+
, (0, _commonUtil.commonFetch)('/designer/v1/h5/products', params, 'GET')];
|
|
368
371
|
|
|
369
372
|
case 2:
|
|
370
|
-
res =
|
|
373
|
+
res = _l.sent();
|
|
371
374
|
newData = __spreadArrays(res.list);
|
|
372
375
|
return [3
|
|
373
376
|
/*break*/
|
|
@@ -390,7 +393,7 @@ function (_super) {
|
|
|
390
393
|
}, 'POST')];
|
|
391
394
|
|
|
392
395
|
case 4:
|
|
393
|
-
res =
|
|
396
|
+
res = _l.sent();
|
|
394
397
|
newData = __spreadArrays(res.pageInfo.list);
|
|
395
398
|
return [3
|
|
396
399
|
/*break*/
|
|
@@ -398,7 +401,7 @@ function (_super) {
|
|
|
398
401
|
|
|
399
402
|
case 5:
|
|
400
403
|
newData = [];
|
|
401
|
-
|
|
404
|
+
_l.label = 6;
|
|
402
405
|
|
|
403
406
|
case 6:
|
|
404
407
|
return [3
|
|
@@ -407,7 +410,7 @@ function (_super) {
|
|
|
407
410
|
|
|
408
411
|
case 7:
|
|
409
412
|
newData = [];
|
|
410
|
-
|
|
413
|
+
_l.label = 8;
|
|
411
414
|
|
|
412
415
|
case 8:
|
|
413
416
|
return [3
|
|
@@ -415,7 +418,7 @@ function (_super) {
|
|
|
415
418
|
, 10];
|
|
416
419
|
|
|
417
420
|
case 9:
|
|
418
|
-
e_1 =
|
|
421
|
+
e_1 = _l.sent();
|
|
419
422
|
newData = [];
|
|
420
423
|
return [3
|
|
421
424
|
/*break*/
|
|
@@ -424,10 +427,10 @@ function (_super) {
|
|
|
424
427
|
case 10:
|
|
425
428
|
if (!(0, _coreUtil.isDesignMode)()) {
|
|
426
429
|
_cache = (0, _storeUtil.getMagicStore)("recommend_" + pageId + "_" + recommendId);
|
|
427
|
-
(0, _storeUtil.setMagicStore)("recommend_" + pageId + "_" + recommendId, __assign(__assign({}, _cache), (
|
|
430
|
+
(0, _storeUtil.setMagicStore)("recommend_" + pageId + "_" + recommendId, __assign(__assign({}, _cache), (_j = {}, _j["products" + index] = newData, _j.endTime = Date.now() + 3 * 60 * 1000, _j)));
|
|
428
431
|
}
|
|
429
432
|
|
|
430
|
-
this.setState((
|
|
433
|
+
this.setState((_k = {}, _k["products" + index] = newData, _k), function () {
|
|
431
434
|
_this.resetLayout();
|
|
432
435
|
});
|
|
433
436
|
return [2
|
|
@@ -114,11 +114,13 @@ function (_super) {
|
|
|
114
114
|
}, (0, _locale.i18n)('AI_RECOMMENDATION')))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
115
115
|
className: "greyBg"
|
|
116
116
|
}, panelProps.sourceType === 'select' && /*#__PURE__*/_react["default"].createElement(_common.ProductSource, {
|
|
117
|
-
onChange: function onChange(
|
|
118
|
-
panelProps.prodIds =
|
|
117
|
+
onChange: function onChange(ids, type) {
|
|
118
|
+
panelProps.prodIds = ids;
|
|
119
|
+
panelProps.prodType = type;
|
|
119
120
|
|
|
120
121
|
_this.selfRender();
|
|
121
122
|
},
|
|
123
|
+
prodType: panelProps.prodType,
|
|
122
124
|
value: panelProps.prodIds
|
|
123
125
|
}), panelProps.sourceType === 'recommend' && /*#__PURE__*/_react["default"].createElement(_AIRecommendation["default"], {
|
|
124
126
|
onChange: function onChange(val) {
|
package/lib/locale/en/en.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"PUSH": "Push",
|
|
3
|
-
"SET_AS_TEMPLATE":"Set as Template",
|
|
3
|
+
"SET_AS_TEMPLATE": "Set as Template",
|
|
4
4
|
"DISPLAY_PAGE": "Display page",
|
|
5
5
|
"NAME": "Name",
|
|
6
6
|
"ADD_MENU": "Add Menu",
|
|
@@ -97,7 +97,8 @@
|
|
|
97
97
|
"BANNER_HEIGHT": "Banner Height",
|
|
98
98
|
"IMAGE": "Image",
|
|
99
99
|
"PRODUCT_NAME": "Product Name",
|
|
100
|
-
"
|
|
100
|
+
"SKU_CODE": "SKU Code",
|
|
101
|
+
"SPU_CODE": "SPU Code",
|
|
101
102
|
"SKU": "SKU",
|
|
102
103
|
"PRICE": "Price",
|
|
103
104
|
"BRAND": "Brand",
|
package/lib/locale/es/es.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"PUSH": "Push",
|
|
3
|
-
"SET_AS_TEMPLATE":"Set as Template",
|
|
3
|
+
"SET_AS_TEMPLATE": "Set as Template",
|
|
4
4
|
"DISPLAY_PAGE": "Display page",
|
|
5
5
|
"NAME": "Name",
|
|
6
6
|
"ADD_MENU": "Add Menu",
|
|
@@ -97,7 +97,8 @@
|
|
|
97
97
|
"BANNER_HEIGHT": "Altura del banner",
|
|
98
98
|
"IMAGE": "Imagen",
|
|
99
99
|
"PRODUCT_NAME": "Nombre del producto",
|
|
100
|
-
"
|
|
100
|
+
"SKU_CODE": "Código SKU",
|
|
101
|
+
"SPU_CODE": "Código spu",
|
|
101
102
|
"SKU": "SKU",
|
|
102
103
|
"PRICE": "Precio",
|
|
103
104
|
"BRAND": "Marca",
|
package/lib/locale/id/id.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"PUSH": "Push",
|
|
3
|
-
"SET_AS_TEMPLATE":"Set as Template",
|
|
3
|
+
"SET_AS_TEMPLATE": "Set as Template",
|
|
4
4
|
"DISPLAY_PAGE": "Display page",
|
|
5
5
|
"NAME": "Name",
|
|
6
6
|
"ADD_MENU": "Add Menu",
|
|
@@ -97,7 +97,8 @@
|
|
|
97
97
|
"BANNER_HEIGHT": "Banner Height",
|
|
98
98
|
"IMAGE": "Image",
|
|
99
99
|
"PRODUCT_NAME": "Product Name",
|
|
100
|
-
"
|
|
100
|
+
"SKU_CODE": "SKU Code",
|
|
101
|
+
"SPU_CODE": "SPU Code",
|
|
101
102
|
"SKU": "SKU",
|
|
102
103
|
"PRICE": "Price",
|
|
103
104
|
"BRAND": "Brand",
|
package/lib/utils/commonUtil.js
CHANGED
|
@@ -291,14 +291,22 @@ var navigateTo = function navigateTo(url) {
|
|
|
291
291
|
return;
|
|
292
292
|
}
|
|
293
293
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
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
|
|