|
@@ -75,9 +75,9 @@ function Sinicize({ setGotopage }: { setGotopage: (page: number) => void }) {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
setSelectedTime(index)
|
|
setSelectedTime(index)
|
|
|
-
|
|
|
|
|
|
|
+ if (index === 5) return
|
|
|
setIsShowLine(
|
|
setIsShowLine(
|
|
|
- myData.sinicizeData[index].imgItems.map((item, index) => ({
|
|
|
|
|
|
|
+ myData.sinicizeData[index]?.imgItems.map((item, index) => ({
|
|
|
index,
|
|
index,
|
|
|
isShow: true
|
|
isShow: true
|
|
|
}))
|
|
}))
|
|
@@ -87,6 +87,16 @@ function Sinicize({ setGotopage }: { setGotopage: (page: number) => void }) {
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
|
if (selectedTime >= 0 && sinicize1Ref.current && originRef.current) {
|
|
if (selectedTime >= 0 && sinicize1Ref.current && originRef.current) {
|
|
|
console.log(123, selectedTime)
|
|
console.log(123, selectedTime)
|
|
|
|
|
+ // 最右边的年份项滚动到最左边
|
|
|
|
|
+ if (selectedTime === 5) {
|
|
|
|
|
+ requestAnimationFrame(() => {
|
|
|
|
|
+ if (originRef.current) {
|
|
|
|
|
+ originRef.current.scrollLeft = originRef.current.scrollWidth
|
|
|
|
|
+ console.log(originRef.current.scrollLeft)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
// 依次排列,如果不需要就是[0,100,200,300,400]
|
|
// 依次排列,如果不需要就是[0,100,200,300,400]
|
|
|
const scrollPosition = [0, 100, 200, 300, 400][selectedTime] + sinicize1Ref.current.offsetWidth
|
|
const scrollPosition = [0, 100, 200, 300, 400][selectedTime] + sinicize1Ref.current.offsetWidth
|
|
|
console.log(123, scrollPosition)
|
|
console.log(123, scrollPosition)
|
|
@@ -318,12 +328,16 @@ function Sinicize({ setGotopage }: { setGotopage: (page: number) => void }) {
|
|
|
|
|
|
|
|
{/* 结语 */}
|
|
{/* 结语 */}
|
|
|
<div className='yearItem'>
|
|
<div className='yearItem'>
|
|
|
- <div className='year year-zongjie'>
|
|
|
|
|
- <div className='yearContainner'>
|
|
|
|
|
|
|
+ <div className='year year-zongjie'
|
|
|
|
|
+ >
|
|
|
|
|
+ <div className='yearContainner' onClick={(e) => handleYearItemClick(e, 5)}>
|
|
|
<div className='txt songFont'>{myData.sinicizeDataStatic.zongjie.title}</div>
|
|
<div className='txt songFont'>{myData.sinicizeDataStatic.zongjie.title}</div>
|
|
|
- <div className='front' id='jieyu'>{myData.sinicizeDataStatic.zongjie.txt}</div>
|
|
|
|
|
|
|
+ <div className='front' id='jieyu'></div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <div id='jieyuDetail' className={`jieyuDetail ${selectedTime === 5 ? '' : 'jieyuDetailHide'}`}>
|
|
|
|
|
+ <div className="jieyuDetailtxt">{myData.sinicizeDataStatic.zongjie.txt}</div>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|