@fonixtree/magic-design 0.1.29 → 0.1.31

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.
@@ -17,6 +17,8 @@ var _defaultImg = _interopRequireDefault(require("../../../../../common/GroupLis
17
17
 
18
18
  var _commonUtil = require("../../../../../utils/commonUtil");
19
19
 
20
+ var _locale = require("../../../../../locale");
21
+
20
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
21
23
 
22
24
  var __extends = void 0 && (void 0).__extends || function () {
@@ -198,7 +200,8 @@ function (_super) {
198
200
 
199
201
  _this.state = {
200
202
  storeInfo: null,
201
- isFollow: false
203
+ isFollow: false,
204
+ inputVal: ''
202
205
  };
203
206
 
204
207
  _this.getStoreInfo = function () {
@@ -225,7 +228,6 @@ function (_super) {
225
228
 
226
229
  case 2:
227
230
  isFollow = _a.sent();
228
- console.log('---d', res);
229
231
  this.setState({
230
232
  storeInfo: res,
231
233
  isFollow: isFollow
@@ -241,6 +243,11 @@ function (_super) {
241
243
  });
242
244
  };
243
245
 
246
+ _this.searchProduct = function () {
247
+ var storeId = window.magicDesign.storeId;
248
+ clickUrl("/product/list?q=" + _this.state.inputVal + "&storeId=" + storeId);
249
+ };
250
+
244
251
  _this.clickCollect = function () {
245
252
  return __awaiter(_this, void 0, void 0, function () {
246
253
  var storeId, isFollow, error_1;
@@ -290,6 +297,31 @@ function (_super) {
290
297
  });
291
298
  };
292
299
 
300
+ _this.onChangeVal = function (val) {
301
+ _this.setState({
302
+ inputVal: val
303
+ });
304
+ };
305
+
306
+ _this.keyUp = function (e) {
307
+ if (e.keyCode === 13) {
308
+ _this.searchProduct();
309
+ }
310
+ };
311
+
312
+ _this.toChat = function () {
313
+ var storeInfo = _this.state.storeInfo; // 登录情况下,直接跳聊天页
314
+
315
+ if (localStorage.getItem('isLogin') === 'Y') {
316
+ (0, _commonUtil.navigateTo)("/chat/" + (storeInfo === null || storeInfo === void 0 ? void 0 : storeInfo.sysAccount));
317
+ } else {
318
+ window.magicDesign.history.push({
319
+ pathname: '/sign-in',
320
+ state: "/chat/" + (storeInfo === null || storeInfo === void 0 ? void 0 : storeInfo.sysAccount)
321
+ });
322
+ }
323
+ };
324
+
293
325
  return _this;
294
326
  }
295
327
 
@@ -298,26 +330,37 @@ function (_super) {
298
330
  };
299
331
 
300
332
  SignBoardMobile.prototype.render = function () {
333
+ var _this = this;
334
+
301
335
  var data = this.props.data;
302
336
  console.log('--SignBoard', data);
303
337
  var _a = this.state,
304
338
  storeInfo = _a.storeInfo,
305
- isFollow = _a.isFollow;
339
+ isFollow = _a.isFollow,
340
+ inputVal = _a.inputVal;
306
341
  return /*#__PURE__*/_react["default"].createElement("div", {
307
342
  className: "m-sign-board-bar"
308
343
  }, /*#__PURE__*/_react["default"].createElement("div", {
309
344
  className: "search"
310
345
  }, /*#__PURE__*/_react["default"].createElement(_antd.Input, {
311
346
  className: "search-input",
312
- placeholder: "Search in shop"
313
- }), /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
347
+ onChange: function onChange(e) {
348
+ return _this.onChangeVal(e.target.value);
349
+ },
350
+ onKeyUp: this.keyUp,
351
+ placeholder: (0, _locale.i18n)('SEARCH_IN_SHOP'),
352
+ value: inputVal
353
+ }), /*#__PURE__*/_react["default"].createElement("div", {
354
+ className: "search-icon",
355
+ onClick: this.searchProduct
356
+ }, /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
314
357
  color: "#696973",
315
358
  size: (0, _commonUtil.convertToRem)(20),
316
359
  style: {
317
360
  display: 'flex'
318
361
  },
319
362
  type: "icon-search2"
320
- })), /*#__PURE__*/_react["default"].createElement("div", {
363
+ }))), /*#__PURE__*/_react["default"].createElement("div", {
321
364
  className: "store-info-wrap"
322
365
  }, /*#__PURE__*/_react["default"].createElement("img", {
323
366
  className: "store-logo",
@@ -334,11 +377,12 @@ function (_super) {
334
377
  className: "store-info-wrap"
335
378
  }, /*#__PURE__*/_react["default"].createElement("div", {
336
379
  className: "number"
337
- }, /*#__PURE__*/_react["default"].createElement("span", null, (storeInfo === null || storeInfo === void 0 ? void 0 : storeInfo.storeEvalValue) || '98%', " "), " Positive"), /*#__PURE__*/_react["default"].createElement("div", {
380
+ }, /*#__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", {
338
381
  className: "number"
339
- }, /*#__PURE__*/_react["default"].createElement("span", null, (storeInfo === null || storeInfo === void 0 ? void 0 : storeInfo.userCollectionNum) || '1000+', " "), " Followers"), /*#__PURE__*/_react["default"].createElement("div", {
340
- className: "chat-btn"
341
- }, "CHAT")));
382
+ }, /*#__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", {
383
+ className: "chat-btn",
384
+ onClick: this.toChat
385
+ }, (0, _locale.i18n)('CHAT'))));
342
386
  };
343
387
 
344
388
  SignBoardMobile.defaultProps = {
@@ -390,13 +390,13 @@ function (_super) {
390
390
  className: "store-number"
391
391
  }, /*#__PURE__*/_react["default"].createElement("div", {
392
392
  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", {
393
+ }, (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
394
  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", {
395
+ }, (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
396
  onClick: this.clickCollect
397
397
  }, isFollow ? /*#__PURE__*/_react["default"].createElement("div", {
398
398
  className: "followed"
399
- }, "Following") : /*#__PURE__*/_react["default"].createElement("div", {
399
+ }, (0, _locale.i18n)('FOLLOWING')) : /*#__PURE__*/_react["default"].createElement("div", {
400
400
  className: "follow"
401
401
  }, /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
402
402
  color: "#0D52D6",
@@ -404,7 +404,7 @@ function (_super) {
404
404
  type: "icon-add"
405
405
  }), /*#__PURE__*/_react["default"].createElement("span", {
406
406
  className: "txt"
407
- }, "Follow"))))));
407
+ }, (0, _locale.i18n)('FOLLOW')))))));
408
408
  };
409
409
 
410
410
  SignBoardPc.defaultProps = {
@@ -119,6 +119,7 @@
119
119
  }
120
120
  .follow {
121
121
  width: fit-content;
122
+ cursor: pointer;
122
123
  border: 1px solid #0D52D6;
123
124
  border-radius: 4px;
124
125
  padding: 8px 16px;
@@ -135,6 +136,7 @@
135
136
  }
136
137
  }
137
138
  .followed {
139
+ cursor: pointer;
138
140
  width: fit-content;
139
141
  border: 1px solid #E0E0E0;
140
142
  border-radius: 8px;
@@ -1,4 +1,10 @@
1
1
  {
2
+ "CHAT": "Chat",
3
+ "FOLLOW": "Follow",
4
+ "FOLLOWING": "Following",
5
+ "FOLLOWERS": "Followers",
6
+ "POSITIVE": "Positive",
7
+ "SEARCH_IN_SHOP": "Search in shop",
2
8
  "IMAGE_AND_TEXT_NAME": "Image and Text Name",
3
9
  "BANNER_GROUP_NAME": "Banner Group Name",
4
10
  "VIDEO": "Video",
@@ -1,4 +1,10 @@
1
1
  {
2
+ "CHAT": "Chat",
3
+ "FOLLOW": "Follow",
4
+ "FOLLOWING": "Following",
5
+ "FOLLOWERS": "Followers",
6
+ "POSITIVE": "Positive",
7
+ "SEARCH_IN_SHOP": "Search in shop",
2
8
  "IMAGE_AND_TEXT_NAME": "Image and Text Name",
3
9
  "BANNER_GROUP_NAME": "Banner Group Name",
4
10
  "VIDEO": "Video",
@@ -1,4 +1,10 @@
1
1
  {
2
+ "CHAT": "Chat",
3
+ "FOLLOW": "Follow",
4
+ "FOLLOWING": "Following",
5
+ "FOLLOWERS": "Followers",
6
+ "POSITIVE": "Positive",
7
+ "SEARCH_IN_SHOP": "Search in shop",
2
8
  "IMAGE_AND_TEXT_NAME": "Image and Text Name",
3
9
  "BANNER_GROUP_NAME": "Banner Group Name",
4
10
  "VIDEO": "Video",
@@ -17,6 +17,8 @@ var _defaultImg = _interopRequireDefault(require("../../../../../common/GroupLis
17
17
 
18
18
  var _commonUtil = require("../../../../../utils/commonUtil");
19
19
 
20
+ var _locale = require("../../../../../locale");
21
+
20
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
21
23
 
22
24
  var __extends = void 0 && (void 0).__extends || function () {
@@ -198,7 +200,8 @@ function (_super) {
198
200
 
199
201
  _this.state = {
200
202
  storeInfo: null,
201
- isFollow: false
203
+ isFollow: false,
204
+ inputVal: ''
202
205
  };
203
206
 
204
207
  _this.getStoreInfo = function () {
@@ -225,7 +228,6 @@ function (_super) {
225
228
 
226
229
  case 2:
227
230
  isFollow = _a.sent();
228
- console.log('---d', res);
229
231
  this.setState({
230
232
  storeInfo: res,
231
233
  isFollow: isFollow
@@ -241,6 +243,11 @@ function (_super) {
241
243
  });
242
244
  };
243
245
 
246
+ _this.searchProduct = function () {
247
+ var storeId = window.magicDesign.storeId;
248
+ clickUrl("/product/list?q=" + _this.state.inputVal + "&storeId=" + storeId);
249
+ };
250
+
244
251
  _this.clickCollect = function () {
245
252
  return __awaiter(_this, void 0, void 0, function () {
246
253
  var storeId, isFollow, error_1;
@@ -290,6 +297,31 @@ function (_super) {
290
297
  });
291
298
  };
292
299
 
300
+ _this.onChangeVal = function (val) {
301
+ _this.setState({
302
+ inputVal: val
303
+ });
304
+ };
305
+
306
+ _this.keyUp = function (e) {
307
+ if (e.keyCode === 13) {
308
+ _this.searchProduct();
309
+ }
310
+ };
311
+
312
+ _this.toChat = function () {
313
+ var storeInfo = _this.state.storeInfo; // 登录情况下,直接跳聊天页
314
+
315
+ if (localStorage.getItem('isLogin') === 'Y') {
316
+ (0, _commonUtil.navigateTo)("/chat/" + (storeInfo === null || storeInfo === void 0 ? void 0 : storeInfo.sysAccount));
317
+ } else {
318
+ window.magicDesign.history.push({
319
+ pathname: '/sign-in',
320
+ state: "/chat/" + (storeInfo === null || storeInfo === void 0 ? void 0 : storeInfo.sysAccount)
321
+ });
322
+ }
323
+ };
324
+
293
325
  return _this;
294
326
  }
295
327
 
@@ -298,26 +330,37 @@ function (_super) {
298
330
  };
299
331
 
300
332
  SignBoardMobile.prototype.render = function () {
333
+ var _this = this;
334
+
301
335
  var data = this.props.data;
302
336
  console.log('--SignBoard', data);
303
337
  var _a = this.state,
304
338
  storeInfo = _a.storeInfo,
305
- isFollow = _a.isFollow;
339
+ isFollow = _a.isFollow,
340
+ inputVal = _a.inputVal;
306
341
  return /*#__PURE__*/_react["default"].createElement("div", {
307
342
  className: "m-sign-board-bar"
308
343
  }, /*#__PURE__*/_react["default"].createElement("div", {
309
344
  className: "search"
310
345
  }, /*#__PURE__*/_react["default"].createElement(_antd.Input, {
311
346
  className: "search-input",
312
- placeholder: "Search in shop"
313
- }), /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
347
+ onChange: function onChange(e) {
348
+ return _this.onChangeVal(e.target.value);
349
+ },
350
+ onKeyUp: this.keyUp,
351
+ placeholder: (0, _locale.i18n)('SEARCH_IN_SHOP'),
352
+ value: inputVal
353
+ }), /*#__PURE__*/_react["default"].createElement("div", {
354
+ className: "search-icon",
355
+ onClick: this.searchProduct
356
+ }, /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
314
357
  color: "#696973",
315
358
  size: (0, _commonUtil.convertToRem)(20),
316
359
  style: {
317
360
  display: 'flex'
318
361
  },
319
362
  type: "icon-search2"
320
- })), /*#__PURE__*/_react["default"].createElement("div", {
363
+ }))), /*#__PURE__*/_react["default"].createElement("div", {
321
364
  className: "store-info-wrap"
322
365
  }, /*#__PURE__*/_react["default"].createElement("img", {
323
366
  className: "store-logo",
@@ -334,11 +377,12 @@ function (_super) {
334
377
  className: "store-info-wrap"
335
378
  }, /*#__PURE__*/_react["default"].createElement("div", {
336
379
  className: "number"
337
- }, /*#__PURE__*/_react["default"].createElement("span", null, (storeInfo === null || storeInfo === void 0 ? void 0 : storeInfo.storeEvalValue) || '98%', " "), " Positive"), /*#__PURE__*/_react["default"].createElement("div", {
380
+ }, /*#__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", {
338
381
  className: "number"
339
- }, /*#__PURE__*/_react["default"].createElement("span", null, (storeInfo === null || storeInfo === void 0 ? void 0 : storeInfo.userCollectionNum) || '1000+', " "), " Followers"), /*#__PURE__*/_react["default"].createElement("div", {
340
- className: "chat-btn"
341
- }, "CHAT")));
382
+ }, /*#__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", {
383
+ className: "chat-btn",
384
+ onClick: this.toChat
385
+ }, (0, _locale.i18n)('CHAT'))));
342
386
  };
343
387
 
344
388
  SignBoardMobile.defaultProps = {
@@ -390,13 +390,13 @@ function (_super) {
390
390
  className: "store-number"
391
391
  }, /*#__PURE__*/_react["default"].createElement("div", {
392
392
  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", {
393
+ }, (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
394
  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", {
395
+ }, (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
396
  onClick: this.clickCollect
397
397
  }, isFollow ? /*#__PURE__*/_react["default"].createElement("div", {
398
398
  className: "followed"
399
- }, "Following") : /*#__PURE__*/_react["default"].createElement("div", {
399
+ }, (0, _locale.i18n)('FOLLOWING')) : /*#__PURE__*/_react["default"].createElement("div", {
400
400
  className: "follow"
401
401
  }, /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
402
402
  color: "#0D52D6",
@@ -404,7 +404,7 @@ function (_super) {
404
404
  type: "icon-add"
405
405
  }), /*#__PURE__*/_react["default"].createElement("span", {
406
406
  className: "txt"
407
- }, "Follow"))))));
407
+ }, (0, _locale.i18n)('FOLLOW')))))));
408
408
  };
409
409
 
410
410
  SignBoardPc.defaultProps = {
@@ -119,6 +119,7 @@
119
119
  }
120
120
  .follow {
121
121
  width: fit-content;
122
+ cursor: pointer;
122
123
  border: 1px solid #0D52D6;
123
124
  border-radius: 4px;
124
125
  padding: 8px 16px;
@@ -135,6 +136,7 @@
135
136
  }
136
137
  }
137
138
  .followed {
139
+ cursor: pointer;
138
140
  width: fit-content;
139
141
  border: 1px solid #E0E0E0;
140
142
  border-radius: 8px;
@@ -1,4 +1,10 @@
1
1
  {
2
+ "CHAT": "Chat",
3
+ "FOLLOW": "Follow",
4
+ "FOLLOWING": "Following",
5
+ "FOLLOWERS": "Followers",
6
+ "POSITIVE": "Positive",
7
+ "SEARCH_IN_SHOP": "Search in shop",
2
8
  "IMAGE_AND_TEXT_NAME": "Image and Text Name",
3
9
  "BANNER_GROUP_NAME": "Banner Group Name",
4
10
  "VIDEO": "Video",
@@ -1,4 +1,10 @@
1
1
  {
2
+ "CHAT": "Chat",
3
+ "FOLLOW": "Follow",
4
+ "FOLLOWING": "Following",
5
+ "FOLLOWERS": "Followers",
6
+ "POSITIVE": "Positive",
7
+ "SEARCH_IN_SHOP": "Search in shop",
2
8
  "IMAGE_AND_TEXT_NAME": "Image and Text Name",
3
9
  "BANNER_GROUP_NAME": "Banner Group Name",
4
10
  "VIDEO": "Video",
@@ -1,4 +1,10 @@
1
1
  {
2
+ "CHAT": "Chat",
3
+ "FOLLOW": "Follow",
4
+ "FOLLOWING": "Following",
5
+ "FOLLOWERS": "Followers",
6
+ "POSITIVE": "Positive",
7
+ "SEARCH_IN_SHOP": "Search in shop",
2
8
  "IMAGE_AND_TEXT_NAME": "Image and Text Name",
3
9
  "BANNER_GROUP_NAME": "Banner Group Name",
4
10
  "VIDEO": "Video",
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.29",
4
+ "version": "0.1.31",
5
5
  "description": "Magic Design",
6
6
  "license": "MIT",
7
7
  "module": "es/index.js",