@fonixtree/magic-design 2.0.202 → 2.0.203
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.
- package/es/assets/fonts/AvenirNext-Bold.ttf +0 -0
- package/es/assets/fonts/AvenirNext-DemiBold.ttf +0 -0
- package/es/assets/fonts/AvenirNext-Medium.ttf +0 -0
- package/es/assets/fonts/AvenirNext-Regular.ttf +0 -0
- package/es/assets/fonts/magic-box-iconfont.css +27 -3
- package/es/assets/fonts/magic-box-iconfont.js +1 -1
- package/es/assets/fonts/magic-box-iconfont.ttf +0 -0
- package/es/assets/fonts/magic-box-iconfont.woff +0 -0
- package/es/assets/fonts/magic-box-iconfont.woff2 +0 -0
- package/es/assets/images/layout-icon/banner-slide-layout3.png +0 -0
- package/es/assets/images/layout-icon/grouped-carousel-layout1.png +0 -0
- package/es/assets/images/layout-icon/news-layout1.png +0 -0
- package/es/assets/images/layout-icon/search-dito-layout1.png +0 -0
- package/es/assets/images/layout-icon/slide-image-layout1.png +0 -0
- package/es/assets/less/font.less +30 -0
- package/es/assets/less/global.less +5 -0
- package/es/common/CountDown/index.js +29 -2
- package/es/common/CountDown/index.less +38 -5
- package/es/common/LinkModal/ProductList/index.js +484 -0
- package/es/common/LinkModal/ProductList/index.less +130 -0
- package/es/common/LinkModal/index.js +8 -1
- package/es/common/ProductCardModal/imgs/dot-icon.png +0 -0
- package/es/common/ProductCardModal/index.js +255 -0
- package/es/common/ProductCardModal/index.less +131 -0
- package/es/common/Toast/index.js +30 -0
- package/es/common/Toast/index.less +29 -0
- package/es/common/UrlPicker/index.js +1 -1
- package/es/common/Video/index.js +5 -3
- package/es/common/VideoPC/background.png +0 -0
- package/es/common/VideoPC/closeImg.png +0 -0
- package/es/common/VideoPC/components/index.js +100 -0
- package/es/common/VideoPC/components/index.less +62 -0
- package/es/common/VideoPC/cover.png +0 -0
- package/es/common/VideoPC/index.js +750 -0
- package/es/common/VideoPC/index.less +79 -0
- package/es/common/index.js +24 -0
- package/es/composite-comp/common/components/ProductItem/index.js +15 -8
- package/es/composite-comp/common/components/ProductItem/index.less +7 -0
- package/es/composite-comp/common/config-panels/BackgroundConfig/index.js +15 -73
- package/es/composite-comp/common/config-panels/SpacingConfig/index.js +30 -0
- package/es/composite-comp/dito/components/CommonFunctions/defaultJSON.js +1 -1
- package/es/composite-comp/dito/components/CommonFunctions/mobile/index.js +8 -0
- package/es/composite-comp/dito/components/CommonFunctions/mobile/index.less +3 -0
- package/es/composite-comp/dito/components/FlashDeal/defaultJSON.js +26 -12
- package/es/composite-comp/dito/components/FlashDeal/mobile/index.js +15 -14
- package/es/composite-comp/dito/components/FlashDeal/pc/ProductItem/index.js +197 -0
- package/es/composite-comp/dito/components/FlashDeal/pc/ProductItem/index.less +100 -0
- package/es/composite-comp/dito/components/FlashDeal/pc/index.js +18 -22
- package/es/composite-comp/dito/components/FlashDeal/pc/index.less +19 -30
- package/es/composite-comp/dito/components/GroupBuy/mobile/index.less +5 -2
- package/es/composite-comp/dito/components/GroupedCarousel/defaultJSON.js +312 -0
- package/es/composite-comp/dito/components/GroupedCarousel/index.js +86 -0
- package/es/composite-comp/dito/components/GroupedCarousel/pc/index.js +189 -0
- package/es/composite-comp/dito/components/GroupedCarousel/pc/index.less +65 -0
- package/es/composite-comp/dito/components/News/defaultJSON.js +172 -0
- package/{lib/composite-comp/dito/components/Orders → es/composite-comp/dito/components/News}/index.js +13 -13
- package/es/composite-comp/dito/components/News/pc/index.js +113 -0
- package/es/composite-comp/dito/components/News/pc/index.less +46 -0
- package/es/composite-comp/dito/components/Orders/defaultJSON.js +1 -1
- package/es/composite-comp/dito/components/PersonalInformation/defaultJSON.js +56 -2
- package/es/composite-comp/dito/components/PersonalInformation/mobile/index.js +147 -15
- package/es/composite-comp/dito/components/PersonalInformation/mobile/index.less +100 -8
- package/es/composite-comp/dito/components/Recommend/mobile/index.js +130 -14
- package/es/composite-comp/dito/components/SearchBanner/mobile/index.js +3 -11
- package/es/composite-comp/dito/components/SearchDITO/defaultJSON.js +221 -0
- package/es/composite-comp/dito/components/SearchDITO/index.js +86 -0
- package/es/composite-comp/dito/components/SearchDITO/pc/components/ConfirmModal/index.less +69 -0
- package/es/composite-comp/dito/components/SearchDITO/pc/components/Header/index.js +602 -0
- package/es/composite-comp/dito/components/SearchDITO/pc/components/Header/index.less +184 -0
- package/es/composite-comp/dito/components/SearchDITO/pc/components/VideoItem/index.js +153 -0
- package/es/composite-comp/dito/components/SearchDITO/pc/components/VideoItem/index.less +25 -0
- package/es/composite-comp/dito/components/SearchDITO/pc/imgs/avatar.png +0 -0
- package/es/composite-comp/dito/components/SearchDITO/pc/index.js +176 -0
- package/es/composite-comp/dito/components/SearchDITO/pc/index.less +57 -0
- package/es/composite-comp/dito/components/SlideImage/defaultJSON.js +138 -0
- package/es/composite-comp/dito/components/SlideImage/index.js +86 -0
- package/es/composite-comp/dito/components/SlideImage/pc/components/CardItem/index.js +105 -0
- package/es/composite-comp/dito/components/SlideImage/pc/components/CardItem/index.less +5 -0
- package/es/composite-comp/dito/components/SlideImage/pc/components/ParallaxScroll/index.js +170 -0
- package/es/composite-comp/dito/components/SlideImage/pc/components/ParallaxScroll/index.less +23 -0
- package/es/composite-comp/dito/components/SlideImage/pc/components/VideoItem/imgs/cursor.png +0 -0
- package/es/composite-comp/dito/components/SlideImage/pc/components/VideoItem/imgs/d.png +0 -0
- package/es/composite-comp/dito/components/SlideImage/pc/components/VideoItem/index.js +176 -0
- package/es/composite-comp/dito/components/SlideImage/pc/components/VideoItem/index.less +61 -0
- package/es/composite-comp/dito/components/SlideImage/pc/index.js +76 -0
- package/es/composite-comp/dito/config-panels/FlashDealConfig/FlashDealConfigTitle/index.js +7 -20
- package/es/composite-comp/dito/config-panels/FlashDealConfig/index.js +15 -1
- package/es/composite-comp/dito/config-panels/GroupedCarouselConfig/ConfigGroup/index.js +149 -0
- package/es/composite-comp/dito/config-panels/GroupedCarouselConfig/ConfigGroup/index.less +16 -0
- package/es/composite-comp/dito/config-panels/GroupedCarouselConfig/ConfigTitle/index.js +93 -0
- package/es/composite-comp/dito/config-panels/GroupedCarouselConfig/ConfigTitle/index.less +0 -0
- package/es/composite-comp/dito/config-panels/GroupedCarouselConfig/imgs/defaultImg.png +0 -0
- package/es/composite-comp/dito/config-panels/GroupedCarouselConfig/index.js +114 -0
- package/es/composite-comp/dito/config-panels/NewsConfig/ConfigGroup/index.js +148 -0
- package/es/composite-comp/dito/config-panels/NewsConfig/ConfigGroup/index.less +16 -0
- package/es/composite-comp/dito/config-panels/NewsConfig/ConfigTitle/index.js +101 -0
- package/es/composite-comp/dito/config-panels/NewsConfig/ConfigTitle/index.less +0 -0
- package/es/composite-comp/dito/config-panels/NewsConfig/imgs/defaultImg.png +0 -0
- package/{lib/composite-comp/dito/config-panels/OrdersConfig → es/composite-comp/dito/config-panels/NewsConfig}/index.js +40 -40
- package/es/composite-comp/dito/config-panels/{OrdersConfig/ConfigGroup → PersonalInformationConfig/OrdersConfigGroup}/index.js +2 -2
- package/es/composite-comp/dito/config-panels/PersonalInformationConfig/index.js +14 -4
- package/es/composite-comp/dito/config-panels/RecommendConfig/index.js +10 -4
- package/es/composite-comp/dito/config-panels/SearchDITOConfig/ConfigContent/index.js +165 -0
- package/es/composite-comp/dito/config-panels/SearchDITOConfig/ConfigContent/index.less +7 -0
- package/es/composite-comp/dito/config-panels/SearchDITOConfig/ConfigImageGroup/index.js +179 -0
- package/es/composite-comp/dito/config-panels/SearchDITOConfig/ConfigImageGroup/index.less +0 -0
- package/es/composite-comp/dito/config-panels/SearchDITOConfig/ConfigSetting/index.js +181 -0
- package/es/composite-comp/dito/config-panels/SearchDITOConfig/ConfigSetting/index.less +9 -0
- package/es/composite-comp/dito/config-panels/SearchDITOConfig/imgs/defaultImg.png +0 -0
- package/es/composite-comp/dito/config-panels/SearchDITOConfig/index.js +69 -0
- package/es/composite-comp/dito/config-panels/SlideImageConfig/ConfigGroup/index.js +150 -0
- package/es/composite-comp/dito/config-panels/SlideImageConfig/ConfigGroup/index.less +16 -0
- package/es/composite-comp/dito/config-panels/SlideImageConfig/imgs/defaultImg.png +0 -0
- package/es/composite-comp/dito/config-panels/SlideImageConfig/index.js +134 -0
- package/es/composite-comp/dito/second-config-panels/GroupedCarouselSecondConfig/index.js +196 -0
- package/es/composite-comp/dito/second-config-panels/NewsSecondConfig/index.js +133 -0
- package/es/composite-comp/dito/second-config-panels/NewsSecondConfig/index.less +8 -0
- package/es/composite-comp/dito/second-config-panels/PersonalInformationSecondConfig/index.js +64 -1
- package/es/composite-comp/dito/second-config-panels/SearchDITOSecondConfig/index.js +366 -0
- package/es/composite-comp/dito/second-config-panels/SearchDITOSecondConfig/index.less +79 -0
- package/es/composite-comp/dito/second-config-panels/SlideImageSecondConfig/index.js +243 -0
- package/es/composite-comp/dito/second-config-panels/SlideImageSecondConfig/index.less +71 -0
- package/es/composite-comp/monpay/components/MonpayRecommend/mobile/index.js +4 -3
- package/es/constants/component-types.js +27 -9
- package/es/constants/index.js +40 -20
- package/es/constants/layout.js +46 -2
- package/es/core/Designer/ConfigPanel/index.js +17 -1
- package/es/core/Renderer/index.js +37 -2
- package/es/decorator/compositeDecorator.js +5 -1
- package/es/decorator/metaDecorator.js +1 -2
- package/es/locale/ar/ar.json +11 -1
- package/es/locale/en/en.json +11 -1
- package/es/locale/es/es.json +11 -1
- package/es/meta-comp/components/Button/editable.js +3 -1
- package/es/meta-comp/components/Button/index.js +13 -4
- package/es/meta-comp/components/Button/index.less +8 -1
- package/es/meta-comp/components/Image/index.js +7 -2
- package/es/meta-comp/components/Image/index.less +7 -0
- package/es/meta-comp/components/Text/index.js +6 -2
- package/es/meta-comp/components/Text/index.less +3 -0
- package/es/mobx/Frame.js +12 -1
- package/es/mobx/Store.js +12 -0
- package/es/utils/androidUtil.js +10 -2
- package/es/utils/businessUtil.js +218 -3
- package/es/utils/commonUtil.js +155 -4
- package/es/utils/coreUtil.js +59 -4
- package/es/utils/messageUtil.js +40 -0
- package/es/utils/pluginsUtil.js +1 -0
- package/lib/assets/fonts/AvenirNext-Bold.ttf +0 -0
- package/lib/assets/fonts/AvenirNext-DemiBold.ttf +0 -0
- package/lib/assets/fonts/AvenirNext-Medium.ttf +0 -0
- package/lib/assets/fonts/AvenirNext-Regular.ttf +0 -0
- package/lib/assets/fonts/magic-box-iconfont.css +27 -3
- package/lib/assets/fonts/magic-box-iconfont.js +1 -1
- package/lib/assets/fonts/magic-box-iconfont.ttf +0 -0
- package/lib/assets/fonts/magic-box-iconfont.woff +0 -0
- package/lib/assets/fonts/magic-box-iconfont.woff2 +0 -0
- package/lib/assets/images/layout-icon/banner-slide-layout3.png +0 -0
- package/lib/assets/images/layout-icon/grouped-carousel-layout1.png +0 -0
- package/lib/assets/images/layout-icon/news-layout1.png +0 -0
- package/lib/assets/images/layout-icon/search-dito-layout1.png +0 -0
- package/lib/assets/images/layout-icon/slide-image-layout1.png +0 -0
- package/lib/assets/less/font.less +30 -0
- package/lib/assets/less/global.less +5 -0
- package/lib/common/CountDown/index.js +29 -2
- package/lib/common/CountDown/index.less +38 -5
- package/lib/common/LinkModal/ProductList/index.js +484 -0
- package/lib/common/LinkModal/ProductList/index.less +130 -0
- package/lib/common/LinkModal/index.js +8 -1
- package/lib/common/ProductCardModal/imgs/dot-icon.png +0 -0
- package/lib/common/ProductCardModal/index.js +255 -0
- package/lib/common/ProductCardModal/index.less +131 -0
- package/lib/common/Toast/index.js +30 -0
- package/lib/common/Toast/index.less +29 -0
- package/lib/common/UrlPicker/index.js +1 -1
- package/lib/common/Video/index.js +5 -3
- package/lib/common/VideoPC/background.png +0 -0
- package/lib/common/VideoPC/closeImg.png +0 -0
- package/lib/common/VideoPC/components/index.js +100 -0
- package/lib/common/VideoPC/components/index.less +62 -0
- package/lib/common/VideoPC/cover.png +0 -0
- package/lib/common/VideoPC/index.js +750 -0
- package/lib/common/VideoPC/index.less +79 -0
- package/lib/common/index.js +24 -0
- package/lib/composite-comp/common/components/ProductItem/index.js +15 -8
- package/lib/composite-comp/common/components/ProductItem/index.less +7 -0
- package/lib/composite-comp/common/config-panels/BackgroundConfig/index.js +15 -73
- package/lib/composite-comp/common/config-panels/SpacingConfig/index.js +30 -0
- package/lib/composite-comp/dito/components/CommonFunctions/defaultJSON.js +1 -1
- package/lib/composite-comp/dito/components/CommonFunctions/mobile/index.js +8 -0
- package/lib/composite-comp/dito/components/CommonFunctions/mobile/index.less +3 -0
- package/lib/composite-comp/dito/components/FlashDeal/defaultJSON.js +26 -12
- package/lib/composite-comp/dito/components/FlashDeal/mobile/index.js +15 -14
- package/lib/composite-comp/dito/components/FlashDeal/pc/ProductItem/index.js +197 -0
- package/lib/composite-comp/dito/components/FlashDeal/pc/ProductItem/index.less +100 -0
- package/lib/composite-comp/dito/components/FlashDeal/pc/index.js +18 -22
- package/lib/composite-comp/dito/components/FlashDeal/pc/index.less +19 -30
- package/lib/composite-comp/dito/components/GroupBuy/mobile/index.less +5 -2
- package/lib/composite-comp/dito/components/GroupedCarousel/defaultJSON.js +312 -0
- package/lib/composite-comp/dito/components/GroupedCarousel/index.js +86 -0
- package/lib/composite-comp/dito/components/GroupedCarousel/pc/index.js +189 -0
- package/lib/composite-comp/dito/components/GroupedCarousel/pc/index.less +65 -0
- package/lib/composite-comp/dito/components/News/defaultJSON.js +172 -0
- package/{es/composite-comp/dito/components/Orders → lib/composite-comp/dito/components/News}/index.js +13 -13
- package/lib/composite-comp/dito/components/News/pc/index.js +113 -0
- package/lib/composite-comp/dito/components/News/pc/index.less +46 -0
- package/lib/composite-comp/dito/components/Orders/defaultJSON.js +1 -1
- package/lib/composite-comp/dito/components/PersonalInformation/defaultJSON.js +56 -2
- package/lib/composite-comp/dito/components/PersonalInformation/mobile/index.js +147 -15
- package/lib/composite-comp/dito/components/PersonalInformation/mobile/index.less +100 -8
- package/lib/composite-comp/dito/components/Recommend/mobile/index.js +130 -14
- package/lib/composite-comp/dito/components/SearchBanner/mobile/index.js +3 -11
- package/lib/composite-comp/dito/components/SearchDITO/defaultJSON.js +221 -0
- package/lib/composite-comp/dito/components/SearchDITO/index.js +86 -0
- package/lib/composite-comp/dito/components/SearchDITO/pc/components/ConfirmModal/index.less +69 -0
- package/lib/composite-comp/dito/components/SearchDITO/pc/components/Header/index.js +602 -0
- package/lib/composite-comp/dito/components/SearchDITO/pc/components/Header/index.less +184 -0
- package/lib/composite-comp/dito/components/SearchDITO/pc/components/VideoItem/index.js +153 -0
- package/lib/composite-comp/dito/components/SearchDITO/pc/components/VideoItem/index.less +25 -0
- package/lib/composite-comp/dito/components/SearchDITO/pc/imgs/avatar.png +0 -0
- package/lib/composite-comp/dito/components/SearchDITO/pc/index.js +176 -0
- package/lib/composite-comp/dito/components/SearchDITO/pc/index.less +57 -0
- package/lib/composite-comp/dito/components/SlideImage/defaultJSON.js +138 -0
- package/lib/composite-comp/dito/components/SlideImage/index.js +86 -0
- package/lib/composite-comp/dito/components/SlideImage/pc/components/CardItem/index.js +105 -0
- package/lib/composite-comp/dito/components/SlideImage/pc/components/CardItem/index.less +5 -0
- package/lib/composite-comp/dito/components/SlideImage/pc/components/ParallaxScroll/index.js +170 -0
- package/lib/composite-comp/dito/components/SlideImage/pc/components/ParallaxScroll/index.less +23 -0
- package/lib/composite-comp/dito/components/SlideImage/pc/components/VideoItem/imgs/cursor.png +0 -0
- package/lib/composite-comp/dito/components/SlideImage/pc/components/VideoItem/imgs/d.png +0 -0
- package/lib/composite-comp/dito/components/SlideImage/pc/components/VideoItem/index.js +176 -0
- package/lib/composite-comp/dito/components/SlideImage/pc/components/VideoItem/index.less +61 -0
- package/lib/composite-comp/dito/components/SlideImage/pc/index.js +76 -0
- package/lib/composite-comp/dito/config-panels/FlashDealConfig/FlashDealConfigTitle/index.js +7 -20
- package/lib/composite-comp/dito/config-panels/FlashDealConfig/index.js +15 -1
- package/lib/composite-comp/dito/config-panels/GroupedCarouselConfig/ConfigGroup/index.js +149 -0
- package/lib/composite-comp/dito/config-panels/GroupedCarouselConfig/ConfigGroup/index.less +16 -0
- package/lib/composite-comp/dito/config-panels/GroupedCarouselConfig/ConfigTitle/index.js +93 -0
- package/lib/composite-comp/dito/config-panels/GroupedCarouselConfig/ConfigTitle/index.less +0 -0
- package/lib/composite-comp/dito/config-panels/GroupedCarouselConfig/imgs/defaultImg.png +0 -0
- package/lib/composite-comp/dito/config-panels/GroupedCarouselConfig/index.js +114 -0
- package/lib/composite-comp/dito/config-panels/NewsConfig/ConfigGroup/index.js +148 -0
- package/lib/composite-comp/dito/config-panels/NewsConfig/ConfigGroup/index.less +16 -0
- package/lib/composite-comp/dito/config-panels/NewsConfig/ConfigTitle/index.js +101 -0
- package/lib/composite-comp/dito/config-panels/NewsConfig/ConfigTitle/index.less +0 -0
- package/lib/composite-comp/dito/config-panels/NewsConfig/imgs/defaultImg.png +0 -0
- package/{es/composite-comp/dito/config-panels/OrdersConfig → lib/composite-comp/dito/config-panels/NewsConfig}/index.js +40 -40
- package/lib/composite-comp/dito/config-panels/{OrdersConfig/ConfigGroup → PersonalInformationConfig/OrdersConfigGroup}/index.js +2 -2
- package/lib/composite-comp/dito/config-panels/PersonalInformationConfig/index.js +14 -4
- package/lib/composite-comp/dito/config-panels/RecommendConfig/index.js +10 -4
- package/lib/composite-comp/dito/config-panels/SearchDITOConfig/ConfigContent/index.js +165 -0
- package/lib/composite-comp/dito/config-panels/SearchDITOConfig/ConfigContent/index.less +7 -0
- package/lib/composite-comp/dito/config-panels/SearchDITOConfig/ConfigImageGroup/index.js +179 -0
- package/lib/composite-comp/dito/config-panels/SearchDITOConfig/ConfigImageGroup/index.less +0 -0
- package/lib/composite-comp/dito/config-panels/SearchDITOConfig/ConfigSetting/index.js +181 -0
- package/lib/composite-comp/dito/config-panels/SearchDITOConfig/ConfigSetting/index.less +9 -0
- package/lib/composite-comp/dito/config-panels/SearchDITOConfig/imgs/defaultImg.png +0 -0
- package/lib/composite-comp/dito/config-panels/SearchDITOConfig/index.js +69 -0
- package/lib/composite-comp/dito/config-panels/SlideImageConfig/ConfigGroup/index.js +150 -0
- package/lib/composite-comp/dito/config-panels/SlideImageConfig/ConfigGroup/index.less +16 -0
- package/lib/composite-comp/dito/config-panels/SlideImageConfig/imgs/defaultImg.png +0 -0
- package/lib/composite-comp/dito/config-panels/SlideImageConfig/index.js +134 -0
- package/lib/composite-comp/dito/second-config-panels/GroupedCarouselSecondConfig/index.js +196 -0
- package/lib/composite-comp/dito/second-config-panels/NewsSecondConfig/index.js +133 -0
- package/lib/composite-comp/dito/second-config-panels/NewsSecondConfig/index.less +8 -0
- package/lib/composite-comp/dito/second-config-panels/PersonalInformationSecondConfig/index.js +64 -1
- package/lib/composite-comp/dito/second-config-panels/SearchDITOSecondConfig/index.js +366 -0
- package/lib/composite-comp/dito/second-config-panels/SearchDITOSecondConfig/index.less +79 -0
- package/lib/composite-comp/dito/second-config-panels/SlideImageSecondConfig/index.js +243 -0
- package/lib/composite-comp/dito/second-config-panels/SlideImageSecondConfig/index.less +71 -0
- package/lib/composite-comp/monpay/components/MonpayRecommend/mobile/index.js +4 -3
- package/lib/constants/component-types.js +27 -9
- package/lib/constants/index.js +40 -20
- package/lib/constants/layout.js +46 -2
- package/lib/core/Designer/ConfigPanel/index.js +17 -1
- package/lib/core/Renderer/index.js +37 -2
- package/lib/decorator/compositeDecorator.js +5 -1
- package/lib/decorator/metaDecorator.js +1 -2
- package/lib/locale/ar/ar.json +11 -1
- package/lib/locale/en/en.json +11 -1
- package/lib/locale/es/es.json +11 -1
- package/lib/meta-comp/components/Button/editable.js +3 -1
- package/lib/meta-comp/components/Button/index.js +13 -4
- package/lib/meta-comp/components/Button/index.less +8 -1
- package/lib/meta-comp/components/Image/index.js +7 -2
- package/lib/meta-comp/components/Image/index.less +7 -0
- package/lib/meta-comp/components/Text/index.js +6 -2
- package/lib/meta-comp/components/Text/index.less +3 -0
- package/lib/mobx/Frame.js +12 -1
- package/lib/mobx/Store.js +12 -0
- package/lib/utils/androidUtil.js +10 -2
- package/lib/utils/businessUtil.js +218 -3
- package/lib/utils/commonUtil.js +155 -4
- package/lib/utils/coreUtil.js +59 -4
- package/lib/utils/messageUtil.js +40 -0
- package/lib/utils/pluginsUtil.js +1 -0
- package/package.json +5 -2
- package/es/composite-comp/dito/components/FlashDeal/pc/imgs/defImg1.png +0 -0
- package/es/composite-comp/dito/components/FlashDeal/pc/imgs/defImg2.png +0 -0
- package/es/composite-comp/dito/components/FlashDeal/pc/imgs/defImg3.png +0 -0
- package/es/composite-comp/dito/components/Orders/mobile/index.js +0 -352
- package/es/composite-comp/dito/components/Orders/mobile/index.less +0 -86
- package/es/composite-comp/dito/second-config-panels/OrdersSecondConfig/index.less +0 -9
- package/lib/composite-comp/dito/components/FlashDeal/pc/imgs/defImg1.png +0 -0
- package/lib/composite-comp/dito/components/FlashDeal/pc/imgs/defImg2.png +0 -0
- package/lib/composite-comp/dito/components/FlashDeal/pc/imgs/defImg3.png +0 -0
- package/lib/composite-comp/dito/components/Orders/mobile/index.js +0 -352
- package/lib/composite-comp/dito/components/Orders/mobile/index.less +0 -86
- package/lib/composite-comp/dito/second-config-panels/OrdersSecondConfig/index.less +0 -9
- /package/es/composite-comp/dito/config-panels/PersonalInformationConfig/{ConfigGroup → PersonInfoConfigGroup}/index.js +0 -0
- /package/lib/composite-comp/dito/config-panels/PersonalInformationConfig/{ConfigGroup → PersonInfoConfigGroup}/index.js +0 -0
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.setAccountPageValue = exports.pInfoData = exports["default"] = void 0;
|
|
6
|
+
exports.setAccountPageValue = exports.pInfoData = exports.orderData = exports["default"] = void 0;
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
@@ -15,6 +15,8 @@ var _antd = require("antd4");
|
|
|
15
15
|
|
|
16
16
|
var _avatar = _interopRequireDefault(require("./images/avatar.png"));
|
|
17
17
|
|
|
18
|
+
var _coreUtil = require("../../../../../utils/coreUtil");
|
|
19
|
+
|
|
18
20
|
var _components = require("../../../../../meta-comp/components");
|
|
19
21
|
|
|
20
22
|
var _androidUtil = require("../../../../../utils/androidUtil");
|
|
@@ -220,6 +222,20 @@ var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
|
|
|
220
222
|
}
|
|
221
223
|
};
|
|
222
224
|
|
|
225
|
+
var currentUser = JSON.parse(localStorage.getItem('currentUser')) || {};
|
|
226
|
+
|
|
227
|
+
var setAccountPageValue = function setAccountPageValue(obj) {
|
|
228
|
+
var accountPageValue = JSON.parse(localStorage.getItem('accountPageValue'));
|
|
229
|
+
localStorage.setItem('accountPageValue', JSON.stringify(__assign(__assign({}, accountPageValue), obj)));
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
exports.setAccountPageValue = setAccountPageValue;
|
|
233
|
+
|
|
234
|
+
var getAccountPageValue = function getAccountPageValue(key) {
|
|
235
|
+
var accountPageValue = JSON.parse(localStorage.getItem('accountPageValue'));
|
|
236
|
+
return accountPageValue ? accountPageValue[key] || '' : '';
|
|
237
|
+
};
|
|
238
|
+
|
|
223
239
|
var pInfoData = {
|
|
224
240
|
Wishlist: {
|
|
225
241
|
route: '/favourite/list'
|
|
@@ -235,15 +251,29 @@ var pInfoData = {
|
|
|
235
251
|
}
|
|
236
252
|
};
|
|
237
253
|
exports.pInfoData = pInfoData;
|
|
238
|
-
var
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
254
|
+
var orderData = {
|
|
255
|
+
'To Pay': {
|
|
256
|
+
key: 'toPayNum',
|
|
257
|
+
route: '/main/order/1'
|
|
258
|
+
},
|
|
259
|
+
'To Ship': {
|
|
260
|
+
key: 'toDeliveryNum',
|
|
261
|
+
route: '/main/order/2'
|
|
262
|
+
},
|
|
263
|
+
'To Receive': {
|
|
264
|
+
key: 'toReceiveNum',
|
|
265
|
+
route: '/main/order/3'
|
|
266
|
+
},
|
|
267
|
+
Done: {
|
|
268
|
+
key: 'toRatingNum',
|
|
269
|
+
route: '/main/order/4'
|
|
270
|
+
},
|
|
271
|
+
Cancelled: {
|
|
272
|
+
key: 'returnsNum',
|
|
273
|
+
route: '/main/order/5'
|
|
274
|
+
}
|
|
244
275
|
};
|
|
245
|
-
|
|
246
|
-
exports.setAccountPageValue = setAccountPageValue;
|
|
276
|
+
exports.orderData = orderData;
|
|
247
277
|
|
|
248
278
|
var PersonalInfoMobile =
|
|
249
279
|
/** @class */
|
|
@@ -258,7 +288,8 @@ function (_super) {
|
|
|
258
288
|
userInfo: currentUser,
|
|
259
289
|
loading: false,
|
|
260
290
|
selectedImgFile: {},
|
|
261
|
-
editImgModalVisible: false
|
|
291
|
+
editImgModalVisible: false,
|
|
292
|
+
orderStatus: getAccountPageValue('orderStatus') || {}
|
|
262
293
|
};
|
|
263
294
|
|
|
264
295
|
_this.getNum = function (v) {
|
|
@@ -309,6 +340,8 @@ function (_super) {
|
|
|
309
340
|
};
|
|
310
341
|
|
|
311
342
|
_this.clickName = function () {
|
|
343
|
+
var LPObj = (0, _storeUtil.getSessionStore)('channelPurchase') || {};
|
|
344
|
+
|
|
312
345
|
if (!(0, _isEmpty["default"])(LPObj)) {
|
|
313
346
|
return;
|
|
314
347
|
}
|
|
@@ -406,7 +439,6 @@ function (_super) {
|
|
|
406
439
|
|
|
407
440
|
_this.hideBottomBar = function () {
|
|
408
441
|
var homeNavBar = document.querySelector('.home-navigation');
|
|
409
|
-
console.log('homeNavBar', homeNavBar);
|
|
410
442
|
if (homeNavBar) homeNavBar.style.visibility = 'hidden';
|
|
411
443
|
};
|
|
412
444
|
|
|
@@ -471,6 +503,57 @@ function (_super) {
|
|
|
471
503
|
}
|
|
472
504
|
};
|
|
473
505
|
|
|
506
|
+
_this.onOrderItemClick = function (v) {
|
|
507
|
+
var _a;
|
|
508
|
+
|
|
509
|
+
if ((0, _commonUtil.checkLogin)(true)) {
|
|
510
|
+
var routeUrl = (_a = orderData[v]) === null || _a === void 0 ? void 0 : _a.route;
|
|
511
|
+
var selfUrl = (0, _commonUtil.ensure)(function () {
|
|
512
|
+
return item.title.content.clickUrl.value || item.image.content.clickUrl.value;
|
|
513
|
+
}, '');
|
|
514
|
+
(0, _commonUtil.navigateTo)(routeUrl || selfUrl);
|
|
515
|
+
}
|
|
516
|
+
};
|
|
517
|
+
|
|
518
|
+
_this.getInit = function () {
|
|
519
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
520
|
+
var orderStatus;
|
|
521
|
+
return __generator(this, function (_a) {
|
|
522
|
+
switch (_a.label) {
|
|
523
|
+
case 0:
|
|
524
|
+
return [4
|
|
525
|
+
/*yield*/
|
|
526
|
+
, (0, _commonUtil.commonFetch)('/designer/v1/h5/orders/status/num', {}, 'GET')];
|
|
527
|
+
|
|
528
|
+
case 1:
|
|
529
|
+
orderStatus = _a.sent();
|
|
530
|
+
this.setState({
|
|
531
|
+
orderStatus: orderStatus
|
|
532
|
+
});
|
|
533
|
+
setAccountPageValue({
|
|
534
|
+
orderStatus: orderStatus
|
|
535
|
+
});
|
|
536
|
+
return [2
|
|
537
|
+
/*return*/
|
|
538
|
+
];
|
|
539
|
+
}
|
|
540
|
+
});
|
|
541
|
+
});
|
|
542
|
+
};
|
|
543
|
+
|
|
544
|
+
_this.getImageHtml = function (item) {
|
|
545
|
+
var orderStatus = _this.state.orderStatus;
|
|
546
|
+
var num = (0, _commonUtil.ensure)(function () {
|
|
547
|
+
return orderStatus[orderData[item.sourceType].key];
|
|
548
|
+
}, '');
|
|
549
|
+
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_components.MetaImage, {
|
|
550
|
+
data: item.image,
|
|
551
|
+
maxWidth: "100%"
|
|
552
|
+
}), num ? /*#__PURE__*/_react["default"].createElement("span", {
|
|
553
|
+
className: "pot"
|
|
554
|
+
}, num) : null);
|
|
555
|
+
};
|
|
556
|
+
|
|
474
557
|
return _this;
|
|
475
558
|
}
|
|
476
559
|
|
|
@@ -480,6 +563,10 @@ function (_super) {
|
|
|
480
563
|
}
|
|
481
564
|
|
|
482
565
|
this.getMessageNum();
|
|
566
|
+
|
|
567
|
+
if ((0, _commonUtil.isLogin)()) {
|
|
568
|
+
this.getInit();
|
|
569
|
+
}
|
|
483
570
|
};
|
|
484
571
|
|
|
485
572
|
PersonalInfoMobile.prototype.render = function () {
|
|
@@ -491,8 +578,11 @@ function (_super) {
|
|
|
491
578
|
userInfo = _a.userInfo,
|
|
492
579
|
editImgModalVisible = _a.editImgModalVisible,
|
|
493
580
|
selectedImgFile = _a.selectedImgFile;
|
|
581
|
+
var LPObj = (0, _storeUtil.getSessionStore)('channelPurchase') || {};
|
|
494
582
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
495
|
-
className: (0, _classnames["default"])('personal-information-mobile'
|
|
583
|
+
className: (0, _classnames["default"])('personal-information-mobile', {
|
|
584
|
+
higher: (0, _commonUtil.isLogin)() || (0, _coreUtil.isDesignMode)()
|
|
585
|
+
})
|
|
496
586
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
497
587
|
className: "top"
|
|
498
588
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -541,7 +631,7 @@ function (_super) {
|
|
|
541
631
|
color: "#fff",
|
|
542
632
|
onClick: this.goSettings,
|
|
543
633
|
size: 24,
|
|
544
|
-
type: "icon-
|
|
634
|
+
type: "icon-settings"
|
|
545
635
|
}), /*#__PURE__*/_react["default"].createElement("div", {
|
|
546
636
|
className: "iconWrap"
|
|
547
637
|
}, /*#__PURE__*/_react["default"].createElement(_Iconfont["default"], {
|
|
@@ -551,7 +641,7 @@ function (_super) {
|
|
|
551
641
|
type: "icon-messages"
|
|
552
642
|
}), !!messageNum && /*#__PURE__*/_react["default"].createElement("span", {
|
|
553
643
|
className: "num"
|
|
554
|
-
}, messageNum)))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
644
|
+
}, messageNum)))), ((0, _commonUtil.isLogin)() || (0, _coreUtil.isDesignMode)()) && /*#__PURE__*/_react["default"].createElement("div", {
|
|
555
645
|
className: "bottom"
|
|
556
646
|
}, data.groupSource.map(function (item) {
|
|
557
647
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
@@ -577,7 +667,49 @@ function (_super) {
|
|
|
577
667
|
item.title.text = text;
|
|
578
668
|
}
|
|
579
669
|
})));
|
|
580
|
-
})),
|
|
670
|
+
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
671
|
+
className: "orders"
|
|
672
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
673
|
+
className: "fixed-wrap"
|
|
674
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
675
|
+
className: "top"
|
|
676
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
677
|
+
className: "title"
|
|
678
|
+
}, (0, _locale.i18n)('ORDERS')), /*#__PURE__*/_react["default"].createElement("div", {
|
|
679
|
+
className: "btn-wrap"
|
|
680
|
+
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
681
|
+
className: "text",
|
|
682
|
+
onClick: function onClick() {
|
|
683
|
+
if ((0, _commonUtil.checkLogin)(true)) (0, _commonUtil.navigateTo)('/main/order/0');
|
|
684
|
+
}
|
|
685
|
+
}, (0, _locale.i18n)('VIEW_ALL_ORDERS')), /*#__PURE__*/_react["default"].createElement(_Iconfont["default"], {
|
|
686
|
+
color: "#C7C7C7",
|
|
687
|
+
size: 13,
|
|
688
|
+
type: "icon-outlined-right"
|
|
689
|
+
}))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
690
|
+
className: "list"
|
|
691
|
+
}, data.groupSource2.map(function (item) {
|
|
692
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
693
|
+
key: item.id,
|
|
694
|
+
className: "item",
|
|
695
|
+
onClick: function onClick() {
|
|
696
|
+
return _this.onOrderItemClick(item.sourceType);
|
|
697
|
+
}
|
|
698
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
699
|
+
className: "content-wrap",
|
|
700
|
+
style: {
|
|
701
|
+
pointerEvents: window.magicDesign.mode == 'designer' ? 'auto' : 'none'
|
|
702
|
+
}
|
|
703
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
704
|
+
className: "img-wrap"
|
|
705
|
+
}, item.image.open && _this.getImageHtml(item)), item.title.open && /*#__PURE__*/_react["default"].createElement(_components.MetaText, {
|
|
706
|
+
className: "title",
|
|
707
|
+
data: item.title,
|
|
708
|
+
onTextInput: function onTextInput(text) {
|
|
709
|
+
item.title.text = text;
|
|
710
|
+
}
|
|
711
|
+
})));
|
|
712
|
+
})))), editImgModalVisible && /*#__PURE__*/_react["default"].createElement(_common.CropperModal, {
|
|
581
713
|
onClose: function onClose() {
|
|
582
714
|
_this.setState({
|
|
583
715
|
editImgModalVisible: false
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
.personal-information-mobile {
|
|
2
|
-
|
|
3
|
-
padding: 0.32rem;
|
|
2
|
+
padding: 0.44rem 0.32rem;
|
|
4
3
|
box-sizing: border-box;
|
|
4
|
+
height: 5rem;
|
|
5
|
+
}
|
|
6
|
+
.personal-information-mobile.higher {
|
|
7
|
+
border-bottom: 1.52rem solid #fff;
|
|
8
|
+
height: 6.8rem;
|
|
5
9
|
}
|
|
6
10
|
.personal-information-mobile .top {
|
|
7
11
|
display: flex;
|
|
@@ -45,8 +49,9 @@
|
|
|
45
49
|
margin: 0;
|
|
46
50
|
}
|
|
47
51
|
.personal-information-mobile .top .pInfoWrap .userInfo .name {
|
|
48
|
-
font-
|
|
49
|
-
font-
|
|
52
|
+
font-family: Montserrat;
|
|
53
|
+
font-size: 0.32rem;
|
|
54
|
+
font-weight: 600;
|
|
50
55
|
color: #ffffff;
|
|
51
56
|
max-width: 2.96rem;
|
|
52
57
|
white-space: nowrap;
|
|
@@ -55,8 +60,9 @@
|
|
|
55
60
|
word-break: break-all;
|
|
56
61
|
}
|
|
57
62
|
.personal-information-mobile .top .pInfoWrap .userInfo .phone {
|
|
58
|
-
font-
|
|
59
|
-
font-
|
|
63
|
+
font-family: Montserrat;
|
|
64
|
+
font-size: 0.32rem;
|
|
65
|
+
font-weight: 600;
|
|
60
66
|
color: #ffffff;
|
|
61
67
|
margin-top: 0.1rem;
|
|
62
68
|
}
|
|
@@ -70,8 +76,8 @@
|
|
|
70
76
|
border-radius: 50%;
|
|
71
77
|
}
|
|
72
78
|
.personal-information-mobile .top .pInfoWrap .btnLogin {
|
|
73
|
-
font-size: 0.
|
|
74
|
-
font-weight:
|
|
79
|
+
font-size: 0.32rem;
|
|
80
|
+
font-weight: 600;
|
|
75
81
|
color: #ffffff;
|
|
76
82
|
font-family: Montserrat;
|
|
77
83
|
}
|
|
@@ -141,3 +147,89 @@
|
|
|
141
147
|
line-height: 0.32rem;
|
|
142
148
|
text-align: center;
|
|
143
149
|
}
|
|
150
|
+
.personal-information-mobile .orders {
|
|
151
|
+
margin-top: 0.48rem;
|
|
152
|
+
}
|
|
153
|
+
.personal-information-mobile .orders .fixed-wrap {
|
|
154
|
+
display: flex;
|
|
155
|
+
flex-direction: column;
|
|
156
|
+
background-color: #fff;
|
|
157
|
+
box-shadow: 0 0.06rem 0.12rem rgba(0, 0, 0, 0.16);
|
|
158
|
+
border-radius: 0.32rem;
|
|
159
|
+
width: auto;
|
|
160
|
+
padding: 0.32rem;
|
|
161
|
+
}
|
|
162
|
+
.personal-information-mobile .orders .fixed-wrap .top {
|
|
163
|
+
display: flex;
|
|
164
|
+
flex-direction: row;
|
|
165
|
+
justify-content: space-between;
|
|
166
|
+
font-weight: 600;
|
|
167
|
+
line-height: 0.36rem;
|
|
168
|
+
color: var(--font-color);
|
|
169
|
+
}
|
|
170
|
+
.personal-information-mobile .orders .fixed-wrap .top .title {
|
|
171
|
+
font-size: 0.28rem;
|
|
172
|
+
font-weight: 600;
|
|
173
|
+
color: #2C2C2C;
|
|
174
|
+
}
|
|
175
|
+
.personal-information-mobile .orders .fixed-wrap .top .btn-wrap {
|
|
176
|
+
display: flex;
|
|
177
|
+
flex-direction: row;
|
|
178
|
+
justify-content: center;
|
|
179
|
+
align-items: center;
|
|
180
|
+
}
|
|
181
|
+
.personal-information-mobile .orders .fixed-wrap .top .btn-wrap .text {
|
|
182
|
+
font-size: 0.28rem;
|
|
183
|
+
color: #929292;
|
|
184
|
+
font-weight: 400;
|
|
185
|
+
margin-right: 0.08rem;
|
|
186
|
+
}
|
|
187
|
+
.personal-information-mobile .orders .fixed-wrap .list {
|
|
188
|
+
display: flex;
|
|
189
|
+
flex-direction: row;
|
|
190
|
+
justify-content: space-between;
|
|
191
|
+
height: 1.32rem;
|
|
192
|
+
margin-top: 0.48rem;
|
|
193
|
+
margin-bottom: 0.02rem;
|
|
194
|
+
}
|
|
195
|
+
.personal-information-mobile .orders .fixed-wrap .list .item {
|
|
196
|
+
display: flex;
|
|
197
|
+
flex: 1 1;
|
|
198
|
+
}
|
|
199
|
+
.personal-information-mobile .orders .fixed-wrap .list .item .content-wrap {
|
|
200
|
+
width: 100%;
|
|
201
|
+
display: flex;
|
|
202
|
+
flex-direction: column;
|
|
203
|
+
justify-content: center;
|
|
204
|
+
align-items: center;
|
|
205
|
+
}
|
|
206
|
+
.personal-information-mobile .orders .fixed-wrap .list .item .img-wrap {
|
|
207
|
+
position: relative;
|
|
208
|
+
display: flex;
|
|
209
|
+
margin-bottom: 0.16rem;
|
|
210
|
+
width: 0.72rem;
|
|
211
|
+
height: 0.72rem;
|
|
212
|
+
}
|
|
213
|
+
.personal-information-mobile .orders .fixed-wrap .list .item .img-wrap .pot {
|
|
214
|
+
display: inline-block;
|
|
215
|
+
padding: 0 0.08rem;
|
|
216
|
+
background: #ce1126;
|
|
217
|
+
border: 0.02rem solid #ce1126;
|
|
218
|
+
font-size: 0.16rem;
|
|
219
|
+
text-align: center;
|
|
220
|
+
color: #fff;
|
|
221
|
+
position: absolute;
|
|
222
|
+
top: -0.04rem;
|
|
223
|
+
left: 0.4rem;
|
|
224
|
+
min-width: 0.32rem;
|
|
225
|
+
height: 0.32rem;
|
|
226
|
+
border-radius: 50%;
|
|
227
|
+
line-height: 0.3rem;
|
|
228
|
+
}
|
|
229
|
+
.personal-information-mobile .orders .fixed-wrap .list .item .title {
|
|
230
|
+
height: 0.44rem;
|
|
231
|
+
font-size: 0.24rem;
|
|
232
|
+
line-height: 0.22rem;
|
|
233
|
+
color: #2C2C2C;
|
|
234
|
+
text-align: center;
|
|
235
|
+
}
|
|
@@ -270,6 +270,73 @@ var LAYOUT_IMAGE_SIZE = {
|
|
|
270
270
|
h: 110
|
|
271
271
|
}
|
|
272
272
|
};
|
|
273
|
+
/**
|
|
274
|
+
* 将第二个数组随机插入到第一个数组中
|
|
275
|
+
* @param {Array} array1 - 第一个数组
|
|
276
|
+
* @param {Array} array2 - 第二个数组
|
|
277
|
+
* @returns {Array} - 返回合并后的新数组
|
|
278
|
+
*/
|
|
279
|
+
|
|
280
|
+
var insertArrayRandomly = function insertArrayRandomly(arr1, arr2) {
|
|
281
|
+
if (arr1.length < 1) {
|
|
282
|
+
return [];
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
if (arr1.length < 2) {
|
|
286
|
+
return __spreadArrays(arr1, arr2);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
if (arr1.length === 2) {
|
|
290
|
+
return __spreadArrays([arr1[0]], arr2, [arr1[1]]);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
if (arr1.length === 3) {
|
|
294
|
+
return __spreadArrays([arr1[0]], arr2, arr1.splice(1));
|
|
295
|
+
} // 创建一个复制的第一个数组,以免修改原数组
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
var result = __spreadArrays(arr1); // 记录已插入元素的位置
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
var insertedIndices = [];
|
|
302
|
+
|
|
303
|
+
var _loop_1 = function _loop_1(i) {
|
|
304
|
+
var randomIndex; // 确保生成的随机索引不在首尾,并且与已插入的索引相隔至少两个位置
|
|
305
|
+
|
|
306
|
+
do {
|
|
307
|
+
randomIndex = Math.floor(Math.random() * (result.length - 2)) + 1; // 1 到 result.length - 2
|
|
308
|
+
// eslint-disable-next-line no-loop-func
|
|
309
|
+
} while (insertedIndices.some(function (index) {
|
|
310
|
+
return Math.abs(index - randomIndex) < 2;
|
|
311
|
+
})); // 在随机位置插入第二个数组的元素
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
result.splice(randomIndex, 0, arr2[i]); // 记录已插入的位置
|
|
315
|
+
|
|
316
|
+
insertedIndices.push(randomIndex);
|
|
317
|
+
}; // 随机插入第二个数组的元素
|
|
318
|
+
// eslint-disable-next-line no-plusplus
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
for (var i = 0; i < arr2.length; i++) {
|
|
322
|
+
_loop_1(i);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
return result;
|
|
326
|
+
};
|
|
327
|
+
|
|
328
|
+
var getRandomItemsAndRemove = function getRandomItemsAndRemove(arr, list) {
|
|
329
|
+
var _count = Math.ceil(list.length / 5);
|
|
330
|
+
|
|
331
|
+
var result = []; // eslint-disable-next-line no-plusplus
|
|
332
|
+
|
|
333
|
+
for (var i = 0; i < _count && arr.length > 0; i++) {
|
|
334
|
+
var randomIndex = Math.floor(Math.random() * arr.length);
|
|
335
|
+
result.push(arr.splice(randomIndex, 1)[0]);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
return result;
|
|
339
|
+
};
|
|
273
340
|
|
|
274
341
|
var RecommendMobile =
|
|
275
342
|
/** @class */
|
|
@@ -279,6 +346,7 @@ function (_super) {
|
|
|
279
346
|
function RecommendMobile() {
|
|
280
347
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
281
348
|
|
|
349
|
+
_this.ads = [];
|
|
282
350
|
_this.preData = {};
|
|
283
351
|
_this.preLayout = '';
|
|
284
352
|
_this.preContent = '';
|
|
@@ -328,16 +396,49 @@ function (_super) {
|
|
|
328
396
|
}, '#CE1126') : '#CE1126';
|
|
329
397
|
};
|
|
330
398
|
|
|
399
|
+
_this.getAdvertise = function () {
|
|
400
|
+
return __awaiter(_this, void 0, void 0, function () {
|
|
401
|
+
var ad;
|
|
402
|
+
return __generator(this, function (_a) {
|
|
403
|
+
switch (_a.label) {
|
|
404
|
+
case 0:
|
|
405
|
+
return [4
|
|
406
|
+
/*yield*/
|
|
407
|
+
, (0, _commonUtil.commonFetch)('/designer/v1/h5/ad/today/valid/MagicDesignRecommendation/list', {}, 'GET')];
|
|
408
|
+
|
|
409
|
+
case 1:
|
|
410
|
+
ad = _a.sent();
|
|
411
|
+
|
|
412
|
+
if (ad === null || ad === void 0 ? void 0 : ad.length) {
|
|
413
|
+
return [2
|
|
414
|
+
/*return*/
|
|
415
|
+
, ad[0].advertiseContents.map(function (it) {
|
|
416
|
+
return {
|
|
417
|
+
type: 'ad',
|
|
418
|
+
url: it === null || it === void 0 ? void 0 : it.url,
|
|
419
|
+
adObj: it
|
|
420
|
+
};
|
|
421
|
+
})];
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
return [2
|
|
425
|
+
/*return*/
|
|
426
|
+
, []];
|
|
427
|
+
}
|
|
428
|
+
});
|
|
429
|
+
});
|
|
430
|
+
};
|
|
431
|
+
|
|
331
432
|
_this.getProductList = function (index) {
|
|
332
433
|
return __awaiter(_this, void 0, void 0, function () {
|
|
333
|
-
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;
|
|
434
|
+
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, _h, insertAds, _cache;
|
|
334
435
|
|
|
335
|
-
var
|
|
436
|
+
var _j, _k, _l;
|
|
336
437
|
|
|
337
438
|
var _this = this;
|
|
338
439
|
|
|
339
|
-
return __generator(this, function (
|
|
340
|
-
switch (
|
|
440
|
+
return __generator(this, function (_m) {
|
|
441
|
+
switch (_m.label) {
|
|
341
442
|
case 0:
|
|
342
443
|
panelProps = this.props.panelProps;
|
|
343
444
|
groupSource = this.state.groupSource;
|
|
@@ -349,7 +450,7 @@ function (_super) {
|
|
|
349
450
|
|
|
350
451
|
if (cache) {
|
|
351
452
|
if ("products" + index in cache) {
|
|
352
|
-
this.setState((
|
|
453
|
+
this.setState((_j = {}, _j["products" + index] = cache["products" + index], _j), function () {
|
|
353
454
|
_this.resetLayout();
|
|
354
455
|
});
|
|
355
456
|
/** 如果数据未过期 */
|
|
@@ -363,10 +464,10 @@ function (_super) {
|
|
|
363
464
|
|
|
364
465
|
_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;
|
|
365
466
|
newData = [];
|
|
366
|
-
|
|
467
|
+
_m.label = 1;
|
|
367
468
|
|
|
368
469
|
case 1:
|
|
369
|
-
|
|
470
|
+
_m.trys.push([1, 9,, 10]);
|
|
370
471
|
|
|
371
472
|
if (!(groupSource.length > 0)) return [3
|
|
372
473
|
/*break*/
|
|
@@ -392,7 +493,7 @@ function (_super) {
|
|
|
392
493
|
, (0, _commonUtil.commonFetch)('/designer/v1/h5/products', params, 'GET')];
|
|
393
494
|
|
|
394
495
|
case 2:
|
|
395
|
-
res =
|
|
496
|
+
res = _m.sent();
|
|
396
497
|
newData = __spreadArrays(res.list);
|
|
397
498
|
return [3
|
|
398
499
|
/*break*/
|
|
@@ -415,7 +516,7 @@ function (_super) {
|
|
|
415
516
|
}, 'POST')];
|
|
416
517
|
|
|
417
518
|
case 4:
|
|
418
|
-
res =
|
|
519
|
+
res = _m.sent();
|
|
419
520
|
newData = __spreadArrays(res.pageInfo.list);
|
|
420
521
|
return [3
|
|
421
522
|
/*break*/
|
|
@@ -423,7 +524,7 @@ function (_super) {
|
|
|
423
524
|
|
|
424
525
|
case 5:
|
|
425
526
|
newData = [];
|
|
426
|
-
|
|
527
|
+
_m.label = 6;
|
|
427
528
|
|
|
428
529
|
case 6:
|
|
429
530
|
return [3
|
|
@@ -432,7 +533,7 @@ function (_super) {
|
|
|
432
533
|
|
|
433
534
|
case 7:
|
|
434
535
|
newData = [];
|
|
435
|
-
|
|
536
|
+
_m.label = 8;
|
|
436
537
|
|
|
437
538
|
case 8:
|
|
438
539
|
return [3
|
|
@@ -440,19 +541,34 @@ function (_super) {
|
|
|
440
541
|
, 10];
|
|
441
542
|
|
|
442
543
|
case 9:
|
|
443
|
-
e_1 =
|
|
544
|
+
e_1 = _m.sent();
|
|
444
545
|
newData = [];
|
|
445
546
|
return [3
|
|
446
547
|
/*break*/
|
|
447
548
|
, 10];
|
|
448
549
|
|
|
449
550
|
case 10:
|
|
551
|
+
if (!window.magicDesign.showRecommendAds) return [3
|
|
552
|
+
/*break*/
|
|
553
|
+
, 12];
|
|
554
|
+
_h = this;
|
|
555
|
+
return [4
|
|
556
|
+
/*yield*/
|
|
557
|
+
, this.getAdvertise()];
|
|
558
|
+
|
|
559
|
+
case 11:
|
|
560
|
+
_h.ads = _m.sent();
|
|
561
|
+
insertAds = getRandomItemsAndRemove(this.ads, newData);
|
|
562
|
+
newData = insertArrayRandomly(newData, insertAds);
|
|
563
|
+
_m.label = 12;
|
|
564
|
+
|
|
565
|
+
case 12:
|
|
450
566
|
if (!(0, _coreUtil.isDesignMode)()) {
|
|
451
567
|
_cache = (0, _storeUtil.getMagicStore)("recommend_" + pageId + "_" + recommendId);
|
|
452
|
-
(0, _storeUtil.setMagicStore)("recommend_" + pageId + "_" + recommendId, __assign(__assign({}, _cache), (
|
|
568
|
+
(0, _storeUtil.setMagicStore)("recommend_" + pageId + "_" + recommendId, __assign(__assign({}, _cache), (_k = {}, _k["products" + index] = newData, _k.endTime = Date.now() + 3 * 60 * 1000, _k)));
|
|
453
569
|
}
|
|
454
570
|
|
|
455
|
-
this.setState((
|
|
571
|
+
this.setState((_l = {}, _l["products" + index] = newData, _l), function () {
|
|
456
572
|
_this.resetLayout();
|
|
457
573
|
});
|
|
458
574
|
return [2
|
|
@@ -31,6 +31,8 @@ var _coreUtil = require("../../../../../utils/coreUtil");
|
|
|
31
31
|
|
|
32
32
|
var _mobx = require("../../../../../mobx");
|
|
33
33
|
|
|
34
|
+
var _locale = require("../../../../../locale");
|
|
35
|
+
|
|
34
36
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
35
37
|
|
|
36
38
|
var __extends = void 0 && (void 0).__extends || function () {
|
|
@@ -89,16 +91,6 @@ function (_super) {
|
|
|
89
91
|
_this.carouselRef = /*#__PURE__*/_react["default"].createRef();
|
|
90
92
|
_this.destroy = null;
|
|
91
93
|
|
|
92
|
-
_this.bannerGoto = function (groupSource) {
|
|
93
|
-
var nextIndex = groupSource.findIndex(function (item) {
|
|
94
|
-
return item.id === _mobx.store.clickedGroup;
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
if (nextIndex != -1 && nextIndex != _this.state.carouseIndex) {
|
|
98
|
-
_this.carouselRef.current.goTo(nextIndex);
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
|
|
102
94
|
_this.bannerGoto = function (groupSource) {
|
|
103
95
|
var nextIndex = groupSource.findIndex(function (item) {
|
|
104
96
|
return item.id === _mobx.store.clickedGroup;
|
|
@@ -251,7 +243,7 @@ function (_super) {
|
|
|
251
243
|
if (window.magicDesign.pushGA) {
|
|
252
244
|
window.magicDesign.pushGA({}, 'select_promotion', {
|
|
253
245
|
event_section: 'Search_Banner',
|
|
254
|
-
promotion_name: item.image.content.h5ImgSrc ? item.image.content.h5Name : i18n('BANNER_GROUP_NAME')
|
|
246
|
+
promotion_name: item.image.content.h5ImgSrc ? item.image.content.h5Name : (0, _locale.i18n)('BANNER_GROUP_NAME')
|
|
255
247
|
});
|
|
256
248
|
}
|
|
257
249
|
}
|