|
@@ -7,12 +7,14 @@ import { useSelector } from 'react-redux'
|
|
|
|
|
|
|
|
function Zaoxiang() {
|
|
function Zaoxiang() {
|
|
|
|
|
|
|
|
- const {myData} = useSelector((state: RootState) => state.A0Layout)
|
|
|
|
|
|
|
+ const { myData } = useSelector((state: RootState) => state.A0Layout)
|
|
|
|
|
|
|
|
const [currentType, setCurrentType] = useState('')
|
|
const [currentType, setCurrentType] = useState('')
|
|
|
const [isShowDetail, setIsShowDetail] = useState(false)
|
|
const [isShowDetail, setIsShowDetail] = useState(false)
|
|
|
|
|
|
|
|
const currentItem = React.useMemo(() => myData.zaoxiangDataDetail.find(item => item.type === currentType), [currentType, myData.zaoxiangDataDetail])
|
|
const currentItem = React.useMemo(() => myData.zaoxiangDataDetail.find(item => item.type === currentType), [currentType, myData.zaoxiangDataDetail])
|
|
|
|
|
+ const currentItemIndex = React.useMemo(() => myData.zaoxiangDataDetail.findIndex(item => item.type === currentType), [currentType, myData.zaoxiangDataDetail])
|
|
|
|
|
+
|
|
|
|
|
|
|
|
const handleDotClick = (type: string) => {
|
|
const handleDotClick = (type: string) => {
|
|
|
setCurrentType(type)
|
|
setCurrentType(type)
|
|
@@ -74,17 +76,17 @@ function Zaoxiang() {
|
|
|
</div>
|
|
</div>
|
|
|
<div className='preview'>
|
|
<div className='preview'>
|
|
|
{currentItem?.imgItems.map((item, index) => (
|
|
{currentItem?.imgItems.map((item, index) => (
|
|
|
- <div className='previewItem' key={index}>
|
|
|
|
|
|
|
+ <div className='previewItem' key={index} onClick={() =>
|
|
|
|
|
+ store.dispatch({
|
|
|
|
|
+ type: 'layout/lookBigImg',
|
|
|
|
|
+ payload: { url: item.src, show: true }
|
|
|
|
|
+ })
|
|
|
|
|
+ }>
|
|
|
<div className='pic'>
|
|
<div className='pic'>
|
|
|
<img src={item.src} draggable='false' alt='' />
|
|
<img src={item.src} draggable='false' alt='' />
|
|
|
</div>
|
|
</div>
|
|
|
- <div className='txt'>{item.title}</div>
|
|
|
|
|
- <div className='icon3' onClick={() =>
|
|
|
|
|
- store.dispatch({
|
|
|
|
|
- type: 'layout/lookBigImg',
|
|
|
|
|
- payload: { url: item.src, show: true }
|
|
|
|
|
- })
|
|
|
|
|
- }>
|
|
|
|
|
|
|
+ <div className='txt' dangerouslySetInnerHTML={{ __html: item.title }}></div>
|
|
|
|
|
+ <div className='icon3' >
|
|
|
<img
|
|
<img
|
|
|
src={require('@/assets/img/A6_zaoxiang_foxiang_zoomIn.png')}
|
|
src={require('@/assets/img/A6_zaoxiang_foxiang_zoomIn.png')}
|
|
|
draggable='false'
|
|
draggable='false'
|
|
@@ -94,8 +96,9 @@ function Zaoxiang() {
|
|
|
</div>
|
|
</div>
|
|
|
))}
|
|
))}
|
|
|
</div>
|
|
</div>
|
|
|
- <div className='foxiang'>
|
|
|
|
|
|
|
+ <div className={`foxiang${currentItemIndex}`}>
|
|
|
<img src={require('@/assets/img/A6_zaoxiang_foxiang.png')} draggable='false' alt='' />
|
|
<img src={require('@/assets/img/A6_zaoxiang_foxiang.png')} draggable='false' alt='' />
|
|
|
|
|
+ <img className={`foxiangLine`} src={currentItem?.lineSrc} draggable='false' alt='' />
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>)}
|
|
</div>)}
|