|
|
@@ -1,11 +1,13 @@
|
|
|
import React, { useRef, useEffect, useState } from 'react'
|
|
|
import styles from './index.module.scss'
|
|
|
import MenuSider from '@/components/MenuSider'
|
|
|
-
|
|
|
+import Zvideo from '@/components/Zvideo'
|
|
|
+import Zback from '@/components/Zback'
|
|
|
function A4Member() {
|
|
|
const scrollRef = useRef<HTMLDivElement>(null)
|
|
|
const [currentIndex, setCurrentIndex] = useState(0)
|
|
|
const [hasHover, setHasHover] = useState(true)
|
|
|
+ const [isShowVideo, setIsShowVideo] = useState(false)
|
|
|
useEffect(() => {
|
|
|
const mq = window.matchMedia('(hover: hover)')
|
|
|
setHasHover(mq.matches)
|
|
|
@@ -32,16 +34,18 @@ function A4Member() {
|
|
|
{myDataTemp.memberList.map((item, index) => (
|
|
|
<>
|
|
|
<div
|
|
|
- className={`item ${currentIndex === index ? `itemAc itemAc${index + 1}` : ''}`}
|
|
|
- key={index}
|
|
|
- onMouseEnter={hasHover ? () => setCurrentIndex(index) : undefined}
|
|
|
- onClick={!hasHover ? () => setCurrentIndex(index) : undefined}
|
|
|
- >
|
|
|
+ className={`item ${currentIndex === index ? `itemAc itemAc${index + 1}` : ''}`}
|
|
|
+ key={index}
|
|
|
+ onMouseEnter={hasHover ? () => setCurrentIndex(index) : undefined}
|
|
|
+ onClick={!hasHover ? () => setCurrentIndex(index) : () => setIsShowVideo(true)}
|
|
|
+ >
|
|
|
<div className='nameBox'>
|
|
|
<div className='up'>
|
|
|
<img
|
|
|
draggable={false}
|
|
|
- src={require(`../../assets/img/A4_member_up${currentIndex === index ? '_ac' : ''}.png`)}
|
|
|
+ src={require(
|
|
|
+ `../../assets/img/A4_member_up${currentIndex === index ? '_ac' : ''}.png`
|
|
|
+ )}
|
|
|
alt=''
|
|
|
/>
|
|
|
</div>
|
|
|
@@ -49,7 +53,9 @@ function A4Member() {
|
|
|
<div className='down'>
|
|
|
<img
|
|
|
draggable={false}
|
|
|
- src={require(`../../assets/img/A4_member_down${currentIndex === index ? '_ac' : ''}.png`)}
|
|
|
+ src={require(
|
|
|
+ `../../assets/img/A4_member_down${currentIndex === index ? '_ac' : ''}.png`
|
|
|
+ )}
|
|
|
alt=''
|
|
|
/>
|
|
|
</div>
|
|
|
@@ -71,16 +77,34 @@ function A4Member() {
|
|
|
</div>
|
|
|
<div className='nameEn'>{item.nameEn}</div>
|
|
|
</div>
|
|
|
+ {/* 在一体机有按钮 */}
|
|
|
+ {!hasHover ? (
|
|
|
+ <div className='btnBox' onClick={() => setIsShowVideo(true)}>
|
|
|
+ <img
|
|
|
+ draggable={false}
|
|
|
+ src={require('../../assets/img/A4_member_btn.png')}
|
|
|
+ alt=''
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ ) : null}
|
|
|
</div>
|
|
|
<div className='split'>
|
|
|
<img draggable={false} src={require('../../assets/img/A4_member_split.png')} alt='' />
|
|
|
</div>
|
|
|
</>
|
|
|
))}
|
|
|
- <div className="item" style={{width: '10%'}}></div>
|
|
|
+ <div className='item' style={{ width: '10%' }}></div>
|
|
|
</div>
|
|
|
|
|
|
<MenuSider isSidebarOpen={false} />
|
|
|
+
|
|
|
+ {/* 动画 */}
|
|
|
+ {isShowVideo ? (
|
|
|
+ <div className={styles.videoBox}>
|
|
|
+ <Zvideo src={myDataTemp.memberList[currentIndex].videoSrc} />
|
|
|
+ <Zback onBack={() => setIsShowVideo(false)} />
|
|
|
+ </div>
|
|
|
+ ) : null}
|
|
|
</div>
|
|
|
)
|
|
|
}
|