Pārlūkot izejas kodu

Merge remote-tracking branch 'origin/wanzi'

liyanbo 3 mēneši atpakaļ
vecāks
revīzija
02fcc288f5

+ 1 - 1
src/components/MarkdownView/index.vue

@@ -39,7 +39,7 @@ const renderedMarkdown = computed(() => {
 
 <style lang="scss">
 .markdown-view {
-  font-family: PingFang SC;
+  font-family: 'SourceHanSansCN-Normal';
   font-size: 1rem;
   font-weight: 400;
   line-height: 1.6rem;

+ 4 - 4
src/components/ai/vision/VisionThink.vue

@@ -406,8 +406,10 @@ const imageList = ref([]) // image 列表
   background-color: #ffffff;
   margin-left: auto; // 消息靠右显示
   margin-right: 0; // 重置右边距
+  margin-bottom: rpx(10);
   max-width: rpx(400);
   font-size: rpx(8);
+  font-weight: normal;
   width: fit-content; // 宽度随文字内容变化
   border-radius: rpx(5);
   padding: rpx(5);
@@ -423,6 +425,7 @@ const imageList = ref([]) // image 列表
   max-width: rpx(400);
   padding: rpx(5);
   font-size: rpx(8);
+  font-weight: normal;
   border-radius: rpx(5);
   text-align: left; // 文字左对齐
 }
@@ -468,10 +471,7 @@ const imageList = ref([]) // image 列表
 
 /* AI返回的HTML内容样式 */
 .ai-html-content {
-  margin-top: 10px;
-  padding: 10px;
-  border-radius: 5px;
-  background-color: rgba(255, 255, 255, 0.8);
+  border-radius: rpx(5);
   max-width: 100%;
   overflow-x: auto;
 }

+ 28 - 4
src/components/ai/voice/VoiceInput.vue

@@ -53,14 +53,26 @@ const isRecording = ref(false) // 录音状态
 const recognition = ref(null) // 语音识别实例
 const countdown = ref(0) // 倒计时剩余秒数
 const countdownTimer = ref(null) // 倒计时定时器
+const isBrowserSupported = ref(true) // 浏览器是否支持语音识别
 
-// 初始化语音识别
-const initSpeechRecognition = () => {
+// 检测浏览器是否支持语音识别
+const checkBrowserSupport = () => {
   const SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition
   if (!SpeechRecognition) {
-    ElMessage.warning('当前浏览器不支持语音输入功能')
+    ElMessage.warning('当前浏览器不支持语音识别输入功能')
+    isBrowserSupported.value = false
+    return false
+  }
+  return true
+}
+
+// 初始化语音识别
+const initSpeechRecognition = () => {
+  if (!checkBrowserSupport()) {
     return null
   }
+  
+  const SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition
 
   const instance = new SpeechRecognition()
   instance.lang = props.lang
@@ -105,8 +117,10 @@ const toggleSpeechInput = () => {
   countdownTimer.value = null
 
   if (isRecording.value) {
-    // 手动停止时重置状态
+    // 手动停止时立即重置状态,确保在所有浏览器中波纹都能立即关闭
+    isRecording.value = false
     countdown.value = 0
+    emit('recordingStatusChanged', false)
     recognition.value?.stop()
   } else {
     // 初始化倒计时前再次清除定时器(防止快速点击)
@@ -142,6 +156,16 @@ const toggleSpeechInput = () => {
   }
 }
 
+// 组件挂载时检测浏览器支持
+onMounted(() => {
+  checkBrowserSupport()
+})
+
+// 组件挂载时检测浏览器支持
+onMounted(() => {
+  checkBrowserSupport()
+})
+
 // 组件卸载时清理资源
 onUnmounted(() => {
   clearInterval(countdownTimer.value)

+ 2 - 0
src/style.css

@@ -69,6 +69,8 @@ button:focus-visible {
   margin: 0 auto;
   padding: 2rem;
   text-align: center;
+  color: black;
+  font-family: 'SourceHanSansCN-Normal';
 }
 
 @media (prefers-color-scheme: light) {

+ 7 - 4
src/views/AIPage/AIImageToImage.vue

@@ -32,7 +32,6 @@
       <div class="img-box">
         <p>
           <img
-              style="width: fit-content; height: 180px; margin: 10px;"
               src="@/assets/images/color.png"
               class="avatar user"
           />
@@ -128,9 +127,9 @@ const goBack = () => {
 }
 
 .left-group2 img {
-  width: rpx(110);
-  height: auto;
-  margin-top: rpx(30);
+  width: fit-content;
+  height: rpx(100);
+  margin: rpx(5);
 }
 
 .title-box {
@@ -158,4 +157,8 @@ const goBack = () => {
   margin-top: rpx(50);
   color: #a39dce;
 }
+
+.img-box p {
+  font-size: rpx(10);
+}
 </style>

+ 6 - 4
src/views/AIPage/AIImageToVideo.vue

@@ -32,7 +32,6 @@
       <div class="img-box">
         <p>
           <img
-              style=" width: fit-content; height: 180px; margin: 10px;"
               src="@/assets/images/color.png"
               class="avatar user"
           />
@@ -123,9 +122,9 @@ const toggleDrawer = () => {
 }
 
 .left-group2 img {
-  width: rpx(110);
-  height: auto;
-  margin-top: rpx(30);
+  width: fit-content;
+  height: rpx(100);
+  margin: rpx(5);
 }
 
 .title-box {
@@ -153,4 +152,7 @@ const toggleDrawer = () => {
   margin-top: rpx(50);
   color: #a39dce;
 }
+.img-box p {
+  font-size: rpx(10);
+}
 </style>

+ 1 - 1
src/views/AIPage/AIQuestions.vue

@@ -169,7 +169,7 @@ watch(
 
 // 侧边栏
 .left-group2 {
-  // width: rpx(150);
+  width: rpx(20);
   height: 100%;
   display: flex;
   background-color: #ece9fd;

+ 7 - 4
src/views/AIPage/PlantExperts.vue

@@ -33,11 +33,11 @@
       <div class="img-box">
         <p>
           <img
-              style=" width: fit-content; height: 180px; margin: 10px;"
               src="@/assets/images/farm.png"
               class="avatar user"
           />
         </p>
+        <p>一起来认识神奇的植物吧~</p>
       </div>
     </div>
 
@@ -124,9 +124,9 @@ const toggleDrawer = () => {
 }
 
 .left-group2 img {
-  width: rpx(110);
-  height: auto;
-  margin-top: rpx(30);
+  width: fit-content;
+  height: rpx(100);
+  margin: rpx(5);
 }
 
 .title-box {
@@ -154,4 +154,7 @@ const toggleDrawer = () => {
   margin-top: rpx(50);
   color: #a39dce;
 }
+.img-box p {
+  font-size: rpx(10);
+}
 </style>