فهرست منبع

修改内容及添加蒙层

yangg 1 ماه پیش
والد
کامیت
3f5756133c
3فایلهای تغییر یافته به همراه60 افزوده شده و 25 حذف شده
  1. 1 1
      pages/camera/camera.vue
  2. 42 1
      pages/identity-verify/identity-verify.vue
  3. 17 23
      pages/interview-question/interview-question.vue

+ 1 - 1
pages/camera/camera.vue

@@ -53,7 +53,7 @@
 						<view class="question-button-container" v-if="qIndex === currentQuestionIndex && question.questionType === 2">
 							<button class="next-button" @click="nextQuestion()" 
 								:disabled="selectedOptions.length === 0">
-								{{"提交答案"}}
+								{{"下一题"}}
 							</button>
 						</view>
 					</view>

+ 42 - 1
pages/identity-verify/identity-verify.vue

@@ -34,7 +34,11 @@
           @click.prevent="preventVideoControl"
           @touchstart.prevent="preventVideoControl">
         </video>
-         <div class="answer-button-container" v-if="showAnswerButton">
+        
+        <!-- 添加透明蒙层 -->
+        <div class="video-overlay"></div>
+        
+        <div class="answer-button-container" v-if="showAnswerButton">
           <button class="answer-button" @click="handleAnswerButtonClick">
             开始回答
           </button>
@@ -3682,4 +3686,41 @@ video::-webkit-media-controls-fullscreen-button {
 .rerecord-button:hover {
   background-color: #f0f0f0;
 }
+
+/* 添加视频蒙层样式 */
+.video-overlay {
+  position: absolute;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100%;
+  background-color: transparent; /* 完全透明 */
+  z-index: 6; /* 确保在视频之上,但在按钮和字幕之下 */
+  pointer-events: auto; /* 允许捕获点击事件 */
+}
+
+/* 调整其他元素的z-index以确保正确的层级关系 */
+.subtitle-overlay {
+  /* ... 现有样式 ... */
+  z-index: 10; /* 确保字幕在蒙层之上 */
+}
+
+.answer-button-container,
+.stop-recording-button-container,
+.start-recording-button-container,
+.retry-button-container,
+.rerecord-button-container {
+  /* ... 现有样式 ... */
+  z-index: 20; /* 确保按钮在蒙层之上 */
+}
+
+.user-camera-container {
+  /* ... 现有样式 ... */
+  z-index: 20; /* 确保摄像头窗口在蒙层之上 */
+}
+
+.recording-indicator {
+  /* ... 现有样式 ... */
+  z-index: 20; /* 确保录制指示器在蒙层之上 */
+}
 </style>

+ 17 - 23
pages/interview-question/interview-question.vue

@@ -2670,7 +2670,7 @@ export default {
       }
     },
 
-    // 增强 submitToAiVoiceInteraction 方法
+    // 修改 submitToAiVoiceInteraction 方法
     submitToAiVoiceInteraction(videoUrl) {
       console.log('提交视频到AI语音交互接口:', videoUrl);
       
@@ -2682,32 +2682,29 @@ export default {
       
       // 获取用户信息和租户ID
       const tenant_id = uni.getStorageSync('tenant_id') || '1';
-      const userInfo = uni.getStorageSync('userInfo');
-      const openid = userInfo ? (JSON.parse(userInfo).openid || '') : '';
-      
-      // 检查环境
-      const systemInfo = uni.getSystemInfoSync();
-      const isMiniProgram = systemInfo.uniPlatform && systemInfo.uniPlatform.startsWith('mp-');
+      const application_id = uni.getStorageSync('appId') || '98'; // 默认为98(报告)
       
       // 准备请求数据
       const requestData = {
-        url: videoUrl,
+        voice_url: videoUrl,
         tenant_id: tenant_id,
-      /*   openid: openid,
-        application_id: uni.getStorageSync('appId') || '',
-        has_audio: true, // 明确标记包含音频
-        audio_format: 'mp4', // 指定音频格式
-        duration: this.recordingTimerCount || 0 // 添加录制时长 */
+        application_id: application_id,
+        scene_type: 'interview', // 场景类型:面试
+        voice_type: 'longxiaoxia' // 角色:龙小侠
       };
       
+      // 检查环境
+      const systemInfo = uni.getSystemInfoSync();
+      const isMiniProgram = systemInfo.uniPlatform && systemInfo.uniPlatform.startsWith('mp-');
+      
       if (isMiniProgram) {
         // 小程序环境使用 uni.request
         uni.request({
-          url: `${apiBaseUrl}/api/voice_ai_interaction`,
+          url: `${apiBaseUrl}/api/system/voice/mcp/interaction`, // 使用新的接口地址
           method: 'POST',
           data: requestData,
           header: {
-            'content-type': 'application/x-www-form-urlencoded'
+            'content-type': 'application/json' // 修改为JSON格式
           },
           success: (res) => {
             this.handleAiInteractionResponse(res.data);
@@ -2717,15 +2714,11 @@ export default {
           }
         });
       } else {
-        // H5/App环境使用 FormData 和 XMLHttpRequest
-        const formData = new FormData();
-        for (const key in requestData) {
-          formData.append(key, requestData[key]);
-        }
-        
+        // H5/App环境使用 XMLHttpRequest
         const xhr = new XMLHttpRequest();
-        xhr.open('POST', `${apiBaseUrl}/api/voice_ai_interaction`, true);
+        xhr.open('POST', `${apiBaseUrl}/api/system/voice/mcp/interaction`, true);
         xhr.timeout = 60000; // 60秒超时
+        xhr.setRequestHeader('Content-Type', 'application/json');
         
         xhr.onload = () => {
           if (xhr.status === 200) {
@@ -2749,7 +2742,8 @@ export default {
           this.handleAiInteractionError({ errMsg: '请求超时' });
         };
         
-        xhr.send(formData);
+        // 发送JSON格式的数据
+        xhr.send(JSON.stringify(requestData));
       }
     },