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' import EndVideo from '@/components/EndVideo' import NextPage from '@/components/NextPage' import classNames from 'classnames' import FloorBtn from '@/components/FloorBtn' import HotIcon from '@/components/HotIcon' import Hot2 from '../A2visit/PanoVideo/Hot2' import { PlowHotType } from '@/types' import useLoding from '@/components/ownUse/useLoding' import BtnRight from '@/components/BtnRight' function A6plow() { // 初始显示和隐藏 const [cutVideoShow, setCutVideoShow] = useState(false) // 控制视频播放的方法 const videoPlayFu = useCallback((index: number) => { setTimeout(() => { const domAll: any = document.querySelectorAll('.A6video') if (domAll && domAll.length) { domAll.forEach((v: HTMLVideoElement, i: number) => { if (index === i) v.play() else { v.pause() v.currentTime = 0 } }) } }, 100) }, []) // 点击继续 const btnStart = useCallback(() => { setCutVideoShow(true) }, []) // 点击 跳下一个章节 const [lastVideo, setLastVideo] = useState(false) // 左侧按钮的选中 const [leftAc, setLeftAc] = useState(0) const leftAcFu = useCallback( (index: number) => { videoPlayFu(index) setLeftAc(index) }, [videoPlayFu] ) // 底部文字 const floorTxt = useMemo(() => { return myData.plow.info[leftAc].txt }, [leftAc]) // 先加载背景图 序列帧等 在加载视频 const { imgNow, imgNumFu } = useLoding(3) // 汉代庄园田耕记二维码 const [code, setCode] = useState(false) // 蔬菜-庄家切换 const [staCut, setStaCut] = useState('蔬菜') // useEffect(() => { // setLeftAc(0) // }, [staCut]) // 打开热点 const [acName, setAcName] = useState('') const hotInfo = useMemo(() => { let info = {} as PlowHotType const temp = [...myData.plow.isSSSArr, ...myData.plow.info[leftAc].hot] if (temp && temp.find(v => v.name === acName)) { info = temp.find(v => v.name === acName) } return info }, [acName, leftAc]) return (
{isPc ? '扫码二维码,体验小游戏' : '长按图片,保存二维码'}
{isPc ? '' : '体验小游戏'}《汉代庄园田耕记》
{/* 右下角的返回按钮 */}