@fonixtree/magic-design 2.0.95 → 2.0.98

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 (193) hide show
  1. package/es/assets/images/layout-icon/banner-slide-layout1.png +0 -0
  2. package/es/assets/images/layout-icon/banner-slide-layout1.svg +6 -0
  3. package/es/assets/images/layout-icon/banner-slide-layout2.png +0 -0
  4. package/es/assets/images/layout-icon/layout-recommend-mobile-1.png +0 -0
  5. package/es/assets/images/layout-icon/layout-recommend-mobile-2.png +0 -0
  6. package/es/assets/images/layout-icon/layout-recommend-mobile-3.png +0 -0
  7. package/es/assets/images/layout-icon/layout-recommend-mobile-4.png +0 -0
  8. package/es/common/Collapse/index.js +10 -8
  9. package/es/common/FontStyles/index.less +3 -1
  10. package/es/common/LinkModal/MiniAppApi/const.js +637 -0
  11. package/es/common/LinkModal/MiniAppApi/index.js +61 -0
  12. package/es/common/LinkModal/index.js +6 -0
  13. package/es/common/MonpayCountDown/index.js +160 -0
  14. package/es/common/RatingText/index.js +105 -0
  15. package/es/common/RatingText/index.less +12 -0
  16. package/es/common/index.js +8 -0
  17. package/es/composite-comp/bol/components/Banner/defaultJSON.js +1 -0
  18. package/es/composite-comp/bol/components/Banner/mobile/index.js +2 -1
  19. package/es/composite-comp/bol/components/Banner/mobile/index.less +8 -4
  20. package/es/composite-comp/bol/components/Banner/pc/index.js +2 -1
  21. package/es/composite-comp/bol/components/Banner/pc/index.less +9 -3
  22. package/es/composite-comp/bol/config-panels/BannerConfig/BannerConfigSetting/index.js +11 -11
  23. package/es/composite-comp/bol/config-panels/NewsletterConfig/NewsletterContentSetting/index.js +1 -1
  24. package/es/composite-comp/common/components/MonpayProductItem/index.js +283 -0
  25. package/es/composite-comp/common/components/MonpayProductItem/index.less +211 -0
  26. package/es/composite-comp/common/components/ProductItem/index.js +5 -11
  27. package/es/composite-comp/common/components/ProductItem/index.less +10 -0
  28. package/es/composite-comp/common/config-panels/CustomizeConfig/index.js +13 -0
  29. package/es/composite-comp/{bol/config-panels/NewsletterConfig → common/config-panels}/InputField/index.js +18 -10
  30. package/es/composite-comp/dito/components/GroupBuy/defaultJSON.js +0 -4
  31. package/es/composite-comp/dito/components/GroupBuy/mobile/index.js +3 -3
  32. package/es/composite-comp/dito/components/SearchBar/defaultJSON.js +14 -1
  33. package/es/composite-comp/dito/components/SearchBar/mobile/index.js +98 -33
  34. package/es/composite-comp/dito/components/SearchBar/mobile/index.less +11 -1
  35. package/es/composite-comp/dito/components/SearchBar/pc/index.js +78 -6
  36. package/es/composite-comp/dito/components/SearchBar/pc/index.less +1 -0
  37. package/es/composite-comp/dito/components/SignBoard/mobile/index.js +4 -3
  38. package/es/composite-comp/dito/config-panels/GroupBuyConfig/GroupBuyConfigContent/index.js +5 -9
  39. package/es/composite-comp/dito/config-panels/GroupBuyConfig/GroupBuyConfigContent/index.less +2 -0
  40. package/es/composite-comp/dito/config-panels/SearchBarConfig/SearchBarConfigContent/index.js +36 -6
  41. package/es/composite-comp/dito/config-panels/SearchBarConfig/SearchBarConfigContent/index.less +7 -0
  42. package/es/composite-comp/monpay/components/MonpayFlashDeal/MonpayCountDown/index.js +212 -0
  43. package/es/composite-comp/monpay/components/MonpayFlashDeal/MonpayCountDown/index.less +21 -0
  44. package/es/composite-comp/monpay/components/MonpayFlashDeal/defaultJSON.js +322 -0
  45. package/es/composite-comp/monpay/components/MonpayFlashDeal/index.js +90 -0
  46. package/es/composite-comp/monpay/components/MonpayFlashDeal/mobile/imgs/defImg.png +0 -0
  47. package/es/composite-comp/monpay/components/MonpayFlashDeal/mobile/imgs/defImg1.png +0 -0
  48. package/es/composite-comp/monpay/components/MonpayFlashDeal/mobile/imgs/defImg2.png +0 -0
  49. package/es/composite-comp/monpay/components/MonpayFlashDeal/mobile/imgs/defImg3.png +0 -0
  50. package/es/composite-comp/monpay/components/MonpayFlashDeal/mobile/index.js +462 -0
  51. package/es/composite-comp/monpay/components/MonpayFlashDeal/mobile/index.less +104 -0
  52. package/es/composite-comp/monpay/components/MonpayFlashDeal/pc/imgs/defImg.png +0 -0
  53. package/es/composite-comp/monpay/components/MonpayFlashDeal/pc/imgs/defImg1.png +0 -0
  54. package/es/composite-comp/monpay/components/MonpayFlashDeal/pc/imgs/defImg2.png +0 -0
  55. package/es/composite-comp/monpay/components/MonpayFlashDeal/pc/imgs/defImg3.png +0 -0
  56. package/es/composite-comp/monpay/components/MonpayFlashDeal/pc/index.js +582 -0
  57. package/es/composite-comp/monpay/components/MonpayFlashDeal/pc/index.less +150 -0
  58. package/es/composite-comp/monpay/components/MonpayRecommend/defaultJSON.js +385 -0
  59. package/es/composite-comp/monpay/components/MonpayRecommend/index.js +90 -0
  60. package/es/composite-comp/monpay/components/MonpayRecommend/mobile/imgs/defImg1.png +0 -0
  61. package/es/composite-comp/monpay/components/MonpayRecommend/mobile/imgs/defImg2.png +0 -0
  62. package/es/composite-comp/monpay/components/MonpayRecommend/mobile/imgs/defImg3.png +0 -0
  63. package/es/composite-comp/monpay/components/MonpayRecommend/mobile/index.js +714 -0
  64. package/es/composite-comp/monpay/components/MonpayRecommend/mobile/index.less +81 -0
  65. package/es/composite-comp/monpay/components/MonpayRecommend/pc/imgs/defImg1.png +0 -0
  66. package/es/composite-comp/monpay/components/MonpayRecommend/pc/imgs/defImg2.png +0 -0
  67. package/es/composite-comp/monpay/components/MonpayRecommend/pc/imgs/defImg3.png +0 -0
  68. package/es/composite-comp/monpay/components/MonpayRecommend/pc/index.js +763 -0
  69. package/es/composite-comp/monpay/components/MonpayRecommend/pc/index.less +124 -0
  70. package/es/composite-comp/monpay/config-panels/MonpayFlashDealConfig/FlashDealConfigContent/index.js +177 -0
  71. package/es/composite-comp/monpay/config-panels/MonpayFlashDealConfig/FlashDealConfigContent/index.less +41 -0
  72. package/es/composite-comp/monpay/config-panels/MonpayFlashDealConfig/FlashDealConfigTitle/index.js +171 -0
  73. package/es/composite-comp/monpay/config-panels/MonpayFlashDealConfig/FlashDealConfigTitle/index.less +7 -0
  74. package/es/composite-comp/monpay/config-panels/MonpayFlashDealConfig/imgs/layout1.png +0 -0
  75. package/es/composite-comp/monpay/config-panels/MonpayFlashDealConfig/index.js +73 -0
  76. package/es/composite-comp/monpay/config-panels/MonpayRecommendConfig/RecommendConfigContent/index.js +141 -0
  77. package/es/composite-comp/monpay/config-panels/MonpayRecommendConfig/RecommendConfigContent/index.less +0 -0
  78. package/es/composite-comp/monpay/config-panels/MonpayRecommendConfig/RecommendConfigGroup/index.js +149 -0
  79. package/es/composite-comp/monpay/config-panels/MonpayRecommendConfig/RecommendConfigGroup/index.less +16 -0
  80. package/es/composite-comp/monpay/config-panels/MonpayRecommendConfig/RecommendConfigTitle/index.js +93 -0
  81. package/es/composite-comp/monpay/config-panels/MonpayRecommendConfig/RecommendConfigTitle/index.less +0 -0
  82. package/es/composite-comp/monpay/config-panels/MonpayRecommendConfig/imgs/defaultImg.png +0 -0
  83. package/es/composite-comp/monpay/config-panels/MonpayRecommendConfig/index.js +150 -0
  84. package/es/composite-comp/monpay/second-config-panels/MonpayRecommendSecondConfig/AIRecommendation/index.js +431 -0
  85. package/es/composite-comp/monpay/second-config-panels/MonpayRecommendSecondConfig/index.js +258 -0
  86. package/es/composite-comp/monpay/second-config-panels/MonpayRecommendSecondConfig/index.less +15 -0
  87. package/es/constants/component-types.js +13 -3
  88. package/es/constants/index.js +10 -1
  89. package/es/constants/layout.js +43 -4
  90. package/es/core/Designer/ConfigPanel/index.js +1 -1
  91. package/es/core/Designer/index.js +5 -2
  92. package/es/locale/en/en.json +11 -0
  93. package/es/locale/es/es.json +11 -0
  94. package/es/locale/id/id.json +11 -0
  95. package/es/utils/businessUtil.js +12 -0
  96. package/es/utils/dateUtil.js +13 -0
  97. package/lib/assets/images/layout-icon/banner-slide-layout1.png +0 -0
  98. package/lib/assets/images/layout-icon/banner-slide-layout1.svg +6 -0
  99. package/lib/assets/images/layout-icon/banner-slide-layout2.png +0 -0
  100. package/lib/assets/images/layout-icon/layout-recommend-mobile-1.png +0 -0
  101. package/lib/assets/images/layout-icon/layout-recommend-mobile-2.png +0 -0
  102. package/lib/assets/images/layout-icon/layout-recommend-mobile-3.png +0 -0
  103. package/lib/assets/images/layout-icon/layout-recommend-mobile-4.png +0 -0
  104. package/lib/common/Collapse/index.js +10 -8
  105. package/lib/common/FontStyles/index.less +3 -1
  106. package/lib/common/LinkModal/MiniAppApi/const.js +637 -0
  107. package/lib/common/LinkModal/MiniAppApi/index.js +61 -0
  108. package/lib/common/LinkModal/index.js +6 -0
  109. package/lib/common/MonpayCountDown/index.js +160 -0
  110. package/lib/common/RatingText/index.js +105 -0
  111. package/lib/common/RatingText/index.less +12 -0
  112. package/lib/common/index.js +8 -0
  113. package/lib/composite-comp/bol/components/Banner/defaultJSON.js +1 -0
  114. package/lib/composite-comp/bol/components/Banner/mobile/index.js +2 -1
  115. package/lib/composite-comp/bol/components/Banner/mobile/index.less +8 -4
  116. package/lib/composite-comp/bol/components/Banner/pc/index.js +2 -1
  117. package/lib/composite-comp/bol/components/Banner/pc/index.less +9 -3
  118. package/lib/composite-comp/bol/config-panels/BannerConfig/BannerConfigSetting/index.js +11 -11
  119. package/lib/composite-comp/bol/config-panels/NewsletterConfig/NewsletterContentSetting/index.js +1 -1
  120. package/lib/composite-comp/common/components/MonpayProductItem/index.js +283 -0
  121. package/lib/composite-comp/common/components/MonpayProductItem/index.less +211 -0
  122. package/lib/composite-comp/common/components/ProductItem/index.js +5 -11
  123. package/lib/composite-comp/common/components/ProductItem/index.less +10 -0
  124. package/lib/composite-comp/common/config-panels/CustomizeConfig/index.js +13 -0
  125. package/lib/composite-comp/{bol/config-panels/NewsletterConfig → common/config-panels}/InputField/index.js +18 -10
  126. package/lib/composite-comp/dito/components/GroupBuy/defaultJSON.js +0 -4
  127. package/lib/composite-comp/dito/components/GroupBuy/mobile/index.js +3 -3
  128. package/lib/composite-comp/dito/components/SearchBar/defaultJSON.js +14 -1
  129. package/lib/composite-comp/dito/components/SearchBar/mobile/index.js +98 -33
  130. package/lib/composite-comp/dito/components/SearchBar/mobile/index.less +11 -1
  131. package/lib/composite-comp/dito/components/SearchBar/pc/index.js +78 -6
  132. package/lib/composite-comp/dito/components/SearchBar/pc/index.less +1 -0
  133. package/lib/composite-comp/dito/components/SignBoard/mobile/index.js +4 -3
  134. package/lib/composite-comp/dito/config-panels/GroupBuyConfig/GroupBuyConfigContent/index.js +5 -9
  135. package/lib/composite-comp/dito/config-panels/GroupBuyConfig/GroupBuyConfigContent/index.less +2 -0
  136. package/lib/composite-comp/dito/config-panels/SearchBarConfig/SearchBarConfigContent/index.js +36 -6
  137. package/lib/composite-comp/dito/config-panels/SearchBarConfig/SearchBarConfigContent/index.less +7 -0
  138. package/lib/composite-comp/monpay/components/MonpayFlashDeal/MonpayCountDown/index.js +212 -0
  139. package/lib/composite-comp/monpay/components/MonpayFlashDeal/MonpayCountDown/index.less +21 -0
  140. package/lib/composite-comp/monpay/components/MonpayFlashDeal/defaultJSON.js +322 -0
  141. package/lib/composite-comp/monpay/components/MonpayFlashDeal/index.js +90 -0
  142. package/lib/composite-comp/monpay/components/MonpayFlashDeal/mobile/imgs/defImg.png +0 -0
  143. package/lib/composite-comp/monpay/components/MonpayFlashDeal/mobile/imgs/defImg1.png +0 -0
  144. package/lib/composite-comp/monpay/components/MonpayFlashDeal/mobile/imgs/defImg2.png +0 -0
  145. package/lib/composite-comp/monpay/components/MonpayFlashDeal/mobile/imgs/defImg3.png +0 -0
  146. package/lib/composite-comp/monpay/components/MonpayFlashDeal/mobile/index.js +462 -0
  147. package/lib/composite-comp/monpay/components/MonpayFlashDeal/mobile/index.less +104 -0
  148. package/lib/composite-comp/monpay/components/MonpayFlashDeal/pc/imgs/defImg.png +0 -0
  149. package/lib/composite-comp/monpay/components/MonpayFlashDeal/pc/imgs/defImg1.png +0 -0
  150. package/lib/composite-comp/monpay/components/MonpayFlashDeal/pc/imgs/defImg2.png +0 -0
  151. package/lib/composite-comp/monpay/components/MonpayFlashDeal/pc/imgs/defImg3.png +0 -0
  152. package/lib/composite-comp/monpay/components/MonpayFlashDeal/pc/index.js +582 -0
  153. package/lib/composite-comp/monpay/components/MonpayFlashDeal/pc/index.less +150 -0
  154. package/lib/composite-comp/monpay/components/MonpayRecommend/defaultJSON.js +385 -0
  155. package/lib/composite-comp/monpay/components/MonpayRecommend/index.js +90 -0
  156. package/lib/composite-comp/monpay/components/MonpayRecommend/mobile/imgs/defImg1.png +0 -0
  157. package/lib/composite-comp/monpay/components/MonpayRecommend/mobile/imgs/defImg2.png +0 -0
  158. package/lib/composite-comp/monpay/components/MonpayRecommend/mobile/imgs/defImg3.png +0 -0
  159. package/lib/composite-comp/monpay/components/MonpayRecommend/mobile/index.js +714 -0
  160. package/lib/composite-comp/monpay/components/MonpayRecommend/mobile/index.less +81 -0
  161. package/lib/composite-comp/monpay/components/MonpayRecommend/pc/imgs/defImg1.png +0 -0
  162. package/lib/composite-comp/monpay/components/MonpayRecommend/pc/imgs/defImg2.png +0 -0
  163. package/lib/composite-comp/monpay/components/MonpayRecommend/pc/imgs/defImg3.png +0 -0
  164. package/lib/composite-comp/monpay/components/MonpayRecommend/pc/index.js +763 -0
  165. package/lib/composite-comp/monpay/components/MonpayRecommend/pc/index.less +124 -0
  166. package/lib/composite-comp/monpay/config-panels/MonpayFlashDealConfig/FlashDealConfigContent/index.js +177 -0
  167. package/lib/composite-comp/monpay/config-panels/MonpayFlashDealConfig/FlashDealConfigContent/index.less +41 -0
  168. package/lib/composite-comp/monpay/config-panels/MonpayFlashDealConfig/FlashDealConfigTitle/index.js +171 -0
  169. package/lib/composite-comp/monpay/config-panels/MonpayFlashDealConfig/FlashDealConfigTitle/index.less +7 -0
  170. package/lib/composite-comp/monpay/config-panels/MonpayFlashDealConfig/imgs/layout1.png +0 -0
  171. package/lib/composite-comp/monpay/config-panels/MonpayFlashDealConfig/index.js +73 -0
  172. package/lib/composite-comp/monpay/config-panels/MonpayRecommendConfig/RecommendConfigContent/index.js +141 -0
  173. package/lib/composite-comp/monpay/config-panels/MonpayRecommendConfig/RecommendConfigContent/index.less +0 -0
  174. package/lib/composite-comp/monpay/config-panels/MonpayRecommendConfig/RecommendConfigGroup/index.js +149 -0
  175. package/lib/composite-comp/monpay/config-panels/MonpayRecommendConfig/RecommendConfigGroup/index.less +16 -0
  176. package/lib/composite-comp/monpay/config-panels/MonpayRecommendConfig/RecommendConfigTitle/index.js +93 -0
  177. package/lib/composite-comp/monpay/config-panels/MonpayRecommendConfig/RecommendConfigTitle/index.less +0 -0
  178. package/lib/composite-comp/monpay/config-panels/MonpayRecommendConfig/imgs/defaultImg.png +0 -0
  179. package/lib/composite-comp/monpay/config-panels/MonpayRecommendConfig/index.js +150 -0
  180. package/lib/composite-comp/monpay/second-config-panels/MonpayRecommendSecondConfig/AIRecommendation/index.js +431 -0
  181. package/lib/composite-comp/monpay/second-config-panels/MonpayRecommendSecondConfig/index.js +258 -0
  182. package/lib/composite-comp/monpay/second-config-panels/MonpayRecommendSecondConfig/index.less +15 -0
  183. package/lib/constants/component-types.js +13 -3
  184. package/lib/constants/index.js +10 -1
  185. package/lib/constants/layout.js +43 -4
  186. package/lib/core/Designer/ConfigPanel/index.js +1 -1
  187. package/lib/core/Designer/index.js +5 -2
  188. package/lib/locale/en/en.json +11 -0
  189. package/lib/locale/es/es.json +11 -0
  190. package/lib/locale/id/id.json +11 -0
  191. package/lib/utils/businessUtil.js +12 -0
  192. package/lib/utils/dateUtil.js +13 -0
  193. package/package.json +1 -1
@@ -0,0 +1,763 @@
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
+ var _macy = _interopRequireDefault(require("macy"));
11
+
12
+ require("./index.less");
13
+
14
+ var _classnames = _interopRequireDefault(require("classnames"));
15
+
16
+ var _debounce = _interopRequireDefault(require("lodash/debounce"));
17
+
18
+ var _lodash = _interopRequireDefault(require("lodash.throttle"));
19
+
20
+ var _mobx = require("../../../../../mobx");
21
+
22
+ var _MonpayProductItem = _interopRequireDefault(require("../../../../common/components/MonpayProductItem"));
23
+
24
+ var _components = require("../../../../../meta-comp/components");
25
+
26
+ var _storeUtil = require("../../../../../utils/storeUtil");
27
+
28
+ var _commonUtil = require("../../../../../utils/commonUtil");
29
+
30
+ var _coreUtil = require("../../../../../utils/coreUtil");
31
+
32
+ var _Iconfont = _interopRequireDefault(require("../../../../../common/Iconfont"));
33
+
34
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
35
+
36
+ var __extends = void 0 && (void 0).__extends || function () {
37
+ var _extendStatics = function extendStatics(d, b) {
38
+ _extendStatics = Object.setPrototypeOf || {
39
+ __proto__: []
40
+ } instanceof Array && function (d, b) {
41
+ d.__proto__ = b;
42
+ } || function (d, b) {
43
+ for (var p in b) {
44
+ if (b.hasOwnProperty(p)) d[p] = b[p];
45
+ }
46
+ };
47
+
48
+ return _extendStatics(d, b);
49
+ };
50
+
51
+ return function (d, b) {
52
+ _extendStatics(d, b);
53
+
54
+ function __() {
55
+ this.constructor = d;
56
+ }
57
+
58
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
59
+ };
60
+ }();
61
+
62
+ var __assign = void 0 && (void 0).__assign || function () {
63
+ __assign = Object.assign || function (t) {
64
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
65
+ s = arguments[i];
66
+
67
+ for (var p in s) {
68
+ if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
69
+ }
70
+ }
71
+
72
+ return t;
73
+ };
74
+
75
+ return __assign.apply(this, arguments);
76
+ };
77
+
78
+ var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
79
+ function adopt(value) {
80
+ return value instanceof P ? value : new P(function (resolve) {
81
+ resolve(value);
82
+ });
83
+ }
84
+
85
+ return new (P || (P = Promise))(function (resolve, reject) {
86
+ function fulfilled(value) {
87
+ try {
88
+ step(generator.next(value));
89
+ } catch (e) {
90
+ reject(e);
91
+ }
92
+ }
93
+
94
+ function rejected(value) {
95
+ try {
96
+ step(generator["throw"](value));
97
+ } catch (e) {
98
+ reject(e);
99
+ }
100
+ }
101
+
102
+ function step(result) {
103
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
104
+ }
105
+
106
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
107
+ });
108
+ };
109
+
110
+ var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
111
+ var _ = {
112
+ label: 0,
113
+ sent: function sent() {
114
+ if (t[0] & 1) throw t[1];
115
+ return t[1];
116
+ },
117
+ trys: [],
118
+ ops: []
119
+ },
120
+ f,
121
+ y,
122
+ t,
123
+ g;
124
+ return g = {
125
+ next: verb(0),
126
+ "throw": verb(1),
127
+ "return": verb(2)
128
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
129
+ return this;
130
+ }), g;
131
+
132
+ function verb(n) {
133
+ return function (v) {
134
+ return step([n, v]);
135
+ };
136
+ }
137
+
138
+ function step(op) {
139
+ if (f) throw new TypeError("Generator is already executing.");
140
+
141
+ while (_) {
142
+ try {
143
+ 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;
144
+ if (y = 0, t) op = [op[0] & 2, t.value];
145
+
146
+ switch (op[0]) {
147
+ case 0:
148
+ case 1:
149
+ t = op;
150
+ break;
151
+
152
+ case 4:
153
+ _.label++;
154
+ return {
155
+ value: op[1],
156
+ done: false
157
+ };
158
+
159
+ case 5:
160
+ _.label++;
161
+ y = op[1];
162
+ op = [0];
163
+ continue;
164
+
165
+ case 7:
166
+ op = _.ops.pop();
167
+
168
+ _.trys.pop();
169
+
170
+ continue;
171
+
172
+ default:
173
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
174
+ _ = 0;
175
+ continue;
176
+ }
177
+
178
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
179
+ _.label = op[1];
180
+ break;
181
+ }
182
+
183
+ if (op[0] === 6 && _.label < t[1]) {
184
+ _.label = t[1];
185
+ t = op;
186
+ break;
187
+ }
188
+
189
+ if (t && _.label < t[2]) {
190
+ _.label = t[2];
191
+
192
+ _.ops.push(op);
193
+
194
+ break;
195
+ }
196
+
197
+ if (t[2]) _.ops.pop();
198
+
199
+ _.trys.pop();
200
+
201
+ continue;
202
+ }
203
+
204
+ op = body.call(thisArg, _);
205
+ } catch (e) {
206
+ op = [6, e];
207
+ y = 0;
208
+ } finally {
209
+ f = t = 0;
210
+ }
211
+ }
212
+
213
+ if (op[0] & 5) throw op[1];
214
+ return {
215
+ value: op[0] ? op[1] : void 0,
216
+ done: true
217
+ };
218
+ }
219
+ };
220
+
221
+ var __spreadArrays = void 0 && (void 0).__spreadArrays || function () {
222
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++) {
223
+ s += arguments[i].length;
224
+ }
225
+
226
+ for (var r = Array(s), k = 0, i = 0; i < il; i++) {
227
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) {
228
+ r[k] = a[j];
229
+ }
230
+ }
231
+
232
+ return r;
233
+ };
234
+
235
+ var RecommendMobile =
236
+ /** @class */
237
+ function (_super) {
238
+ __extends(RecommendMobile, _super);
239
+
240
+ function RecommendMobile() {
241
+ var _this = _super !== null && _super.apply(this, arguments) || this;
242
+
243
+ _this.preData = {};
244
+ _this.preLayout = '';
245
+ _this.preContent = '';
246
+ _this.preSpacing = '';
247
+ _this._cache = (0, _coreUtil.isDesignMode)() ? {} : (0, _commonUtil.ensure)(function () {
248
+ return (0, _storeUtil.getMagicStore)("recommend_" + (window.magicDesign.pageId || '') + "_" + _this.props.panelProps.id);
249
+ }, {});
250
+ _this.scrollRef = /*#__PURE__*/_react["default"].createRef();
251
+ _this.state = __assign({
252
+ contentWidth: 0,
253
+ tabIndex: 0,
254
+ tabLeft: 0,
255
+ tabWidth: 0,
256
+ groupSource: [],
257
+ hideTabs: false,
258
+ scrollToLeftDisabled: true,
259
+ scrollToRightDisabled: true
260
+ }, _this._cache);
261
+
262
+ _this.listenWidth = function () {
263
+ setTimeout(function () {
264
+ var renderContainer = document.querySelector(".macyContainer_" + _this.props.panelProps.id) || document.querySelector(".scrollContainer_" + _this.props.panelProps.id);
265
+ if (renderContainer) _this.setState({
266
+ contentWidth: renderContainer.offsetWidth
267
+ });
268
+ });
269
+ };
270
+
271
+ _this.setScrollDisabled = function (scrollDom) {
272
+ var scrollToLeftDisabled = scrollDom.scrollLeft === 0;
273
+ var scrollToRightDisabled = scrollDom.clientWidth + scrollDom.scrollLeft >= scrollDom.scrollWidth;
274
+
275
+ _this.setState({
276
+ scrollToLeftDisabled: scrollToLeftDisabled,
277
+ scrollToRightDisabled: scrollToRightDisabled
278
+ });
279
+ };
280
+
281
+ _this.initTab = function (index, hideTabs) {
282
+ var selectedTabDom = document.querySelector(".tab-select-wrap .tabTitle:nth-child(" + (index + 1) + ")");
283
+ var tabLeft = 0;
284
+ var tabWidth = 0;
285
+
286
+ if (selectedTabDom && !hideTabs) {
287
+ tabLeft = selectedTabDom.offsetLeft;
288
+ tabWidth = selectedTabDom.offsetWidth;
289
+ }
290
+
291
+ _this.setState({
292
+ tabLeft: tabLeft,
293
+ tabWidth: tabWidth
294
+ });
295
+ };
296
+
297
+ _this.getTabBarActiveColor = function (_panelProps) {
298
+ var tabIndex = _this.state.tabIndex;
299
+ return (0, _commonUtil.ensure)(function () {
300
+ return _panelProps.groupSource[tabIndex].hover.groupName.content.color;
301
+ }, '#1890ff');
302
+ };
303
+
304
+ _this.getProductList = function (index) {
305
+ return __awaiter(_this, void 0, void 0, function () {
306
+ var panelProps, groupSource, recommendId, pageId, cache, _a, _b, sourceType, _c, prodIds, _d, intelligentType, _e, intelligentValue, _f, maxProdNum, newData, res, res, e_1, _cache;
307
+
308
+ var _g, _h, _j;
309
+
310
+ var _this = this;
311
+
312
+ return __generator(this, function (_k) {
313
+ switch (_k.label) {
314
+ case 0:
315
+ panelProps = this.props.panelProps;
316
+ groupSource = this.state.groupSource;
317
+ recommendId = panelProps.id;
318
+ pageId = window.magicDesign.pageId || '';
319
+
320
+ if (!(0, _coreUtil.isDesignMode)()) {
321
+ cache = (0, _storeUtil.getMagicStore)("recommend_" + pageId + "_" + recommendId);
322
+
323
+ if (cache) {
324
+ if ("products" + index in cache) {
325
+ this.setState((_g = {}, _g["products" + index] = cache["products" + index], _g), function () {
326
+ _this.resetLayout();
327
+ });
328
+ /** 如果数据未过期 */
329
+
330
+ if (cache.endTime > Date.now()) return [2
331
+ /*return*/
332
+ ];
333
+ }
334
+ }
335
+ }
336
+
337
+ _a = groupSource[index] || {}, _b = _a.sourceType, sourceType = _b === void 0 ? '' : _b, _c = _a.prodIds, prodIds = _c === void 0 ? '' : _c, _d = _a.intelligentType, intelligentType = _d === void 0 ? '' : _d, _e = _a.intelligentValue, intelligentValue = _e === void 0 ? [] : _e, _f = _a.maxProdNum, maxProdNum = _f === void 0 ? 10 : _f;
338
+ newData = [];
339
+ _k.label = 1;
340
+
341
+ case 1:
342
+ _k.trys.push([1, 9,, 10]);
343
+
344
+ if (!(groupSource.length > 0)) return [3
345
+ /*break*/
346
+ , 7];
347
+ if (!(sourceType === 'select')) return [3
348
+ /*break*/
349
+ , 3];
350
+
351
+ if (!prodIds) {
352
+ return [2
353
+ /*return*/
354
+ ];
355
+ }
356
+
357
+ return [4
358
+ /*yield*/
359
+ , (0, _commonUtil.commonFetch)('/designer/v1/h5/products', {
360
+ products: prodIds,
361
+ state: 'A'
362
+ }, 'GET')];
363
+
364
+ case 2:
365
+ res = _k.sent();
366
+ newData = __spreadArrays(res.list);
367
+ return [3
368
+ /*break*/
369
+ , 6];
370
+
371
+ case 3:
372
+ if (!(sourceType === 'recommend')) return [3
373
+ /*break*/
374
+ , 5];
375
+ return [4
376
+ /*yield*/
377
+ , (0, _commonUtil.commonFetch)('/designer/v1/h5/offers', {
378
+ pageIndex: 1,
379
+ pageSize: maxProdNum,
380
+ sortType: '1',
381
+ intelligentType: intelligentType,
382
+ intelligentValue: intelligentValue.join(','),
383
+ aggregation: false,
384
+ storeId: window.magicDesign.storeId >= 0 ? window.magicDesign.storeId : ''
385
+ }, 'POST')];
386
+
387
+ case 4:
388
+ res = _k.sent();
389
+ newData = __spreadArrays(res.pageInfo.list);
390
+ return [3
391
+ /*break*/
392
+ , 6];
393
+
394
+ case 5:
395
+ newData = [];
396
+ _k.label = 6;
397
+
398
+ case 6:
399
+ return [3
400
+ /*break*/
401
+ , 8];
402
+
403
+ case 7:
404
+ newData = [];
405
+ _k.label = 8;
406
+
407
+ case 8:
408
+ return [3
409
+ /*break*/
410
+ , 10];
411
+
412
+ case 9:
413
+ e_1 = _k.sent();
414
+ newData = [];
415
+ return [3
416
+ /*break*/
417
+ , 10];
418
+
419
+ case 10:
420
+ if (!(0, _coreUtil.isDesignMode)()) {
421
+ _cache = (0, _storeUtil.getMagicStore)("recommend_" + pageId + "_" + recommendId);
422
+ (0, _storeUtil.setMagicStore)("recommend_" + pageId + "_" + recommendId, __assign(__assign({}, _cache), (_h = {}, _h["products" + index] = newData, _h.endTime = Date.now() + 3 * 60 * 1000, _h)));
423
+ }
424
+
425
+ this.setState((_j = {}, _j["products" + index] = newData, _j), function () {
426
+ _this.resetLayout();
427
+ });
428
+ return [2
429
+ /*return*/
430
+ ];
431
+ }
432
+ });
433
+ });
434
+ };
435
+
436
+ _this.resetLayout = function () {
437
+ var customize = _this.props.panelProps.customize;
438
+ if (customize.layout.pcLayout !== 'layout1') return;
439
+ setTimeout(function () {
440
+ if (document.querySelector(".macyContainer_" + _this.props.panelProps.id)) {
441
+ _this.getMacy(".macyContainer_" + _this.props.panelProps.id, customize.pcRowNum);
442
+ }
443
+ }, 10);
444
+ };
445
+
446
+ _this.getMacy = function (container, columns) {
447
+ var masonryNew = new _macy["default"]({
448
+ container: container,
449
+ trueOrder: false,
450
+ waitForImages: false,
451
+ useOwnImageLoader: false,
452
+ margin: {
453
+ x: 24,
454
+ y: 24
455
+ },
456
+ columns: columns
457
+ });
458
+ masonryNew.runOnImageLoad(function () {
459
+ masonryNew.recalculate(true);
460
+ }, true);
461
+ };
462
+
463
+ _this.onTabClick = function (e, index) {
464
+ var tabIndex = _this.state.tabIndex;
465
+ if (tabIndex === index) return; // e.currentTarget.scrollIntoView(false);
466
+
467
+ _this.setState({
468
+ tabIndex: index
469
+ }, function () {
470
+ _this.resetLayout();
471
+
472
+ _this.initTab(index);
473
+ });
474
+
475
+ _this.getProductList(index);
476
+
477
+ setTimeout(function () {
478
+ var scrollDom = _this.scrollRef.current;
479
+
480
+ if (scrollDom) {
481
+ _this.setScrollDisabled(scrollDom);
482
+
483
+ scrollDom.onscroll = (0, _lodash["default"])(function () {
484
+ _this.setScrollDisabled(scrollDom);
485
+ }, 500);
486
+ }
487
+ }, 0);
488
+ };
489
+
490
+ _this.scrollToRight = function () {
491
+ var scrollDom = _this.scrollRef.current;
492
+
493
+ if (scrollDom.clientWidth + scrollDom.scrollLeft < scrollDom.scrollWidth) {
494
+ scrollDom.scrollTo(scrollDom.scrollLeft + scrollDom.clientWidth, 0);
495
+ }
496
+ };
497
+
498
+ _this.scrollToLeft = function () {
499
+ var scrollDom = _this.scrollRef.current;
500
+
501
+ if (scrollDom.scrollLeft > 0) {
502
+ scrollDom.scrollTo(scrollDom.scrollLeft - scrollDom.clientWidth, 0);
503
+ }
504
+ };
505
+
506
+ return _this;
507
+ }
508
+
509
+ RecommendMobile.prototype.componentDidMount = function () {
510
+ var _this = this;
511
+
512
+ var panelProps = this.props.panelProps;
513
+ var source = [];
514
+ panelProps.groupSource.map(function (m) {
515
+ var show = m.image.open || m.groupName.open;
516
+ if (show) source.push(m);
517
+ });
518
+ this.setState({
519
+ groupSource: source
520
+ }, function () {
521
+ _this.initTab(0);
522
+
523
+ _this.getProductList(0);
524
+ });
525
+ setTimeout(function () {
526
+ var scrollDom = _this.scrollRef.current;
527
+
528
+ if (scrollDom) {
529
+ _this.setScrollDisabled(scrollDom);
530
+
531
+ scrollDom.onscroll = (0, _lodash["default"])(function () {
532
+ _this.setScrollDisabled(scrollDom);
533
+ }, 500);
534
+ }
535
+ }, 0);
536
+ this.listenWidth();
537
+ window.addEventListener('resize', (0, _debounce["default"])(this.listenWidth));
538
+ };
539
+
540
+ RecommendMobile.prototype.componentWillUnmount = function () {
541
+ window.removeEventListener('resize', this.listenWidth);
542
+ };
543
+
544
+ RecommendMobile.prototype.componentWillReceiveProps = function (nextProps) {
545
+ var _this = this;
546
+
547
+ var tabIndex = this.state.tabIndex;
548
+ var panelProps = nextProps.panelProps;
549
+ var source = [];
550
+ var hideTabs = false;
551
+ panelProps.groupSource.map(function (m) {
552
+ var show = m.image.open || m.groupName.open;
553
+ if (show) source.push(m);
554
+ });
555
+
556
+ if (source.length === 0) {
557
+ if (panelProps.groupSource.length > 0) source.push(panelProps.groupSource[0]);
558
+ hideTabs = true;
559
+ }
560
+
561
+ this.setState({
562
+ groupSource: source
563
+ }, function () {
564
+ var groupSource = _this.state.groupSource;
565
+
566
+ if (JSON.stringify(groupSource) === _this.preData) {
567
+ return;
568
+ }
569
+
570
+ _this.preData = JSON.stringify(groupSource);
571
+ var newTabIndex = tabIndex;
572
+ if (tabIndex >= source.length) newTabIndex = 0;
573
+
574
+ _this.initTab(newTabIndex, hideTabs);
575
+
576
+ _this.getProductList(newTabIndex);
577
+
578
+ _this.setState({
579
+ tabIndex: newTabIndex,
580
+ hideTabs: hideTabs
581
+ });
582
+ });
583
+ var curLayout = JSON.stringify(panelProps.customize);
584
+
585
+ if (curLayout !== this.preLayout) {
586
+ this.resetLayout();
587
+ setTimeout(function () {
588
+ var scrollDom = _this.scrollRef.current;
589
+
590
+ if (scrollDom) {
591
+ _this.setScrollDisabled(scrollDom);
592
+
593
+ scrollDom.onscroll = (0, _lodash["default"])(function () {
594
+ _this.setScrollDisabled(scrollDom);
595
+ }, 500);
596
+ }
597
+ }, 0);
598
+ }
599
+
600
+ var curContent = JSON.stringify(panelProps.content);
601
+ var curSpacing = JSON.stringify(panelProps.spacing);
602
+
603
+ if (curLayout !== this.preLayout || curSpacing !== this.preSpacing) {
604
+ this.listenWidth();
605
+ }
606
+
607
+ if (curContent !== this.preContent || curSpacing !== this.preSpacing) {
608
+ this.resetLayout();
609
+ }
610
+
611
+ this.preLayout = curLayout;
612
+ this.preContent = curContent;
613
+ this.preSpacing = curSpacing;
614
+ };
615
+
616
+ RecommendMobile.prototype.render = function () {
617
+ var _this = this;
618
+
619
+ var panelProps = this.props.panelProps;
620
+ var _a = this.state,
621
+ tabIndex = _a.tabIndex,
622
+ tabLeft = _a.tabLeft,
623
+ tabWidth = _a.tabWidth,
624
+ groupSource = _a.groupSource,
625
+ hideTabs = _a.hideTabs,
626
+ scrollToLeftDisabled = _a.scrollToLeftDisabled,
627
+ scrollToRightDisabled = _a.scrollToRightDisabled,
628
+ contentWidth = _a.contentWidth;
629
+ var products = this.state["products" + tabIndex] || [];
630
+ var isDivide = false;
631
+ var layout = panelProps.customize.layout.pcLayout;
632
+
633
+ var _seeAll = (0, _commonUtil.ensure)(function () {
634
+ return groupSource[tabIndex].seeAll;
635
+ }, '');
636
+
637
+ var imgSize = 140;
638
+ var otherWidth = layout === 'layout3' ? 100 : 0;
639
+ var colNumber = layout === 'layout1' ? panelProps.customize.pcRowNum : panelProps.customize.pcRowNum + 0.5;
640
+ var spaceNumber = layout === 'layout1' ? panelProps.customize.pcRowNum - 1 : panelProps.customize.pcRowNum;
641
+ if (contentWidth) imgSize = (contentWidth - 24 * spaceNumber - otherWidth) / colNumber;
642
+ return /*#__PURE__*/_react["default"].createElement("div", {
643
+ className: "m-recommend-pc"
644
+ }, !hideTabs && /*#__PURE__*/_react["default"].createElement("div", {
645
+ className: "tab-select-wrap"
646
+ }, groupSource.map(function (tab, index) {
647
+ var _image = index == tabIndex && tab.hover.open && tab.hover.image.open ? tab.hover.image : tab.image;
648
+
649
+ var _groupName = index == tabIndex && tab.hover.open && tab.hover.groupName.open ? tab.hover.groupName : tab.groupName;
650
+
651
+ return /*#__PURE__*/_react["default"].createElement("div", {
652
+ key: tab.id,
653
+ className: "tabTitle",
654
+ onClick: function onClick(e) {
655
+ _this.onTabClick(e, index);
656
+
657
+ _mobx.store.setState({
658
+ clickedGroup: tab.id,
659
+ clickedFloor: _mobx.store.getFloorIdByGroupId(tab.id)
660
+ });
661
+ },
662
+ style: {
663
+ flex: ~~isDivide
664
+ }
665
+ }, tab.image.open && _image && /*#__PURE__*/_react["default"].createElement(_components.MetaImage, {
666
+ data: _image
667
+ }), tab.groupName.open && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
668
+ data: _groupName,
669
+ onTextInput: function onTextInput(text) {
670
+ tab.hover.groupName.text = text;
671
+ tab.groupName.text = text;
672
+ }
673
+ }));
674
+ }), /*#__PURE__*/_react["default"].createElement("div", {
675
+ className: "active-line",
676
+ style: {
677
+ width: tabWidth,
678
+ transform: "translateX(" + tabLeft + "px)",
679
+ background: this.getTabBarActiveColor(panelProps)
680
+ }
681
+ })), /*#__PURE__*/_react["default"].createElement("div", {
682
+ className: "tab-content"
683
+ }, layout !== 'layout1' && /*#__PURE__*/_react["default"].createElement("div", {
684
+ className: "arrow-icon left",
685
+ onClick: function onClick() {
686
+ return _this.scrollToLeft();
687
+ }
688
+ }, /*#__PURE__*/_react["default"].createElement(_Iconfont["default"], {
689
+ color: scrollToLeftDisabled ? '#BDC1C8' : '#232F46',
690
+ size: (0, _commonUtil.convertToRem)(20),
691
+ type: "icon-outlined-left"
692
+ })), layout === 'layout1' ? /*#__PURE__*/_react["default"].createElement("div", {
693
+ className: "tab-list"
694
+ }, /*#__PURE__*/_react["default"].createElement("div", {
695
+ key: "macyContainer",
696
+ ref: this.scrollRef,
697
+ className: "macyContainer macyContainer_" + panelProps.id
698
+ }, products.map(function (item) {
699
+ return /*#__PURE__*/_react["default"].createElement(_MonpayProductItem["default"], {
700
+ key: item.productId,
701
+ data: item,
702
+ fixHeight: true,
703
+ imgHeight: imgSize,
704
+ imgWidth: "100%" // onItemClick={() => clickUrl(`/product/detail/${item.offerId}`)}
705
+ ,
706
+ onItemClick: function onItemClick() {
707
+ return (0, _coreUtil.clickUrl)("proDetail-" + item.offerId);
708
+ },
709
+ panelProps: panelProps.content,
710
+ showProgress: false
711
+ });
712
+ })), _seeAll.open && products.length > 0 && /*#__PURE__*/_react["default"].createElement(_components.MetaButton, {
713
+ className: (0, _classnames["default"])('btnSeeAll', {
714
+ line: layout === 'layout1'
715
+ }),
716
+ data: _seeAll
717
+ })) : /*#__PURE__*/_react["default"].createElement("div", {
718
+ key: "scrollContainer",
719
+ ref: this.scrollRef,
720
+ className: (0, _classnames["default"])("scrollContainer scrollContainer_" + panelProps.id, {
721
+ pl_100: layout === 'layout3'
722
+ })
723
+ }, /*#__PURE__*/_react["default"].createElement("div", {
724
+ className: "scrollProductList"
725
+ }, products.map(function (item) {
726
+ return /*#__PURE__*/_react["default"].createElement("div", {
727
+ className: "productCard"
728
+ }, /*#__PURE__*/_react["default"].createElement(_MonpayProductItem["default"], {
729
+ key: "scroll_" + item.productId,
730
+ data: item,
731
+ fixHeight: true,
732
+ imgHeight: imgSize,
733
+ imgWidth: imgSize // onItemClick={() => clickUrl(`/product/detail/${item.offerId}`)}
734
+ ,
735
+ onItemClick: function onItemClick() {
736
+ return (0, _coreUtil.clickUrl)("proDetail-" + item.offerId);
737
+ },
738
+ panelProps: panelProps.content,
739
+ showProgress: false
740
+ }));
741
+ })), _seeAll.open && products.length > 0 && /*#__PURE__*/_react["default"].createElement(_components.MetaButton, {
742
+ className: "btnSeeAll",
743
+ data: _seeAll
744
+ })), layout !== 'layout1' && /*#__PURE__*/_react["default"].createElement("div", {
745
+ className: "arrow-icon right",
746
+ onClick: function onClick() {
747
+ return _this.scrollToRight();
748
+ }
749
+ }, /*#__PURE__*/_react["default"].createElement(_Iconfont["default"], {
750
+ color: scrollToRightDisabled ? '#BDC1C8' : '#232F46',
751
+ size: (0, _commonUtil.convertToRem)(20),
752
+ type: "icon-outlined-right"
753
+ }))));
754
+ };
755
+
756
+ RecommendMobile.defaultProps = {
757
+ panelProps: {}
758
+ };
759
+ return RecommendMobile;
760
+ }(_react["default"].Component);
761
+
762
+ var _default = RecommendMobile;
763
+ exports["default"] = _default;