Quellcode durchsuchen

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

shaogen1995 vor 3 Wochen
Ursprung
Commit
2f89b9b5e0

Datei-Diff unterdrückt, da er zu groß ist
+ 11 - 11
public/myData/myData.js


+ 9 - 4
src/components/Zback/index.tsx

@@ -2,6 +2,7 @@ import React from 'react'
 import styles from './index.module.scss'
 import { useSelector } from 'react-redux'
 import { RootState } from '@/store'
+import classNames from 'classnames'
 
 type Props = {
   clickFu: () => void
@@ -11,10 +12,14 @@ function Zback({ clickFu }: Props) {
   const { myLangue } = useSelector((state: RootState) => state.A0Layout)
 
   return (
-    <div className={styles.Zback} onClick={(e) => {
-      e.stopPropagation()
-      clickFu()
-    }} id='Zback'>
+    <div
+      className={classNames(styles.Zback, 'Zback')}
+      onClick={e => {
+        e.stopPropagation()
+        clickFu()
+      }}
+      id='Zback'
+    >
       <img
         className='backImg'
         src={require(`@/assets/img/btn_back${myLangue === 'EN' ? 'En' : ''}.png`)}

+ 7 - 8
src/pages/A2yblm/index.tsx

@@ -16,9 +16,9 @@ function A2yblm() {
   const [loding, setLoding] = useState(false)
 
   useEffect(() => {
-      // 切换场景
-      cutUnityFu('TombstoneView',()=>setLoding(true))
-      
+    // 切换场景
+    cutUnityFu('TombstoneView', () => setLoding(true))
+
   }, [])
 
   const { myData, myLangue } = useSelector((state: RootState) => state.A0Layout)
@@ -39,7 +39,7 @@ function A2yblm() {
   const previousTab = useRef(currentTab)
 
   const [isOpenMzm, setIsOpenMzm] = useState(false)
-  const [currentTagIndex, setCurrentTagIndex] = useState(1)
+  const [currentTagIndex, setCurrentTagIndex] = useState(0)
   const [isShowTag, setIsShowTag] = useState(false)
 
   const gotoQuanwenOrWenwu = useCallback(() => {
@@ -57,7 +57,7 @@ function A2yblm() {
   const modelChange = useCallback(() => {
     if (currentTab === 'tab2') setIsShowTag(true)
     if (currentTab !== 'tab2') {
-      setCurrentTagIndex(1)
+      setCurrentTagIndex(0)
       setIsShowTag(false)
       callIframeFu('showHotspot', -1)
     }
@@ -151,9 +151,8 @@ function A2yblm() {
 
       <div className='wenwu' onClick={gotoQuanwenOrWenwu}>
         <img
-          src={require(`@/assets/img/A2_${currentTab === 'tab3' ? 'quanwen' : 'wenwu'}${
-            myLangue === 'EN' ? 'En' : ''
-          }.png`)}
+          src={require(`@/assets/img/A2_${currentTab === 'tab3' ? 'quanwen' : 'wenwu'}${myLangue === 'EN' ? 'En' : ''
+            }.png`)}
           alt=''
         />
       </div>

+ 3 - 3
src/pages/A6ybwx/A6_2_zxzgh/components/Bwzzq/index.module.scss

@@ -121,9 +121,6 @@
                 margin-top: 6px;
                 line-height: 22px;
               }
-              .from {
-                font-size: 13px;
-              }
             }
             .dotRight {
               width: 180px;
@@ -196,6 +193,9 @@
                 width: 0px;
                 height: 0px;
               }
+              & > span {
+                color: rgb(169, 135, 99);
+              }
             }
           }
         }

+ 2 - 2
src/pages/A6ybwx/A6_2_zxzgh/components/Bwzzq/index.tsx

@@ -40,7 +40,7 @@ function Bwzzq({ sItem, selectedTime, index, isShowLine, setIsShowLine }: yearTy
             <div className='lInfo'>
               <div className='item' key={index}>
                 <div className='lTitle songFont'>{sItem.items[0].title}</div>
-                <div className='lText'>{sItem.items[0].txt}</div>
+                <div className='lText' dangerouslySetInnerHTML={{ __html: sItem.items[0].txt }}></div>
               </div>
             </div>
             <div className='lImgBox'>
@@ -109,7 +109,7 @@ function Bwzzq({ sItem, selectedTime, index, isShowLine, setIsShowLine }: yearTy
           <div className='lInfo'>
             <div className='item' key={index}>
               <div className='lTitle songFont'>{sItem.items[1].title}</div>
-              <div className='lText'>{sItem.items[1].txt}</div>
+              <div className='lText' dangerouslySetInnerHTML={{ __html: sItem.items[1].txt }}></div>
             </div>
           </div>
         </div>

+ 2 - 2
src/pages/A6ybwx/A6_2_zxzgh/components/InfoCard/index.module.scss

@@ -54,7 +54,7 @@
       }
       .location {
         color: rgba(175, 135, 100, 1);
-        font-weight: 500;
+        font-weight: 600;
       }
       .Cardtext {
         text-align: justify;
@@ -69,7 +69,7 @@
         }
       }
       .from {
-        font-size: 13px;
+        font-size: 11px;
         color: rgba(151, 151, 151, 1);
       }
     }

+ 19 - 6
src/pages/A6ybwx/Sangzang/components/Policy/index.tsx

@@ -10,6 +10,7 @@ function Policy({ setShowTab }: { setShowTab: (tab: number) => void }) {
 
   const originRef = useRef<HTMLDivElement>(null)
   const itemRef = useRef<HTMLDivElement>(null)
+
   const { myData } = useSelector((state: RootState) => state.A0Layout)
   const [isOriStates, setIsOriStates] = useState(
     myData.policy[0].part2.map(item => (item.img ? true : false))
@@ -56,12 +57,25 @@ function Policy({ setShowTab }: { setShowTab: (tab: number) => void }) {
     return isOriStates[part2Index] ? part2Item?.img?.[0] || '' : part2Item?.img_ac?.[0] || ''
   }
 
+  useEffect(() => {
+    const part1TXT = document.querySelectorAll('#part1TXT')
+    part1TXT.forEach((v: any) => {
+      v.addEventListener('wheel', (e: any) => {
+        e.preventDefault()
+        e.stopPropagation()
+        console.log('part1TXT', v.scrollTop += e.deltaY)
+
+      })
+    })
+
+  }, [currentItem])
+
   return (
     <div className={styles.Policy}>
       <Zback clickFu={() => setShowTab(0)} />
 
-      <div className='containner' ref={originRef} onWheel={handleWheel}>
-        <div className='containner2'>
+      <div className='containner'  >
+        <div className='containner2' ref={originRef} onWheel={handleWheel}>
           {myData.policy.map((item, index) => (
             <div className='tabItem' ref={itemRef} key={item.title}>
               <div className={`history1`} onClick={() => handleItemClick(index + 1)}>
@@ -73,7 +87,7 @@ function Policy({ setShowTab }: { setShowTab: (tab: number) => void }) {
               <div className={`historyDetail ${currentItem !== 0 ? '' : 'historyDetail_hide'}`}>
                 <>
                   <div className='part1' style={partChangeCss(index)}>
-                    <div className='part1Box'>
+                    <div className='part1Box' id={`part1TXT`}>
                       <div className='part1txt'>{item.part1.txt} </div>
                       <div className='from'>
                         <div className='fromtxt'>{item.part1.from} </div>
@@ -134,9 +148,8 @@ function Policy({ setShowTab }: { setShowTab: (tab: number) => void }) {
               {item.title}
             </div>
             <img
-              src={require(`@/assets/img/A7base3_icon${
-                currentItem - 1 === index ? 'A' : '_n'
-              }.png`)}
+              src={require(`@/assets/img/A7base3_icon${currentItem - 1 === index ? 'A' : '_n'
+                }.png`)}
               alt=''
             />
           </div>

+ 47 - 2
src/pages/A9knowlege/components/Chart/index.tsx

@@ -2,12 +2,14 @@ import React, { useState, useRef, useEffect } from 'react'
 import axios from 'axios'
 import styles from './index.module.scss'
 import { decrypt } from '@/utils/encrypt'
+import ChartInput from '../ChartInput'
+import { useSelector } from 'react-redux'
+import { RootState } from '@/store'
 
 const questions = [
   '程哲碑有哪些特殊之处?',
   '碑主程哲是一个怎样的人?',
-  '程哲碑的造像艺术有何特点?',
-  '什么是“碑禁政策”?'
+  '程哲碑的造像艺术有何特点?'
 ]
 
 const FASTGPT_API_URL = 'https://cloud.fastgpt.cn/api'
@@ -20,12 +22,16 @@ interface Message {
 }
 
 function Chart() {
+  const { isHH } = useSelector((state: RootState) => state.A0Layout)
   const [messages, setMessages] = useState<Message[]>([])
   const [inputValue, setInputValue] = useState('')
   const [isLoading, setIsLoading] = useState(false)
   const [showQuickQuestions, setShowQuickQuestions] = useState(true)
+  const [showChartInput, setShowChartInput] = useState(false)
   const messagesEndRef = useRef<HTMLDivElement>(null)
   const inputRef = useRef<HTMLInputElement>(null)
+  const savedTransformRef = useRef<string>('')
+  const savedLeftRef = useRef<string>('')
 
   useEffect(() => {
     messagesEndRef.current?.scrollIntoView({ behavior: 'smooth' })
@@ -155,6 +161,35 @@ function Chart() {
     setShowQuickQuestions(true)
   }
 
+  const handleInputClick = () => {
+    if (isHH) {
+      return
+    }
+
+    const rootElement = document.querySelector('#root') as HTMLElement
+    if (rootElement) {
+      savedTransformRef.current = rootElement.style.transform || ''
+      savedLeftRef.current = rootElement.style.left || ''
+
+      const currentTransform = rootElement.style.transform
+      if (currentTransform && currentTransform.includes('rotate(90deg)')) {
+        rootElement.style.transform = ''
+        rootElement.style.left = '0'
+      }
+
+      setShowChartInput(true)
+    }
+  }
+
+  const handleCloseChartInput = () => {
+    const rootElement = document.querySelector('#root') as HTMLElement
+    if (rootElement) {
+      rootElement.style.transform = savedTransformRef.current || ''
+      rootElement.style.left = savedLeftRef.current || ''
+    }
+    setShowChartInput(false)
+  }
+
   return (
     <div className={styles.chart}>
       <div className={styles.chartWrap}>
@@ -199,15 +234,25 @@ function Chart() {
           <input
             ref={inputRef}
             type='text'
+            readOnly={!isHH}
             placeholder='请输入您想了解的内容...'
             value={inputValue}
             onChange={e => setInputValue(e.target.value)}
             onKeyPress={handleInputKeyPress}
+            onClick={handleInputClick}
             disabled={isLoading}
           />
           <div className={styles.btn} onClick={handleSendMessage.bind(null, inputValue)} />
         </div>
       </div>
+
+      {showChartInput && (
+        <ChartInput
+          onClose={handleCloseChartInput}
+          onSend={handleSendMessage}
+          isLoading={isLoading}
+        />
+      )}
     </div>
   )
 }

+ 50 - 0
src/pages/A9knowlege/components/ChartInput/index.module.scss

@@ -0,0 +1,50 @@
+.chartInput {
+  position: fixed;
+  inset: 0;
+  padding: 58px 30px 30px;
+  background: url('../../images/img_pop_02@2x-min.jpg') no-repeat right bottom / 100% 100%;
+  z-index: 9999;
+  display: flex;
+  flex-direction: column;
+
+  :global {
+    .Zback {
+      top: 20px;
+      left: 22px;
+      width: 57px;
+      height: 28px;
+    }
+  }
+}
+
+.textarea {
+  padding: 13px;
+  width: 100%;
+  height: 262px;
+  border-radius: 5px;
+  color: #7c4b36;
+  border: 1px solid #7c4b36;
+  background: rgba(124, 75, 54, 0.1);
+  outline: none;
+  resize: none;
+  font-size: 16px;
+  font-family: inherit;
+  cursor: text;
+
+  &::placeholder {
+    color: #7c4b36;
+    opacity: 0.6;
+  }
+
+  &:disabled {
+    cursor: not-allowed;
+    opacity: 0.6;
+  }
+}
+
+.button {
+  margin-top: 5px;
+  width: 100%;
+  transition: opacity 0.3s;
+  user-select: none;
+}

+ 70 - 0
src/pages/A9knowlege/components/ChartInput/index.tsx

@@ -0,0 +1,70 @@
+import React, { useState, useRef, useEffect } from 'react'
+import styles from './index.module.scss'
+import Zback from '@/components/Zback'
+
+interface ChartInputProps {
+  onClose: () => void
+  onSend: (message: string) => void
+  isLoading?: boolean
+}
+
+function ChartInput({ onClose, onSend, isLoading = false }: ChartInputProps) {
+  const [inputValue, setInputValue] = useState('')
+  const textareaRef = useRef<HTMLTextAreaElement>(null)
+
+  useEffect(() => {
+    textareaRef.current?.focus()
+  }, [])
+
+  const handleSend = () => {
+    const text = inputValue.trim()
+    if (!text || isLoading) return
+
+    onSend(text)
+    setInputValue('')
+    onClose()
+  }
+
+  const handleKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {
+    if (e.key === 'Enter' && !e.shiftKey) {
+      e.preventDefault()
+      handleSend()
+    }
+  }
+
+  const handleButtonClick = (e: React.MouseEvent) => {
+    e.stopPropagation()
+    handleSend()
+  }
+
+  const handleContainerClick = (e: React.MouseEvent) => {
+    e.stopPropagation()
+  }
+
+  return (
+    <div className={styles.chartInput} onClick={handleContainerClick}>
+      <Zback clickFu={onClose} />
+
+      <textarea
+        ref={textareaRef}
+        className={styles.textarea}
+        placeholder='请输入您想了解的内容...'
+        value={inputValue}
+        onChange={e => setInputValue(e.target.value)}
+        onKeyDown={handleKeyDown}
+        disabled={isLoading}
+      />
+      <img
+        src={require('../../images/btn-min.png')}
+        alt='button'
+        className={styles.button}
+        onClick={handleButtonClick}
+        style={{ cursor: isLoading ? 'not-allowed' : 'pointer', opacity: isLoading ? 0.6 : 1 }}
+      />
+    </div>
+  )
+}
+
+const MemoChartInput = React.memo(ChartInput)
+
+export default MemoChartInput

BIN
src/pages/A9knowlege/images/btn-min.png


BIN
src/pages/A9knowlege/images/img_pop_02@2x-min.jpg


BIN
src/pages/A9knowlege/images/img_pop_03-min.png


+ 1 - 0
src/pages/A9knowlege/index.tsx

@@ -6,6 +6,7 @@ import Panel2 from './components/Panel2'
 import ModelPanel from './components/ModelPanel'
 import { echPageBackFu } from '@/components/MenuSider/data'
 import Zback from '@/components/Zback'
+import ChartInput from './components/ChartInput'
 
 function A9knowlege() {
   // 是否显示返回按钮