@fonixtree/magic-design 1.0.74 → 1.0.76

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.
Files changed (77) hide show
  1. package/es/assets/fonts/.DS_Store +0 -0
  2. package/es/assets/fonts/magic-box-iconfont.css +11 -3
  3. package/es/assets/fonts/magic-box-iconfont.js +1 -1
  4. package/es/assets/fonts/magic-box-iconfont.ttf +0 -0
  5. package/es/assets/fonts/magic-box-iconfont.woff +0 -0
  6. package/es/assets/fonts/magic-box-iconfont.woff2 +0 -0
  7. package/es/common/index.js +8 -0
  8. package/es/composite-comp/bol/components/Banner/mobile/index.js +1 -1
  9. package/es/composite-comp/common/components/ProductItem/index.js +23 -9
  10. package/es/composite-comp/common/components/ProductItem/index.less +9 -0
  11. package/es/composite-comp/dito/components/FlashDeal/defaultJSON.js +1 -1
  12. package/es/composite-comp/dito/components/FlashDeal/mobile/index.js +1 -1
  13. package/es/composite-comp/dito/components/FlashDeal/mobile/index.less +0 -3
  14. package/es/composite-comp/dito/components/GroupBuy/defaultJSON.js +232 -0
  15. package/es/composite-comp/dito/components/GroupBuy/index.js +86 -0
  16. package/es/composite-comp/dito/components/GroupBuy/mobile/imgs/defImg.png +0 -0
  17. package/es/composite-comp/dito/components/GroupBuy/mobile/imgs/defImg1.png +0 -0
  18. package/es/composite-comp/dito/components/GroupBuy/mobile/imgs/defImg2.png +0 -0
  19. package/es/composite-comp/dito/components/GroupBuy/mobile/imgs/defImg3.png +0 -0
  20. package/es/composite-comp/dito/components/GroupBuy/mobile/index.js +341 -0
  21. package/es/composite-comp/dito/components/GroupBuy/mobile/index.less +87 -0
  22. package/es/composite-comp/dito/components/MobileNavigation/mobile/index.js +1 -1
  23. package/es/composite-comp/dito/components/Recommend/defaultJSON.js +1 -1
  24. package/es/composite-comp/dito/components/Recommend/mobile/index.js +1 -1
  25. package/es/composite-comp/dito/components/SearchBar/mobile/index.js +1 -1
  26. package/es/composite-comp/dito/components/SignBoard/mobile/index.js +1 -1
  27. package/es/composite-comp/dito/config-panels/FlashDealConfig/FlashDealConfigContent/index.js +3 -3
  28. package/es/composite-comp/dito/config-panels/GroupBuyConfig/GroupBuyConfigContent/index.js +170 -0
  29. package/es/composite-comp/dito/config-panels/GroupBuyConfig/GroupBuyConfigContent/index.less +38 -0
  30. package/es/composite-comp/dito/config-panels/GroupBuyConfig/GroupBuyConfigTitle/index.js +103 -0
  31. package/es/composite-comp/dito/config-panels/GroupBuyConfig/imgs/layout1.png +0 -0
  32. package/es/composite-comp/dito/config-panels/GroupBuyConfig/index.js +73 -0
  33. package/es/constants/component-types.js +6 -2
  34. package/es/constants/index.js +4 -0
  35. package/es/core/Renderer/index.js +27 -10
  36. package/es/locale/en/en.json +3 -1
  37. package/es/locale/es/es.json +2 -0
  38. package/es/locale/id/id.json +3 -1
  39. package/lib/assets/fonts/.DS_Store +0 -0
  40. package/lib/assets/fonts/magic-box-iconfont.css +11 -3
  41. package/lib/assets/fonts/magic-box-iconfont.js +1 -1
  42. package/lib/assets/fonts/magic-box-iconfont.ttf +0 -0
  43. package/lib/assets/fonts/magic-box-iconfont.woff +0 -0
  44. package/lib/assets/fonts/magic-box-iconfont.woff2 +0 -0
  45. package/lib/common/index.js +8 -0
  46. package/lib/composite-comp/bol/components/Banner/mobile/index.js +1 -1
  47. package/lib/composite-comp/common/components/ProductItem/index.js +23 -9
  48. package/lib/composite-comp/common/components/ProductItem/index.less +9 -0
  49. package/lib/composite-comp/dito/components/FlashDeal/defaultJSON.js +1 -1
  50. package/lib/composite-comp/dito/components/FlashDeal/mobile/index.js +1 -1
  51. package/lib/composite-comp/dito/components/FlashDeal/mobile/index.less +0 -3
  52. package/lib/composite-comp/dito/components/GroupBuy/defaultJSON.js +232 -0
  53. package/lib/composite-comp/dito/components/GroupBuy/index.js +86 -0
  54. package/lib/composite-comp/dito/components/GroupBuy/mobile/imgs/defImg.png +0 -0
  55. package/lib/composite-comp/dito/components/GroupBuy/mobile/imgs/defImg1.png +0 -0
  56. package/lib/composite-comp/dito/components/GroupBuy/mobile/imgs/defImg2.png +0 -0
  57. package/lib/composite-comp/dito/components/GroupBuy/mobile/imgs/defImg3.png +0 -0
  58. package/lib/composite-comp/dito/components/GroupBuy/mobile/index.js +341 -0
  59. package/lib/composite-comp/dito/components/GroupBuy/mobile/index.less +87 -0
  60. package/lib/composite-comp/dito/components/MobileNavigation/mobile/index.js +1 -1
  61. package/lib/composite-comp/dito/components/Recommend/defaultJSON.js +1 -1
  62. package/lib/composite-comp/dito/components/Recommend/mobile/index.js +1 -1
  63. package/lib/composite-comp/dito/components/SearchBar/mobile/index.js +1 -1
  64. package/lib/composite-comp/dito/components/SignBoard/mobile/index.js +1 -1
  65. package/lib/composite-comp/dito/config-panels/FlashDealConfig/FlashDealConfigContent/index.js +3 -3
  66. package/lib/composite-comp/dito/config-panels/GroupBuyConfig/GroupBuyConfigContent/index.js +170 -0
  67. package/lib/composite-comp/dito/config-panels/GroupBuyConfig/GroupBuyConfigContent/index.less +38 -0
  68. package/lib/composite-comp/dito/config-panels/GroupBuyConfig/GroupBuyConfigTitle/index.js +103 -0
  69. package/lib/composite-comp/dito/config-panels/GroupBuyConfig/imgs/layout1.png +0 -0
  70. package/lib/composite-comp/dito/config-panels/GroupBuyConfig/index.js +73 -0
  71. package/lib/constants/component-types.js +6 -2
  72. package/lib/constants/index.js +4 -0
  73. package/lib/core/Renderer/index.js +27 -10
  74. package/lib/locale/en/en.json +3 -1
  75. package/lib/locale/es/es.json +2 -0
  76. package/lib/locale/id/id.json +3 -1
  77. package/package.json +1 -1
@@ -0,0 +1,341 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ require("./index.less");
11
+
12
+ var _defImg = _interopRequireDefault(require("./imgs/defImg.png"));
13
+
14
+ var _ProductItem = _interopRequireDefault(require("../../../../common/components/ProductItem"));
15
+
16
+ var _coreUtil = require("../../../../../utils/coreUtil");
17
+
18
+ var _components = require("../../../../../meta-comp/components");
19
+
20
+ var _commonUtil = require("../../../../../utils/commonUtil");
21
+
22
+ var _storeUtil = require("../../../../../utils/storeUtil");
23
+
24
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
25
+
26
+ var __extends = void 0 && (void 0).__extends || function () {
27
+ var _extendStatics = function extendStatics(d, b) {
28
+ _extendStatics = Object.setPrototypeOf || {
29
+ __proto__: []
30
+ } instanceof Array && function (d, b) {
31
+ d.__proto__ = b;
32
+ } || function (d, b) {
33
+ for (var p in b) {
34
+ if (b.hasOwnProperty(p)) d[p] = b[p];
35
+ }
36
+ };
37
+
38
+ return _extendStatics(d, b);
39
+ };
40
+
41
+ return function (d, b) {
42
+ _extendStatics(d, b);
43
+
44
+ function __() {
45
+ this.constructor = d;
46
+ }
47
+
48
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
49
+ };
50
+ }();
51
+
52
+ var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
53
+ function adopt(value) {
54
+ return value instanceof P ? value : new P(function (resolve) {
55
+ resolve(value);
56
+ });
57
+ }
58
+
59
+ return new (P || (P = Promise))(function (resolve, reject) {
60
+ function fulfilled(value) {
61
+ try {
62
+ step(generator.next(value));
63
+ } catch (e) {
64
+ reject(e);
65
+ }
66
+ }
67
+
68
+ function rejected(value) {
69
+ try {
70
+ step(generator["throw"](value));
71
+ } catch (e) {
72
+ reject(e);
73
+ }
74
+ }
75
+
76
+ function step(result) {
77
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
78
+ }
79
+
80
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
81
+ });
82
+ };
83
+
84
+ var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
85
+ var _ = {
86
+ label: 0,
87
+ sent: function sent() {
88
+ if (t[0] & 1) throw t[1];
89
+ return t[1];
90
+ },
91
+ trys: [],
92
+ ops: []
93
+ },
94
+ f,
95
+ y,
96
+ t,
97
+ g;
98
+ return g = {
99
+ next: verb(0),
100
+ "throw": verb(1),
101
+ "return": verb(2)
102
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
103
+ return this;
104
+ }), g;
105
+
106
+ function verb(n) {
107
+ return function (v) {
108
+ return step([n, v]);
109
+ };
110
+ }
111
+
112
+ function step(op) {
113
+ if (f) throw new TypeError("Generator is already executing.");
114
+
115
+ while (_) {
116
+ try {
117
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
118
+ if (y = 0, t) op = [op[0] & 2, t.value];
119
+
120
+ switch (op[0]) {
121
+ case 0:
122
+ case 1:
123
+ t = op;
124
+ break;
125
+
126
+ case 4:
127
+ _.label++;
128
+ return {
129
+ value: op[1],
130
+ done: false
131
+ };
132
+
133
+ case 5:
134
+ _.label++;
135
+ y = op[1];
136
+ op = [0];
137
+ continue;
138
+
139
+ case 7:
140
+ op = _.ops.pop();
141
+
142
+ _.trys.pop();
143
+
144
+ continue;
145
+
146
+ default:
147
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
148
+ _ = 0;
149
+ continue;
150
+ }
151
+
152
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
153
+ _.label = op[1];
154
+ break;
155
+ }
156
+
157
+ if (op[0] === 6 && _.label < t[1]) {
158
+ _.label = t[1];
159
+ t = op;
160
+ break;
161
+ }
162
+
163
+ if (t && _.label < t[2]) {
164
+ _.label = t[2];
165
+
166
+ _.ops.push(op);
167
+
168
+ break;
169
+ }
170
+
171
+ if (t[2]) _.ops.pop();
172
+
173
+ _.trys.pop();
174
+
175
+ continue;
176
+ }
177
+
178
+ op = body.call(thisArg, _);
179
+ } catch (e) {
180
+ op = [6, e];
181
+ y = 0;
182
+ } finally {
183
+ f = t = 0;
184
+ }
185
+ }
186
+
187
+ if (op[0] & 5) throw op[1];
188
+ return {
189
+ value: op[0] ? op[1] : void 0,
190
+ done: true
191
+ };
192
+ }
193
+ };
194
+
195
+ var defaultData = [{
196
+ imgUrlContent: {
197
+ url: _defImg["default"]
198
+ },
199
+ offerName: 'Product Name',
200
+ salesPrice: 18000000,
201
+ specialPrice: 18000000,
202
+ marketPrice: 19000000,
203
+ discountPercent: 10,
204
+ salePercent: 500,
205
+ sppType: '4'
206
+ }, {
207
+ imgUrlContent: {
208
+ url: _defImg["default"]
209
+ },
210
+ offerName: 'Product Name',
211
+ salesPrice: 18000000,
212
+ specialPrice: 18000000,
213
+ marketPrice: 19000000,
214
+ discountPercent: 10,
215
+ salePercent: 500,
216
+ sppType: '4'
217
+ }, {
218
+ imgUrlContent: {
219
+ url: _defImg["default"]
220
+ },
221
+ offerName: 'Product Name',
222
+ salesPrice: 18000000,
223
+ specialPrice: 18000000,
224
+ marketPrice: 19000000,
225
+ discountPercent: 10,
226
+ salePercent: 500,
227
+ sppType: '4'
228
+ }];
229
+
230
+ var GroupBuyMobile =
231
+ /** @class */
232
+ function (_super) {
233
+ __extends(GroupBuyMobile, _super);
234
+
235
+ function GroupBuyMobile() {
236
+ var _this = _super !== null && _super.apply(this, arguments) || this; // 商品列表排序方式
237
+
238
+
239
+ _this.sortType = '';
240
+ _this.state = {
241
+ list: (0, _coreUtil.isDesignMode)() ? [] : (0, _commonUtil.ensure)(function () {
242
+ return (0, _storeUtil.getMagicStore)("groupBuy_" + (window.magicDesign.pageId || '') + "_" + _this.props.panelProps.id);
243
+ }, [])
244
+ };
245
+
246
+ _this.getData = function () {
247
+ return __awaiter(_this, void 0, void 0, function () {
248
+ var res;
249
+ return __generator(this, function (_a) {
250
+ switch (_a.label) {
251
+ case 0:
252
+ return [4
253
+ /*yield*/
254
+ , (0, _commonUtil.commonFetch)('/designer/v1/h5/offers', {
255
+ campaignType: '4',
256
+ sortType: this.sortType
257
+ }, 'POST')];
258
+
259
+ case 1:
260
+ res = _a.sent();
261
+
262
+ if (!(0, _coreUtil.isDesignMode)()) {
263
+ (0, _storeUtil.setMagicStore)("groupBuy_" + (window.magicDesign.pageId || '') + "_" + this.props.panelProps.id, res.pageInfo.list);
264
+ }
265
+
266
+ this.setState({
267
+ list: res.pageInfo.list
268
+ });
269
+ return [2
270
+ /*return*/
271
+ ];
272
+ }
273
+ });
274
+ });
275
+ };
276
+
277
+ return _this;
278
+ }
279
+
280
+ GroupBuyMobile.prototype.componentDidMount = function () {
281
+ this.sortType = this.props.panelProps.content.sortType;
282
+ this.getData();
283
+ };
284
+
285
+ GroupBuyMobile.prototype.componentWillReceiveProps = function (nextProps) {
286
+ if (nextProps.panelProps.content.sortType !== this.sortType) {
287
+ this.sortType = nextProps.panelProps.content.sortType;
288
+ this.getData();
289
+ }
290
+ };
291
+
292
+ GroupBuyMobile.prototype.render = function () {
293
+ var panelProps = this.props.panelProps;
294
+ var list = this.state.list;
295
+
296
+ var _list = list.length === 0 && (0, _coreUtil.isDesignMode)() ? defaultData : list;
297
+
298
+ return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, _list.length > 0 && /*#__PURE__*/_react["default"].createElement("div", {
299
+ className: "m-group-buy-mobile"
300
+ }, /*#__PURE__*/_react["default"].createElement("div", {
301
+ className: "group-buy-title"
302
+ }, /*#__PURE__*/_react["default"].createElement("div", {
303
+ className: "left"
304
+ }, panelProps.title.headline.open && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
305
+ className: "title",
306
+ data: panelProps.title.headline
307
+ })), /*#__PURE__*/_react["default"].createElement("div", {
308
+ className: "right"
309
+ }, panelProps.title.button.open && /*#__PURE__*/_react["default"].createElement(_components.MetaButton, {
310
+ className: "btn",
311
+ data: panelProps.title.button
312
+ }))), /*#__PURE__*/_react["default"].createElement("div", {
313
+ className: "group-buy-list"
314
+ }, _list.map(function (item) {
315
+ return /*#__PURE__*/_react["default"].createElement(_ProductItem["default"], {
316
+ key: item.id,
317
+ data: item,
318
+ onItemClick: function onItemClick() {
319
+ if (window.magicDesign.pushGA) {
320
+ window.magicDesign.pushGA({}, 'select_promotion', {
321
+ event_section: 'Group Buy',
322
+ promotion_name: item === null || item === void 0 ? void 0 : item.offerName
323
+ });
324
+ }
325
+
326
+ (0, _coreUtil.clickUrl)("proDetail-" + item.offerId + "-" + (item.sppProductId || ''));
327
+ },
328
+ panelProps: panelProps.content,
329
+ type: "groupBuy"
330
+ });
331
+ }))));
332
+ };
333
+
334
+ GroupBuyMobile.defaultProps = {
335
+ panelProps: {}
336
+ };
337
+ return GroupBuyMobile;
338
+ }(_react["default"].Component);
339
+
340
+ var _default = GroupBuyMobile;
341
+ exports["default"] = _default;
@@ -0,0 +1,87 @@
1
+ .m-group-buy-mobile {
2
+ display: flex;
3
+ flex-direction: column;
4
+ padding: 0.32rem 0.32rem 0.56rem 0.32rem;
5
+ }
6
+ .m-group-buy-mobile .group-buy-title {
7
+ display: flex;
8
+ justify-content: space-between;
9
+ align-items: center;
10
+ }
11
+ .m-group-buy-mobile .group-buy-title .left {
12
+ display: flex;
13
+ align-items: center;
14
+ }
15
+ .m-group-buy-mobile .group-buy-title .left .icon {
16
+ height: 0.36rem;
17
+ margin-right: 0.2rem;
18
+ }
19
+ .m-group-buy-mobile .group-buy-title .left .title {
20
+ font-family: 'Montserrat';
21
+ font-style: normal;
22
+ font-weight: 600;
23
+ font-size: 0.28rem;
24
+ line-height: 0.36rem;
25
+ color: #2C2C2C;
26
+ margin-right: 0.2rem;
27
+ }
28
+ .m-group-buy-mobile .group-buy-title .left .sub-title {
29
+ font-family: 'Montserrat';
30
+ font-style: normal;
31
+ font-weight: 600;
32
+ font-size: 0.2rem;
33
+ line-height: 0.36rem;
34
+ color: #2C2C2C;
35
+ margin-right: 0.12rem;
36
+ align-self: end;
37
+ }
38
+ .m-group-buy-mobile .group-buy-title .right {
39
+ display: flex;
40
+ align-items: center;
41
+ }
42
+ .m-group-buy-mobile .group-buy-title .right .text {
43
+ font-family: 'Montserrat';
44
+ font-style: normal;
45
+ font-weight: 600;
46
+ font-size: 0.24rem;
47
+ line-height: 0.3rem;
48
+ color: #0038A8;
49
+ margin-right: 0.1rem;
50
+ }
51
+ .m-group-buy-mobile .group-buy-title .right .btn {
52
+ white-space: nowrap;
53
+ }
54
+ .m-group-buy-mobile .group-buy-list {
55
+ margin-top: 0.32rem;
56
+ overflow-x: auto;
57
+ overflow-y: hidden;
58
+ white-space: nowrap;
59
+ display: flex;
60
+ align-items: flex-start;
61
+ justify-content: flex-start;
62
+ position: relative;
63
+ }
64
+ .m-group-buy-mobile .group-buy-list .loading-wrap {
65
+ display: flex;
66
+ align-items: center;
67
+ justify-content: center;
68
+ padding: 0.6rem;
69
+ position: absolute;
70
+ top: 0;
71
+ bottom: 0;
72
+ left: 0;
73
+ right: 0;
74
+ margin: auto;
75
+ }
76
+ .m-group-buy-mobile .group-buy-list .m-product-item-wrap {
77
+ width: 3.14rem;
78
+ margin-right: 0.24rem;
79
+ border-radius: 0;
80
+ }
81
+ .m-group-buy-mobile .group-buy-list .m-product-item-wrap .product-img {
82
+ height: 2.6rem;
83
+ width: 3.1rem;
84
+ }
85
+ .m-group-buy-mobile .group-buy-list .m-product-item-wrap .content-wrap {
86
+ padding: 0.24rem;
87
+ }
@@ -106,7 +106,7 @@ function (_super) {
106
106
  /** PTO 定制GA */
107
107
  if (window.magicDesign.pushGA) {
108
108
  window.magicDesign.pushGA({}, 'select_promotion', {
109
- event_section: data.type,
109
+ event_section: 'Mobile Navigation',
110
110
  promotion_name: source.image.content.h5ImgSrc ? source.image.content.h5Name : (0, _locale.i18n)('NAVIGATION_NAME')
111
111
  });
112
112
  }
@@ -270,7 +270,7 @@ var getDefaultJSON = function getDefaultJSON() {
270
270
  lineHeight: 18
271
271
  }
272
272
  },
273
- salesProgressVisible: {
273
+ salesProgress: {
274
274
  open: true
275
275
  }
276
276
  },
@@ -643,7 +643,7 @@ function (_super) {
643
643
  if (window.magicDesign.pushGA) {
644
644
  window.magicDesign.pushGA(item, 'GA_SENSOR_select_item', {
645
645
  event_action: 'Select Item',
646
- event_section: data.type,
646
+ event_section: 'Recommend',
647
647
  promotion_name: item === null || item === void 0 ? void 0 : item.offerName
648
648
  });
649
649
  }
@@ -352,7 +352,7 @@ function (_super) {
352
352
 
353
353
  if (window.magicDesign.pushGA) {
354
354
  window.magicDesign.pushGA({}, 'select_promotion', {
355
- event_section: data.type,
355
+ event_section: 'Search',
356
356
  promotion_name: (_b = (_a = data.content.logo) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.h5Name
357
357
  });
358
358
  }
@@ -387,7 +387,7 @@ function (_super) {
387
387
  className: "store-info-wrap"
388
388
  }, /*#__PURE__*/_react["default"].createElement("div", {
389
389
  className: "number"
390
- }, /*#__PURE__*/_react["default"].createElement("span", null, (storeInfo === null || storeInfo === void 0 ? void 0 : storeInfo.storeEvalValue) ? Number(storeInfo.storeEvalValue / 100).toFixed(1) : '50', " "), /*#__PURE__*/_react["default"].createElement("img", {
390
+ }, /*#__PURE__*/_react["default"].createElement("span", null, (storeInfo === null || storeInfo === void 0 ? void 0 : storeInfo.storeEvalValue) ? Number(storeInfo.storeEvalValue / 100).toFixed(1) : '5.0', " "), /*#__PURE__*/_react["default"].createElement("img", {
391
391
  alt: "star",
392
392
  src: _star["default"]
393
393
  })), /*#__PURE__*/_react["default"].createElement("div", {
@@ -125,9 +125,9 @@ function (_super) {
125
125
  }, /*#__PURE__*/_react["default"].createElement("span", {
126
126
  className: "label"
127
127
  }, (0, _locale.i18n)('SALES_PROGRESS')), /*#__PURE__*/_react["default"].createElement(_antd.Switch, {
128
- checked: panelProps.salesProgressVisible.open,
128
+ checked: panelProps.salesProgress.open,
129
129
  onChange: function onChange(v) {
130
- panelProps.salesProgressVisible = {
130
+ panelProps.salesProgress = {
131
131
  open: v
132
132
  };
133
133
 
@@ -143,7 +143,7 @@ function (_super) {
143
143
  productName: {},
144
144
  activityPrice: {},
145
145
  salesPrice: {},
146
- salesProgressVisible: {
146
+ salesProgress: {
147
147
  open: false
148
148
  }
149
149
  }
@@ -0,0 +1,170 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _antd = require("antd");
11
+
12
+ var _ButtonConfig = _interopRequireDefault(require("../../../../../meta-comp/config-panels/ButtonConfig"));
13
+
14
+ var _TextConfig = _interopRequireDefault(require("../../../../../meta-comp/config-panels/TextConfig"));
15
+
16
+ var _coreUtil = require("../../../../../utils/coreUtil");
17
+
18
+ var _common = require("../../../../../common");
19
+
20
+ var _locale = require("../../../../../locale");
21
+
22
+ require("./index.less");
23
+
24
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
25
+
26
+ var __extends = void 0 && (void 0).__extends || function () {
27
+ var _extendStatics = function extendStatics(d, b) {
28
+ _extendStatics = Object.setPrototypeOf || {
29
+ __proto__: []
30
+ } instanceof Array && function (d, b) {
31
+ d.__proto__ = b;
32
+ } || function (d, b) {
33
+ for (var p in b) {
34
+ if (b.hasOwnProperty(p)) d[p] = b[p];
35
+ }
36
+ };
37
+
38
+ return _extendStatics(d, b);
39
+ };
40
+
41
+ return function (d, b) {
42
+ _extendStatics(d, b);
43
+
44
+ function __() {
45
+ this.constructor = d;
46
+ }
47
+
48
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
49
+ };
50
+ }();
51
+
52
+ var AComponent =
53
+ /** @class */
54
+ function (_super) {
55
+ __extends(AComponent, _super);
56
+
57
+ function AComponent() {
58
+ var _this = _super !== null && _super.apply(this, arguments) || this;
59
+
60
+ _this.state = {};
61
+
62
+ _this.reRender = function () {
63
+ (0, _coreUtil.renderPreview)();
64
+
65
+ _this.setState({});
66
+ };
67
+
68
+ return _this;
69
+ }
70
+
71
+ AComponent.prototype.render = function () {
72
+ var _this = this;
73
+
74
+ var panelProps = this.props.panelProps;
75
+ return /*#__PURE__*/_react["default"].createElement("div", {
76
+ className: "group_buy_content"
77
+ }, /*#__PURE__*/_react["default"].createElement(_common.Field, {
78
+ title: (0, _locale.i18n)('PRODUCT_SORT_BY')
79
+ }, /*#__PURE__*/_react["default"].createElement(_antd.Select, {
80
+ onChange: function onChange(v) {
81
+ panelProps.sortType = v;
82
+
83
+ _this.reRender();
84
+ },
85
+ value: panelProps.sortType
86
+ }, /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
87
+ value: "3"
88
+ }, (0, _locale.i18n)('PRICE')), /*#__PURE__*/_react["default"].createElement(_antd.Select.Option, {
89
+ value: "1"
90
+ }, (0, _locale.i18n)('SALES')))), /*#__PURE__*/_react["default"].createElement(_common.Collapse, {
91
+ headerSize: "middle",
92
+ onRefresh: this.reRender,
93
+ source: [{
94
+ key: '1',
95
+ name: (0, _locale.i18n)('GROUP_LABEL'),
96
+ value: /*#__PURE__*/_react["default"].createElement(_ButtonConfig["default"], {
97
+ data: panelProps.label
98
+ }),
99
+ metaOption: panelProps.label
100
+ }, {
101
+ key: '2',
102
+ name: (0, _locale.i18n)('PRODUCT_NAME'),
103
+ value: /*#__PURE__*/_react["default"].createElement(_TextConfig["default"], {
104
+ data: panelProps.productName
105
+ }),
106
+ metaOption: panelProps.productName
107
+ }, {
108
+ key: '3',
109
+ name: (0, _locale.i18n)('ACTIVITY_PRICE'),
110
+ value: /*#__PURE__*/_react["default"].createElement(_TextConfig["default"], {
111
+ data: panelProps.activityPrice
112
+ }),
113
+ metaOption: panelProps.activityPrice
114
+ }, {
115
+ key: '4',
116
+ name: (0, _locale.i18n)('SALES_PRICE'),
117
+ value: /*#__PURE__*/_react["default"].createElement(_TextConfig["default"], {
118
+ data: panelProps.salesPrice
119
+ }),
120
+ metaOption: panelProps.salesPrice
121
+ }],
122
+ type: "switch"
123
+ }), /*#__PURE__*/_react["default"].createElement("div", {
124
+ className: "sales_progress_wrap"
125
+ }, /*#__PURE__*/_react["default"].createElement("div", {
126
+ className: "title"
127
+ }, /*#__PURE__*/_react["default"].createElement("span", {
128
+ className: "label"
129
+ }, (0, _locale.i18n)('SALES_PROGRESS')), /*#__PURE__*/_react["default"].createElement(_antd.Switch, {
130
+ checked: panelProps.salesProgress.open,
131
+ onChange: function onChange(v) {
132
+ panelProps.salesProgress = {
133
+ open: v
134
+ };
135
+
136
+ _this.reRender();
137
+ }
138
+ })), /*#__PURE__*/_react["default"].createElement("div", {
139
+ className: "content"
140
+ }, /*#__PURE__*/_react["default"].createElement("p", {
141
+ className: "name"
142
+ }, (0, _locale.i18n)('PROGRESS_BAR_COLOR')), /*#__PURE__*/_react["default"].createElement(_common.ColorPickerInput, {
143
+ colorType: "rgba",
144
+ onChange: function onChange(v) {
145
+ panelProps.salesProgress.color = v;
146
+
147
+ _this.reRender();
148
+ },
149
+ value: panelProps.salesProgress.color
150
+ }))));
151
+ };
152
+
153
+ AComponent.defaultProps = {
154
+ panelProps: {
155
+ sortType: '1',
156
+ label: {},
157
+ productName: {},
158
+ activityPrice: {},
159
+ salesPrice: {},
160
+ salesProgress: {
161
+ open: false,
162
+ color: '#000'
163
+ }
164
+ }
165
+ };
166
+ return AComponent;
167
+ }(_react["default"].Component);
168
+
169
+ var _default = AComponent;
170
+ exports["default"] = _default;