index.tsx 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import React, { useState } from 'react'
  2. import styles from './index.module.scss'
  3. import Swiper3 from './Swiper3'
  4. import TopBarM from '@/components/TopBarM'
  5. import Zvideo from '@/components/Zvideo'
  6. function A7animationM() {
  7. const [isShowVideo, setIsShowVideo] = useState(false)
  8. const [currentIndex, setCurrentIndex] = useState(0)
  9. return (
  10. <div className={styles.A7animationM}>
  11. {!isShowVideo ? (
  12. <>
  13. <TopBarM />
  14. <Swiper3 setIsShowVideo={setIsShowVideo} setCurrentIndex={setCurrentIndex} />
  15. </>
  16. ) : (
  17. <div className={styles.videoBox}>
  18. <div
  19. className={styles.backBtn}>
  20. <img
  21. onClick={() => setIsShowVideo(false)}
  22. src={require('../../assets/img/back1.png')}
  23. alt=''
  24. />
  25. </div>
  26. <div className={styles.title}>{myDataTemp.animationList[currentIndex].name}</div>
  27. <Zvideo
  28. src={myDataTemp.animationList[currentIndex].videoSrc}
  29. objFit='contain'
  30. style={{ height: 'auto' }}
  31. />
  32. </div>
  33. )}
  34. </div>
  35. )
  36. }
  37. const MemoA7animationM = React.memo(A7animationM)
  38. export default MemoA7animationM