|
@@ -581,6 +581,8 @@ const state = reactive({
|
|
|
evxmlAddPartName: false, // 妙极客的部分曲子没有part-name,需要自行添加的part-name
|
|
|
/** 乐器id */
|
|
|
instrumentId: null,
|
|
|
+ /** 是否是作业模式(包含练习和评测) */
|
|
|
+ isHomeWork: false,
|
|
|
});
|
|
|
const browserInfo = browser();
|
|
|
let offset_duration = 0;
|
|
@@ -677,7 +679,7 @@ const dynamicShowPlaySpeed = (index: number) => {
|
|
|
export const initSetPlayRate = () => {
|
|
|
const item: any = (state.sectionStatus && state.section.length === 2) ? state.sectionFirst || state.section[0] : state.times[state.activeNoteIndex];
|
|
|
if (item && item.measureSpeed) {
|
|
|
- const ratio = state.speed / item.measureSpeed
|
|
|
+ const ratio = state.speed / Math.floor(item.measureSpeed)
|
|
|
// state.audiosInstance?.setSpeed(ratio)
|
|
|
state.basePlayRate = ratio || 1;
|
|
|
console.log('播放倍率',state.basePlayRate)
|
|
@@ -773,7 +775,9 @@ const handlePlaying = () => {
|
|
|
};
|
|
|
/** 跳转到指定音符开始播放 */
|
|
|
export const skipNotePlay = async (itemIndex: number, isStart = false, handType?: string) => {
|
|
|
+ // 纯预览模式,练习、评测作业模式,禁止手动点击跳转音符
|
|
|
if (state.isPreView) return;
|
|
|
+ if (handType === 'manual' && (query.workRecord || query.evaluatingRecord)) return;
|
|
|
const item = state.times[itemIndex];
|
|
|
// 如果是选段状态,可以点击段落范围内的音符,从当前音符开始播放,如果不是段落内的音符,直接return
|
|
|
if (handType === 'manual' && state.section.length === 2 && !(item.MeasureNumberXML >= state.section[0].MeasureNumberXML && item.MeasureNumberXML <= state.section[1].MeasureNumberXML)) {
|
|
@@ -1286,7 +1290,7 @@ export const hanldeDirectSelection = (list: any[]) => {
|
|
|
state.section = formateSelectMearure(list);
|
|
|
// 选段完成后,需要根据预报小节的速度,设置右下角显示的速度
|
|
|
const currentItem: any = (state.sectionStatus && state.section.length === 2) ? state.sectionFirst || state.section[0] : state.times[state.activeNoteIndex];
|
|
|
- if (currentItem.measureSpeed && query.workRecord === undefined) {
|
|
|
+ if (currentItem.measureSpeed && query.workRecord === undefined && query.evaluatingRecord === undefined) {
|
|
|
handleSetSpeed(currentItem.measureSpeed);
|
|
|
}
|
|
|
console.log('选段小节', state.section)
|
|
@@ -1388,14 +1392,7 @@ const getMusicInfo = async (res: any) => {
|
|
|
partIndex = state.partIndex;
|
|
|
}
|
|
|
// 布置作业 取作业的乐器id
|
|
|
- const workRecord = query.workRecord
|
|
|
let workRecordInstrumentId:undefined | string
|
|
|
- if(workRecord){
|
|
|
- const res = await api_lessonTrainingTrainingStudentDetail(workRecord);
|
|
|
- if (res?.code === 200) {
|
|
|
- workRecordInstrumentId = res.data?.instrumentId
|
|
|
- }
|
|
|
- }
|
|
|
/* 获取声轨列表 */
|
|
|
let xmlString = await fetch(res.data.xmlFileUrl).then((response) => response.text());
|
|
|
xmlString = xmlAddPartName(xmlString);
|
|
@@ -1726,11 +1723,18 @@ const setState = (data: any, index: number) => {
|
|
|
// 如果是PC端,放大曲谱
|
|
|
state.platform = query.platform?.toLocaleUpperCase() || "";
|
|
|
if (state.platform === IPlatform.PC) {
|
|
|
+ // pc端,谱面默认初始大小设置为1.5
|
|
|
+ state.zoom = 1.5;
|
|
|
if (query.zoom <= 1) {
|
|
|
- state.zoom = query.zoom || state.zoom;
|
|
|
+ state.zoom = query.zoom ? Number(query.zoom) : state.zoom;
|
|
|
+ } else {
|
|
|
+ state.zoom = localStorage.getItem('scoreZoom') ? Number(localStorage.getItem('scoreZoom')) : state.zoom
|
|
|
}
|
|
|
state.enableEvaluation = false;
|
|
|
}
|
|
|
+ if (storeData.isApp) {
|
|
|
+ state.zoom = localStorage.getItem('scoreZoom') ? Number(localStorage.getItem('scoreZoom')) : state.zoom
|
|
|
+ }
|
|
|
/**
|
|
|
* 默认渲染什么谱面类型 & 能否转谱逻辑
|
|
|
* 渲染类型:首先取url参数musicRenderType,没有该参数则取musicalInstruments字段匹配的当前分轨的defaultScore,没有匹配到则取默认值('firstTone')
|
|
@@ -2162,7 +2166,7 @@ export const refreshMusicSvg = () => {
|
|
|
clearSelection();
|
|
|
resetBaseRate();
|
|
|
state.activeMeasureIndex = -1;
|
|
|
- if (query.workRecord) {
|
|
|
+ if (query.workRecord || query.evaluatingRecord) {
|
|
|
state.workSectionNeedReset = true;
|
|
|
}
|
|
|
// 销毁旋律线
|