|
|
@ -50,80 +50,93 @@ class ReactCarousel extends Component { |
|
|
|
} |
|
|
|
|
|
|
|
render () { |
|
|
|
const { imgs } = this.state |
|
|
|
const { imgs, showIndex } = this.state |
|
|
|
return ( |
|
|
|
<div className="ReactCarousel" style={{ width: "100%", height: "100%" }}> |
|
|
|
<div className="contain" |
|
|
|
onMouseEnter={() => { this.stop() }} //鼠标进入停止自动播放
|
|
|
|
onMouseLeave={() => { this.start() }} //鼠标退出自动播放
|
|
|
|
> |
|
|
|
<ul className="ul"> |
|
|
|
{ |
|
|
|
imgs[showIndex] ? |
|
|
|
<div style={{ width: "90%", height: "80%", backgroundSize: 'cover', position: "absolute", left: "10%", top: "-5%" }}> |
|
|
|
{this.renderVideo(imgs[showIndex], showIndex)} |
|
|
|
<div style={{ width: "100%", position: "absolute", top: "83%" }}> |
|
|
|
<div style={{ width: "100%", height: "20%", backgroundColor: "rgba(0,0,0,0.6)", overflow: "hiddden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}> |
|
|
|
<img src='/assets/images/leadership/weizhis.png' style={{ width: "6%", height: "80%", marginLeft: "3%", marginRight: "3%" }} /> |
|
|
|
{imgs[showIndex]?.deviceName} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
: '' |
|
|
|
} |
|
|
|
{/* <ul className="ul"> |
|
|
|
{ |
|
|
|
this.state.imgs.map((value, index) => { |
|
|
|
return ( |
|
|
|
<li style={{ position: "relative", left: "8%", width: "100%", height: "100%", top: "-5%", fontSize: "12px" }} className={index === this.state.showIndex ? 'show' : ''} |
|
|
|
key={index} |
|
|
|
> |
|
|
|
{ |
|
|
|
imgs.map((value, index) => { |
|
|
|
if (index == 0) { |
|
|
|
return value?.deviceSerial ? <div style={{ width: "45%", height: "40%", backgroundSize: 'cover', position: "absolute", left: "-3%", top: "5%" }}> |
|
|
|
{this.renderVideo(value, index)} |
|
|
|
<div style={{ width: "100%", height: "100%", position: "absolute", top: "80%" }}> |
|
|
|
<div style={{ width: "100%", height: "20%", backgroundColor: "rgba(0,0,0,0.6)", overflow: "hiddden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}> |
|
|
|
<img src='/assets/images/leadership/weizhis.png' style={{ width: "6%", height: "80%", marginLeft: "3%", marginRight: "3%" }} /> |
|
|
|
{value?.deviceName} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> : '' |
|
|
|
} else if (index == 1) { |
|
|
|
return value?.deviceSerial ? <div style={{ width: "45%", height: "40%", backgroundSize: 'cover', position: "absolute", left: "45%", top: "5%" }}> |
|
|
|
{this.renderVideo(value, index)} |
|
|
|
<div style={{ width: "100%", height: "100%", position: "absolute", top: "80%" }}> |
|
|
|
<div style={{ width: "100%", height: "20%", backgroundColor: "rgba(0,0,0,0.6)", overflow: "hiddden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}> |
|
|
|
<img src='/assets/images/leadership/weizhis.png' style={{ width: "6%", height: "80%", marginLeft: "3%", marginRight: "3%" }} /> |
|
|
|
{value?.deviceName} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> : "" |
|
|
|
} else if (index == 2) { |
|
|
|
return value?.deviceSerial ? <div style={{ width: "45%", height: "40%", backgroundSize: 'cover', position: "absolute", left: "-3%", top: "49%" }}> |
|
|
|
{this.renderVideo(value, index)} |
|
|
|
<div style={{ width: "100%", height: "100%", position: "absolute", top: "80%" }}> |
|
|
|
<div style={{ width: "100%", height: "20%", backgroundColor: "rgba(0,0,0,0.6)", overflow: "hiddden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}> |
|
|
|
<img src='/assets/images/leadership/weizhis.png' style={{ width: "6%", height: "80%", marginLeft: "3%", marginRight: "3%" }} /> |
|
|
|
{value?.deviceName} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> : "" |
|
|
|
} else if (index == 3) { |
|
|
|
return value?.deviceSerial ? <div style={{ width: "45%", height: "40%", backgroundSize: 'cover', position: "absolute", left: "45%", top: "49%" }}> |
|
|
|
{this.renderVideo(value, index)} |
|
|
|
<div style={{ width: "100%", height: "100%", position: "absolute", top: "80%" }}> |
|
|
|
<div style={{ width: "100%", height: "20%", backgroundColor: "rgba(0,0,0,0.6)", overflow: "hiddden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}> |
|
|
|
<img src='/assets/images/leadership/weizhis.png' style={{ width: "6%", height: "80%", marginLeft: "3%", marginRight: "3%" }} /> |
|
|
|
{value?.deviceName} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> : "" |
|
|
|
} else { |
|
|
|
return undefined |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
</li> |
|
|
|
) |
|
|
|
}) |
|
|
|
// this.state.imgs.map((value, index) => {
|
|
|
|
// return (
|
|
|
|
// <li style={{ position: "relative", left: "8%", width: "100%", height: "100%", top: "-5%", fontSize: "12px" }} className={index === this.state.showIndex ? 'show' : ''}
|
|
|
|
// key={index}
|
|
|
|
// >
|
|
|
|
// {
|
|
|
|
// imgs.map((value, index) => {
|
|
|
|
// if (index == 0) {
|
|
|
|
// return value?.deviceSerial ? <div style={{ width: "45%", height: "40%", backgroundSize: 'cover', position: "absolute", left: "-3%", top: "5%" }}>
|
|
|
|
// {this.renderVideo(value, index)}
|
|
|
|
// <div style={{ width: "100%", height: "100%", position: "absolute", top: "80%" }}>
|
|
|
|
// <div style={{ width: "100%", height: "20%", backgroundColor: "rgba(0,0,0,0.6)", overflow: "hiddden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
|
|
|
|
// <img src='/assets/images/leadership/weizhis.png' style={{ width: "6%", height: "80%", marginLeft: "3%", marginRight: "3%" }} />
|
|
|
|
// {value?.deviceName}
|
|
|
|
// </div>
|
|
|
|
// </div>
|
|
|
|
// </div> : ''
|
|
|
|
// } else if (index == 1) {
|
|
|
|
// return value?.deviceSerial ? <div style={{ width: "45%", height: "40%", backgroundSize: 'cover', position: "absolute", left: "45%", top: "5%" }}>
|
|
|
|
// {this.renderVideo(value, index)}
|
|
|
|
// <div style={{ width: "100%", height: "100%", position: "absolute", top: "80%" }}>
|
|
|
|
// <div style={{ width: "100%", height: "20%", backgroundColor: "rgba(0,0,0,0.6)", overflow: "hiddden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
|
|
|
|
// <img src='/assets/images/leadership/weizhis.png' style={{ width: "6%", height: "80%", marginLeft: "3%", marginRight: "3%" }} />
|
|
|
|
// {value?.deviceName}
|
|
|
|
// </div>
|
|
|
|
// </div>
|
|
|
|
// </div> : ""
|
|
|
|
// } else if (index == 2) {
|
|
|
|
// return value?.deviceSerial ? <div style={{ width: "45%", height: "40%", backgroundSize: 'cover', position: "absolute", left: "-3%", top: "49%" }}>
|
|
|
|
// {this.renderVideo(value, index)}
|
|
|
|
// <div style={{ width: "100%", height: "100%", position: "absolute", top: "80%" }}>
|
|
|
|
// <div style={{ width: "100%", height: "20%", backgroundColor: "rgba(0,0,0,0.6)", overflow: "hiddden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
|
|
|
|
// <img src='/assets/images/leadership/weizhis.png' style={{ width: "6%", height: "80%", marginLeft: "3%", marginRight: "3%" }} />
|
|
|
|
// {value?.deviceName}
|
|
|
|
// </div>
|
|
|
|
// </div>
|
|
|
|
// </div> : ""
|
|
|
|
// } else if (index == 3) {
|
|
|
|
// return value?.deviceSerial ? <div style={{ width: "45%", height: "40%", backgroundSize: 'cover', position: "absolute", left: "45%", top: "49%" }}>
|
|
|
|
// {this.renderVideo(value, index)}
|
|
|
|
// <div style={{ width: "100%", height: "100%", position: "absolute", top: "80%" }}>
|
|
|
|
// <div style={{ width: "100%", height: "20%", backgroundColor: "rgba(0,0,0,0.6)", overflow: "hiddden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
|
|
|
|
// <img src='/assets/images/leadership/weizhis.png' style={{ width: "6%", height: "80%", marginLeft: "3%", marginRight: "3%" }} />
|
|
|
|
// {value?.deviceName}
|
|
|
|
// </div>
|
|
|
|
// </div>
|
|
|
|
// </div> : ""
|
|
|
|
// } else {
|
|
|
|
// return undefined
|
|
|
|
// }
|
|
|
|
// })
|
|
|
|
// }
|
|
|
|
// </li>
|
|
|
|
// )
|
|
|
|
// })
|
|
|
|
} |
|
|
|
</ul> |
|
|
|
{/* <div className="control" style={{ width: "100%", height: "10%" }}> |
|
|
|
<span style={{ position: "absolute", top: "86%", width: "3%", height: "8%" }} className="left" onClick={(e) => { this.previous(e) }}> |
|
|
|
</ul> */} |
|
|
|
<div className="control" style={{ width: "100%", height: "10%" }}> |
|
|
|
<span style={{ position: "absolute", top: "75%", width: "3%", height: "8%" }} className="left" onClick={(e) => { this.previous(e) }}> |
|
|
|
<img src='/assets/images/leadership/zuofanye.png' style={{ width: "100%", height: "100%" }} /> |
|
|
|
</span> |
|
|
|
<span style={{ position: "absolute", top: "86%", width: "3%", height: "8%", right: "6%" }} className="right" onClick={(e) => { this.next(e) }}> |
|
|
|
<span style={{ position: "absolute", top: "75%", width: "3%", height: "8%", right: "6%" }} className="right" onClick={(e) => { this.next(e) }}> |
|
|
|
<img src='/assets/images/leadership/youofanye.png' style={{ width: "100%", height: "100%" }} /> |
|
|
|
</span> |
|
|
|
</div> */} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
) |
|
|
|