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