camera.vue 38 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496
  1. <template>
  2. <view class="camera-container">
  3. <!-- 顶部相机区域 - 固定位置 -->
  4. <view class="fixed-camera-container">
  5. <view class="user-avatar">
  6. <camera v-if="!digitalHumanUrl" device-position="front" flash="auto" class="camera"
  7. :mode="mode" @error="handleCameraError"></camera>
  8. <web-view v-else-if="digitalHumanUrl" :src="digitalHumanUrl" class="digital-human-webview"></web-view>
  9. <image v-else src="/static/avatar.png" mode="aspectFill" class="avatar-image"></image>
  10. </view>
  11. </view>
  12. <!-- 主要内容区域 - 修改为流式布局 -->
  13. <scroll-view class="content-scroll" scroll-y="true" :scroll-into-view="currentScrollId" :scroll-with-animation="true">
  14. <view class="content">
  15. <!-- 测试内容区域 - 修改为流式布局,每个问题都显示 -->
  16. <view v-for="(question, qIndex) in questions" :key="question.id" :id="'question-'+qIndex" class="interview-content">
  17. <!-- 问题编号和进度 -->
  18. <view class="question-number">
  19. <text>{{qIndex + 1}}/{{questions.length}}</text>
  20. </view>
  21. <!-- 问题和选项区域 -->
  22. <view class="question-area">
  23. <view class="question-importance">
  24. <!-- <text v-if="currentQuestion.isImportant">重点题</text> -->
  25. <text class="question-type">{{question.questionTypeName}}</text>
  26. {{question.text}}<text class="question-type" v-if="question.is_required_correct">(红线题)</text>
  27. </view>
  28. <!-- 添加图片显示区域,仅在 question_form 为 3 时显示 -->
  29. <view class="question-image-container" v-if="question.questionType === 3 && question.imageUrl">
  30. <image :src="question.imageUrl" mode="widthFix" class="question-image"></image>
  31. </view>
  32. <view class="options">
  33. <!-- 渲染非开放问题 (questionType: 1, 2 或 3) -->
  34. <view
  35. v-if="question.questionType !== 0"
  36. v-for="(option, index) in question.options"
  37. :key="index"
  38. class="option-item"
  39. :class="{
  40. 'option-selected': isOptionSelected(question, qIndex, index),
  41. 'option-disabled': qIndex !== currentQuestionIndex
  42. }"
  43. @click="qIndex === currentQuestionIndex && selectOption(index)">
  44. <text class="option-text">{{ option.option_text || (typeof option === 'string' ? option : JSON.stringify(option)) }}</text>
  45. </view>
  46. </view>
  47. <!-- 添加当前题目的按钮 - 只在多选题时显示 -->
  48. <view class="question-button-container" v-if="qIndex === currentQuestionIndex && question.questionType === 2">
  49. <button class="next-button" @click="nextQuestion()"
  50. :disabled="selectedOptions.length === 0">
  51. {{"提交答案"}}
  52. </button>
  53. </view>
  54. </view>
  55. </view>
  56. <!-- 添加底部空白区域,确保内容不被固定按钮遮挡 -->
  57. <view class="bottom-space"></view>
  58. </view>
  59. </scroll-view>
  60. <!-- 面试结束弹窗 -->
  61. <view class="interview-end-modal" v-if="showEndModal">
  62. <view class="modal-content">
  63. <view class="modal-title">测试已完成</view>
  64. <!-- <view class="score-display">{{score}}/{{totalQuestions}}</view>
  65. <view class="modal-message">您在本次测试中答了{{score}}道题目,共{{totalQuestions}}道题目。</view> -->
  66. <view class="modal-buttons">
  67. <!-- <button type="default" class="modal-button" @click="restartTest">重新测试</button> -->
  68. <button type="primary" class="modal-button" @click="navigateToInterview">进入面试</button>
  69. </view>
  70. </view>
  71. </view>
  72. <!-- AI面试结束页面 -->
  73. <view class="interview-complete-screen" v-if="interviewCompleted">
  74. <view class="digital-avatar-large">
  75. <image src="/static/avatar.png" mode="aspectFill" class="avatar-image-large"></image>
  76. </view>
  77. <view class="complete-message">AI面试已结束</view>
  78. <view class="complete-description">本次面试的全部环节已结束。非常感谢您的参与。</view>
  79. <button class="complete-button" @click="back">我知道了</button>
  80. </view>
  81. <!-- 在模板中添加一个测试按钮(开发时使用,发布前删除) -->
  82. <!-- <button @click="testEndScreen" style="position: absolute; top: 10px; right: 10px; z-index: 9999;">测试结束页</button> -->
  83. <!-- 添加加载状态 -->
  84. <view class="loading-container" v-if="loading">
  85. <uni-load-more status="loading" :contentText="{contentdown: '加载中...'}" />
  86. <text class="loading-text">正在加载面试题目...</text>
  87. </view>
  88. <!-- 添加加载错误提示 -->
  89. <view class="loading-container" v-if="!loading && loadError">
  90. <view class="error-container">
  91. <text class="error-message">加载面试题目失败</text>
  92. <button class="retry-button" @click="fetchInterviewData">重试</button>
  93. </view>
  94. </view>
  95. </view>
  96. </template>
  97. <script>
  98. import { getInterviewList, getInterviewDetail,getQuestions } from '@/api/user.js';
  99. import { apiBaseUrl } from '@/common/config.js';
  100. export default {
  101. data() {
  102. return {
  103. cameraContext: null,
  104. devicePosition: 'front',
  105. interviewStarted: true,
  106. showEndModal: false,
  107. currentQuestionIndex: 0,
  108. currentStep: 1,
  109. stepTexts: ['测试准备', '回答问题', '测试结束'],
  110. progressWidth: 50,
  111. remainingTime: '00:27',
  112. selectedOption: null,
  113. selectedOptions: [],
  114. showResult: false,
  115. isAnswerCorrect: false,
  116. questions: [], // 改为空数组,将通过API获取
  117. interviewId: null, // 存储当前面试ID
  118. useVideo: false,
  119. timerInterval: null,
  120. score: 0,
  121. totalQuestions: 0,
  122. interviewCompleted: false,
  123. digitalHumanUrl: '', // 数字人URL
  124. loading: true, // 添加加载状态
  125. loadError: false, // 添加加载错误状态
  126. errorMessage: '', // 添加错误消息
  127. answers: [], // 存储用户的所有答案
  128. currentQuestionDetail: null, // 当前题目详情
  129. isSubmitting: false, // 是否正在提交答案
  130. openQuestionAnswer: '', // 存储开放问题的答案
  131. currentAnswer: null, // 存储当前答案以便提交
  132. questionStartTime: null, // 存储问题开始时间
  133. mode: 'normal', // 相机模式
  134. currentScrollId: 'question-0', // 当前滚动到的问题ID
  135. }
  136. },
  137. computed: {
  138. currentQuestion() {
  139. console.log(this.questions[this.currentQuestionIndex]);
  140. return this.questions[this.currentQuestionIndex];
  141. }
  142. },
  143. onLoad(options) {
  144. // 从路由参数中获取面试ID
  145. if (options && options.id) {
  146. this.interviewId = options.id;
  147. this.fetchInterviewData();
  148. } else {
  149. // 如果没有ID,可以获取面试列表并使用第一个
  150. this.fetchInterviewList();
  151. }
  152. },
  153. onReady() {
  154. // 创建相机上下文
  155. this.cameraContext = uni.createCameraContext();
  156. // 创建AI视频上下文
  157. if (this.useVideo) {
  158. this.aiVideoContext = uni.createVideoContext('aiInterviewer');
  159. }
  160. // 初始化数字人
  161. this.initDigitalHuman();
  162. },
  163. methods: {
  164. // 获取面试列表
  165. async fetchInterviewList() {
  166. try {
  167. this.loading = true;
  168. const res = await getQuestions({position_id:JSON.parse(uni.getStorageSync('selectedJob')).id,page:1,limit:999,tenant_id:1});
  169. console.log(res.items);
  170. // 使用第一个面试
  171. this.interviewId = res.items//[0].id;
  172. this.fetchInterviewData(res.items);
  173. } catch (error) {
  174. console.error('获取面试列表失败:', error);
  175. this.handleLoadError('获取面试列表失败');
  176. }
  177. },
  178. // 获取面试详情数据
  179. async fetchInterviewData(data) {
  180. try {
  181. this.loading = true;
  182. // const res = await getInterviewDetail({ id: this.interviewId });
  183. // console.log('API返回数据:', res);
  184. // 如果返回的是问题列表
  185. if (data && Array.isArray(data)) {
  186. // 处理多个问题,并过滤掉 question_form 为 0 的问题
  187. this.questions = data
  188. .filter(q => q.question_form !== 0) // 过滤掉开放问题
  189. .map((q, index) => ({
  190. id: q.id || index + 1,
  191. text: q.question || '未知问题',
  192. options: q.options || [],
  193. correctAnswer: q.correctAnswer || 0,
  194. isImportant: q.is_system || false,
  195. explanation: q.explanation || '',
  196. questionType: q.question_form,
  197. questionTypeName: q.question_form_name || '单选题',
  198. is_required_correct: q.is_required_correct || false,
  199. correctAnswers: q.correct_answers || [],
  200. difficulty: q.difficulty || 1,
  201. difficultyName: q.difficulty_name || '初级',
  202. imageUrl: q.question_image_url || '' // 添加图片URL字段
  203. }));
  204. } else {
  205. // 处理单个问题
  206. this.processInterviewData(res);
  207. }
  208. console.log(this.questions);
  209. // 设置总题目数
  210. this.totalQuestions = this.questions.length;
  211. /* // 启动倒计时
  212. if (this.questions.length > 0) {
  213. this.startTimer();
  214. } */
  215. } catch (error) {
  216. console.error('获取面试详情失败:', error);
  217. this.handleLoadError('获取面试详情失败');
  218. } finally {
  219. this.loading = false;
  220. }
  221. },
  222. // 处理面试数据
  223. processInterviewData(data) {
  224. // 清空现有问题列表
  225. this.questions = [];
  226. // 检查数据格式并处理
  227. if (data && data.question_form !== 0) { // 只处理非开放问题
  228. // 创建一个格式化的问题对象
  229. const formattedQuestion = {
  230. id: data.id || 1,
  231. text: data.question || '未知问题',
  232. options: data.options || [],
  233. correctAnswer: data.correctAnswer || 0,
  234. isImportant: data.is_system || false,
  235. explanation: data.explanation || '',
  236. questionType: data.question_form, // 1-单选题,2-多选题,3-看图答题
  237. questionTypeName: data.question_form_name || '单选题',
  238. is_required_correct: data.is_required_correct || false,
  239. correctAnswers: data.correct_answers || [],
  240. difficulty: data.difficulty || 1,
  241. difficultyName: data.difficulty_name || '初级',
  242. imageUrl: data.question_image_url || '' // 添加图片URL字段
  243. };
  244. // 添加到问题列表
  245. this.questions.push(formattedQuestion);
  246. // 设置总题目数
  247. this.totalQuestions = this.questions.length;
  248. /* // 启动倒计时
  249. this.startTimer(); */
  250. } else {
  251. this.handleLoadError('没有可用的选择题');
  252. }
  253. },
  254. // 处理加载错误
  255. handleLoadError(message) {
  256. this.loadError = true;
  257. this.loading = false;
  258. this.errorMessage = message || '加载失败';
  259. uni.showToast({
  260. title: message || '加载失败',
  261. icon: 'none',
  262. duration: 2000
  263. });
  264. },
  265. startTimer() {
  266. // 确保问题已加载
  267. if (this.questions.length === 0) return;
  268. // 记录开始时间
  269. this.questionStartTime = new Date();
  270. // 设置倒计时时间(秒)
  271. let seconds = 60; // 每题60秒,可以根据需要调整
  272. this.remainingTime = `01:00`;
  273. this.timerInterval = setInterval(() => {
  274. seconds--;
  275. if (seconds <= 0) {
  276. clearInterval(this.timerInterval);
  277. // 时间到,自动提交答案并进入下一题
  278. if (!this.showResult) {
  279. this.checkAnswer();
  280. // 短暂延迟后自动进入下一题
  281. setTimeout(() => {
  282. if (this.currentQuestionIndex < this.questions.length - 1) {
  283. this.goToNextQuestion();
  284. } else {
  285. // 如果是最后一题,显示结束模态框或跳转
  286. uni.navigateTo({
  287. url: '/pages/interview-question/interview-question'
  288. });
  289. }
  290. }, 1500); // 1.5秒后自动进入下一题
  291. }
  292. }
  293. // 格式化显示时间 (不再显示,但仍然计算用于内部逻辑)
  294. const min = Math.floor(seconds / 60).toString().padStart(2, '0');
  295. const sec = (seconds % 60).toString().padStart(2, '0');
  296. this.remainingTime = `${min}:${sec}`;
  297. }, 1000);
  298. },
  299. resetTimer() {
  300. clearInterval(this.timerInterval);
  301. /* this.startTimer(); */
  302. },
  303. selectOption(index) {
  304. if (this.showResult) return; // 已显示结果时不能再选择
  305. console.log('selectOption',index);
  306. // 判断当前题目类型
  307. if (this.currentQuestion.questionType === 2) { // 多选题
  308. // 如果已经选中,则取消选中
  309. const optionIndex = this.selectedOptions.indexOf(index);
  310. if (optionIndex > -1) {
  311. this.selectedOptions.splice(optionIndex, 1);
  312. } else {
  313. // 否则添加到已选中数组
  314. this.selectedOptions.push(index);
  315. }
  316. // 多选题不自动提交,需要用户手动点击"进入下一题"按钮
  317. } else if (this.currentQuestion.questionType === 1 || this.currentQuestion.questionType === 3 || this.currentQuestion.questionType === 4) { // 单选题、看图答题或类型4题目
  318. this.selectedOption = index;
  319. // 自动提交答案并进入下一题
  320. this.playAiSpeaking();
  321. // 短暂延迟后提交答案,让用户看到选中效果
  322. setTimeout(() => {
  323. this.checkAnswer();
  324. this.saveAnswer();
  325. // 提交答案
  326. this.submitCurrentAnswer().then(() => {
  327. // 提交成功后,短暂延迟后自动进入下一题
  328. setTimeout(() => {
  329. // 如果是最后一题,跳转到面试页面
  330. if (this.currentQuestionIndex >= this.questions.length - 1) {
  331. uni.navigateTo({
  332. url: '/pages/interview-question/interview-question'
  333. });
  334. } else {
  335. // 否则进入下一题
  336. this.goToNextQuestion();
  337. }
  338. }, 800); // 0.8秒后自动进入下一题
  339. }).catch(error => {
  340. console.error('提交答案失败:', error);
  341. // 即使提交失败也继续下一题
  342. setTimeout(() => {
  343. if (this.currentQuestionIndex >= this.questions.length - 1) {
  344. uni.navigateTo({
  345. url: '/pages/interview-question/interview-question'
  346. });
  347. } else {
  348. this.goToNextQuestion();
  349. }
  350. }, 1000);
  351. });
  352. }, 500); // 0.5秒后提交答案
  353. }
  354. },
  355. checkAnswer() {
  356. // 如果已经显示结果,说明已经提交过答案,不再重复提交
  357. if (this.showResult) return;
  358. clearInterval(this.timerInterval); // 停止计时
  359. // 确保当前问题存在
  360. if (!this.currentQuestion) {
  361. console.error('当前问题不存在');
  362. return;
  363. }
  364. // 根据题目类型检查答案是否正确
  365. if (this.currentQuestion.questionType === 0) { // 开放问题
  366. // 开放问题没有标准答案,可以根据需要设置为正确或待评估
  367. this.isAnswerCorrect = true; // 或者设置为 null 表示待评估
  368. } else if (this.currentQuestion.questionType === 2) { // 多选题
  369. const sortedSelected = [...this.selectedOptions].sort();
  370. const sortedCorrect = [...this.currentQuestion.correctAnswers].sort();
  371. if (sortedSelected.length !== sortedCorrect.length) {
  372. this.isAnswerCorrect = false;
  373. } else {
  374. this.isAnswerCorrect = sortedSelected.every((value, index) => value === sortedCorrect[index]);
  375. }
  376. } else { // 单选题或看图答题 (questionType === 1 或 3)
  377. this.isAnswerCorrect = this.selectedOption === this.currentQuestion.correctAnswer;
  378. }
  379. // 显示结果
  380. this.showResult = true;
  381. // 保存当前题目的答案
  382. this.saveAnswer();
  383. },
  384. // 修改 nextQuestion 方法,只处理多选题
  385. nextQuestion() {
  386. // 确保当前是多选题
  387. if (this.currentQuestion.questionType !== 2) return;
  388. // 检查答案并提交
  389. this.checkAnswer();
  390. // 保存当前题目的答案
  391. this.saveAnswer();
  392. // 提交答案
  393. this.submitCurrentAnswer().then(() => {
  394. // 提交成功后,短暂延迟后自动进入下一题
  395. setTimeout(() => {
  396. // 如果是最后一题,跳转到面试页面
  397. if (this.currentQuestionIndex >= this.questions.length - 1) {
  398. uni.navigateTo({
  399. url: '/pages/interview-question/interview-question'
  400. });
  401. } else {
  402. // 否则进入下一题
  403. this.goToNextQuestion();
  404. }
  405. }, 500); // 0.5秒后自动进入下一题
  406. }).catch(error => {
  407. console.error('提交答案失败:', error);
  408. // 即使提交失败也继续下一题
  409. setTimeout(() => {
  410. if (this.currentQuestionIndex >= this.questions.length - 1) {
  411. uni.navigateTo({
  412. url: '/pages/interview-question/interview-question'
  413. });
  414. } else {
  415. this.goToNextQuestion();
  416. }
  417. }, 1000);
  418. });
  419. },
  420. // 保存当前题目的答案
  421. saveAnswer() {
  422. let answer;
  423. if (this.currentQuestion.questionType === 0) { // 开放问题
  424. answer = {
  425. questionId: this.currentQuestion.id,
  426. questionType: this.currentQuestion.questionType,
  427. answer: this.openQuestionAnswer,
  428. answerDuration: this.getAnswerDuration() // 添加答题时长
  429. };
  430. } else if (this.currentQuestion.questionType === 1 || this.currentQuestion.questionType === 3 || this.currentQuestion.questionType === 4) { // 单选题、看图答题或类型4题目
  431. answer = {
  432. questionId: this.currentQuestion.id,
  433. questionType: this.currentQuestion.questionType,
  434. answer: this.selectedOption,
  435. answerDuration: this.getAnswerDuration() // 添加答题时长
  436. };
  437. } else { // 多选题
  438. answer = {
  439. questionId: this.currentQuestion.id,
  440. questionType: this.currentQuestion.questionType,
  441. answer: this.selectedOptions,
  442. answerDuration: this.getAnswerDuration() // 添加答题时长
  443. };
  444. }
  445. // 检查是否已存在该题目的答案,如果存在则更新
  446. const existingIndex = this.answers.findIndex(a => a.questionId === answer.questionId);
  447. if (existingIndex > -1) {
  448. this.answers[existingIndex] = answer;
  449. } else {
  450. this.answers.push(answer);
  451. }
  452. // 保存当前答案以便提交
  453. this.currentAnswer = answer;
  454. console.log('已保存答案:', this.answers);
  455. },
  456. // 获取答题时长(秒)
  457. getAnswerDuration() {
  458. // 这里假设每题默认30秒,根据剩余时间计算用时
  459. // 您可以根据实际情况调整计算逻辑
  460. const remainingTimeArr = this.remainingTime.split(':');
  461. const remainingSeconds = parseInt(remainingTimeArr[0]) * 60 + parseInt(remainingTimeArr[1]);
  462. return 30 - remainingSeconds; // 假设每题30秒
  463. },
  464. // 提交当前答案
  465. async submitCurrentAnswer() {
  466. if (!this.currentAnswer || this.isSubmitting) return; // 如果正在提交或没有答案,则不执行
  467. try {
  468. // 设置提交状态为true
  469. this.isSubmitting = true;
  470. // 显示提交中提示
  471. uni.showLoading({
  472. title: '正在提交答案...'
  473. });
  474. // 构建提交数据
  475. let answerContent = '';
  476. let answerOptions = [];
  477. if (this.currentAnswer.questionType === 0) {
  478. // 开放题直接使用文本答案
  479. answerContent = this.currentAnswer.answer;
  480. answerOptions = [];
  481. } else if (this.currentAnswer.questionType === 1 || this.currentAnswer.questionType === 3 || this.currentAnswer.questionType === 4) {
  482. // 单选题或看图答题,获取选项ID而不是索引
  483. const selectedIndex = this.currentAnswer.answer;
  484. const selectedOption = this.currentQuestion.options[selectedIndex];
  485. console.log('selectedOption',selectedOption);
  486. const optionId = selectedOption.id ? selectedOption.id : selectedIndex;
  487. answerContent = optionId.toString();
  488. answerOptions = [optionId];
  489. } else if (this.currentAnswer.questionType === 2) {
  490. // 多选题,将选项ID数组转为逗号分隔的字符串
  491. const selectedIndices = this.currentAnswer.answer;
  492. const selectedOptionIds = selectedIndices.map(index => {
  493. const option = this.currentQuestion.options[index];
  494. // 使用选项的ID或其他唯一标识符
  495. return option.id ? option.id : index;
  496. });
  497. answerOptions = selectedOptionIds;
  498. }
  499. const submitData = {
  500. position_id: JSON.parse(uni.getStorageSync('selectedJob')).id,
  501. applicant_id: JSON.parse(uni.getStorageSync('userInfo')).id,
  502. job_position_question_id: this.currentAnswer.questionId,
  503. // answer_content: answerContent,
  504. answer_options: answerOptions,
  505. answer_duration: this.currentAnswer.answerDuration || 0,
  506. tenant_id: 1
  507. };
  508. console.log('提交数据:', submitData);
  509. // 调用API提交答案
  510. const res = await this.$http.post(`${apiBaseUrl}/api/job/submit_answer`, submitData);
  511. console.log('提交答案响应:', res);
  512. return res;
  513. } catch (error) {
  514. console.error('提交答案失败:', error);
  515. // 显示错误提示
  516. uni.showToast({
  517. title: '提交答案失败,请重试',
  518. icon: 'none'
  519. });
  520. throw error;
  521. } finally {
  522. // 隐藏加载提示
  523. uni.hideLoading();
  524. // 重置提交状态
  525. this.isSubmitting = false;
  526. }
  527. },
  528. // 修改 goToNextQuestion 方法,在切换到下一题时重置当前选项状态
  529. async goToNextQuestion() {
  530. // 重置状态
  531. this.showResult = false;
  532. // 重置当前选择状态,但不影响已保存的答案
  533. this.selectedOption = null;
  534. this.selectedOptions = [];
  535. this.openQuestionAnswer = ''; // 重置开放问题答案
  536. // 前往下一题
  537. this.currentQuestionIndex++;
  538. // 更新滚动ID,滚动到下一题
  539. this.currentScrollId = 'question-' + this.currentQuestionIndex;
  540. // 如果已经有下一题的详情,直接使用
  541. if (this.questions[this.currentQuestionIndex]) {
  542. // 更新进度
  543. this.progressWidth = (this.currentQuestionIndex + 1) / this.questions.length * 100;
  544. // 重置计时器但不显示
  545. this.resetTimer();
  546. // 播放AI介绍下一题
  547. this.playAiSpeaking();
  548. setTimeout(() => {
  549. this.pauseAiSpeaking();
  550. }, 2000);
  551. return;
  552. }
  553. // 否则请求下一题详情
  554. try {
  555. this.loading = true;
  556. // 假设您有一个获取单个题目详情的API
  557. // const res = await getQuestionDetail({
  558. // interviewId: this.interviewId,
  559. // questionIndex: this.currentQuestionIndex
  560. // });
  561. // 模拟API调用
  562. await new Promise(resolve => setTimeout(resolve, 1000));
  563. const res = { /* 模拟的题目数据 */ };
  564. // 处理题目数据
  565. if (res) {
  566. const formattedQuestion = {
  567. id: res.id || this.currentQuestionIndex + 1,
  568. text: res.question || '未知问题',
  569. options: res.options || [],
  570. correctAnswer: res.correctAnswer || 0,
  571. isImportant: res.is_system || false,
  572. explanation: res.explanation || '',
  573. questionType: res.question_form || 1,
  574. questionTypeName: res.question_form_name || '单选题',
  575. is_required_correct: res.is_required_correct || false,
  576. correctAnswers: res.correct_answers || [],
  577. difficulty: res.difficulty || 1,
  578. difficultyName: res.difficulty_name || '初级'
  579. };
  580. // 添加到问题列表
  581. this.questions.push(formattedQuestion);
  582. }
  583. } catch (error) {
  584. console.error('获取题目详情失败:', error);
  585. uni.showToast({
  586. title: '获取题目失败,请重试',
  587. icon: 'none'
  588. });
  589. // 出错时回到上一题
  590. this.currentQuestionIndex--;
  591. } finally {
  592. this.loading = false;
  593. // 更新进度
  594. this.progressWidth = (this.currentQuestionIndex + 1) / this.questions.length * 100;
  595. // 重置计时器
  596. this.resetTimer();
  597. }
  598. },
  599. toggleSettings() {
  600. // 打开设置面板
  601. uni.showToast({
  602. title: '设置功能开发中',
  603. icon: 'none'
  604. });
  605. },
  606. back(target) {
  607. // 清除计时器
  608. if (this.timerInterval) {
  609. clearInterval(this.timerInterval);
  610. }
  611. // 如果指定了跳转目标
  612. if (target) {
  613. uni.navigateTo({
  614. url: target
  615. });
  616. return;
  617. }
  618. // 否则尝试返回上一页,如果失败则跳转到首页
  619. // try {
  620. // const pages = getCurrentPages();
  621. // if (pages.length > 1) {
  622. // uni.reLaunch({
  623. // url: '/pages/index/index'
  624. // });
  625. // } else {
  626. // // 如果当前是第一页,则跳转到首页
  627. // uni.reLaunch({
  628. // url: '/pages/index/index'
  629. // });
  630. // }
  631. // } catch (e) {
  632. // console.error('导航错误:', e);
  633. // // 出错时也跳转到首页
  634. // uni.reLaunch({
  635. // url: '/pages/index/index'
  636. // });
  637. // }
  638. },
  639. error(e) {
  640. // 相机错误事件
  641. console.error(e.detail);
  642. uni.showToast({
  643. title: '相机启动失败,请检查权限设置',
  644. icon: 'none'
  645. });
  646. },
  647. playAiSpeaking() {
  648. if (this.useVideo && this.aiVideoContext) {
  649. this.aiVideoContext.play();
  650. }
  651. // 触发数字人说话动画
  652. if (this.digitalHumanUrl) {
  653. // 假设当前问题的文本作为数字人要说的内容
  654. const speakText = this.currentQuestion ? this.currentQuestion.text : '';
  655. this.interactWithDigitalHuman(speakText);
  656. }
  657. },
  658. pauseAiSpeaking() {
  659. if (this.useVideo && this.aiVideoContext) {
  660. this.aiVideoContext.pause();
  661. }
  662. },
  663. // 修改 restartTest 方法,添加可选的跳转目标
  664. restartTest(target) {
  665. this.currentQuestionIndex = 0;
  666. this.score = 0;
  667. this.showEndModal = false;
  668. this.showResult = false;
  669. this.selectedOption = null;
  670. this.selectedOptions = [];
  671. this.resetTimer();
  672. // 如果指定了跳转目标
  673. if (target) {
  674. uni.navigateTo({
  675. url: target
  676. });
  677. }
  678. },
  679. // 在methods中添加测试方法
  680. testEndScreen() {
  681. this.interviewCompleted = true;
  682. this.showEndModal = false;
  683. },
  684. // 初始化数字人
  685. initDigitalHuman() {
  686. // 移除不可用的示例URL
  687. // this.digitalHumanUrl = 'https://your-digital-human-service.com/avatar?id=123';
  688. // 暂时不使用数字人服务,直接使用本地图片
  689. this.digitalHumanUrl = '';
  690. // 如果您有实际可用的数字人服务,可以在这里设置
  691. // 例如:this.digitalHumanUrl = 'https://your-actual-service.com/avatar';
  692. // 或者使用本地HTML文件(如果有的话)
  693. // this.digitalHumanUrl = '/hybrid/html/digital-human.html';
  694. },
  695. // 与数字人交互的方法
  696. interactWithDigitalHuman(message) {
  697. // 如果数字人是通过web-view加载的,可以使用postMessage与其通信
  698. const webview = this.$mp.page.$getAppWebview().children()[0];
  699. if (webview) {
  700. webview.evalJS(`receiveMessage('${message}')`);
  701. }
  702. },
  703. // 添加 navigateToInterview 方法
  704. navigateToInterview() {
  705. // 关闭模态框
  706. this.showEndModal = false;
  707. // 跳转到interview页面
  708. uni.navigateTo({
  709. url: '/pages/interview/interview',
  710. success: () => {
  711. console.log('成功跳转到interview页面');
  712. },
  713. fail: (err) => {
  714. console.error('跳转失败:', err);
  715. uni.showToast({
  716. title: '跳转失败,请手动返回首页',
  717. icon: 'none'
  718. });
  719. }
  720. });
  721. },
  722. // 添加 handleCameraError 方法
  723. handleCameraError(e) {
  724. console.error('相机错误:', e.detail);
  725. uni.showToast({
  726. title: '相机启动失败,请检查权限设置',
  727. icon: 'none'
  728. });
  729. },
  730. // 修改 isOptionSelected 方法,更精确地判断选项是否被选中
  731. isOptionSelected(question, qIndex, optionIndex) {
  732. // 获取该题的答案
  733. const answer = this.answers.find(a => a.questionId === question.id);
  734. // 如果是当前正在回答的题目
  735. if (qIndex === this.currentQuestionIndex) {
  736. if (question.questionType === 1 || question.questionType === 3 || question.questionType === 4) { // 单选题
  737. return this.selectedOption === optionIndex;
  738. } else if (question.questionType === 2) { // 多选题
  739. return this.selectedOptions.includes(optionIndex);
  740. }
  741. }
  742. // 如果是已回答过的题目,使用保存的答案
  743. else if (answer) {
  744. if (question.questionType === 1 || question.questionType === 3 || question.questionType === 4) { // 单选题
  745. return answer.answer === optionIndex;
  746. } else if (question.questionType === 2 && Array.isArray(answer.answer)) { // 多选题
  747. return answer.answer.includes(optionIndex);
  748. }
  749. }
  750. return false;
  751. },
  752. },
  753. // 添加生命周期钩子,确保在组件销毁时清除计时器
  754. beforeDestroy() {
  755. if (this.timerInterval) {
  756. clearInterval(this.timerInterval);
  757. }
  758. }
  759. }
  760. </script>
  761. <style>
  762. .camera-container {
  763. position: relative;
  764. width: 100%;
  765. height: 100vh;
  766. background-color: #ffffff;
  767. display: flex;
  768. flex-direction: column;
  769. overflow: hidden; /* 防止内容溢出 */
  770. }
  771. .header {
  772. height: 90rpx;
  773. /* background-color: #000000; */
  774. display: flex;
  775. align-items: center;
  776. padding: 0 30rpx;
  777. /* color: #ffffff; */
  778. }
  779. .back-button {
  780. width: 60rpx;
  781. height: 60rpx;
  782. display: flex;
  783. align-items: center;
  784. justify-content: center;
  785. }
  786. .title {
  787. flex: 1;
  788. text-align: center;
  789. font-size: 32rpx;
  790. font-weight: bold;
  791. }
  792. .controls {
  793. display: flex;
  794. gap: 30rpx;
  795. }
  796. .iconfont {
  797. font-size: 40rpx;
  798. }
  799. .content {
  800. flex: 1;
  801. display: flex;
  802. flex-direction: column;
  803. position: relative;
  804. padding: 50rpx 20rpx 0;
  805. }
  806. .progress-container {
  807. display: flex;
  808. flex-direction: column;
  809. justify-content: space-between;
  810. margin-bottom: 20rpx;
  811. }
  812. .progress-step {
  813. display: flex;
  814. align-items: center;
  815. margin-bottom: 10rpx;
  816. }
  817. .step-circle {
  818. width: 40rpx;
  819. height: 40rpx;
  820. border-radius: 50%;
  821. background-color: #e0e0e0;
  822. display: flex;
  823. align-items: center;
  824. justify-content: center;
  825. font-size: 24rpx;
  826. margin-right: 10rpx;
  827. }
  828. .step-circle.active {
  829. background-color: #ff9500;
  830. color: #ffffff;
  831. }
  832. .step-text {
  833. font-size: 24rpx;
  834. color: #666666;
  835. }
  836. .progress-bar {
  837. height: 10rpx;
  838. background-color: #e0e0e0;
  839. border-radius: 5rpx;
  840. overflow: hidden;
  841. margin-bottom: 20rpx;
  842. }
  843. .progress-fill {
  844. height: 100%;
  845. background-color: #00c853;
  846. transition: width 0.3s;
  847. }
  848. .interview-content {
  849. flex: 1;
  850. display: flex;
  851. flex-direction: column;
  852. margin-bottom: 40rpx;
  853. padding: 20rpx;
  854. border-bottom: 1px solid #eee;
  855. }
  856. .video-area {
  857. display: flex;
  858. /* flex-direction: column; */
  859. justify-content: space-between;
  860. height: auto;
  861. margin-bottom: 20rpx;
  862. }
  863. .video-camera {
  864. display: flex;
  865. flex-direction: row;
  866. align-items: center;
  867. justify-content: space-between;
  868. width: 65%;
  869. }
  870. .interviewer {
  871. background-color: #f5f5f5;
  872. display: flex;
  873. align-items: center;
  874. justify-content: center;
  875. position: relative;
  876. width: 48% !important;
  877. height: 300rpx;
  878. }
  879. .interviewer-video {
  880. width: 100%;
  881. height: 100%;
  882. object-fit: cover;
  883. }
  884. .interviewer-avatar {
  885. width: 80%;
  886. height: 80%;
  887. object-fit: contain;
  888. }
  889. .user-camera-container {
  890. width: 48%;
  891. height: 300rpx;
  892. border-radius: 10rpx;
  893. overflow: hidden;
  894. border: 4rpx solid #ffffff;
  895. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.2);
  896. }
  897. .question-area {
  898. flex: 1;
  899. display: flex;
  900. flex-direction: column;
  901. }
  902. .question-number {
  903. font-size: 28rpx;
  904. color: #666;
  905. margin-bottom: 20rpx;
  906. }
  907. .question-importance {
  908. background-color: #f9f9f9;
  909. padding: 20rpx;
  910. border-radius: 10rpx;
  911. margin-bottom: 20rpx;
  912. font-size: 28rpx;
  913. color: #333;
  914. }
  915. .question-importance text {
  916. color: #ff0000;
  917. /* margin-right: 10rpx; */
  918. }
  919. .options {
  920. display: flex;
  921. flex-direction: column;
  922. gap: 20rpx;
  923. margin-bottom: 30rpx;
  924. }
  925. .option-item {
  926. padding: 20rpx;
  927. background-color: #f5f5f5;
  928. border-radius: 10rpx;
  929. font-size: 28rpx;
  930. transition: all 0.3s;
  931. border: 1px solid #e0e0e0;
  932. display: flex;
  933. align-items: center;
  934. cursor: pointer; /* 添加指针样式 */
  935. }
  936. .option-item:active {
  937. transform: scale(0.98); /* 点击时轻微缩小效果 */
  938. opacity: 0.9;
  939. }
  940. .option-selected {
  941. background-color: #e6f7ff;
  942. border: 1px solid #1890ff;
  943. }
  944. /* 添加选中后的动画效果 */
  945. @keyframes selectedPulse {
  946. 0% { box-shadow: 0 0 0 0 rgba(24, 144, 255, 0.4); }
  947. 70% { box-shadow: 0 0 0 10px rgba(24, 144, 255, 0); }
  948. 100% { box-shadow: 0 0 0 0 rgba(24, 144, 255, 0); }
  949. }
  950. .option-selected {
  951. animation: selectedPulse 1.5s ease-out;
  952. }
  953. .option-correct {
  954. background-color: #d4f7d4;
  955. border: 1px solid #52c41a;
  956. }
  957. .option-wrong {
  958. background-color: #fff1f0;
  959. border: 1px solid #ff4d4f;
  960. }
  961. .option-text {
  962. color: #333;
  963. }
  964. .timer-container {
  965. text-align: right;
  966. margin: 20rpx 0;
  967. }
  968. .timer-text {
  969. font-size: 24rpx;
  970. color: #666;
  971. background-color: #f0f0f0;
  972. padding: 6rpx 12rpx;
  973. border-radius: 6rpx;
  974. }
  975. .bottom-button-container {
  976. position: fixed;
  977. bottom: 50px;
  978. left: 5%;
  979. right: 0;
  980. padding: 20rpx;
  981. display: flex;
  982. justify-content: center;
  983. z-index: 10;
  984. }
  985. .bottom-button-wrapper {
  986. display: flex;
  987. width: 100%;
  988. justify-content: space-between;
  989. align-items: center;
  990. }
  991. .timer-display {
  992. font-size: 28rpx;
  993. color: #666;
  994. padding: 10rpx 20rpx;
  995. border-radius: 6rpx;
  996. }
  997. .next-button {
  998. background-color: #0039b3;
  999. color: #ffffff;
  1000. border-radius: 10rpx;
  1001. font-size: 30rpx;
  1002. height: 80rpx;
  1003. line-height: 80rpx;
  1004. width: 90%;
  1005. text-align: center;
  1006. margin: 0;
  1007. }
  1008. .footer {
  1009. height: 100rpx;
  1010. background-color: #000000;
  1011. display: flex;
  1012. justify-content: space-between;
  1013. align-items: center;
  1014. padding: 0 30rpx;
  1015. color: #ffffff;
  1016. }
  1017. .timer {
  1018. font-size: 28rpx;
  1019. }
  1020. .next-step {
  1021. font-size: 28rpx;
  1022. }
  1023. .interview-end-modal {
  1024. position: fixed;
  1025. top: 0;
  1026. left: 0;
  1027. right: 0;
  1028. bottom: 0;
  1029. background-color: rgba(0, 0, 0, 0.5);
  1030. display: flex;
  1031. align-items: center;
  1032. justify-content: center;
  1033. z-index: 999;
  1034. }
  1035. .modal-content {
  1036. width: 80%;
  1037. background-color: #ffffff;
  1038. border-radius: 20rpx;
  1039. padding: 40rpx;
  1040. display: flex;
  1041. flex-direction: column;
  1042. align-items: center;
  1043. }
  1044. .modal-title {
  1045. font-size: 36rpx;
  1046. font-weight: bold;
  1047. margin-bottom: 30rpx;
  1048. }
  1049. .score-display {
  1050. font-size: 48rpx;
  1051. font-weight: bold;
  1052. color: #0039b3;
  1053. margin: 20rpx 0;
  1054. }
  1055. .modal-message {
  1056. font-size: 28rpx;
  1057. color: #666;
  1058. text-align: center;
  1059. margin-bottom: 40rpx;
  1060. }
  1061. .modal-buttons {
  1062. display: flex;
  1063. justify-content: space-between;
  1064. width: 100%;
  1065. margin-top: 20rpx;
  1066. }
  1067. .modal-button {
  1068. width: 45%;
  1069. }
  1070. @keyframes speaking {
  1071. 0% {
  1072. opacity: 0.8;
  1073. }
  1074. 50% {
  1075. opacity: 1;
  1076. }
  1077. 100% {
  1078. opacity: 0.8;
  1079. }
  1080. }
  1081. .speaking {
  1082. animation: speaking 1.5s infinite;
  1083. }
  1084. .digital-avatar {
  1085. display: flex;
  1086. flex-direction: row;
  1087. align-items: flex-start;
  1088. justify-content: space-between;
  1089. width: 100%;
  1090. margin-bottom: 20rpx;
  1091. }
  1092. .message-box {
  1093. width: 65%;
  1094. min-height: 120rpx;
  1095. background-color: #f5f5f5;
  1096. border-radius: 10rpx;
  1097. padding: 15rpx;
  1098. margin-right: 20rpx;
  1099. display: flex;
  1100. align-items: center;
  1101. }
  1102. .message-text {
  1103. font-size: 24rpx;
  1104. color: #333;
  1105. line-height: 1.5;
  1106. }
  1107. .user-avatar {
  1108. width: 110px;
  1109. height: 160px;
  1110. border-radius: 10rpx;
  1111. overflow: hidden;
  1112. }
  1113. .camera {
  1114. width: 100%;
  1115. height: 100%;
  1116. border-radius: 10rpx;
  1117. border: 2rpx solid #e0e0e0;
  1118. }
  1119. .avatar-image {
  1120. width: 100%;
  1121. height: 100%;
  1122. border-radius: 10rpx;
  1123. border: 2rpx solid #e0e0e0;
  1124. }
  1125. .digital-human-webview {
  1126. width: 100%;
  1127. height: 100%;
  1128. border-radius: 10rpx;
  1129. border: 2rpx solid #e0e0e0;
  1130. }
  1131. .interview-complete-screen {
  1132. position: fixed;
  1133. top: 0;
  1134. left: 0;
  1135. right: 0;
  1136. bottom: 0;
  1137. background-color: #f0f5ff;
  1138. display: flex;
  1139. flex-direction: column;
  1140. align-items: center;
  1141. justify-content: center;
  1142. z-index: 1000;
  1143. padding: 40rpx;
  1144. }
  1145. .digital-avatar-large {
  1146. width: 200rpx;
  1147. height: 200rpx;
  1148. margin-bottom: 60rpx;
  1149. }
  1150. .avatar-image-large {
  1151. width: 100%;
  1152. height: 100%;
  1153. border-radius: 30rpx;
  1154. }
  1155. .complete-message {
  1156. font-size: 40rpx;
  1157. font-weight: bold;
  1158. color: #333;
  1159. margin-bottom: 30rpx;
  1160. }
  1161. .complete-description {
  1162. font-size: 28rpx;
  1163. color: #666;
  1164. text-align: center;
  1165. margin-bottom: 80rpx;
  1166. line-height: 1.5;
  1167. }
  1168. .complete-button {
  1169. background-color: #0039b3;
  1170. color: #ffffff;
  1171. border-radius: 10rpx;
  1172. font-size: 32rpx;
  1173. padding: 20rpx 60rpx;
  1174. margin-top: 40rpx;
  1175. }
  1176. /* 添加加载状态样式 */
  1177. .loading-container {
  1178. position: absolute;
  1179. top: 0;
  1180. left: 0;
  1181. right: 0;
  1182. bottom: 0;
  1183. display: flex;
  1184. flex-direction: column;
  1185. align-items: center;
  1186. justify-content: center;
  1187. background-color: rgba(255, 255, 255, 0.9);
  1188. z-index: 100;
  1189. }
  1190. .loading-text {
  1191. margin-top: 20rpx;
  1192. font-size: 28rpx;
  1193. color: #666;
  1194. }
  1195. .error-container {
  1196. text-align: center;
  1197. }
  1198. .error-message {
  1199. font-size: 28rpx;
  1200. color: #ff4d4f;
  1201. margin-bottom: 30rpx;
  1202. }
  1203. .retry-button {
  1204. background-color: #0039b3;
  1205. color: #ffffff;
  1206. border-radius: 10rpx;
  1207. font-size: 28rpx;
  1208. padding: 10rpx 30rpx;
  1209. }
  1210. .question-type {
  1211. display: inline-block;
  1212. /* background-color: #0039b3; */
  1213. color: white;
  1214. font-size: 24rpx;
  1215. /* padding: 4rpx 5rpx; */
  1216. border-radius: 6rpx;
  1217. /* margin-right: 10rpx; */
  1218. }
  1219. /* 新增的开放问题样式 */
  1220. .open-question-container {
  1221. display: flex;
  1222. flex-direction: column;
  1223. width: 100%;
  1224. margin-bottom: 20rpx;
  1225. }
  1226. .open-question-input {
  1227. width: 100%;
  1228. height: 300rpx;
  1229. background-color: #f9f9f9;
  1230. border: 1px solid #e0e0e0;
  1231. border-radius: 10rpx;
  1232. padding: 20rpx;
  1233. font-size: 28rpx;
  1234. color: #333;
  1235. }
  1236. .word-count {
  1237. text-align: right;
  1238. font-size: 24rpx;
  1239. color: #999;
  1240. margin-top: 10rpx;
  1241. }
  1242. .option-prefix {
  1243. margin-right: 10rpx;
  1244. font-weight: bold;
  1245. color: #333;
  1246. min-width: 30rpx;
  1247. }
  1248. /* 新增的图片显示样式 */
  1249. .question-image-container {
  1250. width: 100%;
  1251. margin: 20rpx 0;
  1252. display: flex;
  1253. justify-content: center;
  1254. align-items: center;
  1255. }
  1256. .question-image {
  1257. width: 100%;
  1258. max-width: 600rpx;
  1259. border-radius: 10rpx;
  1260. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
  1261. }
  1262. /* 添加滚动视图样式 */
  1263. .content-scroll {
  1264. flex: 1;
  1265. height: calc(100vh - 200px); /* 只减去顶部相机的高度 */
  1266. margin-top: 10px;
  1267. }
  1268. /* 添加底部空白区域,防止内容被固定按钮遮挡 */
  1269. .bottom-space {
  1270. height: 50rpx; /* 减小底部空白区域 */
  1271. }
  1272. /* 添加流式布局相关样式 */
  1273. .interview-content {
  1274. margin-bottom: 40rpx;
  1275. padding: 20rpx;
  1276. border-bottom: 1px solid #eee;
  1277. }
  1278. .option-disabled {
  1279. opacity: 0.7;
  1280. pointer-events: none;
  1281. }
  1282. .question-button-container {
  1283. margin-top: 20rpx;
  1284. display: flex;
  1285. justify-content: center;
  1286. }
  1287. .bottom-timer-container {
  1288. display: none;
  1289. }
  1290. /* 添加固定相机容器样式 */
  1291. .fixed-camera-container {
  1292. position: sticky;
  1293. top: 0;
  1294. width: 100%;
  1295. padding: 20rpx;
  1296. background-color: #fff;
  1297. z-index: 10;
  1298. display: flex;
  1299. justify-content: flex-start;
  1300. border-bottom: 1px solid #eee;
  1301. }
  1302. .user-avatar {
  1303. width: 110px;
  1304. height: 160px;
  1305. border-radius: 10rpx;
  1306. overflow: hidden;
  1307. }
  1308. </style>