|
@@ -1,4 +1,4 @@
|
|
|
-import React, { useCallback, useEffect, useMemo, useState } from 'react'
|
|
|
+import React, { useCallback, useMemo, useState } from 'react'
|
|
|
import styles from './index.module.scss'
|
|
|
import BaseImg from '@/components/BaseImg'
|
|
|
import { baseURL, isPc, myData } from '@/utils/http'
|
|
@@ -65,12 +65,9 @@ function A6plow() {
|
|
|
// 蔬菜-庄家切换
|
|
|
const [staCut, setStaCut] = useState('蔬菜')
|
|
|
|
|
|
- useEffect(() => {
|
|
|
- setLeftAc(4)
|
|
|
- }, [staCut])
|
|
|
-
|
|
|
- // 切换底部的时候播放视频
|
|
|
- const [btnVideo, setBtnVideo] = useState('')
|
|
|
+ // useEffect(() => {
|
|
|
+ // setLeftAc(0)
|
|
|
+ // }, [staCut])
|
|
|
|
|
|
// 打开热点
|
|
|
const [acName, setAcName] = useState('')
|
|
@@ -98,6 +95,7 @@ function A6plow() {
|
|
|
imgNow={imgNow}
|
|
|
imgNumFu={imgNumFu}
|
|
|
bird='tianJian'
|
|
|
+ num={50}
|
|
|
/>
|
|
|
|
|
|
{/* 蔬菜的盒子 */}
|
|
@@ -123,31 +121,6 @@ function A6plow() {
|
|
|
))}
|
|
|
</div>
|
|
|
|
|
|
- {/* 切换底部按钮的动画 */}
|
|
|
- {imgNow
|
|
|
- ? myData.plow.flooBtn.map(item => (
|
|
|
- <div
|
|
|
- className={classNames('A6videoBoxsss', btnVideo === item ? 'A6videoBoxShowsss' : '')}
|
|
|
- key={item}
|
|
|
- >
|
|
|
- <video
|
|
|
- playsInline
|
|
|
- muted
|
|
|
- webkit-playsinline='true'
|
|
|
- x5-video-player-type='h5'
|
|
|
- onEnded={() => setBtnVideo('')}
|
|
|
- src={`${baseURL}plow/${item}.mp4`}
|
|
|
- >
|
|
|
- <source type='video/mp4' src={`${baseURL}plow/${item}.mp4`} />
|
|
|
- Your browser does not support the video tag.
|
|
|
- </video>
|
|
|
-
|
|
|
- {/* 右下角的跳过按钮 */}
|
|
|
- <BtnRight imgName='skip' clickSon={() => setBtnVideo('')} title='跳过' />
|
|
|
- </div>
|
|
|
- ))
|
|
|
- : null}
|
|
|
-
|
|
|
{/* 底部2个按钮 */}
|
|
|
{imgNow ? (
|
|
|
<div className='A6floorBox' hidden={!cutVideoShow}>
|
|
@@ -155,23 +128,8 @@ function A6plow() {
|
|
|
<div
|
|
|
onClick={() => {
|
|
|
setStaCut(v)
|
|
|
- setBtnVideo(v)
|
|
|
-
|
|
|
// 每次切换都是播放第4个视频
|
|
|
- leftAcFu(4)
|
|
|
-
|
|
|
- setTimeout(() => {
|
|
|
- const domAll: any = document.querySelectorAll('.A6videoBoxsss video')
|
|
|
- if (domAll && domAll.length) {
|
|
|
- domAll.forEach((v: HTMLVideoElement, i2: number) => {
|
|
|
- if (i1 === i2) v.play()
|
|
|
- else {
|
|
|
- v.pause()
|
|
|
- v.currentTime = 0
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- }, 100)
|
|
|
+ leftAcFu(0)
|
|
|
}}
|
|
|
className={classNames(v === staCut ? 'A6FrowAc' : '')}
|
|
|
key={v}
|