@fonixtree/magic-design 2.0.32 → 2.0.35

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 (69) hide show
  1. package/es/common/AffiliateProductModal/index.js +582 -0
  2. package/es/common/AffiliateProductModal/index.less +146 -0
  3. package/es/common/ProductModal/index.js +1 -2
  4. package/es/common/ProductSource/index.js +42 -10
  5. package/es/composite-comp/common/components/AffiliateProductItem/imgs/icon-Balance2.svg +9 -0
  6. package/es/composite-comp/common/components/AffiliateProductItem/imgs/icon-Koin.svg +40 -0
  7. package/es/composite-comp/common/components/AffiliateProductItem/index.js +175 -0
  8. package/es/composite-comp/common/components/AffiliateProductItem/index.less +107 -0
  9. package/es/composite-comp/common/components/ProductItem/index.js +8 -6
  10. package/es/composite-comp/common/components/ProductItem/index.less +28 -22
  11. package/es/composite-comp/dito/components/AffiliateRecommend/defaultJSON.js +243 -0
  12. package/es/composite-comp/dito/components/AffiliateRecommend/index.js +90 -0
  13. package/es/composite-comp/dito/components/AffiliateRecommend/mobile/index.js +656 -0
  14. package/es/composite-comp/dito/components/AffiliateRecommend/mobile/index.less +76 -0
  15. package/es/composite-comp/dito/components/AffiliateRecommend/pc/index.js +725 -0
  16. package/es/composite-comp/dito/components/AffiliateRecommend/pc/index.less +124 -0
  17. package/es/composite-comp/dito/components/SignBoard/mobile/index.js +1 -1
  18. package/es/composite-comp/dito/config-panels/AffiliateRecommendConfig/RecommendConfigContent/index.js +102 -0
  19. package/es/composite-comp/dito/config-panels/AffiliateRecommendConfig/RecommendConfigContent/index.less +0 -0
  20. package/es/composite-comp/dito/config-panels/AffiliateRecommendConfig/RecommendConfigGroup/index.js +145 -0
  21. package/es/composite-comp/dito/config-panels/AffiliateRecommendConfig/RecommendConfigGroup/index.less +16 -0
  22. package/es/composite-comp/dito/config-panels/AffiliateRecommendConfig/imgs/defaultImg.png +0 -0
  23. package/es/composite-comp/dito/config-panels/AffiliateRecommendConfig/index.js +141 -0
  24. package/es/composite-comp/dito/config-panels/RecommendConfig/RecommendConfigGroup/index.js +10 -9
  25. package/es/composite-comp/dito/second-config-panels/AffiliateRecommendSecondConfig/AIRecommendation/index.js +431 -0
  26. package/es/composite-comp/dito/second-config-panels/AffiliateRecommendSecondConfig/index.js +214 -0
  27. package/es/composite-comp/dito/second-config-panels/AffiliateRecommendSecondConfig/index.less +15 -0
  28. package/es/constants/component-types.js +9 -3
  29. package/es/constants/index.js +4 -0
  30. package/es/core/Designer/ConfigPanel/index.js +7 -2
  31. package/es/core/Designer/LeftTitle/index.js +1 -1
  32. package/es/core/Renderer/index.js +20 -21
  33. package/es/meta-comp/components/Text/index.js +16 -0
  34. package/es/utils/businessUtil.js +6 -1
  35. package/lib/common/AffiliateProductModal/index.js +582 -0
  36. package/lib/common/AffiliateProductModal/index.less +146 -0
  37. package/lib/common/ProductModal/index.js +1 -2
  38. package/lib/common/ProductSource/index.js +42 -10
  39. package/lib/composite-comp/common/components/AffiliateProductItem/imgs/icon-Balance2.svg +9 -0
  40. package/lib/composite-comp/common/components/AffiliateProductItem/imgs/icon-Koin.svg +40 -0
  41. package/lib/composite-comp/common/components/AffiliateProductItem/index.js +175 -0
  42. package/lib/composite-comp/common/components/AffiliateProductItem/index.less +107 -0
  43. package/lib/composite-comp/common/components/ProductItem/index.js +8 -6
  44. package/lib/composite-comp/common/components/ProductItem/index.less +28 -22
  45. package/lib/composite-comp/dito/components/AffiliateRecommend/defaultJSON.js +243 -0
  46. package/lib/composite-comp/dito/components/AffiliateRecommend/index.js +90 -0
  47. package/lib/composite-comp/dito/components/AffiliateRecommend/mobile/index.js +656 -0
  48. package/lib/composite-comp/dito/components/AffiliateRecommend/mobile/index.less +76 -0
  49. package/lib/composite-comp/dito/components/AffiliateRecommend/pc/index.js +725 -0
  50. package/lib/composite-comp/dito/components/AffiliateRecommend/pc/index.less +124 -0
  51. package/lib/composite-comp/dito/components/SignBoard/mobile/index.js +1 -1
  52. package/lib/composite-comp/dito/config-panels/AffiliateRecommendConfig/RecommendConfigContent/index.js +102 -0
  53. package/lib/composite-comp/dito/config-panels/AffiliateRecommendConfig/RecommendConfigContent/index.less +0 -0
  54. package/lib/composite-comp/dito/config-panels/AffiliateRecommendConfig/RecommendConfigGroup/index.js +145 -0
  55. package/lib/composite-comp/dito/config-panels/AffiliateRecommendConfig/RecommendConfigGroup/index.less +16 -0
  56. package/lib/composite-comp/dito/config-panels/AffiliateRecommendConfig/imgs/defaultImg.png +0 -0
  57. package/lib/composite-comp/dito/config-panels/AffiliateRecommendConfig/index.js +141 -0
  58. package/lib/composite-comp/dito/config-panels/RecommendConfig/RecommendConfigGroup/index.js +10 -9
  59. package/lib/composite-comp/dito/second-config-panels/AffiliateRecommendSecondConfig/AIRecommendation/index.js +431 -0
  60. package/lib/composite-comp/dito/second-config-panels/AffiliateRecommendSecondConfig/index.js +214 -0
  61. package/lib/composite-comp/dito/second-config-panels/AffiliateRecommendSecondConfig/index.less +15 -0
  62. package/lib/constants/component-types.js +9 -3
  63. package/lib/constants/index.js +4 -0
  64. package/lib/core/Designer/ConfigPanel/index.js +7 -2
  65. package/lib/core/Designer/LeftTitle/index.js +1 -1
  66. package/lib/core/Renderer/index.js +20 -21
  67. package/lib/meta-comp/components/Text/index.js +16 -0
  68. package/lib/utils/businessUtil.js +6 -1
  69. package/package.json +1 -1
@@ -0,0 +1,146 @@
1
+ .modalCot {
2
+ width: 1200px;
3
+ right: unset !important;
4
+ left: unset !important;
5
+
6
+ .proModalWrap {
7
+ thead .cylon-checkbox {
8
+ visibility: hidden;
9
+ }
10
+
11
+ .content {
12
+ display: flex;
13
+ margin-bottom: 8px;
14
+
15
+ .rightCot {
16
+ width: calc(100% - 260px);
17
+ margin-left: 16px;
18
+ display: flex;
19
+ flex-direction: column;
20
+ justify-content: space-between;
21
+
22
+ .prodImg {
23
+ display: inline-block;
24
+ width: 36px;
25
+ height: 36px;
26
+ background-size: cover;
27
+ background-position: 50% 50%;
28
+ background-repeat: no-repeat;
29
+ }
30
+
31
+ .selectedCot {
32
+ padding-right: 18px;
33
+ margin-left: 4px;
34
+ height: 78px;
35
+ background: #f8f8f8;
36
+ border: 1px solid #e0e0e0;
37
+ border-radius: 2px;
38
+ display: flex;
39
+ flex-direction: row;
40
+ // flex-wrap: wrap;
41
+ overflow-x: auto;
42
+
43
+ .selectedItem {
44
+ box-sizing: border-box;
45
+ margin-top: 12px;
46
+ margin-left: 18px;
47
+ height: 52px;
48
+ position: relative;
49
+
50
+ &:hover {
51
+ .selectedItemImg {
52
+ width: 52px;
53
+ height: 52px;
54
+ border: 1px solid #4477ee !important;
55
+ box-shadow: 0 0 0 2px rgba(68, 119, 238, 0.15);
56
+ border-radius: 2px;
57
+ }
58
+
59
+ .selectedItemClose {
60
+ display: flex;
61
+ }
62
+ }
63
+
64
+ .selectedItemClose {
65
+ display: none;
66
+ border: 1px solid #000;
67
+ width: 16px;
68
+ height: 16px;
69
+ border-radius: 50%;
70
+ padding: 2px;
71
+ position: absolute;
72
+ top: -9px;
73
+ right: -8px;
74
+ z-index: 400;
75
+ cursor: pointer;
76
+ }
77
+
78
+ // &:nth-child(n + 11) {
79
+ // margin-top: 5px !important;
80
+ // }
81
+
82
+ .selectedItemImg {
83
+ height: 52px;
84
+ width: 52px;
85
+ border: 1px solid #e0e0e0;
86
+ border-radius: 2px;
87
+
88
+ &.invalid {
89
+ border: 1px solid red;
90
+ }
91
+ }
92
+ }
93
+ }
94
+ }
95
+
96
+ .leftCot {
97
+ width: 260px;
98
+ padding-right: 14px;
99
+ box-sizing: border-box;
100
+ border-right: 1px solid #e0e0e0;
101
+
102
+ .divider {
103
+ width: 10%;
104
+ display: inline-block;
105
+ text-align: center;
106
+ height: 32px;
107
+ line-height: 32px;
108
+ }
109
+
110
+ .buttonStyle {
111
+ margin-top: 10px;
112
+ display: flex;
113
+ flex-direction: row-reverse;
114
+ align-items: center;
115
+ }
116
+ }
117
+ }
118
+
119
+ .footer {
120
+ padding-top: 12px;
121
+ display: flex;
122
+ align-items: center;
123
+ justify-content: space-between;
124
+ border-top: 1px solid #e0e0e0;
125
+ }
126
+
127
+ .total {
128
+ font-size: 16px;
129
+ color: #2d3040;
130
+ letter-spacing: 0;
131
+
132
+ .totalNum {
133
+ color: #4477ee;
134
+ }
135
+ }
136
+ }
137
+ }
138
+
139
+ .cylon-modal-root {
140
+ display: flex;
141
+ justify-content: center;
142
+ position: absolute;
143
+ left: 0;
144
+ right: 0;
145
+ z-index: 1001;
146
+ }
@@ -216,8 +216,7 @@ var promType = {
216
216
  FLASH_SALE: '2',
217
217
  GROUP_BUY: '4'
218
218
  };
219
- var Option = _antd.Select.Option,
220
- OptGroup = _antd.Select.OptGroup;
219
+ var Option = _antd.Select.Option;
221
220
  var InputGroup = _antd.Input.Group;
222
221
 
223
222
  var ProductModal = function ProductModal(props) {
@@ -19,6 +19,8 @@ var _ProductModal = _interopRequireDefault(require("../ProductModal"));
19
19
 
20
20
  require("./index.less");
21
21
 
22
+ var _AffiliateProductModal = _interopRequireDefault(require("../AffiliateProductModal"));
23
+
22
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
23
25
 
24
26
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
@@ -172,7 +174,8 @@ function ProductSource(_a) {
172
174
  var _this = this;
173
175
 
174
176
  var value = _a.value,
175
- onChange = _a.onChange;
177
+ onChange = _a.onChange,
178
+ isAffiliate = _a.isAffiliate;
176
179
 
177
180
  var _b = (0, _react.useState)([]),
178
181
  selectedProds = _b[0],
@@ -184,18 +187,30 @@ function ProductSource(_a) {
184
187
 
185
188
  var onSelectProduct = function onSelectProduct() {
186
189
  return __awaiter(_this, void 0, void 0, function () {
187
- var list;
190
+ var url, param, list;
188
191
  return __generator(this, function (_a) {
189
192
  switch (_a.label) {
190
193
  case 0:
191
194
  if (!(value && value.length > 0)) return [3
192
195
  /*break*/
193
196
  , 2];
197
+ url = "/designer/v1/" + window.magicDesign.MBaseUrl + "/products";
198
+ param = {
199
+ products: value
200
+ };
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
+
194
211
  return [4
195
212
  /*yield*/
196
- , (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/products", {
197
- products: value
198
- }, 'GET')];
213
+ , (0, _commonUtil.commonFetch)(url, param, 'GET')];
199
214
 
200
215
  case 1:
201
216
  list = _a.sent().list;
@@ -219,9 +234,18 @@ function ProductSource(_a) {
219
234
  };
220
235
 
221
236
  var handleModalSave = function handleModalSave(list) {
222
- var ids = list.map(function (prod) {
223
- return prod.productId;
224
- }).join(',');
237
+ var ids = '';
238
+
239
+ if (isAffiliate) {
240
+ ids = list.map(function (prod) {
241
+ return prod.affiliateProductId;
242
+ }).join(',');
243
+ } else {
244
+ ids = list.map(function (prod) {
245
+ return prod.productId;
246
+ }).join(',');
247
+ }
248
+
225
249
  onChange(ids);
226
250
  };
227
251
 
@@ -242,7 +266,15 @@ function ProductSource(_a) {
242
266
  className: "total"
243
267
  }, (0, _locale.i18n)('TOTAL_PRODUCTS', {
244
268
  count: getLength()
245
- })), visible && /*#__PURE__*/_react["default"].createElement(_ProductModal["default"], {
269
+ })), visible && (isAffiliate ? /*#__PURE__*/_react["default"].createElement(_AffiliateProductModal["default"], {
270
+ closeModal: function closeModal() {
271
+ return setVisbile(false);
272
+ },
273
+ defaultList: selectedProds,
274
+ handleModalSave: handleModalSave,
275
+ maxSelect: 100,
276
+ visible: visible
277
+ }) : /*#__PURE__*/_react["default"].createElement(_ProductModal["default"], {
246
278
  closeModal: function closeModal() {
247
279
  return setVisbile(false);
248
280
  },
@@ -250,5 +282,5 @@ function ProductSource(_a) {
250
282
  handleModalSave: handleModalSave,
251
283
  maxSelect: 100,
252
284
  visible: visible
253
- }));
285
+ })));
254
286
  }
@@ -0,0 +1,9 @@
1
+ <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g id="balance-02 4">
3
+ <path id="Vector" d="M6.29612 7.51894C6.27534 6.80062 6.53358 6.10217 7.01665 5.57014C7.52439 5.03348 8.24492 4.74601 9.10172 4.73948L11.2932 4.72454C11.1735 4.42166 10.9655 4.16179 10.6962 3.97869C10.4269 3.7956 10.1087 3.69775 9.78305 3.69788H2.54225C2.32566 3.69788 2.11794 3.78392 1.96478 3.93707C1.81163 4.09023 1.72559 4.29795 1.72559 4.51454V10.6195C1.72559 10.8361 1.81163 11.0438 1.96478 11.1969C2.11794 11.3501 2.32566 11.4361 2.54225 11.4361H9.78399C10.1171 11.4359 10.4421 11.3333 10.7149 11.1421C10.9877 10.951 11.1951 10.6805 11.3091 10.3675L9.04292 10.3833C7.68585 10.3815 6.31012 9.49574 6.29612 7.51894Z" fill="#269E2C"/>
4
+ <path id="Vector_2" d="M8.25924 6.86653C8.06604 7.03733 7.97364 7.28653 7.97924 7.62907C7.97924 8.1956 8.41604 8.5344 9.13844 8.5344L11.412 8.51853V6.56973L9.25138 6.58467C8.79964 6.5884 8.46644 6.68267 8.25924 6.86653Z" fill="#269E2C"/>
5
+ <path id="Vector_3" d="M11.5072 4.90092L9.10292 4.91865C7.40052 4.93079 6.46345 6.10585 6.47372 7.51892C6.48678 9.38559 7.79438 10.2135 9.06278 10.2041L11.509 10.1873H11.524C11.722 10.1873 11.9119 10.1087 12.052 9.96863C12.192 9.8286 12.2706 9.63868 12.2706 9.44065C12.2706 9.24262 12.192 9.05271 12.052 8.91268C11.9119 8.77265 11.722 8.69399 11.524 8.69399H11.4736L9.15238 8.71079C8.29558 8.71639 7.80278 8.27492 7.79812 7.62999C7.79252 6.86185 8.23492 6.41665 9.24758 6.40639L11.4876 6.39052H11.5286C11.7267 6.39052 11.9166 6.31185 12.0566 6.17183C12.1966 6.0318 12.2753 5.84188 12.2753 5.64385C12.2753 5.44582 12.1966 5.25591 12.0566 5.11588C11.9166 4.97585 11.7267 4.89719 11.5286 4.89719L11.5072 4.90092Z" fill="#FF5B00"/>
6
+ <path id="Vector_4" d="M6.44623 7.98895C6.73941 7.8857 6.89338 7.56434 6.79014 7.27116C6.68689 6.97798 6.36553 6.82401 6.07235 6.92726C5.77917 7.0305 5.6252 7.35187 5.72844 7.64504C5.83169 7.93822 6.15305 8.09219 6.44623 7.98895Z" fill="white"/>
7
+ <path id="Vector_5" d="M2.61328 3.472H9.54048C9.33328 3.26667 9.11675 2.93907 8.86662 2.56573C6.47448 2.86813 5.00355 3.17333 2.61328 3.472Z" fill="#269E2C"/>
8
+ </g>
9
+ </svg>
@@ -0,0 +1,40 @@
1
+ <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g id="Koin">
3
+ <g id="Group">
4
+ <g id="rank icon">
5
+ <path id="Vector" d="M7 12.25C9.8995 12.25 12.25 9.89946 12.25 6.99997C12.25 4.10047 9.8995 1.74997 7 1.74997C4.10051 1.74997 1.75 4.10047 1.75 6.99997C1.75 9.89946 4.10051 12.25 7 12.25Z" fill="url(#paint0_linear_4487_10245)"/>
6
+ <g id="Group_2" opacity="0.9">
7
+ <path id="Vector_2" d="M7.00512 11.7405C9.62051 11.7405 11.7407 9.62027 11.7407 7.00487C11.7407 4.38948 9.62051 2.26929 7.00512 2.26929C4.38973 2.26929 2.26953 4.38948 2.26953 7.00487C2.26953 9.62027 4.38973 11.7405 7.00512 11.7405Z" fill="url(#paint1_radial_4487_10245)"/>
8
+ <g id="Group_3">
9
+ <g id="Group_4" style="mix-blend-mode:screen">
10
+ <path id="Vector_3" d="M7.00512 11.7405C9.62051 11.7405 11.7407 9.62027 11.7407 7.00487C11.7407 4.38948 9.62051 2.26929 7.00512 2.26929C4.38973 2.26929 2.26953 4.38948 2.26953 7.00487C2.26953 9.62027 4.38973 11.7405 7.00512 11.7405Z" fill="#020202"/>
11
+ </g>
12
+ </g>
13
+ </g>
14
+ <path id="Vector_4" d="M5.93809 4.50593V7.45313C6.41413 6.83039 6.88088 6.19898 7.44791 5.65794C7.74133 5.3831 8.03413 5.33729 8.42783 5.33729H9.13229V5.3831C8.7844 5.67652 7.64043 6.97586 7.12787 7.62584C7.52157 8.11054 7.90599 8.61629 8.34488 9.06261C8.79368 9.51141 8.99487 9.60241 9.29695 9.70331C9.16881 10.097 8.96763 10.3075 8.46436 10.3075C8.16317 10.2994 7.87598 10.1786 7.65962 9.96888C7.02759 9.31889 6.47851 8.58658 5.93871 7.86417V10.2716L5.54501 10.2809C4.97797 10.2895 4.70312 9.98745 4.70312 9.41422V3.69128H5.09683C5.6911 3.69128 5.93809 4.02866 5.93809 4.50593Z" fill="#F95812"/>
15
+ <g id="Clip path group">
16
+ <mask id="mask0_4487_10245" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="2" y="2" width="10" height="10">
17
+ <g id="clip-path">
18
+ <path id="Vector_5" d="M7.00512 11.7405C9.62051 11.7405 11.7407 9.62027 11.7407 7.00487C11.7407 4.38948 9.62051 2.26929 7.00512 2.26929C4.38973 2.26929 2.26953 4.38948 2.26953 7.00487C2.26953 9.62027 4.38973 11.7405 7.00512 11.7405Z" fill="white"/>
19
+ </g>
20
+ </mask>
21
+ <g mask="url(#mask0_4487_10245)">
22
+ <g id="Group_5">
23
+ <path id="Vector_6" opacity="0.2" d="M0.0784104 1.79022C0.508637 3.06976 1.12333 3.96673 1.67675 4.58577C4.34168 7.55711 9.29764 8.23805 14.3898 6.67747L12.4993 10.7055C11.3659 11.6642 10.009 12.3215 8.55418 12.6165C6.17463 13.0931 4.2383 12.4425 3.31408 12.0426C2.48149 11.6799 0.199121 10.6931 -0.905849 8.23309C-1.7044 6.45338 -2.00463 3.64298 -0.556096 2.2483C-0.366832 2.06696 -0.153288 1.91279 0.0784104 1.79022Z" fill="#FDECD7"/>
24
+ </g>
25
+ </g>
26
+ </g>
27
+ </g>
28
+ </g>
29
+ </g>
30
+ <defs>
31
+ <linearGradient id="paint0_linear_4487_10245" x1="2.4526" y1="9.62528" x2="11.5474" y2="4.37466" gradientUnits="userSpaceOnUse">
32
+ <stop stop-color="#F78B54"/>
33
+ <stop offset="1" stop-color="#F8BC7F"/>
34
+ </linearGradient>
35
+ <radialGradient id="paint1_radial_4487_10245" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(7.00512 7.00487) scale(4.73559)">
36
+ <stop stop-color="#FDECD7"/>
37
+ <stop offset="1" stop-color="#F8C486"/>
38
+ </radialGradient>
39
+ </defs>
40
+ </svg>
@@ -0,0 +1,175 @@
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 _classnames = _interopRequireDefault(require("classnames"));
11
+
12
+ var _iconBalance = _interopRequireDefault(require("./imgs/icon-Balance2.svg"));
13
+
14
+ var _iconKoin = _interopRequireDefault(require("./imgs/icon-Koin.svg"));
15
+
16
+ var _currencyUtil = require("../../../../utils/currencyUtil");
17
+
18
+ var _components = require("../../../../meta-comp/components");
19
+
20
+ var _NewImg = _interopRequireDefault(require("../../../../common/NewImg"));
21
+
22
+ require("./index.less");
23
+
24
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
25
+
26
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
27
+
28
+ var __extends = void 0 && (void 0).__extends || function () {
29
+ var _extendStatics = function extendStatics(d, b) {
30
+ _extendStatics = Object.setPrototypeOf || {
31
+ __proto__: []
32
+ } instanceof Array && function (d, b) {
33
+ d.__proto__ = b;
34
+ } || function (d, b) {
35
+ for (var p in b) {
36
+ if (b.hasOwnProperty(p)) d[p] = b[p];
37
+ }
38
+ };
39
+
40
+ return _extendStatics(d, b);
41
+ };
42
+
43
+ return function (d, b) {
44
+ _extendStatics(d, b);
45
+
46
+ function __() {
47
+ this.constructor = d;
48
+ }
49
+
50
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
51
+ };
52
+ }();
53
+
54
+ var __assign = void 0 && (void 0).__assign || function () {
55
+ __assign = Object.assign || function (t) {
56
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
57
+ s = arguments[i];
58
+
59
+ for (var p in s) {
60
+ if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
61
+ }
62
+ }
63
+
64
+ return t;
65
+ };
66
+
67
+ return __assign.apply(this, arguments);
68
+ };
69
+
70
+ var __rest = void 0 && (void 0).__rest || function (s, e) {
71
+ var t = {};
72
+
73
+ for (var p in s) {
74
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
75
+ }
76
+
77
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
78
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
79
+ }
80
+ return t;
81
+ };
82
+
83
+ var AffiliateProductItem =
84
+ /** @class */
85
+ function (_super) {
86
+ __extends(AffiliateProductItem, _super);
87
+
88
+ function AffiliateProductItem() {
89
+ var _this = _super !== null && _super.apply(this, arguments) || this;
90
+
91
+ _this.state = {};
92
+ return _this;
93
+ }
94
+
95
+ AffiliateProductItem.prototype.render = function () {
96
+ var _a;
97
+
98
+ var _b = this.props,
99
+ data = _b.data,
100
+ panelProps = _b.panelProps,
101
+ onItemClick = _b.onItemClick,
102
+ fixHeight = _b.fixHeight,
103
+ layout = _b.layout,
104
+ imgHeight = _b.imgHeight,
105
+ imgWidth = _b.imgWidth,
106
+ rest = __rest(_b, ["data", "panelProps", "onItemClick", "fixHeight", "layout", "imgHeight", "imgWidth"]);
107
+
108
+ var imgStyle = {};
109
+ if (imgWidth) imgStyle.width = imgWidth;
110
+ if (imgHeight) imgStyle.height = imgHeight;
111
+ return /*#__PURE__*/_react["default"].createElement("div", _extends({
112
+ className: (0, _classnames["default"])('m-product-item-wrap', {
113
+ fixHeight: fixHeight,
114
+ horizontal: layout === 'horizontal'
115
+ }),
116
+ onClick: function onClick() {
117
+ return onItemClick();
118
+ },
119
+ style: {
120
+ width: imgWidth + 2
121
+ }
122
+ }, rest), /*#__PURE__*/_react["default"].createElement(_NewImg["default"], {
123
+ className: "product-img",
124
+ lazy: true,
125
+ src: (data === null || data === void 0 ? void 0 : data.imgUrls) && ((_a = data === null || data === void 0 ? void 0 : data.imgUrls) === null || _a === void 0 ? void 0 : _a.length) > 0 && data.imgUrls[0],
126
+ style: imgStyle
127
+ }), /*#__PURE__*/_react["default"].createElement("div", {
128
+ className: "contentWrap"
129
+ }, panelProps.productName.open && /*#__PURE__*/_react["default"].createElement("div", {
130
+ className: "productItemContent"
131
+ }, /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
132
+ className: "producItemName",
133
+ data: __assign(__assign({}, panelProps.productName), {
134
+ text: data.productName
135
+ }),
136
+ readonly: true
137
+ })), /*#__PURE__*/_react["default"].createElement("div", {
138
+ className: "cashBackBox"
139
+ }, /*#__PURE__*/_react["default"].createElement("div", {
140
+ className: "cashBackBox_cashBack"
141
+ }, /*#__PURE__*/_react["default"].createElement("img", {
142
+ alt: "",
143
+ src: _iconBalance["default"]
144
+ }), /*#__PURE__*/_react["default"].createElement("div", {
145
+ className: "cashBackBox_text"
146
+ }, "Cashback Saldo", /*#__PURE__*/_react["default"].createElement("span", null, (0, _currencyUtil.formatCurrencyWithSymbol)(data.buyCommission || 0)))), /*#__PURE__*/_react["default"].createElement("div", {
147
+ className: "cashBackBox_koin"
148
+ }, /*#__PURE__*/_react["default"].createElement("img", {
149
+ alt: "",
150
+ src: _iconKoin["default"]
151
+ }), /*#__PURE__*/_react["default"].createElement("div", {
152
+ className: "cashBackBox_text"
153
+ }, "Cashback", /*#__PURE__*/_react["default"].createElement("span", null, (0, _currencyUtil.formatCurrency)(data.giftCommission || 0)), "Koin"))), panelProps.salesPrice.open && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
154
+ className: "producItemPrice",
155
+ data: __assign(__assign({}, panelProps.salesPrice), {
156
+ text: (0, _currencyUtil.formatCurrencyWithSymbol)(data.productPrice || 0)
157
+ }),
158
+ readonly: true,
159
+ style: {
160
+ color: panelProps.salesPrice.content.color
161
+ }
162
+ })));
163
+ };
164
+
165
+ AffiliateProductItem.defaultProps = {
166
+ data: {},
167
+ panelProps: {},
168
+ fixHeight: false,
169
+ layout: 'vertical'
170
+ };
171
+ return AffiliateProductItem;
172
+ }(_react["default"].Component);
173
+
174
+ var _default = AffiliateProductItem;
175
+ exports["default"] = _default;
@@ -0,0 +1,107 @@
1
+ .m-product-item-wrap {
2
+ display: flex;
3
+ flex-direction: column;
4
+ background: #FFFFFF;
5
+ border: 1px solid #D2D9E5;
6
+ width: 142px;
7
+ cursor: pointer;
8
+ position: relative;
9
+ border-radius: 4px;
10
+
11
+ .productItemImg {
12
+ height: 167px;
13
+ border-top-right-radius: 8px;
14
+ border-top-left-radius: 8px;
15
+ }
16
+ .productItemContent {
17
+ padding: 4px 4px 0;
18
+ .producItemName {
19
+ overflow: hidden;
20
+ text-overflow: ellipsis;
21
+ display: -webkit-box;
22
+ -webkit-box-orient: vertical;
23
+ -webkit-line-clamp: 2;
24
+ }
25
+
26
+ }
27
+ .cashBackBox {
28
+ width: 100%;
29
+ background: #F9F9F9;
30
+ padding: 4px;
31
+ .cashBackBox_cashBack {
32
+ display: flex;
33
+ align-items: center;
34
+ img {
35
+ width: 14px;
36
+ height: 14px;
37
+ }
38
+ .cashBackBox_text {
39
+ display: flex;
40
+ align-items: center;
41
+ padding-left: 4px;
42
+ color: #279e2c;
43
+ font-family: Trueno;
44
+ font-size: 10px;
45
+ font-style: normal;
46
+ font-weight: 700;
47
+ line-height: 12px;
48
+ span {
49
+ padding-left: 2px;
50
+ }
51
+ }
52
+ }
53
+ .cashBackBox_koin {
54
+ display: flex;
55
+ align-items: center;
56
+ img {
57
+ width: 14px;
58
+ height: 14px;
59
+ }
60
+ .cashBackBox_text {
61
+ color: #fa7539;
62
+ font-family: Trueno;
63
+ font-size: 10px;
64
+ font-style: normal;
65
+ font-weight: 700;
66
+ line-height: 12px;
67
+ display: flex;
68
+ align-items: center;
69
+ padding-left: 4px;
70
+ span {
71
+ padding: 0 2px;
72
+ }
73
+ }
74
+ }
75
+ }
76
+ .producItemPrice {
77
+ padding: 4px;
78
+ }
79
+
80
+ &.fixHeight {
81
+ .promotions-wrap {
82
+ height: 30px;
83
+ flex-wrap: nowrap;
84
+ overflow: hidden;
85
+ }
86
+
87
+ .product-name-wrap {
88
+ height: 38px;
89
+ }
90
+ }
91
+
92
+ &.horizontal {
93
+ flex-direction: row;
94
+
95
+ .product-img {
96
+ width: 100px;
97
+ height: 100%;
98
+ min-height: 100px;
99
+ }
100
+
101
+ .content-wrap {
102
+ display: flex;
103
+ flex-direction: column;
104
+ justify-content: center;
105
+ }
106
+ }
107
+ }
@@ -202,11 +202,13 @@ function (_super) {
202
202
  text: _price
203
203
  }),
204
204
  readonly: true
205
- }), oldPrice && panelProps.salesPrice.open && /*#__PURE__*/_react["default"].createElement("div", {
205
+ }), panelProps.salesPrice.open && /*#__PURE__*/_react["default"].createElement("div", {
206
+ className: "price-sold-wrap"
207
+ }, /*#__PURE__*/_react["default"].createElement("div", {
206
208
  className: "old-price-wrap"
207
209
  }, !!discount && /*#__PURE__*/_react["default"].createElement("span", {
208
210
  className: "discount"
209
- }, "-", discount, "%"), /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
211
+ }, "-", discount, "%"), oldPrice && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
210
212
  className: "old-price",
211
213
  data: __assign(__assign({}, panelProps.salesPrice), {
212
214
  text: oldPrice
@@ -215,7 +217,9 @@ function (_super) {
215
217
  style: {
216
218
  color: panelProps.salesPrice.content.color
217
219
  }
218
- })), showProgress && panelProps.salesProgressVisible.open && /*#__PURE__*/_react["default"].createElement("div", {
220
+ })), !showProgress && data.salesCnt > 0 && /*#__PURE__*/_react["default"].createElement("div", {
221
+ className: "sold-count"
222
+ }, (0, _commonUtil.convertCount)(data.salesCnt), " sold")), showProgress && panelProps.salesProgressVisible.open && /*#__PURE__*/_react["default"].createElement("div", {
219
223
  className: "progress-wrap"
220
224
  }, /*#__PURE__*/_react["default"].createElement("span", {
221
225
  className: "text"
@@ -226,9 +230,7 @@ function (_super) {
226
230
  style: {
227
231
  width: salePercent + "%"
228
232
  }
229
- }))), !showProgress && data.salesCnt > 0 && /*#__PURE__*/_react["default"].createElement("div", {
230
- className: "sold-count"
231
- }, (0, _commonUtil.convertCount)(data.salesCnt), " sold")));
233
+ })))));
232
234
  };
233
235
 
234
236
  ProductItem.defaultProps = {