@fonixtree/magic-design 1.0.200 → 1.0.203

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.
@@ -121,7 +121,8 @@ function (_super) {
121
121
  imgHeight = _h.imgHeight,
122
122
  imgWidth = _h.imgWidth,
123
123
  unknownPrice = _h.unknownPrice,
124
- rest = __rest(_h, ["data", "type", "panelProps", "onItemClick", "showProName", "showProgress", "fixHeight", "layout", "imgHeight", "imgWidth", "unknownPrice"]);
124
+ hideLabels = _h.hideLabels,
125
+ rest = __rest(_h, ["data", "type", "panelProps", "onItemClick", "showProName", "showProgress", "fixHeight", "layout", "imgHeight", "imgWidth", "unknownPrice", "hideLabels"]);
125
126
 
126
127
  var promotions = (0, _businessUtil.getPromotionList)(data);
127
128
  var price = (0, _currencyUtil.formatCurrency)(data.salesPrice);
@@ -156,7 +157,42 @@ function (_super) {
156
157
  var salePercent = Number(data.salePercent) / 100 || 0;
157
158
  var imgStyle = {};
158
159
  if (imgWidth) imgStyle.width = imgWidth;
159
- if (imgHeight) imgStyle.height = imgHeight;
160
+ if (imgHeight) imgStyle.height = imgHeight; // data.labels = [
161
+ // {
162
+ // labelId: 118,
163
+ // labelClass: '1',
164
+ // labelName: 'label01',
165
+ // position: '1',
166
+ // imgUrl: '/get/resource/store0/conf/20250819/picture/label011957627063377092608_600.png',
167
+ // labelType: 'A',
168
+ // labelCode: null,
169
+ // effDate: '2025-08-18 00:00:00',
170
+ // expDate: '2025-10-31 23:59:59',
171
+ // },
172
+ // {
173
+ // labelId: 118,
174
+ // labelClass: '1',
175
+ // labelName: 'label01',
176
+ // position: '6',
177
+ // imgUrl: '/get/resource/store0/conf/20250819/picture/label011957627063377092608_600.png',
178
+ // labelType: 'A',
179
+ // labelCode: null,
180
+ // effDate: '2025-08-18 00:00:00',
181
+ // expDate: '2025-10-31 23:59:59',
182
+ // },
183
+ // {
184
+ // labelId: 118,
185
+ // labelClass: '1',
186
+ // labelName: 'label01',
187
+ // position: '7',
188
+ // imgUrl: '/get/resource/store0/conf/20250819/picture/label011957627063377092608_600.png',
189
+ // labelType: 'A',
190
+ // labelCode: null,
191
+ // effDate: '2025-08-18 00:00:00',
192
+ // expDate: '2025-10-31 23:59:59',
193
+ // },
194
+ // ];
195
+
160
196
  var imgLabels = ((_a = data.labels) === null || _a === void 0 ? void 0 : _a.filter(function (f) {
161
197
  return f.position !== '6' && f.position !== '7';
162
198
  })) || [];
@@ -209,7 +245,7 @@ function (_super) {
209
245
  lazy: true,
210
246
  src: (0, _commonUtil.convertImageUrl)(data.productImg || data.imgUrlContent || data.productImageUrlContent),
211
247
  style: imgStyle
212
- }), /*#__PURE__*/_react["default"].createElement(_ImageLabel["default"], {
248
+ }), !hideLabels && /*#__PURE__*/_react["default"].createElement(_ImageLabel["default"], {
213
249
  labels: imgLabels,
214
250
  small: true
215
251
  })), /*#__PURE__*/_react["default"].createElement("div", {
@@ -235,7 +271,7 @@ function (_super) {
235
271
  className: "product-name-wrap"
236
272
  }, /*#__PURE__*/_react["default"].createElement("div", {
237
273
  className: "box"
238
- }, prodLabels.length > 0 && /*#__PURE__*/_react["default"].createElement(_ImageLabel["default"], {
274
+ }, prodLabels.length > 0 && !hideLabels && /*#__PURE__*/_react["default"].createElement(_ImageLabel["default"], {
239
275
  labels: prodLabels,
240
276
  small: true
241
277
  }), showProName && panelProps.productName.open && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
@@ -253,7 +289,7 @@ function (_super) {
253
289
  text: _price
254
290
  }),
255
291
  readonly: true
256
- }), priceLabels.length > 0 && /*#__PURE__*/_react["default"].createElement(_ImageLabel["default"], {
292
+ }), priceLabels.length > 0 && !hideLabels && /*#__PURE__*/_react["default"].createElement(_ImageLabel["default"], {
257
293
  labels: priceLabels,
258
294
  small: true
259
295
  })), panelProps.salesPrice.open && (!!discount || oldPrice) && /*#__PURE__*/_react["default"].createElement("div", {
@@ -428,7 +428,8 @@ function (_super) {
428
428
  key: item.id,
429
429
  data: __assign(__assign({}, item), {
430
430
  salePercent: isWill ? 0 : item.salePercent
431
- }) // onItemClick={() => clickUrl(`/product/detail/${item.offerId}?productId=${item.sppProductId ?? ''}`)}
431
+ }),
432
+ hideLabels: isWill // onItemClick={() => clickUrl(`/product/detail/${item.offerId}?productId=${item.sppProductId ?? ''}`)}
432
433
  ,
433
434
  layout: ((_a = panelProps.customize.layout) === null || _a === void 0 ? void 0 : _a.h5Layout) === 'layout2' ? 'horizontal' : 'vertical',
434
435
  onItemClick: function onItemClick() {
@@ -31,6 +31,8 @@ var _mobx = require("../../../../../mobx");
31
31
 
32
32
  var _locale = require("../../../../../locale");
33
33
 
34
+ var _androidUtil = require("../../../../../utils/androidUtil");
35
+
34
36
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
35
37
 
36
38
  var __extends = void 0 && (void 0).__extends || function () {
@@ -151,10 +153,13 @@ function (_super) {
151
153
  autoplay = false;
152
154
  }
153
155
 
156
+ var hasAppBack = (0, _androidUtil.browserVersion)().isDitoApp && (0, _androidUtil.browserVersion)().isDitoMain || window.magicDesign.designMode;
154
157
  return /*#__PURE__*/_react["default"].createElement("div", {
155
158
  className: "m-search-banner-mobile"
156
159
  }, /*#__PURE__*/_react["default"].createElement("div", {
157
- className: "search-bar"
160
+ className: (0, _classnames["default"])('search-bar', {
161
+ with_app_back: hasAppBack
162
+ })
158
163
  }, /*#__PURE__*/_react["default"].createElement("div", {
159
164
  className: "right"
160
165
  }, data.content && ((_a = data.content.box) === null || _a === void 0 ? void 0 : _a.open) && /*#__PURE__*/_react["default"].createElement("div", {
@@ -9,9 +9,13 @@
9
9
  flex-direction: row-reverse;
10
10
  align-items: center;
11
11
  justify-content: space-between;
12
- width: 100%;
13
12
  position: absolute;
14
13
  z-index: 2;
14
+ width: 100%;
15
+ }
16
+ .m-search-banner-mobile .search-bar.with_app_back {
17
+ width: calc(100% - 0.7rem);
18
+ margin-left: 0.7rem;
15
19
  }
16
20
  .m-search-banner-mobile .search-bar .right {
17
21
  display: flex;
@@ -76,6 +76,8 @@
76
76
  display: flex;
77
77
  align-items: center;
78
78
  justify-content: center;
79
+ margin-left: 13px;
80
+ margin-top: 8px;
79
81
  }
80
82
  }
81
83
  }
@@ -201,13 +201,14 @@ var Renderer = function Renderer(props) {
201
201
  };
202
202
  };
203
203
 
204
+ console.log('window.magicDesign.designMode', window.magicDesign.designMode);
204
205
  return /*#__PURE__*/_react["default"].createElement("div", {
205
206
  className: "render_wrap",
206
207
  magic_design: "",
207
208
  style: __assign({
208
209
  background: pageBackground
209
210
  }, getRestStyle())
210
- }, floors.length > 0 && device === 'mobile' && /*#__PURE__*/_react["default"].createElement("div", {
211
+ }, floors.length > 0 && device === 'mobile' && window.magicDesign.designMode && /*#__PURE__*/_react["default"].createElement("div", {
211
212
  className: "btn_app_back"
212
213
  }, /*#__PURE__*/_react["default"].createElement(_Iconfont["default"], {
213
214
  color: "#fff",
@@ -27,7 +27,8 @@ var browserVersion = function browserVersion() {
27
27
  isDitoApp: u.indexOf('mydito') > -1,
28
28
  ditoAndroidApp: u.indexOf('mydito') > -1 && (u.indexOf('Android') > -1 || u.indexOf('Adr') > -1),
29
29
  ditoIosApp: u.indexOf('mydito') > -1 && !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),
30
- isAshitaApp: u.indexOf('app/ASHITA-APP') > -1
30
+ isAshitaApp: u.indexOf('app/ASHITA-APP') > -1,
31
+ isDitoMain: ['/', '/main/home'].includes(window.location.pathname)
31
32
  };
32
33
  };
33
34
 
@@ -121,7 +121,8 @@ function (_super) {
121
121
  imgHeight = _h.imgHeight,
122
122
  imgWidth = _h.imgWidth,
123
123
  unknownPrice = _h.unknownPrice,
124
- rest = __rest(_h, ["data", "type", "panelProps", "onItemClick", "showProName", "showProgress", "fixHeight", "layout", "imgHeight", "imgWidth", "unknownPrice"]);
124
+ hideLabels = _h.hideLabels,
125
+ rest = __rest(_h, ["data", "type", "panelProps", "onItemClick", "showProName", "showProgress", "fixHeight", "layout", "imgHeight", "imgWidth", "unknownPrice", "hideLabels"]);
125
126
 
126
127
  var promotions = (0, _businessUtil.getPromotionList)(data);
127
128
  var price = (0, _currencyUtil.formatCurrency)(data.salesPrice);
@@ -156,7 +157,42 @@ function (_super) {
156
157
  var salePercent = Number(data.salePercent) / 100 || 0;
157
158
  var imgStyle = {};
158
159
  if (imgWidth) imgStyle.width = imgWidth;
159
- if (imgHeight) imgStyle.height = imgHeight;
160
+ if (imgHeight) imgStyle.height = imgHeight; // data.labels = [
161
+ // {
162
+ // labelId: 118,
163
+ // labelClass: '1',
164
+ // labelName: 'label01',
165
+ // position: '1',
166
+ // imgUrl: '/get/resource/store0/conf/20250819/picture/label011957627063377092608_600.png',
167
+ // labelType: 'A',
168
+ // labelCode: null,
169
+ // effDate: '2025-08-18 00:00:00',
170
+ // expDate: '2025-10-31 23:59:59',
171
+ // },
172
+ // {
173
+ // labelId: 118,
174
+ // labelClass: '1',
175
+ // labelName: 'label01',
176
+ // position: '6',
177
+ // imgUrl: '/get/resource/store0/conf/20250819/picture/label011957627063377092608_600.png',
178
+ // labelType: 'A',
179
+ // labelCode: null,
180
+ // effDate: '2025-08-18 00:00:00',
181
+ // expDate: '2025-10-31 23:59:59',
182
+ // },
183
+ // {
184
+ // labelId: 118,
185
+ // labelClass: '1',
186
+ // labelName: 'label01',
187
+ // position: '7',
188
+ // imgUrl: '/get/resource/store0/conf/20250819/picture/label011957627063377092608_600.png',
189
+ // labelType: 'A',
190
+ // labelCode: null,
191
+ // effDate: '2025-08-18 00:00:00',
192
+ // expDate: '2025-10-31 23:59:59',
193
+ // },
194
+ // ];
195
+
160
196
  var imgLabels = ((_a = data.labels) === null || _a === void 0 ? void 0 : _a.filter(function (f) {
161
197
  return f.position !== '6' && f.position !== '7';
162
198
  })) || [];
@@ -209,7 +245,7 @@ function (_super) {
209
245
  lazy: true,
210
246
  src: (0, _commonUtil.convertImageUrl)(data.productImg || data.imgUrlContent || data.productImageUrlContent),
211
247
  style: imgStyle
212
- }), /*#__PURE__*/_react["default"].createElement(_ImageLabel["default"], {
248
+ }), !hideLabels && /*#__PURE__*/_react["default"].createElement(_ImageLabel["default"], {
213
249
  labels: imgLabels,
214
250
  small: true
215
251
  })), /*#__PURE__*/_react["default"].createElement("div", {
@@ -235,7 +271,7 @@ function (_super) {
235
271
  className: "product-name-wrap"
236
272
  }, /*#__PURE__*/_react["default"].createElement("div", {
237
273
  className: "box"
238
- }, prodLabels.length > 0 && /*#__PURE__*/_react["default"].createElement(_ImageLabel["default"], {
274
+ }, prodLabels.length > 0 && !hideLabels && /*#__PURE__*/_react["default"].createElement(_ImageLabel["default"], {
239
275
  labels: prodLabels,
240
276
  small: true
241
277
  }), showProName && panelProps.productName.open && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
@@ -253,7 +289,7 @@ function (_super) {
253
289
  text: _price
254
290
  }),
255
291
  readonly: true
256
- }), priceLabels.length > 0 && /*#__PURE__*/_react["default"].createElement(_ImageLabel["default"], {
292
+ }), priceLabels.length > 0 && !hideLabels && /*#__PURE__*/_react["default"].createElement(_ImageLabel["default"], {
257
293
  labels: priceLabels,
258
294
  small: true
259
295
  })), panelProps.salesPrice.open && (!!discount || oldPrice) && /*#__PURE__*/_react["default"].createElement("div", {
@@ -428,7 +428,8 @@ function (_super) {
428
428
  key: item.id,
429
429
  data: __assign(__assign({}, item), {
430
430
  salePercent: isWill ? 0 : item.salePercent
431
- }) // onItemClick={() => clickUrl(`/product/detail/${item.offerId}?productId=${item.sppProductId ?? ''}`)}
431
+ }),
432
+ hideLabels: isWill // onItemClick={() => clickUrl(`/product/detail/${item.offerId}?productId=${item.sppProductId ?? ''}`)}
432
433
  ,
433
434
  layout: ((_a = panelProps.customize.layout) === null || _a === void 0 ? void 0 : _a.h5Layout) === 'layout2' ? 'horizontal' : 'vertical',
434
435
  onItemClick: function onItemClick() {
@@ -31,6 +31,8 @@ var _mobx = require("../../../../../mobx");
31
31
 
32
32
  var _locale = require("../../../../../locale");
33
33
 
34
+ var _androidUtil = require("../../../../../utils/androidUtil");
35
+
34
36
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
35
37
 
36
38
  var __extends = void 0 && (void 0).__extends || function () {
@@ -151,10 +153,13 @@ function (_super) {
151
153
  autoplay = false;
152
154
  }
153
155
 
156
+ var hasAppBack = (0, _androidUtil.browserVersion)().isDitoApp && (0, _androidUtil.browserVersion)().isDitoMain || window.magicDesign.designMode;
154
157
  return /*#__PURE__*/_react["default"].createElement("div", {
155
158
  className: "m-search-banner-mobile"
156
159
  }, /*#__PURE__*/_react["default"].createElement("div", {
157
- className: "search-bar"
160
+ className: (0, _classnames["default"])('search-bar', {
161
+ with_app_back: hasAppBack
162
+ })
158
163
  }, /*#__PURE__*/_react["default"].createElement("div", {
159
164
  className: "right"
160
165
  }, data.content && ((_a = data.content.box) === null || _a === void 0 ? void 0 : _a.open) && /*#__PURE__*/_react["default"].createElement("div", {
@@ -9,9 +9,13 @@
9
9
  flex-direction: row-reverse;
10
10
  align-items: center;
11
11
  justify-content: space-between;
12
- width: 100%;
13
12
  position: absolute;
14
13
  z-index: 2;
14
+ width: 100%;
15
+ }
16
+ .m-search-banner-mobile .search-bar.with_app_back {
17
+ width: calc(100% - 0.7rem);
18
+ margin-left: 0.7rem;
15
19
  }
16
20
  .m-search-banner-mobile .search-bar .right {
17
21
  display: flex;
@@ -76,6 +76,8 @@
76
76
  display: flex;
77
77
  align-items: center;
78
78
  justify-content: center;
79
+ margin-left: 13px;
80
+ margin-top: 8px;
79
81
  }
80
82
  }
81
83
  }
@@ -201,13 +201,14 @@ var Renderer = function Renderer(props) {
201
201
  };
202
202
  };
203
203
 
204
+ console.log('window.magicDesign.designMode', window.magicDesign.designMode);
204
205
  return /*#__PURE__*/_react["default"].createElement("div", {
205
206
  className: "render_wrap",
206
207
  magic_design: "",
207
208
  style: __assign({
208
209
  background: pageBackground
209
210
  }, getRestStyle())
210
- }, floors.length > 0 && device === 'mobile' && /*#__PURE__*/_react["default"].createElement("div", {
211
+ }, floors.length > 0 && device === 'mobile' && window.magicDesign.designMode && /*#__PURE__*/_react["default"].createElement("div", {
211
212
  className: "btn_app_back"
212
213
  }, /*#__PURE__*/_react["default"].createElement(_Iconfont["default"], {
213
214
  color: "#fff",
@@ -27,7 +27,8 @@ var browserVersion = function browserVersion() {
27
27
  isDitoApp: u.indexOf('mydito') > -1,
28
28
  ditoAndroidApp: u.indexOf('mydito') > -1 && (u.indexOf('Android') > -1 || u.indexOf('Adr') > -1),
29
29
  ditoIosApp: u.indexOf('mydito') > -1 && !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),
30
- isAshitaApp: u.indexOf('app/ASHITA-APP') > -1
30
+ isAshitaApp: u.indexOf('app/ASHITA-APP') > -1,
31
+ isDitoMain: ['/', '/main/home'].includes(window.location.pathname)
31
32
  };
32
33
  };
33
34
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fonixtree/magic-design",
3
3
  "author": "Cylon Team",
4
- "version": "1.0.200",
4
+ "version": "1.0.203",
5
5
  "description": "Magic Design",
6
6
  "license": "MIT",
7
7
  "module": "es/index.js",