@fonixtree/magic-design 0.1.30 → 0.1.32

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.
@@ -206,35 +206,30 @@ function (_super) {
206
206
 
207
207
  _this.getStoreInfo = function () {
208
208
  return __awaiter(_this, void 0, void 0, function () {
209
- var storeId, res, isFollow;
210
- return __generator(this, function (_a) {
211
- switch (_a.label) {
209
+ var storeId, _a, res, isFollow;
210
+
211
+ return __generator(this, function (_b) {
212
+ switch (_b.label) {
212
213
  case 0:
213
214
  storeId = window.magicDesign.storeId;
214
215
  if (!storeId) return [3
215
216
  /*break*/
216
- , 3];
217
+ , 2];
217
218
  return [4
218
219
  /*yield*/
219
- , (0, _commonUtil.commonFetch)("/designer/v1/h5/store/detail/" + storeId, {}, 'GET')];
220
-
221
- case 1:
222
- res = _a.sent();
223
- return [4
224
- /*yield*/
225
- , (0, _commonUtil.commonFetch)('/designer/v1/h5/collection/store/check', {
220
+ , Promise.all([(0, _commonUtil.commonFetch)("/designer/v1/h5/store/detail/" + storeId, {}, 'GET'), (0, _commonUtil.commonFetch)('/designer/v1/h5/collection/store/check', {
226
221
  storeId: storeId
227
- })];
222
+ })])];
228
223
 
229
- case 2:
230
- isFollow = _a.sent();
224
+ case 1:
225
+ _a = _b.sent(), res = _a[0], isFollow = _a[1];
231
226
  this.setState({
232
227
  storeInfo: res,
233
228
  isFollow: isFollow
234
229
  });
235
- _a.label = 3;
230
+ _b.label = 2;
236
231
 
237
- case 3:
232
+ case 2:
238
233
  return [2
239
234
  /*return*/
240
235
  ];
@@ -309,6 +304,21 @@ function (_super) {
309
304
  }
310
305
  };
311
306
 
307
+ _this.toChat = function () {
308
+ var storeInfo = _this.state.storeInfo; // 登录情况下,直接跳聊天页
309
+
310
+ if (localStorage.getItem('isLogin') === 'Y') {
311
+ (0, _commonUtil.navigateTo)("/chat/" + (storeInfo === null || storeInfo === void 0 ? void 0 : storeInfo.sysAccount));
312
+ } else {
313
+ window.magicDesign.history.push({
314
+ pathname: '/sign-in',
315
+ state: {
316
+ redirectUrl: "/chat/" + (storeInfo === null || storeInfo === void 0 ? void 0 : storeInfo.sysAccount)
317
+ }
318
+ });
319
+ }
320
+ };
321
+
312
322
  return _this;
313
323
  }
314
324
 
@@ -364,11 +374,12 @@ function (_super) {
364
374
  className: "store-info-wrap"
365
375
  }, /*#__PURE__*/_react["default"].createElement("div", {
366
376
  className: "number"
367
- }, /*#__PURE__*/_react["default"].createElement("span", null, (storeInfo === null || storeInfo === void 0 ? void 0 : storeInfo.storeEvalValue) || '98%', " "), " Positive"), /*#__PURE__*/_react["default"].createElement("div", {
377
+ }, /*#__PURE__*/_react["default"].createElement("span", null, Number((storeInfo === null || storeInfo === void 0 ? void 0 : storeInfo.storeEvalValue) / 100).toFixed(1) || '5', " "), " ", (0, _locale.i18n)('Positive')), /*#__PURE__*/_react["default"].createElement("div", {
368
378
  className: "number"
369
- }, /*#__PURE__*/_react["default"].createElement("span", null, (storeInfo === null || storeInfo === void 0 ? void 0 : storeInfo.userCollectionNum) || '1000+', " "), " Followers"), /*#__PURE__*/_react["default"].createElement("div", {
370
- className: "chat-btn"
371
- }, "CHAT")));
379
+ }, /*#__PURE__*/_react["default"].createElement("span", null, (storeInfo === null || storeInfo === void 0 ? void 0 : storeInfo.userCollectionNum) || '1000+', " "), " ", (0, _locale.i18n)('FOLLOWERS')), /*#__PURE__*/_react["default"].createElement("div", {
380
+ className: "chat-btn",
381
+ onClick: this.toChat
382
+ }, (0, _locale.i18n)('CHAT'))));
372
383
  };
373
384
 
374
385
  SignBoardMobile.defaultProps = {
@@ -210,36 +210,30 @@ function (_super) {
210
210
 
211
211
  _this.getStoreInfo = function () {
212
212
  return __awaiter(_this, void 0, void 0, function () {
213
- var storeId, res, isFollow;
214
- return __generator(this, function (_a) {
215
- switch (_a.label) {
213
+ var storeId, _a, res, isFollow;
214
+
215
+ return __generator(this, function (_b) {
216
+ switch (_b.label) {
216
217
  case 0:
217
218
  storeId = window.magicDesign.storeId;
218
219
  if (!storeId) return [3
219
220
  /*break*/
220
- , 3];
221
+ , 2];
221
222
  return [4
222
223
  /*yield*/
223
- , (0, _commonUtil.commonFetch)("/designer/v1/h5/store/detail/" + storeId, {}, 'GET')];
224
-
225
- case 1:
226
- res = _a.sent();
227
- return [4
228
- /*yield*/
229
- , (0, _commonUtil.commonFetch)('/designer/v1/h5/collection/store/check', {
224
+ , Promise.all([(0, _commonUtil.commonFetch)("/designer/v1/h5/store/detail/" + storeId, {}, 'GET'), (0, _commonUtil.commonFetch)('/designer/v1/h5/collection/store/check', {
230
225
  storeId: storeId
231
- })];
226
+ })])];
232
227
 
233
- case 2:
234
- isFollow = _a.sent();
235
- console.log('---d', res);
228
+ case 1:
229
+ _a = _b.sent(), res = _a[0], isFollow = _a[1];
236
230
  this.setState({
237
231
  storeInfo: res,
238
232
  isFollow: isFollow
239
233
  });
240
- _a.label = 3;
234
+ _b.label = 2;
241
235
 
242
- case 3:
236
+ case 2:
243
237
  return [2
244
238
  /*return*/
245
239
  ];
@@ -390,13 +384,13 @@ function (_super) {
390
384
  className: "store-number"
391
385
  }, /*#__PURE__*/_react["default"].createElement("div", {
392
386
  className: "store-number-item"
393
- }, "Positive:", /*#__PURE__*/_react["default"].createElement("span", null, (storeInfo === null || storeInfo === void 0 ? void 0 : storeInfo.storeEvalValue) || '98%', " ")), /*#__PURE__*/_react["default"].createElement("div", {
387
+ }, (0, _locale.i18n)('Positive'), ":", /*#__PURE__*/_react["default"].createElement("span", null, Number((storeInfo === null || storeInfo === void 0 ? void 0 : storeInfo.storeEvalValue) / 100).toFixed(1) || '5')), /*#__PURE__*/_react["default"].createElement("div", {
394
388
  className: "store-number-item"
395
- }, "Followers:", /*#__PURE__*/_react["default"].createElement("span", null, (storeInfo === null || storeInfo === void 0 ? void 0 : storeInfo.userCollectionNum) || '1000+')))), /*#__PURE__*/_react["default"].createElement("div", {
389
+ }, (0, _locale.i18n)('FOLLOWERS'), ":", /*#__PURE__*/_react["default"].createElement("span", null, (storeInfo === null || storeInfo === void 0 ? void 0 : storeInfo.userCollectionNum) || '1000+')))), /*#__PURE__*/_react["default"].createElement("div", {
396
390
  onClick: this.clickCollect
397
391
  }, isFollow ? /*#__PURE__*/_react["default"].createElement("div", {
398
392
  className: "followed"
399
- }, "Following") : /*#__PURE__*/_react["default"].createElement("div", {
393
+ }, (0, _locale.i18n)('FOLLOWING')) : /*#__PURE__*/_react["default"].createElement("div", {
400
394
  className: "follow"
401
395
  }, /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
402
396
  color: "#0D52D6",
@@ -404,7 +398,7 @@ function (_super) {
404
398
  type: "icon-add"
405
399
  }), /*#__PURE__*/_react["default"].createElement("span", {
406
400
  className: "txt"
407
- }, "Follow"))))));
401
+ }, (0, _locale.i18n)('FOLLOW')))))));
408
402
  };
409
403
 
410
404
  SignBoardPc.defaultProps = {
@@ -1,4 +1,9 @@
1
1
  {
2
+ "CHAT": "Chat",
3
+ "FOLLOW": "Follow",
4
+ "FOLLOWING": "Following",
5
+ "FOLLOWERS": "Followers",
6
+ "POSITIVE": "Positive",
2
7
  "SEARCH_IN_SHOP": "Search in shop",
3
8
  "IMAGE_AND_TEXT_NAME": "Image and Text Name",
4
9
  "BANNER_GROUP_NAME": "Banner Group Name",
@@ -1,4 +1,9 @@
1
1
  {
2
+ "CHAT": "Chat",
3
+ "FOLLOW": "Follow",
4
+ "FOLLOWING": "Following",
5
+ "FOLLOWERS": "Followers",
6
+ "POSITIVE": "Positive",
2
7
  "SEARCH_IN_SHOP": "Search in shop",
3
8
  "IMAGE_AND_TEXT_NAME": "Image and Text Name",
4
9
  "BANNER_GROUP_NAME": "Banner Group Name",
@@ -1,4 +1,9 @@
1
1
  {
2
+ "CHAT": "Chat",
3
+ "FOLLOW": "Follow",
4
+ "FOLLOWING": "Following",
5
+ "FOLLOWERS": "Followers",
6
+ "POSITIVE": "Positive",
2
7
  "SEARCH_IN_SHOP": "Search in shop",
3
8
  "IMAGE_AND_TEXT_NAME": "Image and Text Name",
4
9
  "BANNER_GROUP_NAME": "Banner Group Name",
@@ -206,35 +206,30 @@ function (_super) {
206
206
 
207
207
  _this.getStoreInfo = function () {
208
208
  return __awaiter(_this, void 0, void 0, function () {
209
- var storeId, res, isFollow;
210
- return __generator(this, function (_a) {
211
- switch (_a.label) {
209
+ var storeId, _a, res, isFollow;
210
+
211
+ return __generator(this, function (_b) {
212
+ switch (_b.label) {
212
213
  case 0:
213
214
  storeId = window.magicDesign.storeId;
214
215
  if (!storeId) return [3
215
216
  /*break*/
216
- , 3];
217
+ , 2];
217
218
  return [4
218
219
  /*yield*/
219
- , (0, _commonUtil.commonFetch)("/designer/v1/h5/store/detail/" + storeId, {}, 'GET')];
220
-
221
- case 1:
222
- res = _a.sent();
223
- return [4
224
- /*yield*/
225
- , (0, _commonUtil.commonFetch)('/designer/v1/h5/collection/store/check', {
220
+ , Promise.all([(0, _commonUtil.commonFetch)("/designer/v1/h5/store/detail/" + storeId, {}, 'GET'), (0, _commonUtil.commonFetch)('/designer/v1/h5/collection/store/check', {
226
221
  storeId: storeId
227
- })];
222
+ })])];
228
223
 
229
- case 2:
230
- isFollow = _a.sent();
224
+ case 1:
225
+ _a = _b.sent(), res = _a[0], isFollow = _a[1];
231
226
  this.setState({
232
227
  storeInfo: res,
233
228
  isFollow: isFollow
234
229
  });
235
- _a.label = 3;
230
+ _b.label = 2;
236
231
 
237
- case 3:
232
+ case 2:
238
233
  return [2
239
234
  /*return*/
240
235
  ];
@@ -309,6 +304,21 @@ function (_super) {
309
304
  }
310
305
  };
311
306
 
307
+ _this.toChat = function () {
308
+ var storeInfo = _this.state.storeInfo; // 登录情况下,直接跳聊天页
309
+
310
+ if (localStorage.getItem('isLogin') === 'Y') {
311
+ (0, _commonUtil.navigateTo)("/chat/" + (storeInfo === null || storeInfo === void 0 ? void 0 : storeInfo.sysAccount));
312
+ } else {
313
+ window.magicDesign.history.push({
314
+ pathname: '/sign-in',
315
+ state: {
316
+ redirectUrl: "/chat/" + (storeInfo === null || storeInfo === void 0 ? void 0 : storeInfo.sysAccount)
317
+ }
318
+ });
319
+ }
320
+ };
321
+
312
322
  return _this;
313
323
  }
314
324
 
@@ -364,11 +374,12 @@ function (_super) {
364
374
  className: "store-info-wrap"
365
375
  }, /*#__PURE__*/_react["default"].createElement("div", {
366
376
  className: "number"
367
- }, /*#__PURE__*/_react["default"].createElement("span", null, (storeInfo === null || storeInfo === void 0 ? void 0 : storeInfo.storeEvalValue) || '98%', " "), " Positive"), /*#__PURE__*/_react["default"].createElement("div", {
377
+ }, /*#__PURE__*/_react["default"].createElement("span", null, Number((storeInfo === null || storeInfo === void 0 ? void 0 : storeInfo.storeEvalValue) / 100).toFixed(1) || '5', " "), " ", (0, _locale.i18n)('Positive')), /*#__PURE__*/_react["default"].createElement("div", {
368
378
  className: "number"
369
- }, /*#__PURE__*/_react["default"].createElement("span", null, (storeInfo === null || storeInfo === void 0 ? void 0 : storeInfo.userCollectionNum) || '1000+', " "), " Followers"), /*#__PURE__*/_react["default"].createElement("div", {
370
- className: "chat-btn"
371
- }, "CHAT")));
379
+ }, /*#__PURE__*/_react["default"].createElement("span", null, (storeInfo === null || storeInfo === void 0 ? void 0 : storeInfo.userCollectionNum) || '1000+', " "), " ", (0, _locale.i18n)('FOLLOWERS')), /*#__PURE__*/_react["default"].createElement("div", {
380
+ className: "chat-btn",
381
+ onClick: this.toChat
382
+ }, (0, _locale.i18n)('CHAT'))));
372
383
  };
373
384
 
374
385
  SignBoardMobile.defaultProps = {
@@ -210,36 +210,30 @@ function (_super) {
210
210
 
211
211
  _this.getStoreInfo = function () {
212
212
  return __awaiter(_this, void 0, void 0, function () {
213
- var storeId, res, isFollow;
214
- return __generator(this, function (_a) {
215
- switch (_a.label) {
213
+ var storeId, _a, res, isFollow;
214
+
215
+ return __generator(this, function (_b) {
216
+ switch (_b.label) {
216
217
  case 0:
217
218
  storeId = window.magicDesign.storeId;
218
219
  if (!storeId) return [3
219
220
  /*break*/
220
- , 3];
221
+ , 2];
221
222
  return [4
222
223
  /*yield*/
223
- , (0, _commonUtil.commonFetch)("/designer/v1/h5/store/detail/" + storeId, {}, 'GET')];
224
-
225
- case 1:
226
- res = _a.sent();
227
- return [4
228
- /*yield*/
229
- , (0, _commonUtil.commonFetch)('/designer/v1/h5/collection/store/check', {
224
+ , Promise.all([(0, _commonUtil.commonFetch)("/designer/v1/h5/store/detail/" + storeId, {}, 'GET'), (0, _commonUtil.commonFetch)('/designer/v1/h5/collection/store/check', {
230
225
  storeId: storeId
231
- })];
226
+ })])];
232
227
 
233
- case 2:
234
- isFollow = _a.sent();
235
- console.log('---d', res);
228
+ case 1:
229
+ _a = _b.sent(), res = _a[0], isFollow = _a[1];
236
230
  this.setState({
237
231
  storeInfo: res,
238
232
  isFollow: isFollow
239
233
  });
240
- _a.label = 3;
234
+ _b.label = 2;
241
235
 
242
- case 3:
236
+ case 2:
243
237
  return [2
244
238
  /*return*/
245
239
  ];
@@ -390,13 +384,13 @@ function (_super) {
390
384
  className: "store-number"
391
385
  }, /*#__PURE__*/_react["default"].createElement("div", {
392
386
  className: "store-number-item"
393
- }, "Positive:", /*#__PURE__*/_react["default"].createElement("span", null, (storeInfo === null || storeInfo === void 0 ? void 0 : storeInfo.storeEvalValue) || '98%', " ")), /*#__PURE__*/_react["default"].createElement("div", {
387
+ }, (0, _locale.i18n)('Positive'), ":", /*#__PURE__*/_react["default"].createElement("span", null, Number((storeInfo === null || storeInfo === void 0 ? void 0 : storeInfo.storeEvalValue) / 100).toFixed(1) || '5')), /*#__PURE__*/_react["default"].createElement("div", {
394
388
  className: "store-number-item"
395
- }, "Followers:", /*#__PURE__*/_react["default"].createElement("span", null, (storeInfo === null || storeInfo === void 0 ? void 0 : storeInfo.userCollectionNum) || '1000+')))), /*#__PURE__*/_react["default"].createElement("div", {
389
+ }, (0, _locale.i18n)('FOLLOWERS'), ":", /*#__PURE__*/_react["default"].createElement("span", null, (storeInfo === null || storeInfo === void 0 ? void 0 : storeInfo.userCollectionNum) || '1000+')))), /*#__PURE__*/_react["default"].createElement("div", {
396
390
  onClick: this.clickCollect
397
391
  }, isFollow ? /*#__PURE__*/_react["default"].createElement("div", {
398
392
  className: "followed"
399
- }, "Following") : /*#__PURE__*/_react["default"].createElement("div", {
393
+ }, (0, _locale.i18n)('FOLLOWING')) : /*#__PURE__*/_react["default"].createElement("div", {
400
394
  className: "follow"
401
395
  }, /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
402
396
  color: "#0D52D6",
@@ -404,7 +398,7 @@ function (_super) {
404
398
  type: "icon-add"
405
399
  }), /*#__PURE__*/_react["default"].createElement("span", {
406
400
  className: "txt"
407
- }, "Follow"))))));
401
+ }, (0, _locale.i18n)('FOLLOW')))))));
408
402
  };
409
403
 
410
404
  SignBoardPc.defaultProps = {
@@ -1,4 +1,9 @@
1
1
  {
2
+ "CHAT": "Chat",
3
+ "FOLLOW": "Follow",
4
+ "FOLLOWING": "Following",
5
+ "FOLLOWERS": "Followers",
6
+ "POSITIVE": "Positive",
2
7
  "SEARCH_IN_SHOP": "Search in shop",
3
8
  "IMAGE_AND_TEXT_NAME": "Image and Text Name",
4
9
  "BANNER_GROUP_NAME": "Banner Group Name",
@@ -1,4 +1,9 @@
1
1
  {
2
+ "CHAT": "Chat",
3
+ "FOLLOW": "Follow",
4
+ "FOLLOWING": "Following",
5
+ "FOLLOWERS": "Followers",
6
+ "POSITIVE": "Positive",
2
7
  "SEARCH_IN_SHOP": "Search in shop",
3
8
  "IMAGE_AND_TEXT_NAME": "Image and Text Name",
4
9
  "BANNER_GROUP_NAME": "Banner Group Name",
@@ -1,4 +1,9 @@
1
1
  {
2
+ "CHAT": "Chat",
3
+ "FOLLOW": "Follow",
4
+ "FOLLOWING": "Following",
5
+ "FOLLOWERS": "Followers",
6
+ "POSITIVE": "Positive",
2
7
  "SEARCH_IN_SHOP": "Search in shop",
3
8
  "IMAGE_AND_TEXT_NAME": "Image and Text Name",
4
9
  "BANNER_GROUP_NAME": "Banner Group Name",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fonixtree/magic-design",
3
3
  "author": "Cylon Team",
4
- "version": "0.1.30",
4
+ "version": "0.1.32",
5
5
  "description": "Magic Design",
6
6
  "license": "MIT",
7
7
  "module": "es/index.js",