@fonixtree/magic-design 1.0.6 → 1.0.7
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/common/LinkModal/FilteredProductModal/index.js +1 -1
- package/es/common/ProductModal/index.js +2 -2
- package/es/composite-comp/common/components/ProductItem/index.js +1 -1
- package/es/composite-comp/dito/components/SignBoard/defaultJSON.js +20 -0
- package/es/composite-comp/dito/components/SignBoard/mobile/index.js +9 -8
- package/es/composite-comp/dito/components/SignBoard/mobile/index.less +0 -9
- package/es/composite-comp/dito/config-panels/SignBoardConfig/SignBoardConfigContent/index.js +11 -1
- package/es/decorator/index.js +24 -1
- package/es/meta-comp/components/Button/index.js +7 -0
- package/es/meta-comp/components/Text/index.js +7 -0
- package/es/meta-comp/config-panels/ButtonConfig/index.js +12 -12
- package/es/utils/commonUtil.js +1 -1
- package/es/utils/currencyUtil.js +8 -8
- package/lib/common/LinkModal/FilteredProductModal/index.js +1 -1
- package/lib/common/ProductModal/index.js +2 -2
- package/lib/composite-comp/common/components/ProductItem/index.js +1 -1
- package/lib/composite-comp/dito/components/SignBoard/defaultJSON.js +20 -0
- package/lib/composite-comp/dito/components/SignBoard/mobile/index.js +9 -8
- package/lib/composite-comp/dito/components/SignBoard/mobile/index.less +0 -9
- package/lib/composite-comp/dito/config-panels/SignBoardConfig/SignBoardConfigContent/index.js +11 -1
- package/lib/decorator/index.js +24 -1
- package/lib/meta-comp/components/Button/index.js +7 -0
- package/lib/meta-comp/components/Text/index.js +7 -0
- package/lib/meta-comp/config-panels/ButtonConfig/index.js +12 -12
- package/lib/utils/commonUtil.js +1 -1
- package/lib/utils/currencyUtil.js +8 -8
- package/package.json +1 -1
|
@@ -447,7 +447,7 @@ var FilteredProductModal = function FilteredProductModal(props) {
|
|
|
447
447
|
switch (_a.label) {
|
|
448
448
|
case 0:
|
|
449
449
|
precision = Math.pow(10, (0, _commonUtil.ensure)(function () {
|
|
450
|
-
return window.
|
|
450
|
+
return window.systemParams.precision;
|
|
451
451
|
}, '0'));
|
|
452
452
|
params = {
|
|
453
453
|
catgIds: tValue.join(','),
|
|
@@ -383,7 +383,7 @@ var ProductModal = function ProductModal(props) {
|
|
|
383
383
|
case 0:
|
|
384
384
|
return [4
|
|
385
385
|
/*yield*/
|
|
386
|
-
, (0, _commonUtil.commonFetch)(
|
|
386
|
+
, (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/storeoffercatgs", {}, 'GET')];
|
|
387
387
|
|
|
388
388
|
case 1:
|
|
389
389
|
res = _a.sent();
|
|
@@ -409,7 +409,7 @@ var ProductModal = function ProductModal(props) {
|
|
|
409
409
|
case 0:
|
|
410
410
|
return [4
|
|
411
411
|
/*yield*/
|
|
412
|
-
, (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/
|
|
412
|
+
, (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/designer/resource/brand/list", {}, 'GET')];
|
|
413
413
|
|
|
414
414
|
case 1:
|
|
415
415
|
res = _a.sent();
|
|
@@ -133,7 +133,7 @@ function (_super) {
|
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
var pricePrefix = (0, _commonUtil.ensure)(function () {
|
|
136
|
-
return window.
|
|
136
|
+
return window.systemParams.prefix;
|
|
137
137
|
}, 'Rp');
|
|
138
138
|
|
|
139
139
|
var _price = pricePrefix + " " + integerPart + " " + (decimalPart ? '.' + decimalPart : '');
|
|
@@ -30,6 +30,26 @@ var getDefaultJSON = function getDefaultJSON() {
|
|
|
30
30
|
pcImgHoverUrl: '',
|
|
31
31
|
h5ImgHoverUrl: ''
|
|
32
32
|
}
|
|
33
|
+
},
|
|
34
|
+
title: {
|
|
35
|
+
id: (0, _uuid.v4)(),
|
|
36
|
+
open: true,
|
|
37
|
+
type: 'TEXT',
|
|
38
|
+
specialContent: [],
|
|
39
|
+
text: 'Title',
|
|
40
|
+
content: {
|
|
41
|
+
sizeType: 'Customize font styles',
|
|
42
|
+
fontFamily: 'Open Sans',
|
|
43
|
+
fontWeight: 600,
|
|
44
|
+
fontSize: 16,
|
|
45
|
+
color: '#070707'
|
|
46
|
+
},
|
|
47
|
+
underline: {
|
|
48
|
+
open: false,
|
|
49
|
+
textDecorationColor: '',
|
|
50
|
+
textDecorationStyle: 'solid'
|
|
51
|
+
},
|
|
52
|
+
vertical: {}
|
|
33
53
|
}
|
|
34
54
|
},
|
|
35
55
|
spacing: {
|
|
@@ -337,14 +337,14 @@ function (_super) {
|
|
|
337
337
|
SignBoardMobile.prototype.render = function () {
|
|
338
338
|
var _this = this;
|
|
339
339
|
|
|
340
|
-
var _a;
|
|
340
|
+
var _a, _b;
|
|
341
341
|
|
|
342
342
|
var data = this.props.data; // console.log('--SignBoard', data);
|
|
343
343
|
|
|
344
|
-
var
|
|
345
|
-
storeInfo =
|
|
346
|
-
isFollow =
|
|
347
|
-
inputVal =
|
|
344
|
+
var _c = this.state,
|
|
345
|
+
storeInfo = _c.storeInfo,
|
|
346
|
+
isFollow = _c.isFollow,
|
|
347
|
+
inputVal = _c.inputVal;
|
|
348
348
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
349
349
|
className: "m-sign-board-bar"
|
|
350
350
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -377,9 +377,10 @@ function (_super) {
|
|
|
377
377
|
height: 44,
|
|
378
378
|
width: 44
|
|
379
379
|
}
|
|
380
|
-
})), /*#__PURE__*/_react["default"].createElement(
|
|
381
|
-
className: "
|
|
382
|
-
|
|
380
|
+
})), data.content && ((_b = data.content.title) === null || _b === void 0 ? void 0 : _b.open) && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
|
|
381
|
+
className: "card-text",
|
|
382
|
+
data: data.content.title
|
|
383
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
383
384
|
onClick: this.clickCollect
|
|
384
385
|
}, /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
|
|
385
386
|
color: isFollow ? '#F1600F' : '#333333',
|
|
@@ -62,12 +62,3 @@
|
|
|
62
62
|
text-transform: uppercase;
|
|
63
63
|
color: #333333;
|
|
64
64
|
}
|
|
65
|
-
.m-sign-board-bar .store-info-wrap .store-name {
|
|
66
|
-
flex: 1;
|
|
67
|
-
margin-left: 0.24rem;
|
|
68
|
-
font-weight: 500;
|
|
69
|
-
font-size: 0.32rem;
|
|
70
|
-
line-height: 0.4rem;
|
|
71
|
-
color: #070707;
|
|
72
|
-
font-family: 'Montserrat';
|
|
73
|
-
}
|
package/es/composite-comp/dito/config-panels/SignBoardConfig/SignBoardConfigContent/index.js
CHANGED
|
@@ -15,6 +15,8 @@ var _ImageConfig = _interopRequireDefault(require("../../../../../meta-comp/conf
|
|
|
15
15
|
|
|
16
16
|
var _coreUtil = require("../../../../../utils/coreUtil");
|
|
17
17
|
|
|
18
|
+
var _TextConfig = _interopRequireDefault(require("../../../../../meta-comp/config-panels/TextConfig"));
|
|
19
|
+
|
|
18
20
|
var _locale = require("../../../../../locale");
|
|
19
21
|
|
|
20
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -69,13 +71,21 @@ function (_super) {
|
|
|
69
71
|
SignBoardConfigContent.prototype.render = function () {
|
|
70
72
|
var panelProps = this.props.panelProps;
|
|
71
73
|
var source = [{
|
|
72
|
-
key: '
|
|
74
|
+
key: 'logo',
|
|
73
75
|
name: (0, _locale.i18n)('LOGO'),
|
|
74
76
|
value: /*#__PURE__*/_react["default"].createElement(_ImageConfig["default"], {
|
|
75
77
|
data: panelProps.logo
|
|
76
78
|
}),
|
|
77
79
|
metaOption: panelProps.logo,
|
|
78
80
|
toggleType: 'switch'
|
|
81
|
+
}, {
|
|
82
|
+
key: 'title',
|
|
83
|
+
name: (0, _locale.i18n)('TITLE'),
|
|
84
|
+
value: /*#__PURE__*/_react["default"].createElement(_TextConfig["default"], {
|
|
85
|
+
data: panelProps.title
|
|
86
|
+
}),
|
|
87
|
+
metaOption: panelProps.title,
|
|
88
|
+
toggleType: 'switch'
|
|
79
89
|
}];
|
|
80
90
|
return /*#__PURE__*/_react["default"].createElement(_common.Collapse, {
|
|
81
91
|
headerSize: "middle",
|
package/es/decorator/index.js
CHANGED
|
@@ -27,6 +27,7 @@ Object.defineProperty(exports, "metaDecorator", {
|
|
|
27
27
|
return _metaDecorator["default"];
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
+
exports.shouldUpdate = shouldUpdate;
|
|
30
31
|
Object.defineProperty(exports, "updateConfigDecorator", {
|
|
31
32
|
enumerable: true,
|
|
32
33
|
get: function get() {
|
|
@@ -42,4 +43,26 @@ var _updateConfigDecorator = _interopRequireDefault(require("./updateConfigDecor
|
|
|
42
43
|
|
|
43
44
|
var _lazyLoadDecorator = require("./lazyLoadDecorator");
|
|
44
45
|
|
|
45
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
46
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
47
|
+
|
|
48
|
+
/* eslint-disable @typescript-eslint/no-unused-expressions */
|
|
49
|
+
|
|
50
|
+
/** props 和 state 改变时才会render */
|
|
51
|
+
function shouldUpdate() {
|
|
52
|
+
return function (target, name, descriptor) {
|
|
53
|
+
var fn = descriptor.value;
|
|
54
|
+
|
|
55
|
+
descriptor.value = function (nextProps, nextState) {
|
|
56
|
+
var nowPropsJson = JSON.stringify(nextProps);
|
|
57
|
+
var nowStateJson = JSON.stringify(nextState);
|
|
58
|
+
var should1 = nowPropsJson != this.preProps;
|
|
59
|
+
var should2 = nowStateJson != this.preState;
|
|
60
|
+
this.preProps = nowPropsJson;
|
|
61
|
+
this.preState = nowStateJson;
|
|
62
|
+
var result = should1 || should2;
|
|
63
|
+
return result && fn.apply(this, {
|
|
64
|
+
nextProps: nextProps
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
}
|
|
@@ -93,6 +93,10 @@ function (_super) {
|
|
|
93
93
|
return _this;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
+
Button.prototype.shouldComponentUpdate = function () {
|
|
97
|
+
return true;
|
|
98
|
+
};
|
|
99
|
+
|
|
96
100
|
Button.prototype.render = function () {
|
|
97
101
|
var _this = this;
|
|
98
102
|
|
|
@@ -168,6 +172,9 @@ function (_super) {
|
|
|
168
172
|
className: '',
|
|
169
173
|
readonly: false
|
|
170
174
|
};
|
|
175
|
+
|
|
176
|
+
__decorate([(0, _decorator.shouldUpdate)()], Button.prototype, "shouldComponentUpdate", null);
|
|
177
|
+
|
|
171
178
|
Button = __decorate([_decorator.metaDecorator], Button);
|
|
172
179
|
return Button;
|
|
173
180
|
}(_react.Component);
|
|
@@ -203,6 +203,10 @@ function (_super) {
|
|
|
203
203
|
});
|
|
204
204
|
};
|
|
205
205
|
|
|
206
|
+
Text.prototype.shouldComponentUpdate = function () {
|
|
207
|
+
return true;
|
|
208
|
+
};
|
|
209
|
+
|
|
206
210
|
Text.prototype.render = function () {
|
|
207
211
|
var _a = this.props,
|
|
208
212
|
data = _a.data,
|
|
@@ -272,6 +276,9 @@ function (_super) {
|
|
|
272
276
|
readonly: false,
|
|
273
277
|
onTextInput: function onTextInput() {}
|
|
274
278
|
};
|
|
279
|
+
|
|
280
|
+
__decorate([(0, _decorator.shouldUpdate)()], Text.prototype, "shouldComponentUpdate", null);
|
|
281
|
+
|
|
275
282
|
Text = __decorate([_decorator.metaDecorator], Text);
|
|
276
283
|
return Text;
|
|
277
284
|
}(_react["default"].Component);
|
|
@@ -162,7 +162,7 @@ function (_super) {
|
|
|
162
162
|
|
|
163
163
|
var fontSizeKey = window.magicDesign.device == 'pc' ? 'pcFontSize' : 'fontSize';
|
|
164
164
|
|
|
165
|
-
var ButtonTextSetting = function ButtonTextSetting(
|
|
165
|
+
var ButtonTextSetting = function ButtonTextSetting(_data) {
|
|
166
166
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_common.Field, {
|
|
167
167
|
title: (0, _locale.i18n)('FONT_STYLE')
|
|
168
168
|
}, /*#__PURE__*/_react["default"].createElement(_antd.Select, {
|
|
@@ -171,24 +171,24 @@ function (_super) {
|
|
|
171
171
|
return t.key == v;
|
|
172
172
|
});
|
|
173
173
|
|
|
174
|
-
_extends(
|
|
174
|
+
_extends(_data, __assign(__assign({}, findOne), {
|
|
175
175
|
sizeType: findOne === null || findOne === void 0 ? void 0 : findOne.key
|
|
176
176
|
}));
|
|
177
177
|
|
|
178
178
|
_this.selfRender();
|
|
179
179
|
},
|
|
180
|
-
value:
|
|
180
|
+
value: _data.sizeType
|
|
181
181
|
}, _TextConfig.sizeTypeList.map(function (sizeType) {
|
|
182
182
|
return /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
|
|
183
183
|
value: sizeType.key
|
|
184
184
|
}, sizeType.key);
|
|
185
|
-
}))),
|
|
185
|
+
}))), _data.sizeType == 'Customize font styles' && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_common.Field, {
|
|
186
186
|
title: (0, _locale.i18n)('FONT_FAMILY')
|
|
187
187
|
}, /*#__PURE__*/_react["default"].createElement(_antd.Select, {
|
|
188
188
|
onChange: function onChange(v) {
|
|
189
|
-
_this.updateAttr(
|
|
189
|
+
_this.updateAttr(_data, 'fontFamily', v);
|
|
190
190
|
},
|
|
191
|
-
value:
|
|
191
|
+
value: _data.fontFamily
|
|
192
192
|
}, /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
|
|
193
193
|
value: "Montserrat"
|
|
194
194
|
}, "Montserrat"), /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
|
|
@@ -197,9 +197,9 @@ function (_super) {
|
|
|
197
197
|
title: (0, _locale.i18n)('FONT_WEIGHT')
|
|
198
198
|
}, /*#__PURE__*/_react["default"].createElement(_antd.Select, {
|
|
199
199
|
onChange: function onChange(v) {
|
|
200
|
-
_this.updateAttr(
|
|
200
|
+
_this.updateAttr(_data, 'fontWeight', v);
|
|
201
201
|
},
|
|
202
|
-
value:
|
|
202
|
+
value: _data.fontWeight
|
|
203
203
|
}, /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
|
|
204
204
|
value: 400
|
|
205
205
|
}, (0, _locale.i18n)('REGULAR')), /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
|
|
@@ -210,21 +210,21 @@ function (_super) {
|
|
|
210
210
|
onChange: function onChange(_a) {
|
|
211
211
|
var count = _a.count;
|
|
212
212
|
|
|
213
|
-
_this.updateAttr(
|
|
213
|
+
_this.updateAttr(_data, fontSizeKey, count);
|
|
214
214
|
},
|
|
215
215
|
unit: "px",
|
|
216
216
|
value: {
|
|
217
|
-
count:
|
|
217
|
+
count: _data[fontSizeKey]
|
|
218
218
|
}
|
|
219
219
|
}))), /*#__PURE__*/_react["default"].createElement(_common.Field, {
|
|
220
220
|
title: ""
|
|
221
221
|
}, /*#__PURE__*/_react["default"].createElement(_common.FontStyles, {
|
|
222
222
|
onChange: function onChange(value) {
|
|
223
|
-
_extends(
|
|
223
|
+
_extends(_data, value);
|
|
224
224
|
|
|
225
225
|
_this.selfRender();
|
|
226
226
|
},
|
|
227
|
-
value:
|
|
227
|
+
value: _data
|
|
228
228
|
})));
|
|
229
229
|
};
|
|
230
230
|
|
package/es/utils/commonUtil.js
CHANGED
|
@@ -776,7 +776,7 @@ var pxToRem = function pxToRem(styleObj) {
|
|
|
776
776
|
if (typeof value === 'string' && value.endsWith('px')) {
|
|
777
777
|
remObj[key] = convertToRem(value.split('px')[0]);
|
|
778
778
|
} else if (typeof value === 'number') {
|
|
779
|
-
remObj[key] = ['opacity', 'lineHeight', 'zIndex'].includes(key) ? value : convertToRem(value);
|
|
779
|
+
remObj[key] = ['opacity', 'lineHeight', 'zIndex', 'fontWeight'].includes(key) ? value : convertToRem(value);
|
|
780
780
|
} else if ((key === 'padding' || key === 'margin') && typeof value === 'string') {
|
|
781
781
|
var paddingValues = value.split(' ');
|
|
782
782
|
var remPaddingValues = paddingValues.map(function (paddingValue) {
|
package/es/utils/currencyUtil.js
CHANGED
|
@@ -15,7 +15,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
15
15
|
|
|
16
16
|
/* eslint-disable */
|
|
17
17
|
var precision = (0, _commonUtil.ensure)(function () {
|
|
18
|
-
return window.
|
|
18
|
+
return window.systemParams.precision;
|
|
19
19
|
}, '0'); // 千分位展示
|
|
20
20
|
|
|
21
21
|
var addSeparators = function addSeparators(nStr, thousandsSep, decimalSep) {
|
|
@@ -42,7 +42,7 @@ exports.addSeparators = addSeparators;
|
|
|
42
42
|
|
|
43
43
|
var getPricePrefix = function getPricePrefix() {
|
|
44
44
|
var pricePrefix = (0, _commonUtil.ensure)(function () {
|
|
45
|
-
return window.
|
|
45
|
+
return window.systemParams.prefix;
|
|
46
46
|
}, 'Rp');
|
|
47
47
|
return pricePrefix;
|
|
48
48
|
};
|
|
@@ -51,7 +51,7 @@ exports.getPricePrefix = getPricePrefix;
|
|
|
51
51
|
|
|
52
52
|
var getPrecision = function getPrecision() {
|
|
53
53
|
var ret = (0, _commonUtil.ensure)(function () {
|
|
54
|
-
return window.
|
|
54
|
+
return window.systemParams.precision;
|
|
55
55
|
}, '0');
|
|
56
56
|
return Number(ret);
|
|
57
57
|
}; // 格式化金额
|
|
@@ -61,13 +61,13 @@ exports.getPrecision = getPrecision;
|
|
|
61
61
|
|
|
62
62
|
var formatCurrency = function formatCurrency(num) {
|
|
63
63
|
var displayPrecision = (0, _commonUtil.ensure)(function () {
|
|
64
|
-
return window.
|
|
64
|
+
return window.systemParams.displayCurrencyPrecision;
|
|
65
65
|
}, '0');
|
|
66
66
|
var precision = (0, _commonUtil.ensure)(function () {
|
|
67
|
-
return window.
|
|
67
|
+
return window.systemParams.precision;
|
|
68
68
|
}, '0');
|
|
69
69
|
var pricePrefix = (0, _commonUtil.ensure)(function () {
|
|
70
|
-
return window.
|
|
70
|
+
return window.systemParams.prefix;
|
|
71
71
|
}, 'Rp');
|
|
72
72
|
var numVal = num;
|
|
73
73
|
|
|
@@ -162,7 +162,7 @@ var currencyToFont = function currencyToFont(value, customPrecision, customDispl
|
|
|
162
162
|
precision = Number(customPrecision);
|
|
163
163
|
} else {
|
|
164
164
|
precision = (0, _commonUtil.ensure)(function () {
|
|
165
|
-
return window.
|
|
165
|
+
return window.systemParams.precision;
|
|
166
166
|
}, '0');
|
|
167
167
|
}
|
|
168
168
|
|
|
@@ -180,7 +180,7 @@ var currencyToFont = function currencyToFont(value, customPrecision, customDispl
|
|
|
180
180
|
displayPrecision = Number(customDisplayPrecision);
|
|
181
181
|
} else {
|
|
182
182
|
displayPrecision = (0, _commonUtil.ensure)(function () {
|
|
183
|
-
return window.
|
|
183
|
+
return window.systemParams.displayCurrencyPrecision;
|
|
184
184
|
}, 'Rp');
|
|
185
185
|
}
|
|
186
186
|
|
|
@@ -447,7 +447,7 @@ var FilteredProductModal = function FilteredProductModal(props) {
|
|
|
447
447
|
switch (_a.label) {
|
|
448
448
|
case 0:
|
|
449
449
|
precision = Math.pow(10, (0, _commonUtil.ensure)(function () {
|
|
450
|
-
return window.
|
|
450
|
+
return window.systemParams.precision;
|
|
451
451
|
}, '0'));
|
|
452
452
|
params = {
|
|
453
453
|
catgIds: tValue.join(','),
|
|
@@ -383,7 +383,7 @@ var ProductModal = function ProductModal(props) {
|
|
|
383
383
|
case 0:
|
|
384
384
|
return [4
|
|
385
385
|
/*yield*/
|
|
386
|
-
, (0, _commonUtil.commonFetch)(
|
|
386
|
+
, (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/storeoffercatgs", {}, 'GET')];
|
|
387
387
|
|
|
388
388
|
case 1:
|
|
389
389
|
res = _a.sent();
|
|
@@ -409,7 +409,7 @@ var ProductModal = function ProductModal(props) {
|
|
|
409
409
|
case 0:
|
|
410
410
|
return [4
|
|
411
411
|
/*yield*/
|
|
412
|
-
, (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/
|
|
412
|
+
, (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/designer/resource/brand/list", {}, 'GET')];
|
|
413
413
|
|
|
414
414
|
case 1:
|
|
415
415
|
res = _a.sent();
|
|
@@ -133,7 +133,7 @@ function (_super) {
|
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
var pricePrefix = (0, _commonUtil.ensure)(function () {
|
|
136
|
-
return window.
|
|
136
|
+
return window.systemParams.prefix;
|
|
137
137
|
}, 'Rp');
|
|
138
138
|
|
|
139
139
|
var _price = pricePrefix + " " + integerPart + " " + (decimalPart ? '.' + decimalPart : '');
|
|
@@ -30,6 +30,26 @@ var getDefaultJSON = function getDefaultJSON() {
|
|
|
30
30
|
pcImgHoverUrl: '',
|
|
31
31
|
h5ImgHoverUrl: ''
|
|
32
32
|
}
|
|
33
|
+
},
|
|
34
|
+
title: {
|
|
35
|
+
id: (0, _uuid.v4)(),
|
|
36
|
+
open: true,
|
|
37
|
+
type: 'TEXT',
|
|
38
|
+
specialContent: [],
|
|
39
|
+
text: 'Title',
|
|
40
|
+
content: {
|
|
41
|
+
sizeType: 'Customize font styles',
|
|
42
|
+
fontFamily: 'Open Sans',
|
|
43
|
+
fontWeight: 600,
|
|
44
|
+
fontSize: 16,
|
|
45
|
+
color: '#070707'
|
|
46
|
+
},
|
|
47
|
+
underline: {
|
|
48
|
+
open: false,
|
|
49
|
+
textDecorationColor: '',
|
|
50
|
+
textDecorationStyle: 'solid'
|
|
51
|
+
},
|
|
52
|
+
vertical: {}
|
|
33
53
|
}
|
|
34
54
|
},
|
|
35
55
|
spacing: {
|
|
@@ -337,14 +337,14 @@ function (_super) {
|
|
|
337
337
|
SignBoardMobile.prototype.render = function () {
|
|
338
338
|
var _this = this;
|
|
339
339
|
|
|
340
|
-
var _a;
|
|
340
|
+
var _a, _b;
|
|
341
341
|
|
|
342
342
|
var data = this.props.data; // console.log('--SignBoard', data);
|
|
343
343
|
|
|
344
|
-
var
|
|
345
|
-
storeInfo =
|
|
346
|
-
isFollow =
|
|
347
|
-
inputVal =
|
|
344
|
+
var _c = this.state,
|
|
345
|
+
storeInfo = _c.storeInfo,
|
|
346
|
+
isFollow = _c.isFollow,
|
|
347
|
+
inputVal = _c.inputVal;
|
|
348
348
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
349
349
|
className: "m-sign-board-bar"
|
|
350
350
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -377,9 +377,10 @@ function (_super) {
|
|
|
377
377
|
height: 44,
|
|
378
378
|
width: 44
|
|
379
379
|
}
|
|
380
|
-
})), /*#__PURE__*/_react["default"].createElement(
|
|
381
|
-
className: "
|
|
382
|
-
|
|
380
|
+
})), data.content && ((_b = data.content.title) === null || _b === void 0 ? void 0 : _b.open) && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
|
|
381
|
+
className: "card-text",
|
|
382
|
+
data: data.content.title
|
|
383
|
+
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
383
384
|
onClick: this.clickCollect
|
|
384
385
|
}, /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
|
|
385
386
|
color: isFollow ? '#F1600F' : '#333333',
|
|
@@ -62,12 +62,3 @@
|
|
|
62
62
|
text-transform: uppercase;
|
|
63
63
|
color: #333333;
|
|
64
64
|
}
|
|
65
|
-
.m-sign-board-bar .store-info-wrap .store-name {
|
|
66
|
-
flex: 1;
|
|
67
|
-
margin-left: 0.24rem;
|
|
68
|
-
font-weight: 500;
|
|
69
|
-
font-size: 0.32rem;
|
|
70
|
-
line-height: 0.4rem;
|
|
71
|
-
color: #070707;
|
|
72
|
-
font-family: 'Montserrat';
|
|
73
|
-
}
|
package/lib/composite-comp/dito/config-panels/SignBoardConfig/SignBoardConfigContent/index.js
CHANGED
|
@@ -15,6 +15,8 @@ var _ImageConfig = _interopRequireDefault(require("../../../../../meta-comp/conf
|
|
|
15
15
|
|
|
16
16
|
var _coreUtil = require("../../../../../utils/coreUtil");
|
|
17
17
|
|
|
18
|
+
var _TextConfig = _interopRequireDefault(require("../../../../../meta-comp/config-panels/TextConfig"));
|
|
19
|
+
|
|
18
20
|
var _locale = require("../../../../../locale");
|
|
19
21
|
|
|
20
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -69,13 +71,21 @@ function (_super) {
|
|
|
69
71
|
SignBoardConfigContent.prototype.render = function () {
|
|
70
72
|
var panelProps = this.props.panelProps;
|
|
71
73
|
var source = [{
|
|
72
|
-
key: '
|
|
74
|
+
key: 'logo',
|
|
73
75
|
name: (0, _locale.i18n)('LOGO'),
|
|
74
76
|
value: /*#__PURE__*/_react["default"].createElement(_ImageConfig["default"], {
|
|
75
77
|
data: panelProps.logo
|
|
76
78
|
}),
|
|
77
79
|
metaOption: panelProps.logo,
|
|
78
80
|
toggleType: 'switch'
|
|
81
|
+
}, {
|
|
82
|
+
key: 'title',
|
|
83
|
+
name: (0, _locale.i18n)('TITLE'),
|
|
84
|
+
value: /*#__PURE__*/_react["default"].createElement(_TextConfig["default"], {
|
|
85
|
+
data: panelProps.title
|
|
86
|
+
}),
|
|
87
|
+
metaOption: panelProps.title,
|
|
88
|
+
toggleType: 'switch'
|
|
79
89
|
}];
|
|
80
90
|
return /*#__PURE__*/_react["default"].createElement(_common.Collapse, {
|
|
81
91
|
headerSize: "middle",
|
package/lib/decorator/index.js
CHANGED
|
@@ -27,6 +27,7 @@ Object.defineProperty(exports, "metaDecorator", {
|
|
|
27
27
|
return _metaDecorator["default"];
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
+
exports.shouldUpdate = shouldUpdate;
|
|
30
31
|
Object.defineProperty(exports, "updateConfigDecorator", {
|
|
31
32
|
enumerable: true,
|
|
32
33
|
get: function get() {
|
|
@@ -42,4 +43,26 @@ var _updateConfigDecorator = _interopRequireDefault(require("./updateConfigDecor
|
|
|
42
43
|
|
|
43
44
|
var _lazyLoadDecorator = require("./lazyLoadDecorator");
|
|
44
45
|
|
|
45
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
46
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
47
|
+
|
|
48
|
+
/* eslint-disable @typescript-eslint/no-unused-expressions */
|
|
49
|
+
|
|
50
|
+
/** props 和 state 改变时才会render */
|
|
51
|
+
function shouldUpdate() {
|
|
52
|
+
return function (target, name, descriptor) {
|
|
53
|
+
var fn = descriptor.value;
|
|
54
|
+
|
|
55
|
+
descriptor.value = function (nextProps, nextState) {
|
|
56
|
+
var nowPropsJson = JSON.stringify(nextProps);
|
|
57
|
+
var nowStateJson = JSON.stringify(nextState);
|
|
58
|
+
var should1 = nowPropsJson != this.preProps;
|
|
59
|
+
var should2 = nowStateJson != this.preState;
|
|
60
|
+
this.preProps = nowPropsJson;
|
|
61
|
+
this.preState = nowStateJson;
|
|
62
|
+
var result = should1 || should2;
|
|
63
|
+
return result && fn.apply(this, {
|
|
64
|
+
nextProps: nextProps
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
}
|
|
@@ -93,6 +93,10 @@ function (_super) {
|
|
|
93
93
|
return _this;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
+
Button.prototype.shouldComponentUpdate = function () {
|
|
97
|
+
return true;
|
|
98
|
+
};
|
|
99
|
+
|
|
96
100
|
Button.prototype.render = function () {
|
|
97
101
|
var _this = this;
|
|
98
102
|
|
|
@@ -168,6 +172,9 @@ function (_super) {
|
|
|
168
172
|
className: '',
|
|
169
173
|
readonly: false
|
|
170
174
|
};
|
|
175
|
+
|
|
176
|
+
__decorate([(0, _decorator.shouldUpdate)()], Button.prototype, "shouldComponentUpdate", null);
|
|
177
|
+
|
|
171
178
|
Button = __decorate([_decorator.metaDecorator], Button);
|
|
172
179
|
return Button;
|
|
173
180
|
}(_react.Component);
|
|
@@ -203,6 +203,10 @@ function (_super) {
|
|
|
203
203
|
});
|
|
204
204
|
};
|
|
205
205
|
|
|
206
|
+
Text.prototype.shouldComponentUpdate = function () {
|
|
207
|
+
return true;
|
|
208
|
+
};
|
|
209
|
+
|
|
206
210
|
Text.prototype.render = function () {
|
|
207
211
|
var _a = this.props,
|
|
208
212
|
data = _a.data,
|
|
@@ -272,6 +276,9 @@ function (_super) {
|
|
|
272
276
|
readonly: false,
|
|
273
277
|
onTextInput: function onTextInput() {}
|
|
274
278
|
};
|
|
279
|
+
|
|
280
|
+
__decorate([(0, _decorator.shouldUpdate)()], Text.prototype, "shouldComponentUpdate", null);
|
|
281
|
+
|
|
275
282
|
Text = __decorate([_decorator.metaDecorator], Text);
|
|
276
283
|
return Text;
|
|
277
284
|
}(_react["default"].Component);
|
|
@@ -162,7 +162,7 @@ function (_super) {
|
|
|
162
162
|
|
|
163
163
|
var fontSizeKey = window.magicDesign.device == 'pc' ? 'pcFontSize' : 'fontSize';
|
|
164
164
|
|
|
165
|
-
var ButtonTextSetting = function ButtonTextSetting(
|
|
165
|
+
var ButtonTextSetting = function ButtonTextSetting(_data) {
|
|
166
166
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_common.Field, {
|
|
167
167
|
title: (0, _locale.i18n)('FONT_STYLE')
|
|
168
168
|
}, /*#__PURE__*/_react["default"].createElement(_antd.Select, {
|
|
@@ -171,24 +171,24 @@ function (_super) {
|
|
|
171
171
|
return t.key == v;
|
|
172
172
|
});
|
|
173
173
|
|
|
174
|
-
_extends(
|
|
174
|
+
_extends(_data, __assign(__assign({}, findOne), {
|
|
175
175
|
sizeType: findOne === null || findOne === void 0 ? void 0 : findOne.key
|
|
176
176
|
}));
|
|
177
177
|
|
|
178
178
|
_this.selfRender();
|
|
179
179
|
},
|
|
180
|
-
value:
|
|
180
|
+
value: _data.sizeType
|
|
181
181
|
}, _TextConfig.sizeTypeList.map(function (sizeType) {
|
|
182
182
|
return /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
|
|
183
183
|
value: sizeType.key
|
|
184
184
|
}, sizeType.key);
|
|
185
|
-
}))),
|
|
185
|
+
}))), _data.sizeType == 'Customize font styles' && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_common.Field, {
|
|
186
186
|
title: (0, _locale.i18n)('FONT_FAMILY')
|
|
187
187
|
}, /*#__PURE__*/_react["default"].createElement(_antd.Select, {
|
|
188
188
|
onChange: function onChange(v) {
|
|
189
|
-
_this.updateAttr(
|
|
189
|
+
_this.updateAttr(_data, 'fontFamily', v);
|
|
190
190
|
},
|
|
191
|
-
value:
|
|
191
|
+
value: _data.fontFamily
|
|
192
192
|
}, /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
|
|
193
193
|
value: "Montserrat"
|
|
194
194
|
}, "Montserrat"), /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
|
|
@@ -197,9 +197,9 @@ function (_super) {
|
|
|
197
197
|
title: (0, _locale.i18n)('FONT_WEIGHT')
|
|
198
198
|
}, /*#__PURE__*/_react["default"].createElement(_antd.Select, {
|
|
199
199
|
onChange: function onChange(v) {
|
|
200
|
-
_this.updateAttr(
|
|
200
|
+
_this.updateAttr(_data, 'fontWeight', v);
|
|
201
201
|
},
|
|
202
|
-
value:
|
|
202
|
+
value: _data.fontWeight
|
|
203
203
|
}, /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
|
|
204
204
|
value: 400
|
|
205
205
|
}, (0, _locale.i18n)('REGULAR')), /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
|
|
@@ -210,21 +210,21 @@ function (_super) {
|
|
|
210
210
|
onChange: function onChange(_a) {
|
|
211
211
|
var count = _a.count;
|
|
212
212
|
|
|
213
|
-
_this.updateAttr(
|
|
213
|
+
_this.updateAttr(_data, fontSizeKey, count);
|
|
214
214
|
},
|
|
215
215
|
unit: "px",
|
|
216
216
|
value: {
|
|
217
|
-
count:
|
|
217
|
+
count: _data[fontSizeKey]
|
|
218
218
|
}
|
|
219
219
|
}))), /*#__PURE__*/_react["default"].createElement(_common.Field, {
|
|
220
220
|
title: ""
|
|
221
221
|
}, /*#__PURE__*/_react["default"].createElement(_common.FontStyles, {
|
|
222
222
|
onChange: function onChange(value) {
|
|
223
|
-
_extends(
|
|
223
|
+
_extends(_data, value);
|
|
224
224
|
|
|
225
225
|
_this.selfRender();
|
|
226
226
|
},
|
|
227
|
-
value:
|
|
227
|
+
value: _data
|
|
228
228
|
})));
|
|
229
229
|
};
|
|
230
230
|
|
package/lib/utils/commonUtil.js
CHANGED
|
@@ -776,7 +776,7 @@ var pxToRem = function pxToRem(styleObj) {
|
|
|
776
776
|
if (typeof value === 'string' && value.endsWith('px')) {
|
|
777
777
|
remObj[key] = convertToRem(value.split('px')[0]);
|
|
778
778
|
} else if (typeof value === 'number') {
|
|
779
|
-
remObj[key] = ['opacity', 'lineHeight', 'zIndex'].includes(key) ? value : convertToRem(value);
|
|
779
|
+
remObj[key] = ['opacity', 'lineHeight', 'zIndex', 'fontWeight'].includes(key) ? value : convertToRem(value);
|
|
780
780
|
} else if ((key === 'padding' || key === 'margin') && typeof value === 'string') {
|
|
781
781
|
var paddingValues = value.split(' ');
|
|
782
782
|
var remPaddingValues = paddingValues.map(function (paddingValue) {
|
|
@@ -15,7 +15,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
15
15
|
|
|
16
16
|
/* eslint-disable */
|
|
17
17
|
var precision = (0, _commonUtil.ensure)(function () {
|
|
18
|
-
return window.
|
|
18
|
+
return window.systemParams.precision;
|
|
19
19
|
}, '0'); // 千分位展示
|
|
20
20
|
|
|
21
21
|
var addSeparators = function addSeparators(nStr, thousandsSep, decimalSep) {
|
|
@@ -42,7 +42,7 @@ exports.addSeparators = addSeparators;
|
|
|
42
42
|
|
|
43
43
|
var getPricePrefix = function getPricePrefix() {
|
|
44
44
|
var pricePrefix = (0, _commonUtil.ensure)(function () {
|
|
45
|
-
return window.
|
|
45
|
+
return window.systemParams.prefix;
|
|
46
46
|
}, 'Rp');
|
|
47
47
|
return pricePrefix;
|
|
48
48
|
};
|
|
@@ -51,7 +51,7 @@ exports.getPricePrefix = getPricePrefix;
|
|
|
51
51
|
|
|
52
52
|
var getPrecision = function getPrecision() {
|
|
53
53
|
var ret = (0, _commonUtil.ensure)(function () {
|
|
54
|
-
return window.
|
|
54
|
+
return window.systemParams.precision;
|
|
55
55
|
}, '0');
|
|
56
56
|
return Number(ret);
|
|
57
57
|
}; // 格式化金额
|
|
@@ -61,13 +61,13 @@ exports.getPrecision = getPrecision;
|
|
|
61
61
|
|
|
62
62
|
var formatCurrency = function formatCurrency(num) {
|
|
63
63
|
var displayPrecision = (0, _commonUtil.ensure)(function () {
|
|
64
|
-
return window.
|
|
64
|
+
return window.systemParams.displayCurrencyPrecision;
|
|
65
65
|
}, '0');
|
|
66
66
|
var precision = (0, _commonUtil.ensure)(function () {
|
|
67
|
-
return window.
|
|
67
|
+
return window.systemParams.precision;
|
|
68
68
|
}, '0');
|
|
69
69
|
var pricePrefix = (0, _commonUtil.ensure)(function () {
|
|
70
|
-
return window.
|
|
70
|
+
return window.systemParams.prefix;
|
|
71
71
|
}, 'Rp');
|
|
72
72
|
var numVal = num;
|
|
73
73
|
|
|
@@ -162,7 +162,7 @@ var currencyToFont = function currencyToFont(value, customPrecision, customDispl
|
|
|
162
162
|
precision = Number(customPrecision);
|
|
163
163
|
} else {
|
|
164
164
|
precision = (0, _commonUtil.ensure)(function () {
|
|
165
|
-
return window.
|
|
165
|
+
return window.systemParams.precision;
|
|
166
166
|
}, '0');
|
|
167
167
|
}
|
|
168
168
|
|
|
@@ -180,7 +180,7 @@ var currencyToFont = function currencyToFont(value, customPrecision, customDispl
|
|
|
180
180
|
displayPrecision = Number(customDisplayPrecision);
|
|
181
181
|
} else {
|
|
182
182
|
displayPrecision = (0, _commonUtil.ensure)(function () {
|
|
183
|
-
return window.
|
|
183
|
+
return window.systemParams.displayCurrencyPrecision;
|
|
184
184
|
}, 'Rp');
|
|
185
185
|
}
|
|
186
186
|
|