From 5ec0f02101cb4255c6398856bbf17a2a0b2c9a7e Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 14 十一月 2022 17:33:55 +0800 Subject: [PATCH] 2022-11-14 --- src/tabviews/custom/components/carousel/prop-card/index.jsx | 69 +++++++++++++++++++--------------- 1 files changed, 39 insertions(+), 30 deletions(-) diff --git a/src/tabviews/custom/components/carousel/prop-card/index.jsx b/src/tabviews/custom/components/carousel/prop-card/index.jsx index 6ad1652..e547437 100644 --- a/src/tabviews/custom/components/carousel/prop-card/index.jsx +++ b/src/tabviews/custom/components/carousel/prop-card/index.jsx @@ -12,6 +12,7 @@ import './index.scss' const CardItem = asyncComponent(() => import('../cardItem')) +const NormalHeader = asyncComponent(() => import('@/tabviews/custom/components/share/normalheader')) class PropCard extends Component { static propTpyes = { @@ -78,7 +79,7 @@ }) _config.subcards.forEach(card => { - card.style.height = _config.style.height + card.style.height = _config.wrap.height if (card.setting.click) { card.style.cursor = 'pointer' } @@ -89,6 +90,8 @@ return item }) }) + + _config.style.height = 'auto' _config.wrap.speed = (_config.wrap.speed || 3) * 1000 @@ -353,22 +356,25 @@ destroyOnClose > <div className="custom-prop-carousel-box" style={config.style}> - {config.subcards.length > 1 && config.wrap.autoplay === 'false' ? <div className="prev" onClick={() => this.node && this.node.prev()}><LeftOutlined /></div> : null} - {config.subcards.length > 1 && config.wrap.autoplay === 'false' ? <div className="next" onClick={() => this.node && this.node.next()}><RightOutlined /></div> : null} - <Carousel - autoplay={config.wrap.autoplay !== 'false'} - dots={config.wrap.dots !== 'false'} - dotPosition={config.wrap.dotPosition || 'bottom'} - effect={config.wrap.effect || 'scrollx'} - autoplaySpeed={config.wrap.speed} - ref={ref => this.node = ref} - > - {config.subcards.map((item, index) => ( - <div key={index}> - <CardItem card={item} cards={config} data={data}/> - </div> - ))} - </Carousel> + <NormalHeader config={config}/> + <div className="carousel-wrap" style={{height: config.wrap.height}}> + {config.subcards.length > 1 && config.wrap.autoplay === 'false' ? <div className="prev" onClick={() => this.node && this.node.prev()}><LeftOutlined /></div> : null} + {config.subcards.length > 1 && config.wrap.autoplay === 'false' ? <div className="next" onClick={() => this.node && this.node.next()}><RightOutlined /></div> : null} + <Carousel + autoplay={config.wrap.autoplay !== 'false'} + dots={config.wrap.dots !== 'false'} + dotPosition={config.wrap.dotPosition || 'bottom'} + effect={config.wrap.effect || 'scrollx'} + autoplaySpeed={config.wrap.speed} + ref={ref => this.node = ref} + > + {config.subcards.map((item, index) => ( + <div key={index}> + <CardItem card={item} cards={config} data={data}/> + </div> + ))} + </Carousel> + </div> </div> {config.wrap.modalContent !== 'update' ? <div className="mk-footer"> <Checkbox defaultChecked={false} onChange={this.onTipChange}>涓嶅湪鎻愰啋</Checkbox> @@ -387,19 +393,22 @@ <Spin /> </div> : null } - <Carousel - autoplay={config.wrap.autoplay !== 'false'} - dots={config.wrap.dots !== 'false'} - dotPosition={config.wrap.dotPosition || 'bottom'} - effect={config.wrap.effect || 'scrollx'} - autoplaySpeed={config.wrap.speed} - > - {config.subcards.map((item, index) => ( - <div key={index}> - <CardItem card={item} cards={config} data={data}/> - </div> - ))} - </Carousel> + <NormalHeader config={config}/> + <div className="carousel-wrap" style={{height: config.wrap.height}}> + <Carousel + autoplay={config.wrap.autoplay !== 'false'} + dots={config.wrap.dots !== 'false'} + dotPosition={config.wrap.dotPosition || 'bottom'} + effect={config.wrap.effect || 'scrollx'} + autoplaySpeed={config.wrap.speed} + > + {config.subcards.map((item, index) => ( + <div key={index}> + <CardItem card={item} cards={config} data={data}/> + </div> + ))} + </Carousel> + </div> </div> ) } -- Gitblit v1.8.0