Просмотр исходного кода

Merge branch 'master' of http://192.168.0.115:3000/lanxin/Chengzhebei into master

shaogen1995 1 месяц назад
Родитель
Сommit
93258ccf67

BIN
src/assets/img/A6_sangzang_hidContent_l.png


BIN
src/assets/img/A6_sangzang_tab0.png


+ 1 - 4
src/assets/styles/base.css

@@ -415,15 +415,12 @@ textarea {
   font-family: 'SimSun' !important;
   font-weight: 700;
 }
-.opacityChange {
-  animation: opacityChange 2s infinite linear;
-}
 @keyframes opacityChange {
   0% {
     opacity: 1;
   }
   50% {
-    opacity: 0.2;
+    opacity: 0.4;
   }
   100% {
     opacity: 1;

+ 7 - 11
src/assets/styles/base.less

@@ -73,7 +73,7 @@ body #A7Back {
   left: 4%;
   cursor: pointer;
 
-  &>img {
+  & > img {
     height: 100%;
     object-fit: contain;
   }
@@ -84,7 +84,7 @@ body #A7Back {
   margin: auto;
   position: relative;
 
-  &>div {
+  & > div {
     width: 100%;
     height: 100%;
   }
@@ -213,7 +213,7 @@ textarea {
   bottom: 15px;
   right: 20px;
 
-  &>img {
+  & > img {
     position: absolute;
     top: 0;
     left: 0;
@@ -331,7 +331,7 @@ textarea {
         justify-content: flex-end;
         align-items: center;
 
-        &>img {
+        & > img {
           height: 90%;
           object-fit: contain;
         }
@@ -357,7 +357,7 @@ textarea {
     z-index: 3;
     cursor: pointer;
 
-    &>img {
+    & > img {
       height: 100%;
       object-fit: contain;
     }
@@ -493,7 +493,7 @@ textarea {
       justify-content: flex-end;
       align-items: center;
 
-      &>img {
+      & > img {
         height: 90%;
         object-fit: contain;
       }
@@ -541,10 +541,6 @@ textarea {
 }
 
 
-// 热点图标闪动
-.opacityChange {
-  animation: opacityChange 2s infinite linear;
-}
 
 @keyframes opacityChange {
   0% {
@@ -552,7 +548,7 @@ textarea {
   }
 
   50% {
-    opacity: 0.2;
+    opacity: 0.4;
   }
 
   100% {

+ 1 - 0
src/components/Skip/index.module.scss

@@ -1,4 +1,5 @@
 .Skip {
+  transform: translateZ(0);
   position: absolute;
   bottom: 15px;
   right: 15px;

+ 8 - 4
src/pages/A0base/index.module.scss

@@ -3,18 +3,20 @@
   height: 100%;
   background-color: #ccc;
   position: relative;
+  z-index: auto;
+  transform: none !important;
+  opacity: 1 !important;
+  will-change: initial !important;
 
   :global {
     .A0baseContainner {
       width: 58%;
       height: 60%;
-      position: absolute;
+      position: fixed;
       z-index: 1;
       top: 50%;
       right: 0;
       transform: translateY(-55%) translateZ(0);
-      z-index: 999; /* 适当提高数值,避免和其他加速层冲突 */
-      will-change: z-index; /* 提示浏览器优化层级渲染 */
       display: flex;
       justify-content: space-between;
       align-items: center;
@@ -109,6 +111,7 @@
       align-items: center;
       justify-content: flex-end;
       flex-direction: column;
+      transform: translateZ(0);
 
       .inter_content {
         width: 100%;
@@ -158,6 +161,7 @@
 
     /* 首页图标*/
     .home {
+      transform: translateZ(0);
       width: 44px;
       height: 44px;
       position: absolute;
@@ -171,7 +175,7 @@
     /* 先导片 */
     .guideVideo {
       display: none !important;
-
+      transform: translateZ(0);
       width: 50px;
       height: 50px;
       position: absolute;

+ 225 - 63
src/pages/A6ybwx/Sangzang/index.module.scss

@@ -31,79 +31,187 @@
         left: 0;
         transform: translate(-88%, -50%);
         display: flex;
-        flex-direction: column;
         align-items: center;
-        justify-content: center;
-        gap: 10px;
         transition: all 0.6s ease-in-out;
-        .open {
-          position: absolute;
-          top: 50%;
-          transform: translateY(-50%);
-          right: -6%;
-          width: 50px;
-          height: 50px;
+        .lHidding_left {
+          width: calc(100% - 300px);
+          height: 100%;
           display: flex;
-          justify-content: center;
           align-items: center;
-          transition: all 0.3s ease-in-out;
-          & > img {
+
+          .detail_info1 {
+            width: 300px;
             height: 100%;
-            width: 100%;
-            object-fit: contain;
+            display: flex;
+            flex-direction: column;
+            align-items: center;
+            justify-content: center;
+            gap: 10px;
+            transition: all 0.6s ease-in-out;
+            .imgBox {
+              position: relative;
+              width: 80%;
+              height: 50%;
+              .pic {
+                width: 100%;
+                height: 100%;
+                background: url('../../../assets/img/A6_sangzang_tab1.png') no-repeat center center;
+                background-size: contain;
+              }
+            }
+            .txt,
+            .title,
+            .time {
+              width: 80%;
+              height: 20px;
+              font-size: 16px;
+              line-height: 24px;
+              font-weight: 400;
+              color: rgba(69, 68, 55, 1);
+              text-align: center;
+            }
+            .txt {
+              line-height: 16px;
+              font-size: 15px;
+              height: 40px;
+              color: rgba(69, 68, 55, 0.8);
+            }
+            .title {
+              height: 16px;
+              color: rgba(124, 75, 54, 1);
+              font-size: 25px;
+              letter-spacing: 1px;
+            }
+            .time {
+              color: rgba(175, 135, 100, 1);
+            }
           }
-        }
-        .imgBox {
-          position: relative;
-          width: 75%;
-          height: 60%;
-          .pic {
-            width: 100%;
-            height: 100%;
-            background: url('../../../assets/img/A6_sangzang_tab1.png') no-repeat center center;
-            background-size: contain;
+          .detail_info2 {
+            width: calc(100% - 300px);
+            height: 74%;
+            display: flex;
+            flex-direction: column;
+            gap: 10px;
+            transition: all 0.6s ease-in-out;
+            .title_info2 {
+              width: fit-content;
+              position: relative;
+              height: 60px;
+              font-size: 26px;
+              color: rgba(124, 75, 54, 1);
+              &::after {
+                content: '';
+                position: absolute;
+                bottom: 0;
+                left: 0;
+                width: 100%;
+                height: 10px;
+                background: url('../../../assets/img/A6_sinicize_line2.png') no-repeat center center;
+                background-size: 100% 100%;
+              }
+            }
+            .txt_info2 {
+              width: 100%;
+              height: 80%;
+              font-size: 16px;
+              line-height: 24px;
+              letter-spacing: 1px;
+              font-weight: 400;
+              color: #504e40;
+              overflow: auto;
+              &::-webkit-scrollbar {
+                width: 0;
+                height: 0;
+              }
+            }
           }
-          .zoomIn {
-            width: 30px;
-            height: 30px;
-            background-color: rgba(175, 135, 100, 0.6);
-            border-radius: 50%;
+        }
+        .lHidding_right {
+          width: 300px;
+          height: 100%;
+          display: flex;
+          flex-direction: column;
+          align-items: center;
+          justify-content: center;
+          gap: 10px;
+          transition: all 0.6s ease-in-out;
+          .open {
             position: absolute;
-            bottom: -1%;
-            right: 2%;
+            top: 50%;
+            transform: translateY(-50%);
+            right: -6%;
+            width: 50px;
+            height: 50px;
             display: flex;
             justify-content: center;
             align-items: center;
+            transition: all 0.3s ease-in-out;
 
-            & > img {
-              height: 20px;
-              width: 20px;
+            .openPic {
+              background: url('../../../assets/img/A6_sangzang_hidRight.png') no-repeat center
+                center;
+              background-size: 100% 100%;
+              height: 100%;
+              width: 100%;
               object-fit: contain;
+              animation: opacityChange 3s infinite ease-in-out;
             }
           }
-        }
-        .txt,
-        .title,
-        .time {
-          width: 80%;
-          height: 20px;
-          font-size: 16px;
-          line-height: 24px;
-          font-weight: 400;
-          color: rgba(69, 68, 55, 1);
-          text-align: center;
-        }
-        .txt {
-          font-size: 15px;
-        }
-        .title {
-          height: 16px;
-          color: rgba(124, 75, 54, 1);
-          font-size: 22px;
-          letter-spacing: 1px;
-        }
-        .time {
-          color: rgba(175, 135, 100, 1);
+          .imgBox {
+            position: relative;
+            width: 75%;
+            height: 60%;
+            .pic {
+              width: 100%;
+              height: 100%;
+              background: url('../../../assets/img/A6_sangzang_tab1.png') no-repeat center center;
+              background-size: contain;
+            }
+            .zoomIn {
+              width: 30px;
+              height: 30px;
+              background-color: rgba(175, 135, 100, 0.6);
+              border-radius: 50%;
+              position: absolute;
+              bottom: -1%;
+              right: 2%;
+              display: flex;
+              justify-content: center;
+              align-items: center;
+
+              & > img {
+                height: 20px;
+                width: 20px;
+                object-fit: contain;
+              }
+            }
+          }
+          .txt,
+          .title,
+          .time {
+            width: 80%;
+            height: 20px;
+            font-size: 16px;
+            line-height: 24px;
+            font-weight: 400;
+            color: rgba(69, 68, 55, 1);
+            text-align: center;
+          }
+          .txt {
+            line-height: 16px;
+            font-size: 15px;
+            height: 30px;
+            color: rgba(69, 68, 55, 0.8);
+          }
+          .title {
+            height: 16px;
+            color: rgba(124, 75, 54, 1);
+            font-size: 25px;
+            letter-spacing: 1px;
+          }
+          .time {
+            color: rgba(175, 135, 100, 1);
+          }
         }
       }
       .left {
@@ -133,6 +241,7 @@
           display: flex;
           flex-direction: column;
           gap: 10px;
+          transition: all 0.3s ease-in-out;
           .title {
             width: 100%;
             font-size: 26px;
@@ -181,11 +290,22 @@
       }
     }
     .mainAc {
-      width: 72%;
+      width: 100%;
+      justify-content: flex-end;
+      gap: 0;
       .lHidding {
-        transform: translate(-84%, -50%);
-        .open {
-          opacity: 0;
+        width: 98%;
+        transform: translate(-2%, -50%);
+        background: url('../../../assets/img/A6_sangzang_hidContent_l.png') no-repeat center center;
+        background-size: 100% 100%;
+        .lHidding_right {
+          .open {
+            right: -2%;
+            .openPic {
+              background: url('../../../assets/img/A6_sangzang_hidLeft.png') no-repeat center center;
+              background-size: 100% 100%;
+            }
+          }
         }
       }
       .left {
@@ -194,12 +314,49 @@
         }
       }
       .right {
-        width: 40%;
+        width: 0;
+        opacity: 0;
         .content {
           width: 85%;
         }
       }
     }
+
+    // 点击tab后的样式
+    .mainShow_tab1,
+    .mainShow_tab2,
+    .mainShow_tab3,
+    .mainShow_tab4 {
+      padding-left: 190px;
+      .lHidding {
+        width: 330px;
+        transform: translate(-7%, -50%);
+        .lHidding_left {
+          display: none;
+        }
+        .lHidding_right {
+          width: 330px;
+          .open {
+            opacity: 0;
+            pointer-events: none;
+          }
+        }
+      }
+      .left {
+        transition: all 0.6s ease-in-out;
+      }
+      .right {
+        width: 39%;
+        transition: all 0.6s ease-in-out;
+        .title {
+          display: none;
+        }
+        .content {
+          width: 92%;
+          transition: all 0.6s ease-in-out;
+        }
+      }
+    }
     .back {
       width: 80px;
       height: 40px;
@@ -252,5 +409,10 @@
         color: rgba(166, 118, 67, 1);
       }
     }
+    .A6_tabBar_hide {
+      opacity: 0;
+      pointer-events: none;
+      transition: all 0.3s ease-in-out;
+    }
   }
 }

+ 92 - 24
src/pages/A6ybwx/Sangzang/index.tsx

@@ -1,46 +1,114 @@
-import React, { useState, useEffect } from "react";
-import styles from "./index.module.scss";
+import React, { useState, useEffect } from 'react'
+import styles from './index.module.scss'
 import { useSelector } from 'react-redux'
 import { RootState } from '@/store'
-import { Toast } from "antd-mobile";
+import { Toast } from 'antd-mobile'
 function Sang({ setGotoTab }: { setGotoTab: (tab: number) => void }) {
-  const [currentTab, setCurrentTab] = useState('tab0');
-  const [isShowTabBar, setIsShowTabBar] = useState(true);
-  const [isShowHidContent, setIsShowHidContent] = useState(false);
+  const [currentTab, setCurrentTab] = useState('tab0')
+  const [isShowTabBar, setIsShowTabBar] = useState(true)
+  const [isShowHidContent, setIsShowHidContent] = useState(false)
   const { myData } = useSelector((state: RootState) => state.A0Layout)
 
   useEffect(() => {
     Toast.show({
       content: '开发中',
-      duration: 1000,
+      duration: 1000
     })
   }, [currentTab])
 
+  useEffect(() => {
+    if (isShowHidContent) {
+      setIsShowTabBar(false)
+    } else {
+      setIsShowTabBar(true)
+    }
+  }, [isShowHidContent])
+
+  const handleTabClick = (tab: string) => {
+    if (tab === currentTab) {
+      setCurrentTab('tab0')
+      return
+    }
+    setCurrentTab(tab)
+  }
+
   return (
     <div className={styles.sang}>
       <div className='back' onClick={() => setGotoTab(0)}>
         <img src={require('@/assets/img/btn_back.png')} alt='' />
       </div>
-      <div className={`main ${isShowHidContent ? 'mainAc' : ''}`} onClick={() => setIsShowHidContent(false)}>
-        <div className="lHidding">
-          <div className="open" onClick={(e) => { e.stopPropagation(); setIsShowHidContent(true) }}><img src={require('@/assets/img/A6_sangzang_hidRight.png')} alt="" /></div>
-          <div className="imgBox"><div className="pic" /><div className="zoomIn"><img src={require('@/assets/img/A5_zoomin.png')} alt="" /></div></div>
-          <div className="txt">图片来源《文物》1963年第6期P50</div>
-          <div className="title">柳子辉墓志铭</div>
-          <div className="time">北齐天保七年(556年)</div>
+      <div
+        className={`main ${isShowHidContent ? 'mainAc' : currentTab === 'tab0' ? '' : 'mainShow_' + currentTab
+          }`}
+      >
+        <div className='lHidding'>
+          <div className='lHidding_left'>
+            <div className='detail_info1'>
+              <div className='imgBox'>
+                <div className='pic' />
+              </div>
+              <div className='txt'>
+                图片来源
+                <br />
+                《文物》1963年第6期P50
+              </div>
+              <div className='title'>柳子辉墓志铭</div>
+              <div className='time'>北齐天保七年(556年)</div>
+            </div>
+            <div className='detail_info2'>
+              <div className='title_info2'>柳子辉墓志铭</div>
+              <div className='txt_info2'>北齐天保七年(556年)</div>
+            </div>
+          </div>
+          <div className='lHidding_right'>
+            <div
+              className='open'
+              onClick={e => {
+                e.stopPropagation()
+                setIsShowHidContent(!isShowHidContent)
+              }}
+            >
+              {' '}
+              <div className='openPic' />{' '}
+            </div>
+            <div className='imgBox'>
+              <div className='pic' />
+              <div className='zoomIn'>
+                <img src={require('@/assets/img/A5_zoomin.png')} alt='' />
+              </div>
+            </div>
+            <div className='txt'>
+              图片来源
+              <br />
+              《文物》1963年第6期P50
+            </div>
+            <div className='title'>柳子辉墓志铭</div>
+            <div className='time'>北齐天保七年(556年)</div>
+          </div>
+        </div>
+        <div className='left'>
+          <div className='pic' />
+          <div className='operate'>
+            <div className='beiwen1'>程氏颂文</div>
+            <div className='beiwen1'>程哲生卒</div>
+            <div className='beiwen1'>先祖功绩</div>
+          </div>
         </div>
-        <div className="left"><div className="pic" /></div>
-        <div className="right">
+        <div className='right'>
           <div className={`content`}>
             <div className='title myFont'>程哲碑丧葬因素</div>
-            <div className='text'>程哲碑,其以佛像为主题的造像风格与传统造像碑无二,但传统造像碑通常以发愿文为核心,内容多为祈福禳灾、超度亡灵或祈求功德,不强调墓主生平与家族世系。<br />程哲碑则强调墓主生平与家族世系,其文字更多是丧葬语境下的内容,其行文与墓志铭密切相关。</div>
+            <div className='text'>
+              程哲碑,其以佛像为主题的造像风格与传统造像碑无二,但传统造像碑通常以发愿文为核心,内容多为祈福禳灾、超度亡灵或祈求功德,不强调墓主生平与家族世系。
+              <br />
+              程哲碑则强调墓主生平与家族世系,其文字更多是丧葬语境下的内容,其行文与墓志铭密切相关。
+            </div>
           </div>
         </div>
       </div>
-      <div className='A6_tabBar' style={{ display: isShowTabBar ? 'flex' : 'none' }}>
+      <div className={`A6_tabBar ${!isShowTabBar ? 'A6_tabBar_hide' : ''}`}>
         <div
           className={`tab ${currentTab === 'tab1' ? 'tab_active' : ''}`}
-          onClick={() => setCurrentTab('tab1')}
+          onClick={() => handleTabClick('tab1')}
         >
           墓志
           <br />
@@ -48,7 +116,7 @@ function Sang({ setGotoTab }: { setGotoTab: (tab: number) => void }) {
         </div>
         <div
           className={`tab ${currentTab === 'tab2' ? 'tab_active' : ''}`}
-          onClick={() => setCurrentTab('tab2')}
+          onClick={() => handleTabClick('tab2')}
         >
           攀附
           <br />
@@ -56,7 +124,7 @@ function Sang({ setGotoTab }: { setGotoTab: (tab: number) => void }) {
         </div>
         <div
           className={`tab ${currentTab === 'tab3' ? 'tab_active' : ''}`}
-          onClick={() => setCurrentTab('tab3')}
+          onClick={() => handleTabClick('tab3')}
         >
           立碑
           <br />
@@ -64,7 +132,7 @@ function Sang({ setGotoTab }: { setGotoTab: (tab: number) => void }) {
         </div>
         <div
           className={`tab ${currentTab === 'tab4' ? 'tab_active' : ''}`}
-          onClick={() => setCurrentTab('tab4')}
+          onClick={() => handleTabClick('tab4')}
         >
           刻写
           <br />
@@ -75,6 +143,6 @@ function Sang({ setGotoTab }: { setGotoTab: (tab: number) => void }) {
   )
 }
 
-const MemoSang = React.memo(Sang);
+const MemoSang = React.memo(Sang)
 
-export default MemoSang;
+export default MemoSang