@fonixtree/magic-design 2.0.156 → 2.0.158

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.
@@ -90,14 +90,18 @@ var renderDiscount = function renderDiscount(data) {
90
90
  var text = '';
91
91
 
92
92
  if (AMT) {
93
- text = (0, _currencyUtil.formatCurrency)(data.discountAmount);
93
+ text = (0, _currencyUtil.formatCurrencyWithSymbol)(data.discountAmount);
94
94
  } else if (DISC) {
95
95
  var temp = (0, _currencyUtil.formatCurrency)(data.discountAmount, 2); // 折扣券处理:100 => 1%
96
96
 
97
97
  text = parseInt(temp, 10) + "%";
98
98
  }
99
99
 
100
- return text;
100
+ return {
101
+ text: text,
102
+ isBig: text.length > 6 && text.length <= 9,
103
+ isHide: text.length > 9
104
+ };
101
105
  };
102
106
 
103
107
  exports.renderDiscount = renderDiscount;
@@ -181,14 +185,14 @@ function (_super) {
181
185
  className: "discount-tag"
182
186
  }, isWill ? (0, _locale.i18n)('COMING_SOON') : data.discountPercent + "% " + (0, _locale.i18n)('OFF'))), /*#__PURE__*/_react["default"].createElement("div", {
183
187
  className: "content-wrap"
184
- }, /*#__PURE__*/_react["default"].createElement("div", {
188
+ }, showProName && panelProps.productName.open && /*#__PURE__*/_react["default"].createElement("div", {
185
189
  className: "product-name-wrap"
186
190
  }, /*#__PURE__*/_react["default"].createElement("div", {
187
191
  className: "box"
188
192
  }, prodLabels.length > 0 && /*#__PURE__*/_react["default"].createElement(_ImageLabel["default"], {
189
193
  labels: prodLabels,
190
194
  small: true
191
- }), showProName && panelProps.productName.open && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
195
+ }), /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
192
196
  data: __assign(__assign({}, panelProps.productName), {
193
197
  text: data.offerName
194
198
  }),
@@ -242,15 +246,18 @@ function (_super) {
242
246
  readonly: true
243
247
  }))), intelligentType === 'Coupon' && data.coupons && data.coupons.length > 0 && /*#__PURE__*/_react["default"].createElement("div", {
244
248
  className: "coupons-list"
245
- }, data.coupons.slice(0, 4).map(function (m) {
249
+ }, data.coupons.map(function (m) {
246
250
  return /*#__PURE__*/_react["default"].createElement("div", {
247
251
  key: m.couponId,
248
- className: (0, _classnames["default"])('item', m.discountMethod)
252
+ className: (0, _classnames["default"])('item', m.discountMethod, {
253
+ big: renderDiscount(m).isBig,
254
+ hide: renderDiscount(m).isHide
255
+ })
249
256
  }, /*#__PURE__*/_react["default"].createElement("div", {
250
257
  className: "name"
251
258
  }, (0, _locale.i18n)('DISCOUNT')), /*#__PURE__*/_react["default"].createElement("div", {
252
259
  className: "num"
253
- }, renderDiscount(m)));
260
+ }, renderDiscount(m).text));
254
261
  })), showProgress && /*#__PURE__*/_react["default"].createElement("div", {
255
262
  className: "progress-wrap"
256
263
  }, ((_j = panelProps.salesProgress) === null || _j === void 0 ? void 0 : _j.open) && /*#__PURE__*/_react["default"].createElement("div", {
@@ -10,7 +10,7 @@
10
10
  .img-wrap {
11
11
  position: relative;
12
12
  border-radius: 8px;
13
- overflow: hidden;
13
+ // overflow: hidden;
14
14
 
15
15
  .product-img {
16
16
  width: 140px;
@@ -156,6 +156,8 @@
156
156
  display: flex;
157
157
  flex-wrap: wrap;
158
158
  margin-top: 8px;
159
+ max-height: 48px;
160
+ overflow: hidden;
159
161
 
160
162
  .item {
161
163
  display: block;
@@ -164,7 +166,7 @@
164
166
  color: #F47A46;
165
167
  background: url('./imgs/coupon-orange.png') no-repeat center;
166
168
  background-size: 100% !important;
167
- margin-right: 6px;
169
+ margin-right: 5px;
168
170
  margin-bottom: 4px;
169
171
  line-height: 1;
170
172
  text-align: center;
@@ -175,6 +177,24 @@
175
177
  background: url('./imgs/coupon-red.png') no-repeat center;
176
178
  }
177
179
 
180
+ &.DISC.big {
181
+ background: url('./imgs/coupon-red-big.png') no-repeat center;
182
+ }
183
+
184
+ &.big {
185
+ width: 75px;
186
+ background: url('./imgs/coupon-orange-big.png') no-repeat center;
187
+
188
+ .num,
189
+ .name {
190
+ width: 62px;
191
+ }
192
+ }
193
+
194
+ &.hide {
195
+ display: none;
196
+ }
197
+
178
198
  .name {
179
199
  font-size: 5px;
180
200
  width: 40px;
@@ -239,6 +259,7 @@
239
259
 
240
260
  .img-wrap {
241
261
  border-radius: 8px 0 0 8px;
262
+ margin-right: 8px;
242
263
 
243
264
  .product-img {
244
265
  width: 100px;
@@ -76,12 +76,12 @@
76
76
  justify-content: flex-start;
77
77
  }
78
78
  .m-flash-deal-mobile .flash-deal-list-vertical .m-product-item-wrap {
79
- width: 2.84rem;
79
+ width: 2.44rem;
80
80
  margin-right: 0.16rem;
81
81
  }
82
82
  .m-flash-deal-mobile .flash-deal-list-vertical .m-product-item-wrap .product-img {
83
- height: 2.8rem;
84
- width: 2.8rem;
83
+ height: 2.4rem;
84
+ width: 2.4rem;
85
85
  }
86
86
  .m-flash-deal-mobile .flash-deal-list-horizontal {
87
87
  display: flex;
@@ -236,9 +236,9 @@ var defaultData = [{
236
236
  imgUrlContent: {
237
237
  url: _card["default"]
238
238
  },
239
- offerName: 'Product Name',
239
+ offerName: 'Product Name Long Long Long Long Long',
240
240
  salesPrice: 10000,
241
- specialPrice: 8000,
241
+ specialPrice: null,
242
242
  marketPrice: 20000,
243
243
  salePercent: 500,
244
244
  discountPercent: 90,
@@ -249,19 +249,19 @@ var defaultData = [{
249
249
  }, {
250
250
  couponId: '2',
251
251
  discountMethod: 'AMT',
252
- discountAmount: 10000
252
+ discountAmount: 100
253
253
  }, {
254
254
  couponId: '3',
255
- discountMethod: 'DISC',
256
- discountAmount: 30
255
+ discountMethod: 'AMT',
256
+ discountAmount: 1000
257
257
  }, {
258
258
  couponId: '4',
259
259
  discountMethod: 'AMT',
260
260
  discountAmount: 10000
261
261
  }, {
262
262
  couponId: '5',
263
- discountMethod: 'DISC',
264
- discountAmount: 30
263
+ discountMethod: 'AMT',
264
+ discountAmount: 100000
265
265
  }]
266
266
  }, {
267
267
  imgUrlContent: {
@@ -276,7 +276,7 @@ var defaultData = [{
276
276
  imgUrlContent: {
277
277
  url: _card["default"]
278
278
  },
279
- offerName: 'Product Name',
279
+ offerName: 'Product Name Long Long Long Long Long',
280
280
  salesPrice: 18000000,
281
281
  specialPrice: 18000000,
282
282
  marketPrice: 19000000,
@@ -857,6 +857,7 @@ function (_super) {
857
857
  return /*#__PURE__*/_react["default"].createElement(_MonpayProductItem["default"], {
858
858
  key: "scroll_" + item.productId,
859
859
  data: item,
860
+ fixHeight: true,
860
861
  imgHeight: imgHeight,
861
862
  imgWidth: imgWidth,
862
863
  intelligentType: (_a = groupSource[tabIndex]) === null || _a === void 0 ? void 0 : _a.intelligentType,
@@ -90,14 +90,18 @@ var renderDiscount = function renderDiscount(data) {
90
90
  var text = '';
91
91
 
92
92
  if (AMT) {
93
- text = (0, _currencyUtil.formatCurrency)(data.discountAmount);
93
+ text = (0, _currencyUtil.formatCurrencyWithSymbol)(data.discountAmount);
94
94
  } else if (DISC) {
95
95
  var temp = (0, _currencyUtil.formatCurrency)(data.discountAmount, 2); // 折扣券处理:100 => 1%
96
96
 
97
97
  text = parseInt(temp, 10) + "%";
98
98
  }
99
99
 
100
- return text;
100
+ return {
101
+ text: text,
102
+ isBig: text.length > 6 && text.length <= 9,
103
+ isHide: text.length > 9
104
+ };
101
105
  };
102
106
 
103
107
  exports.renderDiscount = renderDiscount;
@@ -181,14 +185,14 @@ function (_super) {
181
185
  className: "discount-tag"
182
186
  }, isWill ? (0, _locale.i18n)('COMING_SOON') : data.discountPercent + "% " + (0, _locale.i18n)('OFF'))), /*#__PURE__*/_react["default"].createElement("div", {
183
187
  className: "content-wrap"
184
- }, /*#__PURE__*/_react["default"].createElement("div", {
188
+ }, showProName && panelProps.productName.open && /*#__PURE__*/_react["default"].createElement("div", {
185
189
  className: "product-name-wrap"
186
190
  }, /*#__PURE__*/_react["default"].createElement("div", {
187
191
  className: "box"
188
192
  }, prodLabels.length > 0 && /*#__PURE__*/_react["default"].createElement(_ImageLabel["default"], {
189
193
  labels: prodLabels,
190
194
  small: true
191
- }), showProName && panelProps.productName.open && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
195
+ }), /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
192
196
  data: __assign(__assign({}, panelProps.productName), {
193
197
  text: data.offerName
194
198
  }),
@@ -242,15 +246,18 @@ function (_super) {
242
246
  readonly: true
243
247
  }))), intelligentType === 'Coupon' && data.coupons && data.coupons.length > 0 && /*#__PURE__*/_react["default"].createElement("div", {
244
248
  className: "coupons-list"
245
- }, data.coupons.slice(0, 4).map(function (m) {
249
+ }, data.coupons.map(function (m) {
246
250
  return /*#__PURE__*/_react["default"].createElement("div", {
247
251
  key: m.couponId,
248
- className: (0, _classnames["default"])('item', m.discountMethod)
252
+ className: (0, _classnames["default"])('item', m.discountMethod, {
253
+ big: renderDiscount(m).isBig,
254
+ hide: renderDiscount(m).isHide
255
+ })
249
256
  }, /*#__PURE__*/_react["default"].createElement("div", {
250
257
  className: "name"
251
258
  }, (0, _locale.i18n)('DISCOUNT')), /*#__PURE__*/_react["default"].createElement("div", {
252
259
  className: "num"
253
- }, renderDiscount(m)));
260
+ }, renderDiscount(m).text));
254
261
  })), showProgress && /*#__PURE__*/_react["default"].createElement("div", {
255
262
  className: "progress-wrap"
256
263
  }, ((_j = panelProps.salesProgress) === null || _j === void 0 ? void 0 : _j.open) && /*#__PURE__*/_react["default"].createElement("div", {
@@ -10,7 +10,7 @@
10
10
  .img-wrap {
11
11
  position: relative;
12
12
  border-radius: 8px;
13
- overflow: hidden;
13
+ // overflow: hidden;
14
14
 
15
15
  .product-img {
16
16
  width: 140px;
@@ -156,6 +156,8 @@
156
156
  display: flex;
157
157
  flex-wrap: wrap;
158
158
  margin-top: 8px;
159
+ max-height: 48px;
160
+ overflow: hidden;
159
161
 
160
162
  .item {
161
163
  display: block;
@@ -164,7 +166,7 @@
164
166
  color: #F47A46;
165
167
  background: url('./imgs/coupon-orange.png') no-repeat center;
166
168
  background-size: 100% !important;
167
- margin-right: 6px;
169
+ margin-right: 5px;
168
170
  margin-bottom: 4px;
169
171
  line-height: 1;
170
172
  text-align: center;
@@ -175,6 +177,24 @@
175
177
  background: url('./imgs/coupon-red.png') no-repeat center;
176
178
  }
177
179
 
180
+ &.DISC.big {
181
+ background: url('./imgs/coupon-red-big.png') no-repeat center;
182
+ }
183
+
184
+ &.big {
185
+ width: 75px;
186
+ background: url('./imgs/coupon-orange-big.png') no-repeat center;
187
+
188
+ .num,
189
+ .name {
190
+ width: 62px;
191
+ }
192
+ }
193
+
194
+ &.hide {
195
+ display: none;
196
+ }
197
+
178
198
  .name {
179
199
  font-size: 5px;
180
200
  width: 40px;
@@ -239,6 +259,7 @@
239
259
 
240
260
  .img-wrap {
241
261
  border-radius: 8px 0 0 8px;
262
+ margin-right: 8px;
242
263
 
243
264
  .product-img {
244
265
  width: 100px;
@@ -76,12 +76,12 @@
76
76
  justify-content: flex-start;
77
77
  }
78
78
  .m-flash-deal-mobile .flash-deal-list-vertical .m-product-item-wrap {
79
- width: 2.84rem;
79
+ width: 2.44rem;
80
80
  margin-right: 0.16rem;
81
81
  }
82
82
  .m-flash-deal-mobile .flash-deal-list-vertical .m-product-item-wrap .product-img {
83
- height: 2.8rem;
84
- width: 2.8rem;
83
+ height: 2.4rem;
84
+ width: 2.4rem;
85
85
  }
86
86
  .m-flash-deal-mobile .flash-deal-list-horizontal {
87
87
  display: flex;
@@ -236,9 +236,9 @@ var defaultData = [{
236
236
  imgUrlContent: {
237
237
  url: _card["default"]
238
238
  },
239
- offerName: 'Product Name',
239
+ offerName: 'Product Name Long Long Long Long Long',
240
240
  salesPrice: 10000,
241
- specialPrice: 8000,
241
+ specialPrice: null,
242
242
  marketPrice: 20000,
243
243
  salePercent: 500,
244
244
  discountPercent: 90,
@@ -249,19 +249,19 @@ var defaultData = [{
249
249
  }, {
250
250
  couponId: '2',
251
251
  discountMethod: 'AMT',
252
- discountAmount: 10000
252
+ discountAmount: 100
253
253
  }, {
254
254
  couponId: '3',
255
- discountMethod: 'DISC',
256
- discountAmount: 30
255
+ discountMethod: 'AMT',
256
+ discountAmount: 1000
257
257
  }, {
258
258
  couponId: '4',
259
259
  discountMethod: 'AMT',
260
260
  discountAmount: 10000
261
261
  }, {
262
262
  couponId: '5',
263
- discountMethod: 'DISC',
264
- discountAmount: 30
263
+ discountMethod: 'AMT',
264
+ discountAmount: 100000
265
265
  }]
266
266
  }, {
267
267
  imgUrlContent: {
@@ -276,7 +276,7 @@ var defaultData = [{
276
276
  imgUrlContent: {
277
277
  url: _card["default"]
278
278
  },
279
- offerName: 'Product Name',
279
+ offerName: 'Product Name Long Long Long Long Long',
280
280
  salesPrice: 18000000,
281
281
  specialPrice: 18000000,
282
282
  marketPrice: 19000000,
@@ -857,6 +857,7 @@ function (_super) {
857
857
  return /*#__PURE__*/_react["default"].createElement(_MonpayProductItem["default"], {
858
858
  key: "scroll_" + item.productId,
859
859
  data: item,
860
+ fixHeight: true,
860
861
  imgHeight: imgHeight,
861
862
  imgWidth: imgWidth,
862
863
  intelligentType: (_a = groupSource[tabIndex]) === null || _a === void 0 ? void 0 : _a.intelligentType,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fonixtree/magic-design",
3
3
  "author": "Cylon Team",
4
- "version": "2.0.156",
4
+ "version": "2.0.158",
5
5
  "description": "Magic Design",
6
6
  "license": "MIT",
7
7
  "module": "es/index.js",