|
88 | 88 | </svg> |
89 | 89 | </button> |
90 | 90 | <!-- Edit (detail view, desktop) --> |
| 91 | + <button x-show="view === 'detail' && currentLecture?.transcript" |
| 92 | + @click="showTranscript = !showTranscript" |
| 93 | + class="hidden md:block text-sm bg-gray-100 text-gray-700 px-3 py-1.5 rounded-lg hover:bg-gray-200" |
| 94 | + x-text="showTranscript ? '切换到摘要' : '切换到转录'"> |
| 95 | + </button> |
91 | 96 | <button x-show="view === 'detail' && currentLecture?.state === 'ready'" |
92 | 97 | @click="startEdit()" |
93 | 98 | class="hidden md:block text-sm bg-blue-500 text-white px-3 py-1.5 rounded-lg hover:bg-blue-600"> |
@@ -309,17 +314,31 @@ <h4 class="font-medium text-gray-800 text-sm truncate" x-text="lec.sub_title || |
309 | 314 | <template x-if="currentLecture"> |
310 | 315 | <div> |
311 | 316 | <!-- Metadata --> |
312 | | - <p x-show="currentLecture.summary_model" |
| 317 | + <p x-show="!showTranscript && currentLecture.summary_model" |
313 | 318 | class="text-xs text-gray-400 mb-4"> |
314 | 319 | Generated by <span x-text="currentLecture.summary_model"></span> |
315 | 320 | </p> |
316 | 321 |
|
317 | 322 | <!-- Rendered summary --> |
318 | | - <div class="prose" |
| 323 | + <div x-show="!showTranscript" |
| 324 | + class="prose" |
319 | 325 | x-html="renderMd(currentLecture.summary || '')" |
320 | | - x-effect="currentLecture && $nextTick(() => activateKaTeX($el))"> |
| 326 | + x-effect="!showTranscript && currentLecture && $nextTick(() => activateKaTeX($el))"> |
| 327 | + </div> |
| 328 | + |
| 329 | + <!-- Transcript --> |
| 330 | + <div x-show="showTranscript" |
| 331 | + class="prose whitespace-pre-wrap text-sm text-gray-700" |
| 332 | + x-text="currentLecture.transcript || ''"> |
321 | 333 | </div> |
322 | 334 |
|
| 335 | + <!-- Mobile toggle button --> |
| 336 | + <button x-show="currentLecture.transcript" |
| 337 | + @click="showTranscript = !showTranscript" |
| 338 | + class="md:hidden fixed left-5 bottom-24 text-xs bg-gray-100 text-gray-700 px-3 py-2 rounded-full shadow hover:bg-gray-200 z-20" |
| 339 | + x-text="showTranscript ? '切换到摘要' : '切换到转录'"> |
| 340 | + </button> |
| 341 | + |
323 | 342 | <!-- FAB edit button (mobile) --> |
324 | 343 | <button x-show="currentLecture.state === 'ready'" |
325 | 344 | @click="startEdit()" |
|
0 commit comments