import { defineComponent, toRefs, PropType, ref, Transition, onMounted, computed, nextTick } from 'vue' import { Button, Grid, GridItem, Popup } from 'vant' import qs from 'query-string' import { MusicSheelDetail, ShaeetStatusType } from '../../colexiu/index.d' import BackIcon from '../../colexiu/buttons/icons/icon-back.png' import { heardLevel } from '/src/constant/formats' import Note from '/src/pages/report/note' import PlayerPopup from '/src/pages/report/player' import styles from './index.module.less' import state from '/src/pages/state' import detailState from '/src/pages/detail/state' import AgainIcon from '../again.svg' import ExplainIcon from '../icon-explain.png' import ReplayIcon from '../icon-replay.png' import CloseIcon from './close.png' import detailStyles from './index.module.less' import { postMessage } from '/src/helpers/native-message' import { useOriginSearch } from '../../colexiu/uses' import { browser } from '/src/helpers/utils' import videobg from './videobg.png' import 'plyr/dist/plyr.css' import Plyr from 'plyr' export const active = ref<'pitch' | 'rhythm' | 'completion'>('pitch') const visible = ref(false) export default defineComponent({ name: 'ColexiuReportHeader', props: { detail: { type: Object as PropType, }, record: { type: Object, }, className: { type: String, }, }, emits: ['activeChange'], setup(props, { emit, expose }) { const browserInfo = browser() const search = useOriginSearch() const { detail, record } = toRefs(props) const videoShow = ref(false) const isInitPlyr = ref(false) const back = () => { postMessage({ api: 'back', }) } const _plrl = ref() const autoShow = () => { if (localStorage.getItem('explain-view') != '1') { visible.value = true setTimeout(() => { visible.value = false localStorage.setItem('explain-view', '1') }, 5000) } } const again = () => { if (search.source == 'evaluation') { back() return } const behaviorId = sessionStorage.getItem('behaviorId') || '' + new Date().valueOf() const url = qs.stringifyUrl({ url: location.origin + '/orchestra-music-score', query: { id: detail.value?.id, behaviorId, client: browserInfo.isTeacher ? 'teacher' : 'student', }, }) postMessage({ api: 'openAccompanyWebView', content: { url, orientation: 0, isHideTitle: true, statusBarTextColor: false, isOpenLight: true, }, }) } const mediaType = computed(() => { const subfix = (record.value?.videoFilePath || '').split('.').pop() if (subfix === 'wav' || subfix === 'mp3'|| subfix === 'm4a') { return 'audio' } return 'video' }) const openAudioAndVideo = () => { videoShow.value = true if (isInitPlyr.value) return nextTick(() => { const id = mediaType.value === 'audio' ? '#audioSrc' : '#videoSrc' _plrl.value = new Plyr(id, { controls: ['play-large', 'play', 'progress'], fullscreen: { enabled: false }, }) isInitPlyr.value = true }) } expose({ autoShow, }) return () => { return (
{record?.value?.sysMusicScoreName}
{record.value && record.value?.heardLevel ? ( {(heardLevel as any)[record.value?.heardLevel]}, text: () => 难度, }} /> {record.value?.score}分, text: () => 评测分数, }} /> {detailState.isPercussion ? null : ( { active.value = 'pitch' emit('activeChange', 'pitch') }} vSlots={{ icon: () => ( {record.value?.intonation}分 ), text: () => 音准, }} /> )} { active.value = 'rhythm' emit('activeChange', 'rhythm') }} vSlots={{ icon: () => {record.value?.cadence}分, text: () => 节奏, }} /> {detailState.isPercussion ? null : ( { active.value = 'completion' emit('activeChange', 'completion') }} vSlots={{ icon: () => {record.value?.integrity}分, text: () => 完成度, }} /> )} ) : null} {record.value?.videoFilePath ? ( , text: () => 回放, }} /> ) : null} (visible.value = true)} vSlots={{ icon: () => , text: () => 释义, }} /> {browserInfo.isStudent ? ( , text: () => 再来一遍, }} /> ) : null}
{record.value ? (
{/*
演奏正确
*/} {active.value === 'pitch' && ( <>
音高了
音低了
)} {!state.isPercussion ? ( <> {active.value === 'rhythm' && ( <>
节奏快了
节奏慢了
)} {active.value === 'completion' && (
时值不足
)} ) : null} {/*
未演奏
*/}
) : null} (visible.value = false)} >
(visible.value = false)}>

图标释义

绿色音符:演奏正确, icon: () => , }} /> 红色音符:错音, icon: () => , }} /> 音符重影(红色在前):节奏过快, icon: () => , }} /> 音符重影(红色在后):节奏慢了, icon: () => , }} /> 音符重影(黄色在上):音高了, icon: () => , }} /> 音符重影(黄色在下):音低了, icon: () => , }} /> 紫色音符:完整度不足, icon: () => , }} /> 灰色音符:未演奏, icon: () => , }} />
{ _plrl.value?.pause() }} >
(videoShow.value = false)}>
{mediaType.value === 'audio' && (
) } }, })