fix(mobile): proxy review audio downloads
This commit is contained in:
@@ -173,7 +173,7 @@
|
||||
<view v-for="turn in detail.dialogue" :key="turn.role + turn.text" class="dialogue-row">
|
||||
<text class="dialogue-label">{{ turn.label }}</text>
|
||||
<text class="dialogue-text">{{ turn.text }}</text>
|
||||
<audio v-if="turn.audioUrl" class="dialogue-audio" controls :src="turn.audioUrl"></audio>
|
||||
<audio v-if="audioSrc(turn)" class="dialogue-audio" controls :src="audioSrc(turn)"></audio>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -240,6 +240,7 @@ import { onShow } from '@dcloudio/uni-app';
|
||||
import type { PracticeAlert, PracticeAssignment, PracticeRecord, ReviewDetail } from '@/types/api';
|
||||
import { isLoggedIn, rememberLoginRedirect } from '@/services/auth';
|
||||
import { resetPageScroll } from '@/services/navigation';
|
||||
import { apiUrl } from '@/services/api';
|
||||
import {
|
||||
createPracticeAssignment,
|
||||
getPracticeAlerts,
|
||||
@@ -274,6 +275,9 @@ const scenarioOptions = [
|
||||
{ id: 'repair-elevator-delay', name: '电梯故障' }
|
||||
];
|
||||
|
||||
const audioSrc = (turn: { audioOssId?: number | string; audioUrl?: string }) =>
|
||||
turn.audioOssId ? apiUrl(`/api/aihr/mobile/oss/${turn.audioOssId}`) : turn.audioUrl || '';
|
||||
|
||||
const scenarioIdForText = (text: string) => {
|
||||
if (/电梯/.test(text)) return 'repair-elevator-delay';
|
||||
if (/投诉|报修|漏水|噪音|摔倒/.test(text)) return 'complaint-water';
|
||||
|
||||
@@ -168,6 +168,7 @@ export interface ReviewDialogue {
|
||||
role: string;
|
||||
label: string;
|
||||
text: string;
|
||||
audioOssId?: number | string;
|
||||
audioUrl?: string;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user