|
@@ -1,6 +1,8 @@
|
|
|
import React, { useState, useRef } from 'react'
|
|
import React, { useState, useRef } from 'react'
|
|
|
import styles from './index.module.scss'
|
|
import styles from './index.module.scss'
|
|
|
-import { myData } from '@/utils/http'
|
|
|
|
|
|
|
+import { isPc, myData } from '@/utils/http'
|
|
|
|
|
+import classNames from 'classnames'
|
|
|
|
|
+
|
|
|
function Sinicize() {
|
|
function Sinicize() {
|
|
|
const [currentTab, setCurrentTab] = useState(0)
|
|
const [currentTab, setCurrentTab] = useState(0)
|
|
|
const [selectedTime, setSelectedTime] = useState(0)
|
|
const [selectedTime, setSelectedTime] = useState(0)
|
|
@@ -24,7 +26,10 @@ function Sinicize() {
|
|
|
direct: string
|
|
direct: string
|
|
|
}) => {
|
|
}) => {
|
|
|
return (
|
|
return (
|
|
|
- <div className={styles.label} style={{ inset: inset }}>
|
|
|
|
|
|
|
+ <div
|
|
|
|
|
+ className={classNames(styles.label, isPc ? '' : styles.labelMo)}
|
|
|
|
|
+ style={{ inset: inset }}
|
|
|
|
|
+ >
|
|
|
{direct === 'left' ? <div className='arrowL' style={{ width: width + 'px' }} /> : null}
|
|
{direct === 'left' ? <div className='arrowL' style={{ width: width + 'px' }} /> : null}
|
|
|
<div className='btn'>{name}</div>
|
|
<div className='btn'>{name}</div>
|
|
|
{direct === 'right' ? <div className='arrowR' style={{ width: width + 'px' }} /> : null}
|
|
{direct === 'right' ? <div className='arrowR' style={{ width: width + 'px' }} /> : null}
|
|
@@ -59,7 +64,7 @@ function Sinicize() {
|
|
|
|
|
|
|
|
// 处理触摸移动事件
|
|
// 处理触摸移动事件
|
|
|
const handleOriTouchMove = (e: any) => {
|
|
const handleOriTouchMove = (e: any) => {
|
|
|
- e.preventDefault()
|
|
|
|
|
|
|
+ // e.preventDefault()
|
|
|
const deltaX = e.touches[0].clientY - ori_touchStartX.current
|
|
const deltaX = e.touches[0].clientY - ori_touchStartX.current
|
|
|
if (originRef.current) {
|
|
if (originRef.current) {
|
|
|
originRef.current.scrollLeft -= deltaX
|
|
originRef.current.scrollLeft -= deltaX
|
|
@@ -76,13 +81,16 @@ function Sinicize() {
|
|
|
<>
|
|
<>
|
|
|
<div
|
|
<div
|
|
|
ref={originRef}
|
|
ref={originRef}
|
|
|
- className={styles.Sinicize}
|
|
|
|
|
|
|
+ className={classNames(styles.Sinicize, isPc ? '' : styles.SinicizeMo)}
|
|
|
onWheel={handleWheel}
|
|
onWheel={handleWheel}
|
|
|
onTouchMove={handleOriTouchMove}
|
|
onTouchMove={handleOriTouchMove}
|
|
|
onTouchStart={handleTouchStart}
|
|
onTouchStart={handleTouchStart}
|
|
|
>
|
|
>
|
|
|
<div className='SinicizeScroll'>
|
|
<div className='SinicizeScroll'>
|
|
|
- <div ref={sinicize1Ref} className={styles.Sinicize1}>
|
|
|
|
|
|
|
+ <div
|
|
|
|
|
+ ref={sinicize1Ref}
|
|
|
|
|
+ className={classNames(styles.Sinicize1, isPc ? '' : styles.Sinicize1Mo)}
|
|
|
|
|
+ >
|
|
|
<div className='back' onClick={() => window.location.replace('#/ybwx?tab=1')}>
|
|
<div className='back' onClick={() => window.location.replace('#/ybwx?tab=1')}>
|
|
|
<img src={require('@/assets/img/btn_back.png')} alt='' />
|
|
<img src={require('@/assets/img/btn_back.png')} alt='' />
|
|
|
</div>
|
|
</div>
|
|
@@ -93,9 +101,7 @@ function Sinicize() {
|
|
|
<div className='line1'>
|
|
<div className='line1'>
|
|
|
<img src={require('@/assets/img/A6_sinicize_line2.png')} draggable='false' alt='' />
|
|
<img src={require('@/assets/img/A6_sinicize_line2.png')} draggable='false' alt='' />
|
|
|
</div>
|
|
</div>
|
|
|
- <div className='t2'>
|
|
|
|
|
- {myData.sinicizeDataStatic.desc}
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <div className='t2'>{myData.sinicizeDataStatic.desc}</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div className={`zhufo ${currentTab === 0 ? 'active' : ''}`}>
|
|
<div className={`zhufo ${currentTab === 0 ? 'active' : ''}`}>
|
|
|
<img src={require('@/assets/img/A6_sinicize_zhufo.png')} draggable='false' alt='' />{' '}
|
|
<img src={require('@/assets/img/A6_sinicize_zhufo.png')} draggable='false' alt='' />{' '}
|
|
@@ -138,7 +144,7 @@ function Sinicize() {
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <div className={styles.Sinicize2}>
|
|
|
|
|
|
|
+ <div className={classNames(styles.Sinicize2, isPc ? '' : styles.Sinicize2Mo)}>
|
|
|
<div className='scroll'>
|
|
<div className='scroll'>
|
|
|
{myData.sinicizeData.map((item, index) => (
|
|
{myData.sinicizeData.map((item, index) => (
|
|
|
<div className='yearItem' key={index}>
|
|
<div className='yearItem' key={index}>
|
|
@@ -151,9 +157,7 @@ function Sinicize() {
|
|
|
</div>
|
|
</div>
|
|
|
<div className={`${selectedTime === index ? 'detailShow' : 'detailHide'}`}>
|
|
<div className={`${selectedTime === index ? 'detailShow' : 'detailHide'}`}>
|
|
|
<div className='left'>
|
|
<div className='left'>
|
|
|
- <div className='desc'>
|
|
|
|
|
- {item.desc}
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <div className='desc'>{item.desc}</div>
|
|
|
{item.items.map((item, index) => (
|
|
{item.items.map((item, index) => (
|
|
|
<div className='txtItem' key={index}>
|
|
<div className='txtItem' key={index}>
|
|
|
<div className='title'>{item.title}</div>
|
|
<div className='title'>{item.title}</div>
|
|
@@ -162,19 +166,39 @@ function Sinicize() {
|
|
|
))}
|
|
))}
|
|
|
</div>
|
|
</div>
|
|
|
<div className='right'>
|
|
<div className='right'>
|
|
|
- <div className='title'>{myData.sinicizeData[index].imgItems[currentImgIndex].title}</div>
|
|
|
|
|
- <div className='pic'><img src={myData.sinicizeData[index].imgItems[currentImgIndex].src} alt="" /></div>
|
|
|
|
|
- <div className="txt">{myData.sinicizeData[index].imgItems[currentImgIndex].txt}</div>
|
|
|
|
|
- <div className="iconContainner">
|
|
|
|
|
|
|
+ <div className='title'>
|
|
|
|
|
+ {myData.sinicizeData[index].imgItems[currentImgIndex].title}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div className='pic'>
|
|
|
|
|
+ <img
|
|
|
|
|
+ src={myData.sinicizeData[index].imgItems[currentImgIndex].src}
|
|
|
|
|
+ alt=''
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div className='txt'>
|
|
|
|
|
+ {myData.sinicizeData[index].imgItems[currentImgIndex].txt}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div className='iconContainner'>
|
|
|
{item.imgItems.map((i, index) => {
|
|
{item.imgItems.map((i, index) => {
|
|
|
return (
|
|
return (
|
|
|
- <div className='icon' key={index} onClick={() => { setCurrentImgIndex(index) }}>
|
|
|
|
|
- <img src={require(`@/assets/img/A6_sincize_detailIcon${currentImgIndex === index ? '_ac' : ''}.png`)} draggable='false' alt='' />
|
|
|
|
|
|
|
+ <div
|
|
|
|
|
+ className='icon'
|
|
|
|
|
+ key={index}
|
|
|
|
|
+ onClick={() => {
|
|
|
|
|
+ setCurrentImgIndex(index)
|
|
|
|
|
+ }}
|
|
|
|
|
+ >
|
|
|
|
|
+ <img
|
|
|
|
|
+ src={require(`@/assets/img/A6_sincize_detailIcon${
|
|
|
|
|
+ currentImgIndex === index ? '_ac' : ''
|
|
|
|
|
+ }.png`)}
|
|
|
|
|
+ draggable='false'
|
|
|
|
|
+ alt=''
|
|
|
|
|
+ />
|
|
|
</div>
|
|
</div>
|
|
|
)
|
|
)
|
|
|
})}
|
|
})}
|
|
|
</div>
|
|
</div>
|
|
|
-
|
|
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -184,11 +208,14 @@ function Sinicize() {
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
{isShowTip && (
|
|
{isShowTip && (
|
|
|
- <div className={styles.tip} onClick={() => {
|
|
|
|
|
- setTimeout(() => {
|
|
|
|
|
- setIsShowTip(false)
|
|
|
|
|
- }, 1500);
|
|
|
|
|
- }}>
|
|
|
|
|
|
|
+ <div
|
|
|
|
|
+ className={classNames(styles.tip, isPc ? '' : styles.tipMo)}
|
|
|
|
|
+ onClick={() => {
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ setIsShowTip(false)
|
|
|
|
|
+ }, 1500)
|
|
|
|
|
+ }}
|
|
|
|
|
+ >
|
|
|
<div className='gesture'>
|
|
<div className='gesture'>
|
|
|
<img src={require('@/assets/img/A6_sinicize_gesture.png')} draggable='false' alt='' />{' '}
|
|
<img src={require('@/assets/img/A6_sinicize_gesture.png')} draggable='false' alt='' />{' '}
|
|
|
<div className='txt'>向右滑动查看造像中国化的演变</div>{' '}
|
|
<div className='txt'>向右滑动查看造像中国化的演变</div>{' '}
|