@fonixtree/magic-design 0.1.27 → 0.1.29

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.
@@ -21,6 +21,8 @@ var _defaultImg = _interopRequireDefault(require("../../../../../common/GroupLis
21
21
 
22
22
  var _logo = _interopRequireDefault(require("../imgs/logo.png"));
23
23
 
24
+ var _commonUtil = require("../../../../../utils/commonUtil");
25
+
24
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
25
27
 
26
28
  var __extends = void 0 && (void 0).__extends || function () {
@@ -49,6 +51,149 @@ var __extends = void 0 && (void 0).__extends || function () {
49
51
  };
50
52
  }();
51
53
 
54
+ var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
55
+ function adopt(value) {
56
+ return value instanceof P ? value : new P(function (resolve) {
57
+ resolve(value);
58
+ });
59
+ }
60
+
61
+ return new (P || (P = Promise))(function (resolve, reject) {
62
+ function fulfilled(value) {
63
+ try {
64
+ step(generator.next(value));
65
+ } catch (e) {
66
+ reject(e);
67
+ }
68
+ }
69
+
70
+ function rejected(value) {
71
+ try {
72
+ step(generator["throw"](value));
73
+ } catch (e) {
74
+ reject(e);
75
+ }
76
+ }
77
+
78
+ function step(result) {
79
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
80
+ }
81
+
82
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
83
+ });
84
+ };
85
+
86
+ var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
87
+ var _ = {
88
+ label: 0,
89
+ sent: function sent() {
90
+ if (t[0] & 1) throw t[1];
91
+ return t[1];
92
+ },
93
+ trys: [],
94
+ ops: []
95
+ },
96
+ f,
97
+ y,
98
+ t,
99
+ g;
100
+ return g = {
101
+ next: verb(0),
102
+ "throw": verb(1),
103
+ "return": verb(2)
104
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
105
+ return this;
106
+ }), g;
107
+
108
+ function verb(n) {
109
+ return function (v) {
110
+ return step([n, v]);
111
+ };
112
+ }
113
+
114
+ function step(op) {
115
+ if (f) throw new TypeError("Generator is already executing.");
116
+
117
+ while (_) {
118
+ try {
119
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
120
+ if (y = 0, t) op = [op[0] & 2, t.value];
121
+
122
+ switch (op[0]) {
123
+ case 0:
124
+ case 1:
125
+ t = op;
126
+ break;
127
+
128
+ case 4:
129
+ _.label++;
130
+ return {
131
+ value: op[1],
132
+ done: false
133
+ };
134
+
135
+ case 5:
136
+ _.label++;
137
+ y = op[1];
138
+ op = [0];
139
+ continue;
140
+
141
+ case 7:
142
+ op = _.ops.pop();
143
+
144
+ _.trys.pop();
145
+
146
+ continue;
147
+
148
+ default:
149
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
150
+ _ = 0;
151
+ continue;
152
+ }
153
+
154
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
155
+ _.label = op[1];
156
+ break;
157
+ }
158
+
159
+ if (op[0] === 6 && _.label < t[1]) {
160
+ _.label = t[1];
161
+ t = op;
162
+ break;
163
+ }
164
+
165
+ if (t && _.label < t[2]) {
166
+ _.label = t[2];
167
+
168
+ _.ops.push(op);
169
+
170
+ break;
171
+ }
172
+
173
+ if (t[2]) _.ops.pop();
174
+
175
+ _.trys.pop();
176
+
177
+ continue;
178
+ }
179
+
180
+ op = body.call(thisArg, _);
181
+ } catch (e) {
182
+ op = [6, e];
183
+ y = 0;
184
+ } finally {
185
+ f = t = 0;
186
+ }
187
+ }
188
+
189
+ if (op[0] & 5) throw op[1];
190
+ return {
191
+ value: op[0] ? op[1] : void 0,
192
+ done: true
193
+ };
194
+ }
195
+ };
196
+
52
197
  var SignBoardPc =
53
198
  /** @class */
54
199
  function (_super) {
@@ -58,7 +203,98 @@ function (_super) {
58
203
  var _this = _super !== null && _super.apply(this, arguments) || this;
59
204
 
60
205
  _this.state = {
61
- inputVal: ''
206
+ inputVal: '',
207
+ storeInfo: null,
208
+ isFollow: false
209
+ };
210
+
211
+ _this.getStoreInfo = function () {
212
+ return __awaiter(_this, void 0, void 0, function () {
213
+ var storeId, res, isFollow;
214
+ return __generator(this, function (_a) {
215
+ switch (_a.label) {
216
+ case 0:
217
+ storeId = window.magicDesign.storeId;
218
+ if (!storeId) return [3
219
+ /*break*/
220
+ , 3];
221
+ return [4
222
+ /*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', {
230
+ storeId: storeId
231
+ })];
232
+
233
+ case 2:
234
+ isFollow = _a.sent();
235
+ console.log('---d', res);
236
+ this.setState({
237
+ storeInfo: res,
238
+ isFollow: isFollow
239
+ });
240
+ _a.label = 3;
241
+
242
+ case 3:
243
+ return [2
244
+ /*return*/
245
+ ];
246
+ }
247
+ });
248
+ });
249
+ };
250
+
251
+ _this.clickCollect = function () {
252
+ return __awaiter(_this, void 0, void 0, function () {
253
+ var storeId, isFollow, error_1;
254
+ return __generator(this, function (_a) {
255
+ switch (_a.label) {
256
+ case 0:
257
+ storeId = window.magicDesign.storeId;
258
+ isFollow = this.state.isFollow;
259
+ if (!storeId) return [3
260
+ /*break*/
261
+ , 4];
262
+ _a.label = 1;
263
+
264
+ case 1:
265
+ _a.trys.push([1, 3,, 4]);
266
+
267
+ return [4
268
+ /*yield*/
269
+ , (0, _commonUtil.commonFetch)('/h5/collection/store', {
270
+ storeId: storeId,
271
+ operationType: !isFollow ? 'D' : 'A'
272
+ }, 'post')];
273
+
274
+ case 2:
275
+ _a.sent();
276
+
277
+ this.setState({
278
+ isFollow: !isFollow
279
+ });
280
+ return [3
281
+ /*break*/
282
+ , 4];
283
+
284
+ case 3:
285
+ error_1 = _a.sent();
286
+ console.log(error_1);
287
+ return [3
288
+ /*break*/
289
+ , 4];
290
+
291
+ case 4:
292
+ return [2
293
+ /*return*/
294
+ ];
295
+ }
296
+ });
297
+ });
62
298
  };
63
299
 
64
300
  _this.onChangeVal = function (val) {
@@ -68,8 +304,9 @@ function (_super) {
68
304
  };
69
305
 
70
306
  _this.searchProduct = function () {
71
- console.log('--input', _this.state.inputVal);
72
- (0, _coreUtil.clickUrl)("/product/list?q=" + _this.state.inputVal);
307
+ // console.log('--input', this.state.inputVal);
308
+ var storeId = window.magicDesign.storeId;
309
+ (0, _coreUtil.clickUrl)("/product/list?q=" + _this.state.inputVal + "&storeId=" + storeId);
73
310
  };
74
311
 
75
312
  _this.keyUp = function (e) {
@@ -81,14 +318,19 @@ function (_super) {
81
318
  return _this;
82
319
  }
83
320
 
84
- SignBoardPc.prototype.componentDidMount = function () {};
321
+ SignBoardPc.prototype.componentDidMount = function () {
322
+ this.getStoreInfo();
323
+ };
85
324
 
86
325
  SignBoardPc.prototype.render = function () {
87
326
  var _this = this;
88
327
 
89
328
  var data = this.props.data;
90
- var inputVal = this.state.inputVal;
91
- console.log('--pc data', data);
329
+ console.log('--SignBoardPc data', data);
330
+ var _a = this.state,
331
+ storeInfo = _a.storeInfo,
332
+ isFollow = _a.isFollow,
333
+ inputVal = _a.inputVal;
92
334
  return /*#__PURE__*/_react["default"].createElement("div", {
93
335
  className: "pc-sign-board-bar"
94
336
  }, /*#__PURE__*/_react["default"].createElement("div", {
@@ -139,18 +381,22 @@ function (_super) {
139
381
  }, /*#__PURE__*/_react["default"].createElement("img", {
140
382
  alt: "logo",
141
383
  className: "store-logo",
142
- src: _defaultImg["default"]
384
+ src: (storeInfo === null || storeInfo === void 0 ? void 0 : storeInfo.storeLogoUrl) || _defaultImg["default"]
143
385
  }), /*#__PURE__*/_react["default"].createElement("div", {
144
386
  className: "info"
145
387
  }, /*#__PURE__*/_react["default"].createElement("div", {
146
388
  className: "store-name"
147
- }, "Whale Store"), /*#__PURE__*/_react["default"].createElement("div", {
389
+ }, (storeInfo === null || storeInfo === void 0 ? void 0 : storeInfo.storeName) || 'Whale Store'), /*#__PURE__*/_react["default"].createElement("div", {
148
390
  className: "store-number"
149
391
  }, /*#__PURE__*/_react["default"].createElement("div", {
150
392
  className: "store-number-item"
151
- }, "Positive:", /*#__PURE__*/_react["default"].createElement("span", null, "8")), /*#__PURE__*/_react["default"].createElement("div", {
393
+ }, "Positive:", /*#__PURE__*/_react["default"].createElement("span", null, (storeInfo === null || storeInfo === void 0 ? void 0 : storeInfo.storeEvalValue) || '98%', " ")), /*#__PURE__*/_react["default"].createElement("div", {
152
394
  className: "store-number-item"
153
- }, "Followers:", /*#__PURE__*/_react["default"].createElement("span", null, "225")))), /*#__PURE__*/_react["default"].createElement("div", {
395
+ }, "Followers:", /*#__PURE__*/_react["default"].createElement("span", null, (storeInfo === null || storeInfo === void 0 ? void 0 : storeInfo.userCollectionNum) || '1000+')))), /*#__PURE__*/_react["default"].createElement("div", {
396
+ onClick: this.clickCollect
397
+ }, isFollow ? /*#__PURE__*/_react["default"].createElement("div", {
398
+ className: "followed"
399
+ }, "Following") : /*#__PURE__*/_react["default"].createElement("div", {
154
400
  className: "follow"
155
401
  }, /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
156
402
  color: "#0D52D6",
@@ -158,7 +404,7 @@ function (_super) {
158
404
  type: "icon-add"
159
405
  }), /*#__PURE__*/_react["default"].createElement("span", {
160
406
  className: "txt"
161
- }, "Follow")))));
407
+ }, "Follow"))))));
162
408
  };
163
409
 
164
410
  SignBoardPc.defaultProps = {
@@ -134,6 +134,18 @@
134
134
  margin-left: 8px;
135
135
  }
136
136
  }
137
+ .followed {
138
+ width: fit-content;
139
+ border: 1px solid #E0E0E0;
140
+ border-radius: 8px;
141
+ padding: 12px 16px;
142
+ font-family: 'Montserrat';
143
+ font-style: normal;
144
+ font-weight: 400;
145
+ font-size: 14px;
146
+ line-height: 18px;
147
+ color: rgba(51, 51, 51, 0.65);
148
+ }
137
149
  }
138
150
  }
139
151
  }
@@ -55,7 +55,8 @@ var urlTypeMap = {
55
55
  BUNDLE_CAMPAIGN: 'BundleCampaign',
56
56
  VIDEO: 'Video',
57
57
  SHARE_URL: 'ShareURL',
58
- MINI_APP: 'MiniApp'
58
+ MINI_APP: 'MiniApp',
59
+ STORE: 'Store'
59
60
  };
60
61
  exports.urlTypeMap = urlTypeMap;
61
62
  var respCodeMap = {
@@ -123,6 +123,18 @@ var newParseUrl = function newParseUrl(urlObj) {
123
123
  };
124
124
  break;
125
125
 
126
+ case _constants.urlTypeMap.STORE:
127
+ // 跳转店铺
128
+ link = "/store-home/" + value;
129
+ params = {
130
+ action: 'jump',
131
+ params: {
132
+ type: 'STORE',
133
+ url: value
134
+ }
135
+ };
136
+ break;
137
+
126
138
  default:
127
139
  var map = {
128
140
  '/main/cart': 'CART',
Binary file
@@ -247,8 +247,8 @@ function StoreTable(props) {
247
247
  var rowSelection = {
248
248
  onChange: function onChange(selectedRowKeys, selectedRow) {
249
249
  _onChange({
250
- value: selectedRowKeys[0],
251
- name: selectedRow[0].catgName
250
+ value: selectedRow[0].storeId,
251
+ name: selectedRow[0].storeName
252
252
  });
253
253
  },
254
254
  type: 'radio'
@@ -309,9 +309,7 @@ function StoreTable(props) {
309
309
  },
310
310
  showSizeChanger: false
311
311
  }),
312
- rowKey: function rowKey(record) {
313
- return record && record.key;
314
- },
312
+ rowKey: "storeId",
315
313
  rowSelection: rowSelection,
316
314
  scroll: {
317
315
  y: 400
@@ -98,7 +98,7 @@ function (_super) {
98
98
  moduleName: nodeData.moduleIndex + '.' + nodeData.type
99
99
  };
100
100
  var groupWrapContainerStyle = window.magicDesign.device === 'pc' ? 'padding: 16px 20px;' : 'padding: 12px 20px;';
101
- var style = ".m-text{display: flex;flex-direction: column;}.m-text .title-wrap{font-weight:500;font-size:20px;}.m-text .sub-title-text{font-size:15px;color:#b7b7b7;margin-top:10px;}.m-text .group-content-wrap{width:100%;}.m-text .group-content-wrap .group-wrap-container{" + groupWrapContainerStyle + "}.m-text .group-content-wrap .group-wrap{display:flex;flex-direction:column;width:100%;}.m-text .group-content-wrap .group-wrap .group-title{font-size:14px;}.m-text .group-content-wrap.col-1 .group-wrap{width:100%;}.m-text .group-content-wrap.col-2{display:grid;grid-template-columns:50% 50%;}.m-text .group-content-wrap.col-3{display:grid;grid-template-columns:33.3% 33.3% 33.3%;}.m-text .group-content-wrap.mobile{display:block;}";
101
+ var style = ".m-text{display: flex;flex-direction: column;word-break: break-word;}.m-text .title-wrap{font-weight:500;font-size:20px;}.m-text .sub-title-text{font-size:15px;color:#b7b7b7;margin-top:10px;}.m-text .group-content-wrap{width:100%;}.m-text .group-content-wrap .group-wrap-container{" + groupWrapContainerStyle + "}.m-text .group-content-wrap .group-wrap{display:flex;flex-direction:column;width:100%;}.m-text .group-content-wrap .group-wrap .group-title{font-size:14px;}.m-text .group-content-wrap.col-1 .group-wrap{width:100%;}.m-text .group-content-wrap.col-2{display:grid;grid-template-columns:50% 50%;}.m-text .group-content-wrap.col-3{display:grid;grid-template-columns:33.3% 33.3% 33.3%;}.m-text .group-content-wrap.mobile{display:block;}";
102
102
  return /*#__PURE__*/_react["default"].createElement("div", {
103
103
  className: "m-text",
104
104
  onClick: this.onComponentClick
@@ -1,6 +1,7 @@
1
1
  .m-text {
2
2
  display: flex;
3
3
  flex-direction: column;
4
+ word-break: break-word;
4
5
 
5
6
  .title-wrap {
6
7
  font-weight: 500;
@@ -11,43 +11,43 @@ var getDefaultJSON = function getDefaultJSON() {
11
11
  return {
12
12
  id: (0, _uuid.v4)(),
13
13
  type: 'SIGN_BOARD',
14
- content: {
15
- logo: {
16
- id: (0, _uuid.v4)(),
17
- open: true,
18
- type: 'IMAGE',
19
- content: {
20
- h5Name: 'name2',
21
- pcName: 'name2',
22
- h5ImgSrc: '',
23
- pcImgSrc: '',
24
- clickUrl: ''
25
- },
26
- hover: {
27
- open: false,
28
- backgroundType: 'enlarge',
29
- magnification: 1.5,
30
- pcImgHoverUrl: '',
31
- h5ImgHoverUrl: ''
32
- }
33
- },
34
- box: {
35
- id: (0, _uuid.v4)(),
36
- open: true,
37
- color: {
38
- pc: '#D92929',
39
- mobile: '#8493AF'
40
- }
41
- },
42
- icon: {
43
- id: (0, _uuid.v4)(),
44
- open: true,
45
- color: {
46
- pc: '#D92929',
47
- mobile: '#232F46'
48
- }
49
- }
50
- },
14
+ // content: {
15
+ // logo: {
16
+ // id: uuidv4(),
17
+ // open: true,
18
+ // type: 'IMAGE',
19
+ // content: {
20
+ // h5Name: 'name2',
21
+ // pcName: 'name2',
22
+ // h5ImgSrc: '',
23
+ // pcImgSrc: '',
24
+ // clickUrl: '',
25
+ // },
26
+ // hover: {
27
+ // open: false,
28
+ // backgroundType: 'enlarge',
29
+ // magnification: 1.5,
30
+ // pcImgHoverUrl: '',
31
+ // h5ImgHoverUrl: '',
32
+ // },
33
+ // },
34
+ // box: {
35
+ // id: uuidv4(),
36
+ // open: true,
37
+ // color: {
38
+ // pc: '#D92929',
39
+ // mobile: '#8493AF',
40
+ // },
41
+ // },
42
+ // icon: {
43
+ // id: uuidv4(),
44
+ // open: true,
45
+ // color: {
46
+ // pc: '#D92929',
47
+ // mobile: '#232F46',
48
+ // },
49
+ // },
50
+ // },
51
51
  spacing: {
52
52
  pc: {
53
53
  paddingTop: 20,
@@ -63,10 +63,10 @@ var getDefaultJSON = function getDefaultJSON() {
63
63
  marginBottom: window.magicDesign.compSpacing
64
64
  }
65
65
  },
66
- customize: {
67
- layout: 'left',
68
- align: 'left'
69
- },
66
+ // customize: {
67
+ // layout: 'left',
68
+ // align: 'left',
69
+ // },
70
70
  background: {
71
71
  opacity: 100,
72
72
  color: '#fff',