@fonixtree/magic-design 1.0.131 → 1.0.133

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 (167) hide show
  1. package/es/assets/fonts/magic-box-iconfont.css +11 -3
  2. package/es/assets/fonts/magic-box-iconfont.js +1 -1
  3. package/es/assets/fonts/magic-box-iconfont.ttf +0 -0
  4. package/es/assets/fonts/magic-box-iconfont.woff +0 -0
  5. package/es/assets/fonts/magic-box-iconfont.woff2 +0 -0
  6. package/es/assets/images/layout-icon/grouped-carousel-layout1.png +0 -0
  7. package/es/assets/images/layout-icon/news-layout1.png +0 -0
  8. package/es/assets/images/layout-icon/search-dito-layout1.png +0 -0
  9. package/es/assets/images/layout-icon/slide-image-layout1.png +0 -0
  10. package/es/assets/less/global.less +1 -0
  11. package/es/composite-comp/common/config-panels/SpacingConfig/index.js +30 -0
  12. package/es/composite-comp/dito/components/GroupedCarousel/defaultJSON.js +313 -0
  13. package/es/composite-comp/dito/components/GroupedCarousel/index.js +86 -0
  14. package/es/composite-comp/dito/components/GroupedCarousel/pc/index.js +194 -0
  15. package/es/composite-comp/dito/components/GroupedCarousel/pc/index.less +65 -0
  16. package/es/composite-comp/dito/components/News/defaultJSON.js +176 -0
  17. package/es/composite-comp/dito/components/News/index.js +84 -0
  18. package/es/composite-comp/dito/components/News/pc/index.js +113 -0
  19. package/es/composite-comp/dito/components/News/pc/index.less +46 -0
  20. package/es/composite-comp/dito/components/SearchBanner/mobile/index.js +0 -10
  21. package/es/composite-comp/dito/components/SearchDITO/defaultJSON.js +215 -0
  22. package/es/composite-comp/dito/components/SearchDITO/index.js +86 -0
  23. package/es/composite-comp/dito/components/SearchDITO/pc/components/VideoItem/index.js +146 -0
  24. package/es/composite-comp/dito/components/SearchDITO/pc/components/VideoItem/index.less +25 -0
  25. package/es/composite-comp/dito/components/SearchDITO/pc/index.js +591 -0
  26. package/es/composite-comp/dito/components/SearchDITO/pc/index.less +162 -0
  27. package/es/composite-comp/dito/components/SlideImage/defaultJSON.js +117 -0
  28. package/es/composite-comp/dito/components/SlideImage/index.js +86 -0
  29. package/es/composite-comp/dito/components/SlideImage/pc/components/CardItem/index.js +96 -0
  30. package/es/composite-comp/dito/components/SlideImage/pc/components/CardItem/index.less +1 -0
  31. package/es/composite-comp/dito/components/SlideImage/pc/components/ParallaxScroll/index.js +140 -0
  32. package/es/composite-comp/dito/components/SlideImage/pc/components/ParallaxScroll/index.less +12 -0
  33. package/es/composite-comp/dito/components/SlideImage/pc/components/SvgMask/imgs/mask.svg +0 -0
  34. package/es/composite-comp/dito/components/SlideImage/pc/components/SvgMask/index.js +88 -0
  35. package/es/composite-comp/dito/components/SlideImage/pc/components/SvgMask/index.less +5 -0
  36. package/es/composite-comp/dito/components/SlideImage/pc/components/VideoItem/index.js +121 -0
  37. package/es/composite-comp/dito/components/SlideImage/pc/components/VideoItem/index.less +20 -0
  38. package/es/composite-comp/dito/components/SlideImage/pc/index.js +26 -0
  39. package/es/composite-comp/dito/components/SlideImage/pc/index.less +1 -0
  40. package/es/composite-comp/dito/config-panels/GroupedCarouselConfig/ConfigGroup/index.js +149 -0
  41. package/es/composite-comp/dito/config-panels/GroupedCarouselConfig/ConfigGroup/index.less +16 -0
  42. package/es/composite-comp/dito/config-panels/GroupedCarouselConfig/ConfigTitle/index.js +93 -0
  43. package/es/composite-comp/dito/config-panels/GroupedCarouselConfig/ConfigTitle/index.less +0 -0
  44. package/es/composite-comp/dito/config-panels/GroupedCarouselConfig/imgs/defaultImg.png +0 -0
  45. package/es/composite-comp/dito/config-panels/GroupedCarouselConfig/index.js +106 -0
  46. package/es/composite-comp/dito/config-panels/NewsConfig/ConfigGroup/index.js +148 -0
  47. package/es/composite-comp/dito/config-panels/NewsConfig/ConfigGroup/index.less +16 -0
  48. package/es/composite-comp/dito/config-panels/NewsConfig/ConfigTitle/index.js +101 -0
  49. package/es/composite-comp/dito/config-panels/NewsConfig/ConfigTitle/index.less +0 -0
  50. package/es/composite-comp/dito/config-panels/NewsConfig/imgs/defaultImg.png +0 -0
  51. package/es/composite-comp/dito/config-panels/NewsConfig/index.js +114 -0
  52. package/es/composite-comp/dito/config-panels/SearchDITOConfig/ConfigContent/index.js +156 -0
  53. package/es/composite-comp/dito/config-panels/SearchDITOConfig/ConfigContent/index.less +7 -0
  54. package/es/composite-comp/dito/config-panels/SearchDITOConfig/ConfigImageGroup/index.js +179 -0
  55. package/es/composite-comp/dito/config-panels/SearchDITOConfig/ConfigImageGroup/index.less +0 -0
  56. package/es/composite-comp/dito/config-panels/SearchDITOConfig/ConfigSetting/index.js +181 -0
  57. package/es/composite-comp/dito/config-panels/SearchDITOConfig/ConfigSetting/index.less +9 -0
  58. package/es/composite-comp/dito/config-panels/SearchDITOConfig/imgs/defaultImg.png +0 -0
  59. package/es/composite-comp/dito/config-panels/SearchDITOConfig/index.js +69 -0
  60. package/es/composite-comp/dito/config-panels/SlideImageConfig/ConfigGroup/index.js +150 -0
  61. package/es/composite-comp/dito/config-panels/SlideImageConfig/ConfigGroup/index.less +16 -0
  62. package/es/composite-comp/dito/config-panels/SlideImageConfig/imgs/defaultImg.png +0 -0
  63. package/es/composite-comp/dito/config-panels/SlideImageConfig/index.js +108 -0
  64. package/es/composite-comp/dito/second-config-panels/GroupedCarouselSecondConfig/index.js +198 -0
  65. package/es/composite-comp/dito/second-config-panels/GroupedCarouselSecondConfig/index.less +0 -0
  66. package/es/composite-comp/dito/second-config-panels/NewsSecondConfig/index.js +133 -0
  67. package/es/composite-comp/dito/second-config-panels/NewsSecondConfig/index.less +8 -0
  68. package/es/composite-comp/dito/second-config-panels/SearchDITOSecondConfig/index.js +357 -0
  69. package/es/composite-comp/dito/second-config-panels/SearchDITOSecondConfig/index.less +79 -0
  70. package/es/composite-comp/dito/second-config-panels/SlideImageSecondConfig/index.js +330 -0
  71. package/es/composite-comp/dito/second-config-panels/SlideImageSecondConfig/index.less +0 -0
  72. package/es/constants/component-types.js +27 -3
  73. package/es/constants/index.js +16 -0
  74. package/es/constants/layout.js +34 -2
  75. package/es/locale/en/en.json +5 -1
  76. package/es/locale/es/es.json +5 -1
  77. package/es/locale/id/id.json +5 -1
  78. package/es/meta-comp/components/Button/editable.js +3 -1
  79. package/es/meta-comp/components/Button/index.js +2 -1
  80. package/es/meta-comp/components/Image/index.js +11 -4
  81. package/es/meta-comp/components/Image/index.less +7 -0
  82. package/es/utils/commonUtil.js +4 -1
  83. package/es/utils/pluginsUtil.js +1 -0
  84. package/lib/assets/fonts/magic-box-iconfont.css +11 -3
  85. package/lib/assets/fonts/magic-box-iconfont.js +1 -1
  86. package/lib/assets/fonts/magic-box-iconfont.ttf +0 -0
  87. package/lib/assets/fonts/magic-box-iconfont.woff +0 -0
  88. package/lib/assets/fonts/magic-box-iconfont.woff2 +0 -0
  89. package/lib/assets/images/layout-icon/grouped-carousel-layout1.png +0 -0
  90. package/lib/assets/images/layout-icon/news-layout1.png +0 -0
  91. package/lib/assets/images/layout-icon/search-dito-layout1.png +0 -0
  92. package/lib/assets/images/layout-icon/slide-image-layout1.png +0 -0
  93. package/lib/assets/less/global.less +1 -0
  94. package/lib/composite-comp/common/config-panels/SpacingConfig/index.js +30 -0
  95. package/lib/composite-comp/dito/components/GroupedCarousel/defaultJSON.js +313 -0
  96. package/lib/composite-comp/dito/components/GroupedCarousel/index.js +86 -0
  97. package/lib/composite-comp/dito/components/GroupedCarousel/pc/index.js +194 -0
  98. package/lib/composite-comp/dito/components/GroupedCarousel/pc/index.less +65 -0
  99. package/lib/composite-comp/dito/components/News/defaultJSON.js +176 -0
  100. package/lib/composite-comp/dito/components/News/index.js +84 -0
  101. package/lib/composite-comp/dito/components/News/pc/index.js +113 -0
  102. package/lib/composite-comp/dito/components/News/pc/index.less +46 -0
  103. package/lib/composite-comp/dito/components/SearchBanner/mobile/index.js +0 -10
  104. package/lib/composite-comp/dito/components/SearchDITO/defaultJSON.js +215 -0
  105. package/lib/composite-comp/dito/components/SearchDITO/index.js +86 -0
  106. package/lib/composite-comp/dito/components/SearchDITO/pc/components/VideoItem/index.js +146 -0
  107. package/lib/composite-comp/dito/components/SearchDITO/pc/components/VideoItem/index.less +25 -0
  108. package/lib/composite-comp/dito/components/SearchDITO/pc/index.js +591 -0
  109. package/lib/composite-comp/dito/components/SearchDITO/pc/index.less +162 -0
  110. package/lib/composite-comp/dito/components/SlideImage/defaultJSON.js +117 -0
  111. package/lib/composite-comp/dito/components/SlideImage/index.js +86 -0
  112. package/lib/composite-comp/dito/components/SlideImage/pc/components/CardItem/index.js +96 -0
  113. package/lib/composite-comp/dito/components/SlideImage/pc/components/CardItem/index.less +1 -0
  114. package/lib/composite-comp/dito/components/SlideImage/pc/components/ParallaxScroll/index.js +140 -0
  115. package/lib/composite-comp/dito/components/SlideImage/pc/components/ParallaxScroll/index.less +12 -0
  116. package/lib/composite-comp/dito/components/SlideImage/pc/components/SvgMask/imgs/mask.svg +0 -0
  117. package/lib/composite-comp/dito/components/SlideImage/pc/components/SvgMask/index.js +88 -0
  118. package/lib/composite-comp/dito/components/SlideImage/pc/components/SvgMask/index.less +5 -0
  119. package/lib/composite-comp/dito/components/SlideImage/pc/components/VideoItem/index.js +121 -0
  120. package/lib/composite-comp/dito/components/SlideImage/pc/components/VideoItem/index.less +20 -0
  121. package/lib/composite-comp/dito/components/SlideImage/pc/index.js +26 -0
  122. package/lib/composite-comp/dito/components/SlideImage/pc/index.less +1 -0
  123. package/lib/composite-comp/dito/config-panels/GroupedCarouselConfig/ConfigGroup/index.js +149 -0
  124. package/lib/composite-comp/dito/config-panels/GroupedCarouselConfig/ConfigGroup/index.less +16 -0
  125. package/lib/composite-comp/dito/config-panels/GroupedCarouselConfig/ConfigTitle/index.js +93 -0
  126. package/lib/composite-comp/dito/config-panels/GroupedCarouselConfig/ConfigTitle/index.less +0 -0
  127. package/lib/composite-comp/dito/config-panels/GroupedCarouselConfig/imgs/defaultImg.png +0 -0
  128. package/lib/composite-comp/dito/config-panels/GroupedCarouselConfig/index.js +106 -0
  129. package/lib/composite-comp/dito/config-panels/NewsConfig/ConfigGroup/index.js +148 -0
  130. package/lib/composite-comp/dito/config-panels/NewsConfig/ConfigGroup/index.less +16 -0
  131. package/lib/composite-comp/dito/config-panels/NewsConfig/ConfigTitle/index.js +101 -0
  132. package/lib/composite-comp/dito/config-panels/NewsConfig/ConfigTitle/index.less +0 -0
  133. package/lib/composite-comp/dito/config-panels/NewsConfig/imgs/defaultImg.png +0 -0
  134. package/lib/composite-comp/dito/config-panels/NewsConfig/index.js +114 -0
  135. package/lib/composite-comp/dito/config-panels/SearchDITOConfig/ConfigContent/index.js +156 -0
  136. package/lib/composite-comp/dito/config-panels/SearchDITOConfig/ConfigContent/index.less +7 -0
  137. package/lib/composite-comp/dito/config-panels/SearchDITOConfig/ConfigImageGroup/index.js +179 -0
  138. package/lib/composite-comp/dito/config-panels/SearchDITOConfig/ConfigImageGroup/index.less +0 -0
  139. package/lib/composite-comp/dito/config-panels/SearchDITOConfig/ConfigSetting/index.js +181 -0
  140. package/lib/composite-comp/dito/config-panels/SearchDITOConfig/ConfigSetting/index.less +9 -0
  141. package/lib/composite-comp/dito/config-panels/SearchDITOConfig/imgs/defaultImg.png +0 -0
  142. package/lib/composite-comp/dito/config-panels/SearchDITOConfig/index.js +69 -0
  143. package/lib/composite-comp/dito/config-panels/SlideImageConfig/ConfigGroup/index.js +150 -0
  144. package/lib/composite-comp/dito/config-panels/SlideImageConfig/ConfigGroup/index.less +16 -0
  145. package/lib/composite-comp/dito/config-panels/SlideImageConfig/imgs/defaultImg.png +0 -0
  146. package/lib/composite-comp/dito/config-panels/SlideImageConfig/index.js +108 -0
  147. package/lib/composite-comp/dito/second-config-panels/GroupedCarouselSecondConfig/index.js +198 -0
  148. package/lib/composite-comp/dito/second-config-panels/GroupedCarouselSecondConfig/index.less +0 -0
  149. package/lib/composite-comp/dito/second-config-panels/NewsSecondConfig/index.js +133 -0
  150. package/lib/composite-comp/dito/second-config-panels/NewsSecondConfig/index.less +8 -0
  151. package/lib/composite-comp/dito/second-config-panels/SearchDITOSecondConfig/index.js +357 -0
  152. package/lib/composite-comp/dito/second-config-panels/SearchDITOSecondConfig/index.less +79 -0
  153. package/lib/composite-comp/dito/second-config-panels/SlideImageSecondConfig/index.js +330 -0
  154. package/lib/composite-comp/dito/second-config-panels/SlideImageSecondConfig/index.less +0 -0
  155. package/lib/constants/component-types.js +27 -3
  156. package/lib/constants/index.js +16 -0
  157. package/lib/constants/layout.js +34 -2
  158. package/lib/locale/en/en.json +5 -1
  159. package/lib/locale/es/es.json +5 -1
  160. package/lib/locale/id/id.json +5 -1
  161. package/lib/meta-comp/components/Button/editable.js +3 -1
  162. package/lib/meta-comp/components/Button/index.js +2 -1
  163. package/lib/meta-comp/components/Image/index.js +11 -4
  164. package/lib/meta-comp/components/Image/index.less +7 -0
  165. package/lib/utils/commonUtil.js +4 -1
  166. package/lib/utils/pluginsUtil.js +1 -0
  167. package/package.json +3 -1
@@ -0,0 +1,591 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ require("./index.less");
11
+
12
+ var _antd = require("antd");
13
+
14
+ var _classnames = _interopRequireDefault(require("classnames"));
15
+
16
+ var _VideoItem = _interopRequireDefault(require("./components/VideoItem"));
17
+
18
+ var _common = require("../../../../../common");
19
+
20
+ var _commonUtil = require("../../../../../utils/commonUtil");
21
+
22
+ var _components = require("../../../../../meta-comp/components");
23
+
24
+ require("slick-carousel/slick/slick.css");
25
+
26
+ require("slick-carousel/slick/slick-theme.css");
27
+
28
+ var _coreUtil = require("../../../../../utils/coreUtil");
29
+
30
+ var _mobx = require("../../../../../mobx");
31
+
32
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
33
+
34
+ var __extends = void 0 && (void 0).__extends || function () {
35
+ var _extendStatics = function extendStatics(d, b) {
36
+ _extendStatics = Object.setPrototypeOf || {
37
+ __proto__: []
38
+ } instanceof Array && function (d, b) {
39
+ d.__proto__ = b;
40
+ } || function (d, b) {
41
+ for (var p in b) {
42
+ if (b.hasOwnProperty(p)) d[p] = b[p];
43
+ }
44
+ };
45
+
46
+ return _extendStatics(d, b);
47
+ };
48
+
49
+ return function (d, b) {
50
+ _extendStatics(d, b);
51
+
52
+ function __() {
53
+ this.constructor = d;
54
+ }
55
+
56
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
57
+ };
58
+ }();
59
+
60
+ var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
61
+ function adopt(value) {
62
+ return value instanceof P ? value : new P(function (resolve) {
63
+ resolve(value);
64
+ });
65
+ }
66
+
67
+ return new (P || (P = Promise))(function (resolve, reject) {
68
+ function fulfilled(value) {
69
+ try {
70
+ step(generator.next(value));
71
+ } catch (e) {
72
+ reject(e);
73
+ }
74
+ }
75
+
76
+ function rejected(value) {
77
+ try {
78
+ step(generator["throw"](value));
79
+ } catch (e) {
80
+ reject(e);
81
+ }
82
+ }
83
+
84
+ function step(result) {
85
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
86
+ }
87
+
88
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
89
+ });
90
+ };
91
+
92
+ var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
93
+ var _ = {
94
+ label: 0,
95
+ sent: function sent() {
96
+ if (t[0] & 1) throw t[1];
97
+ return t[1];
98
+ },
99
+ trys: [],
100
+ ops: []
101
+ },
102
+ f,
103
+ y,
104
+ t,
105
+ g;
106
+ return g = {
107
+ next: verb(0),
108
+ "throw": verb(1),
109
+ "return": verb(2)
110
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
111
+ return this;
112
+ }), g;
113
+
114
+ function verb(n) {
115
+ return function (v) {
116
+ return step([n, v]);
117
+ };
118
+ }
119
+
120
+ function step(op) {
121
+ if (f) throw new TypeError("Generator is already executing.");
122
+
123
+ while (_) {
124
+ try {
125
+ 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;
126
+ if (y = 0, t) op = [op[0] & 2, t.value];
127
+
128
+ switch (op[0]) {
129
+ case 0:
130
+ case 1:
131
+ t = op;
132
+ break;
133
+
134
+ case 4:
135
+ _.label++;
136
+ return {
137
+ value: op[1],
138
+ done: false
139
+ };
140
+
141
+ case 5:
142
+ _.label++;
143
+ y = op[1];
144
+ op = [0];
145
+ continue;
146
+
147
+ case 7:
148
+ op = _.ops.pop();
149
+
150
+ _.trys.pop();
151
+
152
+ continue;
153
+
154
+ default:
155
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
156
+ _ = 0;
157
+ continue;
158
+ }
159
+
160
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
161
+ _.label = op[1];
162
+ break;
163
+ }
164
+
165
+ if (op[0] === 6 && _.label < t[1]) {
166
+ _.label = t[1];
167
+ t = op;
168
+ break;
169
+ }
170
+
171
+ if (t && _.label < t[2]) {
172
+ _.label = t[2];
173
+
174
+ _.ops.push(op);
175
+
176
+ break;
177
+ }
178
+
179
+ if (t[2]) _.ops.pop();
180
+
181
+ _.trys.pop();
182
+
183
+ continue;
184
+ }
185
+
186
+ op = body.call(thisArg, _);
187
+ } catch (e) {
188
+ op = [6, e];
189
+ y = 0;
190
+ } finally {
191
+ f = t = 0;
192
+ }
193
+ }
194
+
195
+ if (op[0] & 5) throw op[1];
196
+ return {
197
+ value: op[0] ? op[1] : void 0,
198
+ done: true
199
+ };
200
+ }
201
+ };
202
+
203
+ var SearchDitoPc =
204
+ /** @class */
205
+ function (_super) {
206
+ __extends(SearchDitoPc, _super);
207
+
208
+ function SearchDitoPc() {
209
+ var _this = _super !== null && _super.apply(this, arguments) || this;
210
+
211
+ _this.state = {
212
+ carouseIndex: 0,
213
+ catgList: [],
214
+ catgChildList: [],
215
+ activeCatgId: null,
216
+ catgChildImg: '',
217
+ visible: false,
218
+ relativeLeft: 0
219
+ };
220
+ _this.carouselRef = /*#__PURE__*/_react["default"].createRef();
221
+ _this.destroy = null;
222
+
223
+ _this.bannerGoto = function (groupSource) {
224
+ var nextIndex = groupSource.findIndex(function (item) {
225
+ return item.id === _mobx.store.clickedGroup;
226
+ });
227
+
228
+ if (nextIndex != -1 && nextIndex != _this.state.carouseIndex) {
229
+ _this.carouselRef.current.goTo(nextIndex);
230
+ }
231
+ };
232
+
233
+ _this.getCategory = function () {
234
+ return __awaiter(_this, void 0, void 0, function () {
235
+ var res;
236
+ return __generator(this, function (_a) {
237
+ switch (_a.label) {
238
+ case 0:
239
+ return [4
240
+ /*yield*/
241
+ , (0, _commonUtil.commonFetch)('/designer/v1/h5/pages/buyer/displaycatgs', {
242
+ catgLevel: 1
243
+ }, 'GET')];
244
+
245
+ case 1:
246
+ res = _a.sent();
247
+ this.setState({
248
+ catgList: res
249
+ });
250
+ return [2
251
+ /*return*/
252
+ ];
253
+ }
254
+ });
255
+ });
256
+ };
257
+
258
+ _this.onClickCatg = function (childDom, model) {
259
+ return __awaiter(_this, void 0, void 0, function () {
260
+ var _a, visible, activeCatgId, parentElement, parentRect, childRect, relativeLeft, res;
261
+
262
+ return __generator(this, function (_b) {
263
+ switch (_b.label) {
264
+ case 0:
265
+ _a = this.state, visible = _a.visible, activeCatgId = _a.activeCatgId;
266
+ if (!model.hasChildren) return [3
267
+ /*break*/
268
+ , 4];
269
+ if (!(!visible || model.catgId !== activeCatgId)) return [3
270
+ /*break*/
271
+ , 2];
272
+ parentElement = document.querySelector('.nav-list');
273
+ parentRect = parentElement.getBoundingClientRect();
274
+ childRect = childDom.getBoundingClientRect();
275
+ relativeLeft = childRect.left - parentRect.left;
276
+ this.setState({
277
+ activeCatgId: model.catgId,
278
+ visible: true,
279
+ relativeLeft: relativeLeft
280
+ });
281
+ return [4
282
+ /*yield*/
283
+ , (0, _commonUtil.commonFetch)('/designer/v1/h5/pages/buyer/displaycatgs', {
284
+ parentCatgId: model.catgId
285
+ }, 'GET')];
286
+
287
+ case 1:
288
+ res = _b.sent();
289
+ this.setState({
290
+ catgChildList: res
291
+ });
292
+ return [3
293
+ /*break*/
294
+ , 3];
295
+
296
+ case 2:
297
+ this.setState({
298
+ activeCatgId: null,
299
+ visible: false,
300
+ relativeLeft: 0
301
+ });
302
+ _b.label = 3;
303
+
304
+ case 3:
305
+ return [3
306
+ /*break*/
307
+ , 5];
308
+
309
+ case 4:
310
+ this.jumpUrlConfig(model.catgRela);
311
+ _b.label = 5;
312
+
313
+ case 5:
314
+ return [2
315
+ /*return*/
316
+ ];
317
+ }
318
+ });
319
+ });
320
+ };
321
+
322
+ _this.keyDoFunc = function (data) {
323
+ data.groupSource.forEach(function (group) {
324
+ group.newProperty = 'freshKey'; // Reflect.deleteProperty(group, 'text');
325
+ // Reflect.deleteProperty(group, 'title');
326
+ });
327
+ };
328
+
329
+ _this.onMouseEnter = function (item) {
330
+ _this.setState({
331
+ catgChildImg: item.model.imgUrl
332
+ });
333
+ };
334
+
335
+ _this.onMouseLeave = function () {
336
+ _this.setState({
337
+ catgChildImg: ''
338
+ });
339
+ }; // 跳转配置
340
+
341
+
342
+ _this.jumpUrlConfig = function (item) {
343
+ var _a = item || {},
344
+ objType = _a.objType,
345
+ objValue = _a.objValue;
346
+
347
+ var jumpUrl = '';
348
+
349
+ switch (objType) {
350
+ case 'Category':
351
+ jumpUrl = "catg-" + objValue.objId;
352
+ break;
353
+
354
+ case 'ProductDetail':
355
+ {
356
+ var offerId = objValue.objId && objValue.objId.split(',')[0];
357
+ var productId = objValue.objId && objValue.objId.split(',')[1];
358
+ jumpUrl = "proDetail-" + offerId + "-" + productId;
359
+ break;
360
+ }
361
+
362
+ case 'FilteredProducts':
363
+ {
364
+ var params = JsonToUrl(objValue.filteredProductsRela);
365
+ params = params.replace('productName', 'q');
366
+ jumpUrl = "filter-" + params;
367
+ break;
368
+ }
369
+
370
+ case 'FunctionPage':
371
+ {
372
+ var url = objValue.objId && objValue.objId.split(',')[1];
373
+ jumpUrl = "" + url;
374
+ break;
375
+ }
376
+
377
+ case 'CustomizedPage':
378
+ jumpUrl = "customized-" + objValue.objId;
379
+ break;
380
+
381
+ case 'URL':
382
+ {
383
+ var lastUrl = void 0;
384
+
385
+ if (objValue.url) {
386
+ lastUrl = objValue.url;
387
+ } else {
388
+ lastUrl = objValue.maskValue ? objValue.maskValue.replace('URL: ', '') : '';
389
+ }
390
+
391
+ window.location.href = lastUrl;
392
+ return;
393
+ }
394
+
395
+ default:
396
+ break;
397
+ }
398
+
399
+ (0, _coreUtil.clickUrl)(jumpUrl);
400
+ };
401
+
402
+ return _this;
403
+ }
404
+
405
+ SearchDitoPc.prototype.componentDidMount = function () {
406
+ var _this = this;
407
+
408
+ this.getCategory();
409
+ this.destroy = (0, _mobx.autorun)(function () {
410
+ _this.bannerGoto(_this.props.data.groupSource);
411
+ });
412
+ var navCardDom = document.querySelector('.navigation');
413
+ document.addEventListener('click', function (event) {
414
+ if (!navCardDom.contains(event.target)) {
415
+ _this.setState({
416
+ activeCatgId: null,
417
+ visible: false,
418
+ relativeLeft: 0
419
+ });
420
+ }
421
+ });
422
+ };
423
+
424
+ SearchDitoPc.prototype.componentWillReceiveProps = function (nextProps) {
425
+ this.bannerGoto(nextProps.data.groupSource);
426
+ };
427
+
428
+ SearchDitoPc.prototype.componentWillUnmount = function () {
429
+ this.destroy();
430
+ };
431
+
432
+ SearchDitoPc.prototype.render = function () {
433
+ var _this = this;
434
+
435
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
436
+
437
+ var data = this.props.data;
438
+ var _s = this.state,
439
+ carouseIndex = _s.carouseIndex,
440
+ catgList = _s.catgList,
441
+ catgChildList = _s.catgChildList,
442
+ activeCatgId = _s.activeCatgId,
443
+ visible = _s.visible,
444
+ relativeLeft = _s.relativeLeft,
445
+ catgChildImg = _s.catgChildImg;
446
+ var autoplay = data.setting.autoplay.open;
447
+ /** 设计器模式下 如果选中特定group 自动播放关闭 */
448
+
449
+ if ((0, _coreUtil.isDesignMode)() && _mobx.store.clickedGroup) {
450
+ autoplay = false;
451
+ }
452
+
453
+ return /*#__PURE__*/_react["default"].createElement("div", {
454
+ className: "m-search-dito-pc"
455
+ }, /*#__PURE__*/_react["default"].createElement("div", {
456
+ className: "search-bar"
457
+ }, data.content && ((_a = data.content.logo) === null || _a === void 0 ? void 0 : _a.open) && /*#__PURE__*/_react["default"].createElement("div", {
458
+ className: "logo",
459
+ onClick: function onClick() {
460
+ var _a, _b;
461
+
462
+ if (window.magicDesign.pushGA) {
463
+ window.magicDesign.pushGA({}, 'select_promotion', {
464
+ event_section: 'Search',
465
+ promotion_name: (_b = (_a = data.content.logo) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.h5Name
466
+ });
467
+ }
468
+ }
469
+ }, /*#__PURE__*/_react["default"].createElement(_components.MetaImage, {
470
+ data: data.content.logo
471
+ })), ((_c = (_b = data.content) === null || _b === void 0 ? void 0 : _b.navigation) === null || _c === void 0 ? void 0 : _c.open) && /*#__PURE__*/_react["default"].createElement("div", {
472
+ className: "navigation"
473
+ }, /*#__PURE__*/_react["default"].createElement("ul", {
474
+ className: "nav-list"
475
+ }, catgList.map(function (m) {
476
+ var active = activeCatgId === m.model.catgId;
477
+ return /*#__PURE__*/_react["default"].createElement("li", {
478
+ key: m.model.catgId,
479
+ className: (0, _classnames["default"])({
480
+ active: active
481
+ }),
482
+ onClick: function onClick(e) {
483
+ return _this.onClickCatg(e.target, m.model);
484
+ }
485
+ }, m.model.catgName, m.model.hasChildren && /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
486
+ color: "#fff",
487
+ size: 16,
488
+ type: active && visible ? 'icon-outlined-up' : 'icon-outlined-down'
489
+ }));
490
+ })), visible && /*#__PURE__*/_react["default"].createElement("div", {
491
+ className: "nav-card",
492
+ style: {
493
+ left: relativeLeft
494
+ }
495
+ }, /*#__PURE__*/_react["default"].createElement("ul", null, catgChildList.map(function (m) {
496
+ return /*#__PURE__*/_react["default"].createElement("li", {
497
+ key: m.model.catgId,
498
+ onClick: function onClick() {
499
+ return _this.jumpUrlConfig(m.model.catgRela);
500
+ },
501
+ onMouseEnter: function onMouseEnter() {
502
+ return _this.onMouseEnter(m);
503
+ },
504
+ onMouseLeave: _this.onMouseLeave
505
+ }, /*#__PURE__*/_react["default"].createElement("div", null, m.model.catgName), /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
506
+ className: "icon_right",
507
+ color: "#CE1126",
508
+ size: 18,
509
+ type: "icon-arrow-right"
510
+ }));
511
+ })), /*#__PURE__*/_react["default"].createElement("img", {
512
+ alt: "",
513
+ src: catgChildImg
514
+ }))), /*#__PURE__*/_react["default"].createElement("div", {
515
+ className: "right"
516
+ }, ((_f = (_e = (_d = data.content) === null || _d === void 0 ? void 0 : _d.icon) === null || _e === void 0 ? void 0 : _e.searchIcon) === null || _f === void 0 ? void 0 : _f.pc) && /*#__PURE__*/_react["default"].createElement("div", {
517
+ className: "icon-wrap"
518
+ }, /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
519
+ color: (_h = (_g = data.content.icon) === null || _g === void 0 ? void 0 : _g.color) === null || _h === void 0 ? void 0 : _h.pc,
520
+ onClick: function onClick() {
521
+ return (0, _coreUtil.clickUrl)('/search-page');
522
+ },
523
+ size: 24,
524
+ type: "icon-search-short"
525
+ })), ((_l = (_k = (_j = data.content) === null || _j === void 0 ? void 0 : _j.icon) === null || _k === void 0 ? void 0 : _k.cartIcon) === null || _l === void 0 ? void 0 : _l.pc) && /*#__PURE__*/_react["default"].createElement("div", {
526
+ className: "icon-wrap"
527
+ }, /*#__PURE__*/_react["default"].createElement(_common.Iconfont, {
528
+ color: (_o = (_m = data.content.icon) === null || _m === void 0 ? void 0 : _m.color) === null || _o === void 0 ? void 0 : _o.pc,
529
+ onClick: function onClick() {
530
+ return (0, _coreUtil.clickUrl)('/main/cart');
531
+ },
532
+ size: 24,
533
+ type: "icon-ShoppingCartSimple1"
534
+ })), ((_q = (_p = data.content) === null || _p === void 0 ? void 0 : _p.login) === null || _q === void 0 ? void 0 : _q.open) && /*#__PURE__*/_react["default"].createElement(_components.MetaButton, {
535
+ data: (_r = data.content) === null || _r === void 0 ? void 0 : _r.login
536
+ }))), /*#__PURE__*/_react["default"].createElement(_antd.Carousel, {
537
+ key: JSON.stringify(data.groupSource),
538
+ ref: this.carouselRef,
539
+ afterChange: function afterChange(n) {
540
+ return _this.setState({
541
+ carouseIndex: n
542
+ });
543
+ },
544
+ autoplay: autoplay,
545
+ autoplaySpeed: data.setting.autoplay.interval * 1000,
546
+ className: "carousel-img",
547
+ dots: false
548
+ }, data.groupSource.map(function (m) {
549
+ return /*#__PURE__*/_react["default"].createElement("div", {
550
+ key: m.id
551
+ }, m.image && m.image.open && /*#__PURE__*/_react["default"].createElement(_components.MetaImage, {
552
+ className: "bgImg",
553
+ data: m.image,
554
+ imgCover: true,
555
+ isBackground: true
556
+ }), m.video && /*#__PURE__*/_react["default"].createElement(_VideoItem["default"], {
557
+ data: m
558
+ }));
559
+ })), data.setting.dots.open && /*#__PURE__*/_react["default"].createElement("div", {
560
+ className: "swiper-ban"
561
+ }, data.groupSource.length > 1 && data.groupSource.map(function (item, i) {
562
+ return /*#__PURE__*/_react["default"].createElement("div", {
563
+ key: (item === null || item === void 0 ? void 0 : item.id) || i,
564
+ className: (0, _classnames["default"])('ban', {
565
+ active: i == carouseIndex,
566
+ isCircle: data.setting.dots.layout === 'layout1'
567
+ }),
568
+ onClick: function onClick() {
569
+ var _a;
570
+
571
+ return (_a = _this.carouselRef.current) === null || _a === void 0 ? void 0 : _a.goTo(i);
572
+ },
573
+ style: (0, _commonUtil.pxToRem)({
574
+ backgroundColor: i == carouseIndex ? data.setting.dots.hoverColor.pc : data.setting.dots.color.pc,
575
+ fontSize: i == carouseIndex ? data.setting.dots.hoverSize.pc : data.setting.dots.size.pc
576
+ })
577
+ });
578
+ })));
579
+ };
580
+
581
+ SearchDitoPc.defaultProps = {
582
+ data: {
583
+ setting: {},
584
+ groupSource: []
585
+ }
586
+ };
587
+ return SearchDitoPc;
588
+ }(_react["default"].Component);
589
+
590
+ var _default = SearchDitoPc;
591
+ exports["default"] = _default;