@fonixtree/magic-design 2.0.188 → 2.0.190

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 (33) hide show
  1. package/es/composite-comp/common/components/MonpayProductItem/index.less +6 -2
  2. package/es/composite-comp/dito/components/SearchBar/mobile/index.less +1 -0
  3. package/es/composite-comp/monpay/components/MonpayFlashDeal/mobile/index.js +30 -5
  4. package/es/composite-comp/public/components/Location/mobile/index.js +11 -19
  5. package/es/composite-comp/public/components/Stores/mobile/StoreItem/index.js +0 -1
  6. package/es/composite-comp/public/components/Stores/mobile/index.js +1 -1
  7. package/es/composite-comp/public/components/Wallet/mobile/index.js +4 -1
  8. package/es/constants/index.js +3 -1
  9. package/es/decorator/compositeDecorator.js +27 -1
  10. package/es/locale/ar/ar.json +1 -0
  11. package/es/locale/en/en.json +1 -0
  12. package/es/locale/es/es.json +1 -0
  13. package/es/locale/mn/mn.json +2 -1
  14. package/es/utils/businessUtil.js +27 -2
  15. package/es/utils/coreUtil.js +3 -1
  16. package/es/utils/dateUtil.js +14 -0
  17. package/lib/composite-comp/common/components/MonpayProductItem/index.less +6 -2
  18. package/lib/composite-comp/dito/components/SearchBar/mobile/index.less +1 -0
  19. package/lib/composite-comp/monpay/components/MonpayFlashDeal/mobile/index.js +30 -5
  20. package/lib/composite-comp/public/components/Location/mobile/index.js +11 -19
  21. package/lib/composite-comp/public/components/Stores/mobile/StoreItem/index.js +0 -1
  22. package/lib/composite-comp/public/components/Stores/mobile/index.js +1 -1
  23. package/lib/composite-comp/public/components/Wallet/mobile/index.js +4 -1
  24. package/lib/constants/index.js +3 -1
  25. package/lib/decorator/compositeDecorator.js +27 -1
  26. package/lib/locale/ar/ar.json +1 -0
  27. package/lib/locale/en/en.json +1 -0
  28. package/lib/locale/es/es.json +1 -0
  29. package/lib/locale/mn/mn.json +2 -1
  30. package/lib/utils/businessUtil.js +27 -2
  31. package/lib/utils/coreUtil.js +3 -1
  32. package/lib/utils/dateUtil.js +14 -0
  33. package/package.json +2 -2
@@ -7,16 +7,17 @@
7
7
  position: relative;
8
8
  margin-right: 16px;
9
9
  border-radius: 8px;
10
+ border: 1px solid #E4E4E4;
10
11
 
11
12
  .img-wrap {
12
13
  position: relative;
13
- border-radius: 8px;
14
+ border-radius: 8px 8px 0 0;
14
15
  // overflow: hidden;
15
16
 
16
17
  .product-img {
17
18
  width: 140px;
18
19
  height: 140px;
19
- border-radius: 8px;
20
+ border-radius: 8px 8px 0 0;
20
21
  object-fit: cover;
21
22
  }
22
23
 
@@ -31,6 +32,7 @@
31
32
  top: 15px;
32
33
  left: 0;
33
34
  }
35
+
34
36
  .giftL-tag {
35
37
  font-size: 12px;
36
38
  font-weight: 700;
@@ -40,6 +42,7 @@
40
42
  border-radius: 0 5px 5px 0;
41
43
  display: flex;
42
44
  align-items: center;
45
+
43
46
  .icon {
44
47
  margin-right: 4px;
45
48
  }
@@ -47,6 +50,7 @@
47
50
  }
48
51
 
49
52
  .content-wrap {
53
+ padding: 0 0 8px 10px;
50
54
 
51
55
  .promotions-wrap {
52
56
  display: flex;
@@ -35,6 +35,7 @@
35
35
  font-style: normal;
36
36
  font-weight: 400;
37
37
  font-size: 0.28rem;
38
+ outline: none;
38
39
  }
39
40
  .m-search-bar .right .message-wrap {
40
41
  position: relative;
@@ -11,8 +11,6 @@ require("./index.less");
11
11
 
12
12
  var _defImg = _interopRequireDefault(require("./imgs/defImg.png"));
13
13
 
14
- var _locale = require("../../../../../locale");
15
-
16
14
  var _MonpayProductItem = _interopRequireDefault(require("../../../../common/components/MonpayProductItem"));
17
15
 
18
16
  var _coreUtil = require("../../../../../utils/coreUtil");
@@ -23,6 +21,8 @@ var _commonUtil = require("../../../../../utils/commonUtil");
23
21
 
24
22
  var _storeUtil = require("../../../../../utils/storeUtil");
25
23
 
24
+ var _constants = require("../../../../../constants");
25
+
26
26
  var _dateUtil = require("../../../../../utils/dateUtil");
27
27
 
28
28
  var _MonpayCountDown = _interopRequireDefault(require("../MonpayCountDown"));
@@ -364,6 +364,31 @@ function (_super) {
364
364
  });
365
365
  };
366
366
 
367
+ _this.toLocale = function (value) {
368
+ var locale = (0, _storeUtil.getStore)(_constants.STORAGE_KEY.FISHX_LOCALE) || (0, _storeUtil.getStore)(_constants.STORAGE_KEY.LOCALE);
369
+
370
+ if (locale == 'mn') {
371
+ // const time = newDate('2024-10-13 10:11:00');
372
+ var time = (0, _dateUtil.newDate)(value);
373
+
374
+ var _hour = time.getHours() < 10 ? '0' + time.getHours() : time.getHours();
375
+
376
+ var _minutes = time.getMinutes() < 10 ? '0' + time.getMinutes() : time.getMinutes();
377
+
378
+ if ((0, _dateUtil.isTomorrow)(time)) {
379
+ return "\u041C\u0430\u0440\u0433\u0430\u0430\u0448, " + _hour + ":" + _minutes;
380
+ }
381
+
382
+ if ((0, _dateUtil.isToday)(time)) {
383
+ return "\u04E8\u043D\u04E9\u04E9\u0434\u04E9\u0440, " + _hour + ":" + _minutes;
384
+ } else {
385
+ return time.getMonth() + 1 + " \u0441\u0430\u0440\u044B\u043D " + time.getDate() + "-\u043D\u044B " + _hour + ":" + _minutes;
386
+ }
387
+ } else {
388
+ return (0, _dateUtil.formatDayMonthTime)(value);
389
+ }
390
+ };
391
+
367
392
  return _this;
368
393
  }
369
394
 
@@ -380,6 +405,8 @@ function (_super) {
380
405
  };
381
406
 
382
407
  FlashDealMobile.prototype.render = function () {
408
+ var _this = this;
409
+
383
410
  var panelProps = this.props.panelProps;
384
411
  var _a = this.state,
385
412
  times = _a.times,
@@ -426,9 +453,7 @@ function (_super) {
426
453
  }
427
454
  }, /*#__PURE__*/_react["default"].createElement("div", {
428
455
  className: "time"
429
- }, (0, _dateUtil.formatDayMonthTime)(item.effDate)), /*#__PURE__*/_react["default"].createElement("div", {
430
- className: "status"
431
- }, item.cmpState === 'A' ? (0, _locale.i18n)('COMING_SOON') : (0, _locale.i18n)('ON_GOING')));
456
+ }, _this.toLocale(item.effDate)));
432
457
  })), /*#__PURE__*/_react["default"].createElement("div", {
433
458
  className: "flash-deal-list"
434
459
  }, _list.map(function (item) {
@@ -19,7 +19,9 @@ var _common = require("../../../../../common");
19
19
 
20
20
  var _locale = require("../../../../../locale");
21
21
 
22
- var _androidUtil = require("../../../../../utils/androidUtil");
22
+ var _storeUtil = require("../../../../../utils/storeUtil");
23
+
24
+ var _coreUtil = require("../../../../../utils/coreUtil");
23
25
 
24
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
25
27
 
@@ -74,34 +76,24 @@ function (_super) {
74
76
  var _this = _super !== null && _super.apply(this, arguments) || this;
75
77
 
76
78
  _this.state = {};
77
-
78
- _this.switchLanguage = function (value) {
79
- alert(value);
80
- };
81
-
82
- _this.getUserAddress = function (value) {
83
- alert(value);
84
- };
85
-
86
79
  return _this;
87
80
  }
88
81
 
89
- MerchantSalesMobile.prototype.componentDidMount = function () {
90
- if ((0, _androidUtil.browserVersion)().isDelivistaApp) {
91
- window.magicDesign.switchLanguage = this.switchLanguage;
92
- window.magicDesign.getUserAddress = this.getUserAddress;
93
- }
94
- };
82
+ MerchantSalesMobile.prototype.componentDidMount = function () {};
95
83
 
96
84
  MerchantSalesMobile.prototype.render = function () {
97
85
  var _a;
98
86
 
99
87
  var panelProps = this.props.panelProps;
88
+ var info = (0, _storeUtil.getStore)('USER_ADDRESS_INFO') || {};
89
+ var customerInfo = info.customer ? info.customer + " " + info.tel : (0, _locale.i18n)('CAN_BE_ADDED_AS_YOUR_ADDRESS');
100
90
  return /*#__PURE__*/_react["default"].createElement("div", {
101
91
  className: (0, _classnames["default"])('m-location-mobile', (_a = {}, _a['reversed-layout'] = (0, _commonUtil.needReverse)(), _a))
102
92
  }, /*#__PURE__*/_react["default"].createElement("div", {
103
93
  className: "address-wrap",
104
- onClick: function onClick() {}
94
+ onClick: function onClick() {
95
+ return (0, _coreUtil.clickUrl)('/location');
96
+ }
105
97
  }, /*#__PURE__*/_react["default"].createElement("div", {
106
98
  className: "address-bg",
107
99
  style: {
@@ -116,12 +108,12 @@ function (_super) {
116
108
  }, panelProps.content.address.open && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
117
109
  className: "address one_row",
118
110
  data: __assign(__assign({}, panelProps.content.address), {
119
- text: (0, _locale.i18n)('DISPLAY_LOCATION_ADDRESS')
111
+ text: (0, _coreUtil.isDesignMode)() ? (0, _locale.i18n)('DISPLAY_LOCATION_ADDRESS') : info.address
120
112
  })
121
113
  }), panelProps.content.customer.open && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
122
114
  className: "customer one_row",
123
115
  data: __assign(__assign({}, panelProps.content.customer), {
124
- text: (0, _locale.i18n)('CUSTOMER_NAME_AND_PHONE_NUMBER')
116
+ text: (0, _coreUtil.isDesignMode)() ? (0, _locale.i18n)('CUSTOMER_NAME_AND_PHONE_NUMBER') : customerInfo
125
117
  })
126
118
  })), panelProps.content.arrowIcon.open && /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
127
119
  className: "reversed-icon",
@@ -101,7 +101,6 @@ function (_super) {
101
101
  rest = __rest(_a, ["data", "panelProps", "onItemClick", "layout"]);
102
102
 
103
103
  var soldNumber = data.salesCnt > 250 ? "" + (data.salesCnt - data.salesCnt % 250) : data.salesCnt || 0;
104
- console.log(panelProps);
105
104
  var storeName = panelProps.storeName,
106
105
  storeDesc = panelProps.storeDesc,
107
106
  freeDeliveryLabel = panelProps.freeDeliveryLabel,
@@ -318,7 +318,7 @@ function (_super) {
318
318
  data: __assign({}, item),
319
319
  layout: panelProps.customize.layout,
320
320
  onItemClick: function onItemClick() {
321
- return (0, _coreUtil.clickUrl)("store-" + item.storeId + "}");
321
+ return (0, _coreUtil.clickUrl)("store-" + item.storeId);
322
322
  },
323
323
  panelProps: panelProps.content
324
324
  });
@@ -282,6 +282,7 @@ function (_super) {
282
282
  var _this = this;
283
283
 
284
284
  var data = this.props.data;
285
+ console.log('data: ', data);
285
286
  var _a = this.state,
286
287
  balance = _a.balance,
287
288
  cenduit = _a.cenduit;
@@ -289,6 +290,8 @@ function (_super) {
289
290
  return /*#__PURE__*/_react["default"].createElement("div", {
290
291
  className: "m-wallet"
291
292
  }, data.groupSource.map(function (group, index) {
293
+ var _a;
294
+
292
295
  return /*#__PURE__*/_react["default"].createElement("div", {
293
296
  key: group.id,
294
297
  className: "wallet-item",
@@ -297,7 +300,7 @@ function (_super) {
297
300
  }
298
301
  }, /*#__PURE__*/_react["default"].createElement("div", {
299
302
  className: "item-head"
300
- }, group.logo.open && /*#__PURE__*/_react["default"].createElement(_components.MetaImage, {
303
+ }, ((_a = group === null || group === void 0 ? void 0 : group.logo) === null || _a === void 0 ? void 0 : _a.open) && /*#__PURE__*/_react["default"].createElement(_components.MetaImage, {
301
304
  data: group.logo,
302
305
  GAData: GAData,
303
306
  style: (0, _commonUtil.pxToRem)({
@@ -133,6 +133,7 @@ var campaignTypes = {
133
133
  exports.campaignTypes = campaignTypes;
134
134
  var urlType = {
135
135
  PRODUCT_DETAIL: 'proDetail',
136
+ STORE: 'store',
136
137
  CATG_PROD_LIST: 'catg',
137
138
  CUSTOMIZED: 'customized',
138
139
  PROD_FILTER: 'filter',
@@ -162,7 +163,8 @@ var urlTypeMap = {
162
163
  INTERESTED_MERCHANTS: 'InterestedMerchants',
163
164
  INTERESTED_PRODUCTS: 'InterestedProducts',
164
165
  MERCHANT_STORY: 'MerchantStory',
165
- AFFILIATE_MISSION_DETAIL: 'AffiliateMissionDetail'
166
+ AFFILIATE_MISSION_DETAIL: 'AffiliateMissionDetail',
167
+ BUSINESS_TYPE: 'Business Type'
166
168
  };
167
169
  exports.urlTypeMap = urlTypeMap;
168
170
  var respCodeMap = {
@@ -15,6 +15,8 @@ var _constants = require("../constants");
15
15
 
16
16
  var _commonUtil = require("../utils/commonUtil");
17
17
 
18
+ var _storeUtil = require("../utils/storeUtil");
19
+
18
20
  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); }
19
21
 
20
22
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -84,8 +86,27 @@ function compositeDecorator(WrappedComponent) {
84
86
  _this.state = {
85
87
  clickedFloor: '',
86
88
  hoveredFloor: ''
89
+ };
90
+
91
+ _this.switchLanguage = function (value) {
92
+ alert(value); // const lang = 'ar';
93
+
94
+ (0, _storeUtil.setStore)(_constants.STORAGE_KEY.LOCALE, value);
95
+ };
96
+
97
+ _this.getUserAddress = function (value) {
98
+ alert(value); // const info = {
99
+ // address: '简短地址',
100
+ // customer: '客户名称',
101
+ // tel: '客户手机号',
102
+ // longitude: '经度',
103
+ // latitude: '纬度',
104
+ // };
105
+
106
+ (0, _storeUtil.setStore)('USER_ADDRESS_INFO', value);
87
107
  }; // 复合组件点击事件
88
108
 
109
+
89
110
  _this.onCompositeCompClick = function (event) {
90
111
  if (window.magicDesign.mode === 'renderer') {
91
112
  return;
@@ -266,7 +287,12 @@ function compositeDecorator(WrappedComponent) {
266
287
  hoveredFloor: _mobx.store.hoveredFloor
267
288
  });
268
289
  });
269
- this.getOuterWrapStyle();
290
+ this.getOuterWrapStyle(); // if (browserVersion().isDelivistaApp) {
291
+
292
+ window['switchLanguage'] = this.switchLanguage;
293
+ window['getUserAddress'] = this.getUserAddress; // switchLanguage();
294
+ // getUserAddress();
295
+ // }
270
296
  };
271
297
 
272
298
  Wrapper.prototype.componentWillUnmount = function () {
@@ -1,4 +1,5 @@
1
1
  {
2
+ "CAN_BE_ADDED_AS_YOUR_ADDRESS": "Can be added as your address",
2
3
  "GIFT": "Gift",
3
4
  "SEARCH_FOR_PRODUCT_OR_SHOP": "Search for product or shop",
4
5
  "MIN_ORDER": "Min Order",
@@ -1,4 +1,5 @@
1
1
  {
2
+ "CAN_BE_ADDED_AS_YOUR_ADDRESS": "Can be added as your address",
2
3
  "GIFT": "Gift",
3
4
  "SEARCH_FOR_PRODUCT_OR_SHOP": "Search for product or shop",
4
5
  "MIN_ORDER": "Min Order",
@@ -1,4 +1,5 @@
1
1
  {
2
+ "CAN_BE_ADDED_AS_YOUR_ADDRESS": "Can be added as your address",
2
3
  "GIFT": "Gift",
3
4
  "SEARCH_FOR_PRODUCT_OR_SHOP": "Search for product or shop",
4
5
  "MIN_ORDER": "Min Order",
@@ -1,4 +1,5 @@
1
1
  {
2
+ "CAN_BE_ADDED_AS_YOUR_ADDRESS": "Can be added as your address",
2
3
  "GIFT": "Бэлэгтэй",
3
4
  "SEARCH_FOR_PRODUCT_OR_SHOP": "Search for product or shop",
4
5
  "MIN_ORDER": "Min Order",
@@ -171,7 +172,7 @@
171
172
  "COUPON": "Купон",
172
173
  "HEADER_IMAGE": "Толгойн зураг",
173
174
  "ACTIVITY_LABEL": "Үйл ажиллагааны шошго",
174
- "STOCK": "Хувьцаа",
175
+ "STOCK": "Үлдэгдэл",
175
176
  "DISCOUNT_LABEL": "Хөнгөлөлтийн шошго",
176
177
  "SESSION_TIME": "Сеанс цаг",
177
178
  "COUNTDOWN": "Countdown",
@@ -267,6 +267,18 @@ var newParseUrl = function newParseUrl(urlObj) {
267
267
  };
268
268
  break;
269
269
 
270
+ case _constants.urlTypeMap.BUSINESS_TYPE:
271
+ // 业态列表
272
+ link = '';
273
+ params = {
274
+ action: 'jump',
275
+ params: {
276
+ type: 'SEARCH_STORE_LIST_PAGE',
277
+ storeBizTypeId: value
278
+ }
279
+ };
280
+ break;
281
+
270
282
  default:
271
283
  var map = {
272
284
  '/main/cart': 'CART',
@@ -285,7 +297,8 @@ var newParseUrl = function newParseUrl(urlObj) {
285
297
  '/account/wallet': 'WEBVIEW',
286
298
  '/product/GroupBuy': 'GROUP',
287
299
  '/search-page': 'SEARCH_PAGE',
288
- '/commission': 'COMMISSION'
300
+ '/commission': 'COMMISSION',
301
+ '/location': 'ADD_ADDRESS_PAGE'
289
302
  };
290
303
  var typeTemp = map[link];
291
304
 
@@ -370,6 +383,17 @@ var parseUrl = function parseUrl(url) {
370
383
  }
371
384
  };
372
385
  break;
386
+
387
+ case _constants.urlType.STORE:
388
+ // 店铺详情
389
+ params = {
390
+ action: 'jump',
391
+ params: {
392
+ type: 'STORE',
393
+ storeId: arg1
394
+ }
395
+ };
396
+ break;
373
397
  // 海报页面
374
398
 
375
399
  case _constants.urlType.CUSTOMIZED:
@@ -451,7 +475,8 @@ var parseUrl = function parseUrl(url) {
451
475
  '/product/GroupBuy': 'GROUP',
452
476
  '/search-page': 'SEARCH_PAGE',
453
477
  '/main/my-commission': 'WALLET',
454
- '/commission': 'COMMISSION'
478
+ '/commission': 'COMMISSION',
479
+ '/location': 'ADD_ADDRESS_PAGE'
455
480
  };
456
481
  link = url;
457
482
  params = {
@@ -335,7 +335,9 @@ var clickUrl = function clickUrl(url, state) {
335
335
  return;
336
336
  }
337
337
 
338
- if ((0, _androidUtil.browserVersion)().isAshitaApp || (0, _androidUtil.browserVersion)().flutterApp) {
338
+ console.log('sendToApp', data);
339
+
340
+ if ((0, _androidUtil.browserVersion)().isAshitaApp || (0, _androidUtil.browserVersion)().flutterApp || (0, _androidUtil.browserVersion)().isDelivistaApp) {
339
341
  (0, _androidUtil.sendToApp)(data);
340
342
  } else if ((0, _androidUtil.browserVersion)().isApp && params.link && params.link.startsWith('http')) {
341
343
  // 跳转链接是个绝对路径
@@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.formatDateTime = exports.formatDateMinute = exports.formatDate = void 0;
7
7
  exports.formatDayMonth = formatDayMonth;
8
8
  exports.formatDayMonthTime = formatDayMonthTime;
9
+ exports.isToday = isToday;
10
+ exports.isTomorrow = isTomorrow;
9
11
  exports.newDate = void 0;
10
12
 
11
13
  var _moment = _interopRequireDefault(require("moment"));
@@ -80,4 +82,16 @@ function formatDayMonthTime(date, fmt) {
80
82
  }
81
83
 
82
84
  return (0, _moment["default"])(newDate(date)).format(fmt);
85
+ }
86
+
87
+ function isToday(date) {
88
+ var now = new Date();
89
+ var tomorrow = new Date(now.getFullYear(), now.getMonth(), now.getDate());
90
+ return date.getDate() === tomorrow.getDate() && date.getMonth() === tomorrow.getMonth() && date.getFullYear() === tomorrow.getFullYear();
91
+ }
92
+
93
+ function isTomorrow(date) {
94
+ var now = new Date();
95
+ var tomorrow = new Date(now.getFullYear(), now.getMonth(), now.getDate() + 1);
96
+ return date.getDate() === tomorrow.getDate() && date.getMonth() === tomorrow.getMonth() && date.getFullYear() === tomorrow.getFullYear();
83
97
  }
@@ -7,16 +7,17 @@
7
7
  position: relative;
8
8
  margin-right: 16px;
9
9
  border-radius: 8px;
10
+ border: 1px solid #E4E4E4;
10
11
 
11
12
  .img-wrap {
12
13
  position: relative;
13
- border-radius: 8px;
14
+ border-radius: 8px 8px 0 0;
14
15
  // overflow: hidden;
15
16
 
16
17
  .product-img {
17
18
  width: 140px;
18
19
  height: 140px;
19
- border-radius: 8px;
20
+ border-radius: 8px 8px 0 0;
20
21
  object-fit: cover;
21
22
  }
22
23
 
@@ -31,6 +32,7 @@
31
32
  top: 15px;
32
33
  left: 0;
33
34
  }
35
+
34
36
  .giftL-tag {
35
37
  font-size: 12px;
36
38
  font-weight: 700;
@@ -40,6 +42,7 @@
40
42
  border-radius: 0 5px 5px 0;
41
43
  display: flex;
42
44
  align-items: center;
45
+
43
46
  .icon {
44
47
  margin-right: 4px;
45
48
  }
@@ -47,6 +50,7 @@
47
50
  }
48
51
 
49
52
  .content-wrap {
53
+ padding: 0 0 8px 10px;
50
54
 
51
55
  .promotions-wrap {
52
56
  display: flex;
@@ -35,6 +35,7 @@
35
35
  font-style: normal;
36
36
  font-weight: 400;
37
37
  font-size: 0.28rem;
38
+ outline: none;
38
39
  }
39
40
  .m-search-bar .right .message-wrap {
40
41
  position: relative;
@@ -11,8 +11,6 @@ require("./index.less");
11
11
 
12
12
  var _defImg = _interopRequireDefault(require("./imgs/defImg.png"));
13
13
 
14
- var _locale = require("../../../../../locale");
15
-
16
14
  var _MonpayProductItem = _interopRequireDefault(require("../../../../common/components/MonpayProductItem"));
17
15
 
18
16
  var _coreUtil = require("../../../../../utils/coreUtil");
@@ -23,6 +21,8 @@ var _commonUtil = require("../../../../../utils/commonUtil");
23
21
 
24
22
  var _storeUtil = require("../../../../../utils/storeUtil");
25
23
 
24
+ var _constants = require("../../../../../constants");
25
+
26
26
  var _dateUtil = require("../../../../../utils/dateUtil");
27
27
 
28
28
  var _MonpayCountDown = _interopRequireDefault(require("../MonpayCountDown"));
@@ -364,6 +364,31 @@ function (_super) {
364
364
  });
365
365
  };
366
366
 
367
+ _this.toLocale = function (value) {
368
+ var locale = (0, _storeUtil.getStore)(_constants.STORAGE_KEY.FISHX_LOCALE) || (0, _storeUtil.getStore)(_constants.STORAGE_KEY.LOCALE);
369
+
370
+ if (locale == 'mn') {
371
+ // const time = newDate('2024-10-13 10:11:00');
372
+ var time = (0, _dateUtil.newDate)(value);
373
+
374
+ var _hour = time.getHours() < 10 ? '0' + time.getHours() : time.getHours();
375
+
376
+ var _minutes = time.getMinutes() < 10 ? '0' + time.getMinutes() : time.getMinutes();
377
+
378
+ if ((0, _dateUtil.isTomorrow)(time)) {
379
+ return "\u041C\u0430\u0440\u0433\u0430\u0430\u0448, " + _hour + ":" + _minutes;
380
+ }
381
+
382
+ if ((0, _dateUtil.isToday)(time)) {
383
+ return "\u04E8\u043D\u04E9\u04E9\u0434\u04E9\u0440, " + _hour + ":" + _minutes;
384
+ } else {
385
+ return time.getMonth() + 1 + " \u0441\u0430\u0440\u044B\u043D " + time.getDate() + "-\u043D\u044B " + _hour + ":" + _minutes;
386
+ }
387
+ } else {
388
+ return (0, _dateUtil.formatDayMonthTime)(value);
389
+ }
390
+ };
391
+
367
392
  return _this;
368
393
  }
369
394
 
@@ -380,6 +405,8 @@ function (_super) {
380
405
  };
381
406
 
382
407
  FlashDealMobile.prototype.render = function () {
408
+ var _this = this;
409
+
383
410
  var panelProps = this.props.panelProps;
384
411
  var _a = this.state,
385
412
  times = _a.times,
@@ -426,9 +453,7 @@ function (_super) {
426
453
  }
427
454
  }, /*#__PURE__*/_react["default"].createElement("div", {
428
455
  className: "time"
429
- }, (0, _dateUtil.formatDayMonthTime)(item.effDate)), /*#__PURE__*/_react["default"].createElement("div", {
430
- className: "status"
431
- }, item.cmpState === 'A' ? (0, _locale.i18n)('COMING_SOON') : (0, _locale.i18n)('ON_GOING')));
456
+ }, _this.toLocale(item.effDate)));
432
457
  })), /*#__PURE__*/_react["default"].createElement("div", {
433
458
  className: "flash-deal-list"
434
459
  }, _list.map(function (item) {
@@ -19,7 +19,9 @@ var _common = require("../../../../../common");
19
19
 
20
20
  var _locale = require("../../../../../locale");
21
21
 
22
- var _androidUtil = require("../../../../../utils/androidUtil");
22
+ var _storeUtil = require("../../../../../utils/storeUtil");
23
+
24
+ var _coreUtil = require("../../../../../utils/coreUtil");
23
25
 
24
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
25
27
 
@@ -74,34 +76,24 @@ function (_super) {
74
76
  var _this = _super !== null && _super.apply(this, arguments) || this;
75
77
 
76
78
  _this.state = {};
77
-
78
- _this.switchLanguage = function (value) {
79
- alert(value);
80
- };
81
-
82
- _this.getUserAddress = function (value) {
83
- alert(value);
84
- };
85
-
86
79
  return _this;
87
80
  }
88
81
 
89
- MerchantSalesMobile.prototype.componentDidMount = function () {
90
- if ((0, _androidUtil.browserVersion)().isDelivistaApp) {
91
- window.magicDesign.switchLanguage = this.switchLanguage;
92
- window.magicDesign.getUserAddress = this.getUserAddress;
93
- }
94
- };
82
+ MerchantSalesMobile.prototype.componentDidMount = function () {};
95
83
 
96
84
  MerchantSalesMobile.prototype.render = function () {
97
85
  var _a;
98
86
 
99
87
  var panelProps = this.props.panelProps;
88
+ var info = (0, _storeUtil.getStore)('USER_ADDRESS_INFO') || {};
89
+ var customerInfo = info.customer ? info.customer + " " + info.tel : (0, _locale.i18n)('CAN_BE_ADDED_AS_YOUR_ADDRESS');
100
90
  return /*#__PURE__*/_react["default"].createElement("div", {
101
91
  className: (0, _classnames["default"])('m-location-mobile', (_a = {}, _a['reversed-layout'] = (0, _commonUtil.needReverse)(), _a))
102
92
  }, /*#__PURE__*/_react["default"].createElement("div", {
103
93
  className: "address-wrap",
104
- onClick: function onClick() {}
94
+ onClick: function onClick() {
95
+ return (0, _coreUtil.clickUrl)('/location');
96
+ }
105
97
  }, /*#__PURE__*/_react["default"].createElement("div", {
106
98
  className: "address-bg",
107
99
  style: {
@@ -116,12 +108,12 @@ function (_super) {
116
108
  }, panelProps.content.address.open && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
117
109
  className: "address one_row",
118
110
  data: __assign(__assign({}, panelProps.content.address), {
119
- text: (0, _locale.i18n)('DISPLAY_LOCATION_ADDRESS')
111
+ text: (0, _coreUtil.isDesignMode)() ? (0, _locale.i18n)('DISPLAY_LOCATION_ADDRESS') : info.address
120
112
  })
121
113
  }), panelProps.content.customer.open && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
122
114
  className: "customer one_row",
123
115
  data: __assign(__assign({}, panelProps.content.customer), {
124
- text: (0, _locale.i18n)('CUSTOMER_NAME_AND_PHONE_NUMBER')
116
+ text: (0, _coreUtil.isDesignMode)() ? (0, _locale.i18n)('CUSTOMER_NAME_AND_PHONE_NUMBER') : customerInfo
125
117
  })
126
118
  })), panelProps.content.arrowIcon.open && /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
127
119
  className: "reversed-icon",
@@ -101,7 +101,6 @@ function (_super) {
101
101
  rest = __rest(_a, ["data", "panelProps", "onItemClick", "layout"]);
102
102
 
103
103
  var soldNumber = data.salesCnt > 250 ? "" + (data.salesCnt - data.salesCnt % 250) : data.salesCnt || 0;
104
- console.log(panelProps);
105
104
  var storeName = panelProps.storeName,
106
105
  storeDesc = panelProps.storeDesc,
107
106
  freeDeliveryLabel = panelProps.freeDeliveryLabel,
@@ -318,7 +318,7 @@ function (_super) {
318
318
  data: __assign({}, item),
319
319
  layout: panelProps.customize.layout,
320
320
  onItemClick: function onItemClick() {
321
- return (0, _coreUtil.clickUrl)("store-" + item.storeId + "}");
321
+ return (0, _coreUtil.clickUrl)("store-" + item.storeId);
322
322
  },
323
323
  panelProps: panelProps.content
324
324
  });
@@ -282,6 +282,7 @@ function (_super) {
282
282
  var _this = this;
283
283
 
284
284
  var data = this.props.data;
285
+ console.log('data: ', data);
285
286
  var _a = this.state,
286
287
  balance = _a.balance,
287
288
  cenduit = _a.cenduit;
@@ -289,6 +290,8 @@ function (_super) {
289
290
  return /*#__PURE__*/_react["default"].createElement("div", {
290
291
  className: "m-wallet"
291
292
  }, data.groupSource.map(function (group, index) {
293
+ var _a;
294
+
292
295
  return /*#__PURE__*/_react["default"].createElement("div", {
293
296
  key: group.id,
294
297
  className: "wallet-item",
@@ -297,7 +300,7 @@ function (_super) {
297
300
  }
298
301
  }, /*#__PURE__*/_react["default"].createElement("div", {
299
302
  className: "item-head"
300
- }, group.logo.open && /*#__PURE__*/_react["default"].createElement(_components.MetaImage, {
303
+ }, ((_a = group === null || group === void 0 ? void 0 : group.logo) === null || _a === void 0 ? void 0 : _a.open) && /*#__PURE__*/_react["default"].createElement(_components.MetaImage, {
301
304
  data: group.logo,
302
305
  GAData: GAData,
303
306
  style: (0, _commonUtil.pxToRem)({
@@ -133,6 +133,7 @@ var campaignTypes = {
133
133
  exports.campaignTypes = campaignTypes;
134
134
  var urlType = {
135
135
  PRODUCT_DETAIL: 'proDetail',
136
+ STORE: 'store',
136
137
  CATG_PROD_LIST: 'catg',
137
138
  CUSTOMIZED: 'customized',
138
139
  PROD_FILTER: 'filter',
@@ -162,7 +163,8 @@ var urlTypeMap = {
162
163
  INTERESTED_MERCHANTS: 'InterestedMerchants',
163
164
  INTERESTED_PRODUCTS: 'InterestedProducts',
164
165
  MERCHANT_STORY: 'MerchantStory',
165
- AFFILIATE_MISSION_DETAIL: 'AffiliateMissionDetail'
166
+ AFFILIATE_MISSION_DETAIL: 'AffiliateMissionDetail',
167
+ BUSINESS_TYPE: 'Business Type'
166
168
  };
167
169
  exports.urlTypeMap = urlTypeMap;
168
170
  var respCodeMap = {
@@ -15,6 +15,8 @@ var _constants = require("../constants");
15
15
 
16
16
  var _commonUtil = require("../utils/commonUtil");
17
17
 
18
+ var _storeUtil = require("../utils/storeUtil");
19
+
18
20
  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); }
19
21
 
20
22
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -84,8 +86,27 @@ function compositeDecorator(WrappedComponent) {
84
86
  _this.state = {
85
87
  clickedFloor: '',
86
88
  hoveredFloor: ''
89
+ };
90
+
91
+ _this.switchLanguage = function (value) {
92
+ alert(value); // const lang = 'ar';
93
+
94
+ (0, _storeUtil.setStore)(_constants.STORAGE_KEY.LOCALE, value);
95
+ };
96
+
97
+ _this.getUserAddress = function (value) {
98
+ alert(value); // const info = {
99
+ // address: '简短地址',
100
+ // customer: '客户名称',
101
+ // tel: '客户手机号',
102
+ // longitude: '经度',
103
+ // latitude: '纬度',
104
+ // };
105
+
106
+ (0, _storeUtil.setStore)('USER_ADDRESS_INFO', value);
87
107
  }; // 复合组件点击事件
88
108
 
109
+
89
110
  _this.onCompositeCompClick = function (event) {
90
111
  if (window.magicDesign.mode === 'renderer') {
91
112
  return;
@@ -266,7 +287,12 @@ function compositeDecorator(WrappedComponent) {
266
287
  hoveredFloor: _mobx.store.hoveredFloor
267
288
  });
268
289
  });
269
- this.getOuterWrapStyle();
290
+ this.getOuterWrapStyle(); // if (browserVersion().isDelivistaApp) {
291
+
292
+ window['switchLanguage'] = this.switchLanguage;
293
+ window['getUserAddress'] = this.getUserAddress; // switchLanguage();
294
+ // getUserAddress();
295
+ // }
270
296
  };
271
297
 
272
298
  Wrapper.prototype.componentWillUnmount = function () {
@@ -1,4 +1,5 @@
1
1
  {
2
+ "CAN_BE_ADDED_AS_YOUR_ADDRESS": "Can be added as your address",
2
3
  "GIFT": "Gift",
3
4
  "SEARCH_FOR_PRODUCT_OR_SHOP": "Search for product or shop",
4
5
  "MIN_ORDER": "Min Order",
@@ -1,4 +1,5 @@
1
1
  {
2
+ "CAN_BE_ADDED_AS_YOUR_ADDRESS": "Can be added as your address",
2
3
  "GIFT": "Gift",
3
4
  "SEARCH_FOR_PRODUCT_OR_SHOP": "Search for product or shop",
4
5
  "MIN_ORDER": "Min Order",
@@ -1,4 +1,5 @@
1
1
  {
2
+ "CAN_BE_ADDED_AS_YOUR_ADDRESS": "Can be added as your address",
2
3
  "GIFT": "Gift",
3
4
  "SEARCH_FOR_PRODUCT_OR_SHOP": "Search for product or shop",
4
5
  "MIN_ORDER": "Min Order",
@@ -1,4 +1,5 @@
1
1
  {
2
+ "CAN_BE_ADDED_AS_YOUR_ADDRESS": "Can be added as your address",
2
3
  "GIFT": "Бэлэгтэй",
3
4
  "SEARCH_FOR_PRODUCT_OR_SHOP": "Search for product or shop",
4
5
  "MIN_ORDER": "Min Order",
@@ -171,7 +172,7 @@
171
172
  "COUPON": "Купон",
172
173
  "HEADER_IMAGE": "Толгойн зураг",
173
174
  "ACTIVITY_LABEL": "Үйл ажиллагааны шошго",
174
- "STOCK": "Хувьцаа",
175
+ "STOCK": "Үлдэгдэл",
175
176
  "DISCOUNT_LABEL": "Хөнгөлөлтийн шошго",
176
177
  "SESSION_TIME": "Сеанс цаг",
177
178
  "COUNTDOWN": "Countdown",
@@ -267,6 +267,18 @@ var newParseUrl = function newParseUrl(urlObj) {
267
267
  };
268
268
  break;
269
269
 
270
+ case _constants.urlTypeMap.BUSINESS_TYPE:
271
+ // 业态列表
272
+ link = '';
273
+ params = {
274
+ action: 'jump',
275
+ params: {
276
+ type: 'SEARCH_STORE_LIST_PAGE',
277
+ storeBizTypeId: value
278
+ }
279
+ };
280
+ break;
281
+
270
282
  default:
271
283
  var map = {
272
284
  '/main/cart': 'CART',
@@ -285,7 +297,8 @@ var newParseUrl = function newParseUrl(urlObj) {
285
297
  '/account/wallet': 'WEBVIEW',
286
298
  '/product/GroupBuy': 'GROUP',
287
299
  '/search-page': 'SEARCH_PAGE',
288
- '/commission': 'COMMISSION'
300
+ '/commission': 'COMMISSION',
301
+ '/location': 'ADD_ADDRESS_PAGE'
289
302
  };
290
303
  var typeTemp = map[link];
291
304
 
@@ -370,6 +383,17 @@ var parseUrl = function parseUrl(url) {
370
383
  }
371
384
  };
372
385
  break;
386
+
387
+ case _constants.urlType.STORE:
388
+ // 店铺详情
389
+ params = {
390
+ action: 'jump',
391
+ params: {
392
+ type: 'STORE',
393
+ storeId: arg1
394
+ }
395
+ };
396
+ break;
373
397
  // 海报页面
374
398
 
375
399
  case _constants.urlType.CUSTOMIZED:
@@ -451,7 +475,8 @@ var parseUrl = function parseUrl(url) {
451
475
  '/product/GroupBuy': 'GROUP',
452
476
  '/search-page': 'SEARCH_PAGE',
453
477
  '/main/my-commission': 'WALLET',
454
- '/commission': 'COMMISSION'
478
+ '/commission': 'COMMISSION',
479
+ '/location': 'ADD_ADDRESS_PAGE'
455
480
  };
456
481
  link = url;
457
482
  params = {
@@ -335,7 +335,9 @@ var clickUrl = function clickUrl(url, state) {
335
335
  return;
336
336
  }
337
337
 
338
- if ((0, _androidUtil.browserVersion)().isAshitaApp || (0, _androidUtil.browserVersion)().flutterApp) {
338
+ console.log('sendToApp', data);
339
+
340
+ if ((0, _androidUtil.browserVersion)().isAshitaApp || (0, _androidUtil.browserVersion)().flutterApp || (0, _androidUtil.browserVersion)().isDelivistaApp) {
339
341
  (0, _androidUtil.sendToApp)(data);
340
342
  } else if ((0, _androidUtil.browserVersion)().isApp && params.link && params.link.startsWith('http')) {
341
343
  // 跳转链接是个绝对路径
@@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.formatDateTime = exports.formatDateMinute = exports.formatDate = void 0;
7
7
  exports.formatDayMonth = formatDayMonth;
8
8
  exports.formatDayMonthTime = formatDayMonthTime;
9
+ exports.isToday = isToday;
10
+ exports.isTomorrow = isTomorrow;
9
11
  exports.newDate = void 0;
10
12
 
11
13
  var _moment = _interopRequireDefault(require("moment"));
@@ -80,4 +82,16 @@ function formatDayMonthTime(date, fmt) {
80
82
  }
81
83
 
82
84
  return (0, _moment["default"])(newDate(date)).format(fmt);
85
+ }
86
+
87
+ function isToday(date) {
88
+ var now = new Date();
89
+ var tomorrow = new Date(now.getFullYear(), now.getMonth(), now.getDate());
90
+ return date.getDate() === tomorrow.getDate() && date.getMonth() === tomorrow.getMonth() && date.getFullYear() === tomorrow.getFullYear();
91
+ }
92
+
93
+ function isTomorrow(date) {
94
+ var now = new Date();
95
+ var tomorrow = new Date(now.getFullYear(), now.getMonth(), now.getDate() + 1);
96
+ return date.getDate() === tomorrow.getDate() && date.getMonth() === tomorrow.getMonth() && date.getFullYear() === tomorrow.getFullYear();
83
97
  }
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.188",
4
+ "version": "2.0.190",
5
5
  "description": "Magic Design",
6
6
  "license": "MIT",
7
7
  "module": "es/index.js",
@@ -32,7 +32,7 @@
32
32
  "marked": "4.3.0",
33
33
  "mobx": "6.6.1",
34
34
  "mobx-react": "7.5.2",
35
- "moment": "2.29.3",
35
+ "moment": "2.30",
36
36
  "postcss-pxtorem": "^6.0.0",
37
37
  "quill": "^1.3.7",
38
38
  "ramda": "^0.28.0",