@fonixtree/magic-design 2.0.97 → 2.0.99

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