Parcourir la source

Merge branch 'iteration-temp-http' into online

lex il y a 7 mois
Parent
commit
19099bca91
4 fichiers modifiés avec 237 ajouts et 174 suppressions
  1. 85 43
      src/constant/instruments.ts
  2. 9 9
      src/helpers/utils.ts
  3. 127 113
      src/pages/detail/helpers.ts
  4. 16 9
      src/pages/detail/tv-popup/index.tsx

+ 85 - 43
src/constant/instruments.ts

@@ -7,6 +7,7 @@ export default {
   "Harpsichord": "羽管键琴",
   "Clavichord": "科拉维科特琴",
   "Celesta": "钢片琴",
+  "Glockenspiel": "钢片琴",
   "Music box": "八音盒",
   "Vibraphone": "颤音琴",
   "Marimba": "马林巴",
@@ -52,21 +53,25 @@ export default {
   "French Horn": "法国号",
   "Brass Section": "铜管组",
   "Synth Brass": "合成铜管音色",
-  "Soprano Sax": "高音萨克斯",
-  "Alto Sax": "中音萨克斯",
-  "Tenor Sax": "次中音萨克斯",
-  "Baritone Sax": "低音萨克斯",
+  "Soprano Sax": "高音萨克斯",
+  "Alto Sax": "中音萨克斯",
+  "Tenor Sax": "次中音萨克斯",
+  "Baritone Sax": "低音萨克斯",
   "Oboe": "双簧管",
   "English Horn": "英国管",
   "Bassoon": "巴松",
-  "Clarinet": "单簧管",
+  "Soprano Saxophone": "高音萨克斯管",
+  "Alto Saxophone": "中音萨克斯管",
+  "Tenor Saxophone": "次中音萨克斯管",
+  "Baritone Saxophone": "低音萨克斯管",
   "Piccolo": "短笛",
   "Flute": "长笛",
   "Recorder": "竖笛",
+  "Soprano Recorder": "高音竖笛",
   "Pan Flute": "排箫",
   "Bottle Blow": "瓶木管",
   "Whistle": "口哨声",
-  "Ocarina": "奥卡雷那",
+  "Ocarina": "陶笛",
   "Lead": "合成主音",
   "Lead lead": "合成主音",
   "Pad age": "合成音色",
@@ -81,12 +86,18 @@ export default {
   "Fiddle": "民族提琴",
   "Shanai": "山奈",
   "Tinkle Bell": "叮当铃",
-  "Agogo": "阿哥哥铃",
+  "Agogos": "阿戈戈铃",
   "Steel Drums": "钢鼓",
   "Taiko Drum": "太鼓",
-  "Melodic Tom": "通通鼓",
-  "Synth Drum": "合成鼓",
-  "Reverse Cymbal": "铜钹",
+  "Melodic Toms": "嗵嗵鼓",
+  "Synth Drums": "合成鼓",
+  "Reverse Cymbals": "反向镲",
+  "Agogo Bells": "阿戈戈铃",
+  "Taiko Drums": "太鼓",
+  "Bongos": "邦戈鼓",
+  "Bongo Bell": "邦戈铃",
+  "Congas": "康加鼓",
+  "Guiro": "刮壶",
   "Guitar Fret Noise": "吉他换把杂音",
   "Breath Noise": "呼吸声",
   "Seashore": "海浪声",
@@ -97,67 +108,98 @@ export default {
   "Gunshot": "枪声",
   "Acoustic Bass Drum": "大鼓",
   "Bass Drum": "大鼓",
-  "Side Stick": "小鼓鼓边",
+  "Side Drum": "小鼓鼓边",
   "Acoustic Snare": "小鼓",
-  "Hand Clap": "拍手",
+  "Hand Claps": "拍手",
   "Electric Snare": "小鼓",
-  "Low Floor Tom": "低音鼓",
-  "Closed Hi-Hat": "闭合",
-  "High Floor Tom": "低音鼓",
-  "Pedal Hi-Hat": "脚踏",
-  "Low Tom": "中音鼓",
-  "Open Hi-Hat": "强音钹",
-  "Low-Mid Tom": "中音鼓",
+  "Low Floor Tom": "低音鼓",
+  "Closed Hi-Hat": "闭合踩镲",
+  "High Floor Tom": "高音落地嗵鼓",
+  "Pedal Hi-Hat": "脚踏踩镲",
+  "Low Tom": "低音嗵鼓",
+  "Open Hi-Hat": "开音踩镲",
+  "Low-Mid Tom": "中鼓",
   "Hi Mid Tom": "高音鼓",
-  "Crash Cymbal": "强音钹",
-  "High Tom": "高音鼓",
-  "Ride Cymbal": "打点钹",
-  "Chinese Cymbal": "钹",
+  "Crash Cymbals": "对镲",
+  "High Tom": "高音鼓",
+  "Ride Cymbals": "叮叮镲",
+  "Chinese Cymbals": "中国镲",
   "Ride Bell": "圆铃",
   "Tambourine": "铃鼓",
-  "Splash Cymbal": "小钹铜钹",
+  "Splash Cymbal": "溅音镲",
   "Cowbell": "牛铃",
+  "Crash Cymbal": "强音钹",
   "Vibra-Slap": "颤音器",
-  "Hi Bongo": "高音邦加鼓",
-  "Low Bongo": "低音邦加鼓",
+  "Ride Cymbal": "打点钹",
+  "Hi Bongo": "高音邦戈鼓",
+  "Low Bongo": "低音邦戈鼓",
   "Mute Hi Conga": "弱音高音康加鼓",
   "Open Hi Conga": "强音高音康加鼓",
   "Low Conga": "低音康加鼓",
   "High Timbale": "高音天巴鼓",
   "Low Timbale": "低音天巴鼓",
-  "High Agogo": "高音阿哥哥",
-  "Low Agogo": "低音阿哥哥",
-  "Cabasa": "串珠",
-  "Maracas": "沙",
+  "High Agogo": "高音阿戈戈铃",
+  "Low Agogo": "低音阿戈戈铃",
+  "Cabasa": "卡巴萨",
+  "Maracas": "沙",
   "Short Whistle": "短口哨",
   "Long Whistle": "长口哨",
   "Short Guiro": "短刮壶",
   "Long Guiro": "长刮壶",
-  "Claves": "梆子",
-  "Hi Wood Block": "高音木",
-  "Low Wood Block": "低音木",
+  "Claves": "响棒",
+  "Hi Wood Block": "高音木",
+  "Low Wood Block": "低音木",
   "Mute Triangle": "弱音三角铁",
   "Open Triangle": "强音三角铁",
+  "Drum Set": "架子鼓",
   "Hulusi flute": "葫芦丝",
   "Melodica": "口风琴",
   "Snare Drum": "小军鼓",
-  "Cymbal": "镲",
-  "Cymbals": "镲",
   "Horn in F": "圆号",
   "Triangle": "三角铁",
   "Vibrato": "颤音琴",
-  "Suspend Cymbal": "吊镲",
+  "Suspend Cymbals": "吊镲",
+  "Suspended Cymbals": "吊镲",
   "Tom-Toms": "嗵嗵鼓",
   "Bell": "铃铛",
   "Bells": "铃铛",
   "Alto Clarinet": "中音单簧管",
-  "Soprano Saxophone": "高音萨克斯风",
-  "Alto Saxophone": "中音萨克斯风",
-  "Tenor Saxophone": "次中音萨克斯风",
-  "Baritone Saxophone": "低音萨克斯风",
+  "Bass Clarinet": "低音单簧管",
+  "Clarinet": "单簧管",
   "Cornet": "短号",
   "Euphonium": "上低音号",
   "crash cymbals": "对镲",
-  "Suspend cymbals": "吊镲",
-  "Castanets": "响板"
-}
+  "Castanets": "响板",
+  "Shaker": "沙锤",
+  "Mark tree": "音树",
+  "Chimes": "管钟",
+  "Mark Tree": "音树",
+  "Tom-toms": "嗵嗵鼓",
+  "Hi-Hat": "踩镲",
+  "Sleigh Bells": "雪橇铃",
+  "Flexatone": "弹音器",
+  "Brake drum": "闸鼓",
+  "Gong": "锣",
+  "concert tom": "音乐会嗵嗵鼓",
+  "brake drum": "车轮鼓",
+  "finger cymbal": "指钹",
+  "ride cymbal": "叮叮镲",
+  "Concert Toms": "音乐会嗵嗵鼓",
+  "Vibraslap": "弹音器",
+  "Wood Blocks": "木鱼",
+  "Temple Blocks": "木鱼",
+  "Wood Block": "木鱼",
+  "Field Drum": "军鼓",
+  "Quad-Toms": "筒鼓",
+  "Quads": "筒鼓",
+  "Drums set": "架子鼓",
+  "High Bongo": "邦戈",
+  "Timbales": "天巴鼓",
+  "rain stick": "雨棒",
+  "String Bass": "弦乐低音",
+  "Floor Tom": "侧嗵鼓",
+  "Brake Drum": "闸鼓",
+  "Tam-tam": "大锣",
+  "Cymbal": "镲",
+  "Cymbals": "镲",
+}

+ 9 - 9
src/helpers/utils.ts

@@ -46,18 +46,18 @@ export const browser = () => {
 }
 
 export const getRequestHostname = () => {
-  let search : any = ''
+  let search: any = ''
   try {
     search = qs.parse(location.search)
-  } catch (error) {}
-  if(search?.client){
+  } catch (error) { }
+  if (search?.client) {
     return search.client === 'student' ? '/api-student' : search.client === 'teacher' ? '/api-teacher' : '/api-backend'
   }
   const browserInfo = browser();
-  if (browserInfo.isStudent){
+  if (browserInfo.isStudent) {
     return '/api-student'
   }
-  if (browserInfo.isTeacher){
+  if (browserInfo.isTeacher) {
     return '/api-teacher'
   }
   return '/api-backend'
@@ -92,7 +92,7 @@ export const toNext = (hash: string, query?: any) => {
   // location.replace(nextUrl)
 }
 
-export const noop = (): void => {}
+export const noop = (): void => { }
 
 export const getImageUrl = (name: string) => {
   return new URL(`./dir/${name}.png`, location.origin).href
@@ -100,7 +100,7 @@ export const getImageUrl = (name: string) => {
 
 export const setTongjiTag = (event: any[]) => {
   if ((window as any)._czc) {
-    ;(window as any)._czc.push(event)
+    ; (window as any)._czc.push(event)
   }
 }
 
@@ -185,7 +185,7 @@ export const getVoiceChinesName = (name: string | undefined) => {
           //   循环名称: n,
           //   匹配: name.match(n)
           // })
-          viewname = name.replace(n, appState.chinesePartName[n])
+          viewname = appState.chinesePartName[n] //name.replace(n, appState.chinesePartName[n])
           break
         }
       }
@@ -208,5 +208,5 @@ export const setGlobalData = (_key: string, _value: any) => {
   if (!_key || !_value) return;
   const GYM = (window as any).GYM || {};
   GYM[_key] = _value
-  ;(window as any).GYM = GYM
+    ; (window as any).GYM = GYM
 }

+ 127 - 113
src/pages/detail/helpers.ts

@@ -194,7 +194,7 @@ export const getAllNodes = (osmd: any) => {
   if (osmd?.cursor) {
     try {
       osmd.cursor.reset()
-    } catch (error) {}
+    } catch (error) { }
     const iterator = osmd.cursor.iterator
     let i = 0
     let si = 0
@@ -236,7 +236,7 @@ export const getAllNodes = (osmd: any) => {
       if (state.isCombineRender) {
         for (let index = 0; index < iterator.currentVoiceEntries.length; index++) {
           const element = iterator.currentVoiceEntries[index];
-          /** 
+          /**
            * 曲谱:合奏2-14,1752154261147389954,跳过倚音
            */
           if (element.isGrace) {
@@ -251,7 +251,7 @@ export const getAllNodes = (osmd: any) => {
           elRealValue = element.notes[0].length.realValue
         }
       }
-      
+
       let voiceEntries = iterator.currentVoiceEntries?.[0] ? [iterator.currentVoiceEntries?.[0]] : []
       const voiceEntries2 = iterator.currentVoiceEntries?.[1]
       if (state.isCombineRender) {
@@ -270,7 +270,7 @@ export const getAllNodes = (osmd: any) => {
               .flat()
               .sort((a: any, b: any) => a.Length.realValue - b.Length.realValue)
             note = _notes[0]
-          } catch (error) {}
+          } catch (error) { }
         }
         if (note) {
           if (si === 0) {
@@ -315,7 +315,7 @@ export const getAllNodes = (osmd: any) => {
           //   (state.isSpecialBookCategory
           //     ? getTimeByBeatUnit(beatUnit, measureSpeed, iterator.currentMeasure.activeTimeSignature.Denominator)
           //     : baseSpeed) || 1
-          // #8456 光标和节拍对应不上等bug修复, 
+          // #8456 光标和节拍对应不上等bug修复,
           let beatSpeed = (state.isSpecialBookCategory ? measureSpeed : baseSpeed) || 1;
 
           let speed = (state.isSpecialBookCategory ? measureSpeed : baseSpeed) || 1
@@ -395,10 +395,10 @@ export const getAllNodes = (osmd: any) => {
               speed = allNotes[i - 1]?.speed
             }
             beatSpeed =
-            (state.isSpecialBookCategory
-              ? getTimeByBeatUnit(beatUnit, speed, iterator.currentMeasure.activeTimeSignature.Denominator)
-              : baseSpeed) || 1
-              const isEnd = !(gradualChangeIndex < noteDiff) && !(resetXmlNoteIndex > gradualChangeIndex)
+              (state.isSpecialBookCategory
+                ? getTimeByBeatUnit(beatUnit, speed, iterator.currentMeasure.activeTimeSignature.Denominator)
+                : baseSpeed) || 1
+            const isEnd = !(gradualChangeIndex < noteDiff) && !(resetXmlNoteIndex > gradualChangeIndex)
             gradualChangeIndex++
             // console.log(gradualChangeIndex)
             if (isEnd) {
@@ -432,13 +432,13 @@ export const getAllNodes = (osmd: any) => {
           }
 
           /**
-           * 
+           *
            * bug修复说明
            * 曲目:'我和我的祖国’,
            * 从第32节点后播放异常,进和管乐迷endtime值对比,发现是noteLength计算不一致导致
            * 不一致的原因是:noteLength值计算,多了下面这段逻辑,故先注释掉
            * 20.23.10.13
-           * 
+           *
            */
 
           // 如果是休止符并且整个小节休止,休止符的时值小于小节时值,取小节的时值
@@ -504,7 +504,7 @@ export const getAllNodes = (osmd: any) => {
             const staffEntries = note.sourceMeasure.verticalMeasureList?.[0]?.staffEntries || []
             //计算第一个小节里面的音符时值是否等于整个小节的时值
             staffEntries.forEach((_a: any) => {
-              if(_a?.sourceStaffEntry?.voiceEntries?.[0]?.notes?.[0]?.length?.realValue){
+              if (_a?.sourceStaffEntry?.voiceEntries?.[0]?.notes?.[0]?.length?.realValue) {
                 _firstMeasureRealValue += _a.sourceStaffEntry.voiceEntries[0].notes[0].length.realValue
               }
             })
@@ -560,19 +560,19 @@ export const getAllNodes = (osmd: any) => {
               ornamentContainer: note.voiceEntry.ornamentContainer ? { ...note.voiceEntry.ornamentContainer } : '',
             },
             noteElement: {
-			  ...note.SourceMeasure,	
+              ...note.SourceMeasure,
               NoteToGraphicalNoteObjectId: note.NoteToGraphicalNoteObjectId,
               notehead: note.notehead
                 ? {
-                    filled: note.notehead.filled,
-                    shape: note.notehead.shape,
-                    sourceNote: note.notehead.sourceNote?.NoteToGraphicalNoteObjectId,
-                  }
+                  filled: note.notehead.filled,
+                  shape: note.notehead.shape,
+                  sourceNote: note.notehead.sourceNote?.NoteToGraphicalNoteObjectId,
+                }
                 : '',
               noteheadColor: note.noteheadColor,
               isRestFlag: note.isRestFlag,
               sourceMeasure: {
-				...note.SourceMeasure,
+                ...note.SourceMeasure,
                 measureListIndex: note?.SourceMeasure?.measureListIndex,
                 MeasureNumberXML: note?.SourceMeasure?.MeasureNumberXML,
                 allRests: note?.SourceMeasure?.allRests,
@@ -580,57 +580,57 @@ export const getAllNodes = (osmd: any) => {
                 multipleRestMeasures: note?.SourceMeasure?.multipleRestMeasures,
                 verticalMeasureList: Array.isArray(note?.SourceMeasure?.verticalMeasureList)
                   ? note.SourceMeasure.verticalMeasureList.map((v: any) => {
-                      const { x, y, width, height, start_x, end_x } = v?.stave || {}
-                      return v
-                        ? {
-                            stave: {
-                              x,
-                              y,
-                              width,
-                              height,
-                              start_x,
-                              end_x,
-                            },
-                            boundingBox:
-                              v && v.boundingBox
-                                ? {
-                                    absolutePosition: { ...v.boundingBox.absolutePosition },
-                                    size: { ...v.boundingBox.size },
-                                  }
-                                : '',
-                          }
-                        : undefined
-                    })
+                    const { x, y, width, height, start_x, end_x } = v?.stave || {}
+                    return v
+                      ? {
+                        stave: {
+                          x,
+                          y,
+                          width,
+                          height,
+                          start_x,
+                          end_x,
+                        },
+                        boundingBox:
+                          v && v.boundingBox
+                            ? {
+                              absolutePosition: { ...v.boundingBox.absolutePosition },
+                              size: { ...v.boundingBox.size },
+                            }
+                            : '',
+                      }
+                      : undefined
+                  })
                   : [],
                 activeTimeSignature: note.sourceMeasure?.activeTimeSignature,
-				ActiveTimeSignature: note.sourceMeasure?.activeTimeSignature
+                ActiveTimeSignature: note.sourceMeasure?.activeTimeSignature
               },
               tie: note.tie
                 ? {
-                    StartNote: {
-                      NoteToGraphicalNoteObjectId: note.tie.StartNote.NoteToGraphicalNoteObjectId,
-                    },
-                    notes:
-                      (Array.isArray(note.tie.notes) &&
-                        note.tie.notes?.map((_tie: any) => {
-                          return {
-                            NoteToGraphicalNoteObjectId: _tie.NoteToGraphicalNoteObjectId,
-                          }
-                        })) ||
-                      [],
-                  }
+                  StartNote: {
+                    NoteToGraphicalNoteObjectId: note.tie.StartNote.NoteToGraphicalNoteObjectId,
+                  },
+                  notes:
+                    (Array.isArray(note.tie.notes) &&
+                      note.tie.notes?.map((_tie: any) => {
+                        return {
+                          NoteToGraphicalNoteObjectId: _tie.NoteToGraphicalNoteObjectId,
+                        }
+                      })) ||
+                    [],
+                }
                 : '',
               slurs: Array.isArray(note.slurs)
                 ? note.slurs.map((slur: any) => {
-                    return {
-                      startNote: {
-                        NoteToGraphicalNoteObjectId: slur.startNote.NoteToGraphicalNoteObjectId,
-                      },
-                      endNote: {
-                        NoteToGraphicalNoteObjectId: slur.endNote.NoteToGraphicalNoteObjectId,
-                      },
-                    }
-                  })
+                  return {
+                    startNote: {
+                      NoteToGraphicalNoteObjectId: slur.startNote.NoteToGraphicalNoteObjectId,
+                    },
+                    endNote: {
+                      NoteToGraphicalNoteObjectId: slur.endNote.NoteToGraphicalNoteObjectId,
+                    },
+                  }
+                })
                 : [],
               pitch: {
                 prevFrequency: note.pitch?.prevFrequency,
@@ -650,8 +650,8 @@ export const getAllNodes = (osmd: any) => {
             stave:
               activeVerticalMeasureList[0] && activeVerticalMeasureList[0].stave
                 ? {
-                    attrs: activeVerticalMeasureList[0].stave ? { ...activeVerticalMeasureList[0].stave.attrs } : {},
-                  }
+                  attrs: activeVerticalMeasureList[0].stave ? { ...activeVerticalMeasureList[0].stave.attrs } : {},
+                }
                 : '',
             firstVerticalMeasure: { measureNumber: activeVerticalMeasureList?.[0]?.measureNumber },
             noteLength: 1,
@@ -685,7 +685,7 @@ export const getAllNodes = (osmd: any) => {
     }
     try {
       osmd.cursor.reset()
-    } catch (error) {}
+    } catch (error) { }
   }
   // 按照时间轴排序
   // console.log('看看👀', allNotes)
@@ -786,32 +786,32 @@ export const setStepIndex = (osmd: any, num: number, prev?: number) => {
 }
 
 export const getIndex = (times: any[], currentTime: Number) => {
-	// console.log(currentTime)
-	if (currentTime > state.times[state.times.length - 1].endtime) {
-		return state.times.length - 1;
-	}
-	let index = 0;
+  // console.log(currentTime)
+  if (currentTime > state.times[state.times.length - 1].endtime) {
+    return state.times.length - 1;
+  }
+  let index = 0;
   // js计算有精度问题,增加0.2毫秒误差范围
   currentTime = Number(currentTime) + 0.0002;
   // console.log('时间',currentTime)
-	for (let i = 0; i < times.length; i++) {
-		const item = times[i];
-		const prevItem = times[i - 1];
-		if (currentTime >= item.time) {
-			if (!prevItem || item.time != prevItem.time) {
-				index = item.i;
-			}
-		} else {
-			break;
-		}
-	}
-	if (state.sectionStatus && state.section.length === 2) {
-		// 限制不超过此范围
-		const startSection = state.befireSection || state.section[0];
-		index = Math.min(Math.max(index, startSection.i), state.section[1].i);
-		// console.log('endIndex', index)
-	}
-	return index;
+  for (let i = 0; i < times.length; i++) {
+    const item = times[i];
+    const prevItem = times[i - 1];
+    if (currentTime >= item.time) {
+      if (!prevItem || item.time != prevItem.time) {
+        index = item.i;
+      }
+    } else {
+      break;
+    }
+  }
+  if (state.sectionStatus && state.section.length === 2) {
+    // 限制不超过此范围
+    const startSection = state.befireSection || state.section[0];
+    index = Math.min(Math.max(index, startSection.i), state.section[1].i);
+    // console.log('endIndex', index)
+  }
+  return index;
 };
 
 export const getSlursNote = (_note: any, pos?: 'start' | 'end') => {
@@ -883,18 +883,18 @@ export const getNoteByMeasuresSlursStart = (note: any) => {
 }
 
 export const getActtiveNoteByTimes = (evt: MouseEvent) => {
-	const el = (evt.target as HTMLDivElement)?.dataset;
-	// console.log(state)
+  const el = (evt.target as HTMLDivElement)?.dataset;
+  // console.log(state)
 
-	const data: any = {};
-	for (const time of state.times) {
-		if (time.id && !data[time.id]) {
-			data[time.id] = time;
-		}
-	}
-	const activeNote = data[el.id || ""];
-	// state.timesById = data
-	return activeNote;
+  const data: any = {};
+  for (const time of state.times) {
+    if (time.id && !data[time.id]) {
+      data[time.id] = time;
+    }
+  }
+  const activeNote = data[el.id || ""];
+  // state.timesById = data
+  return activeNote;
 };
 
 const getPrevHasSourceNote = (note: any) => {
@@ -1082,21 +1082,35 @@ export const getMeasureRealBpm = (measure: SourceMeasure) => {
 }
 
 export const getEnvHostname = () => {
-  if (location.origin.indexOf('online') > -1) {
-    return 'https://mstuonline.dayaedu.com'
-  } else if (location.origin.indexOf('dev') > -1) {
-    return 'http://mstudev.dayaedu.com'
+  // if (location.origin.indexOf('online') > -1) {
+  //   return 'https://mstuonline.dayaedu.com'
+  // } else if (location.origin.indexOf('dev') > -1) {
+  //   return 'http://mstudev.dayaedu.com'
+  // }
+  // return 'https://mstutest.dayaedu.com'
+
+  if (location.hostname === 'gym.lexiaoya.cn') {
+    return 'https://gym.lexiaoya.cn/mdaya'
+  } else if (location.hostname === 'dev.gym.lexiaoya.cn') {
+    return 'http://dev.gym.lexiaoya.cn/mdaya'
   }
-  return 'https://mstutest.dayaedu.com'
+  return 'https://test.gym.lexiaoya.cn/mdaya'
 }
 
 export const getTvIconUrl = () => {
-  if (location.origin.indexOf('online') > -1) {
-    return 'https://mteaonline.dayaedu.com/#/guide'
-  } else if (location.origin.indexOf('dev') > -1) {
-    return 'http://mteadev.dayaedu.com/#/guide'
+  // if (location.origin.indexOf('online') > -1) {
+  //   return 'https://mteaonline.dayaedu.com/#/guide'
+  // } else if (location.origin.indexOf('dev') > -1) {
+  //   return 'http://mteadev.dayaedu.com/#/guide'
+  // }
+  // return 'https://mteatest.dayaedu.com/#/guide'
+
+  if (location.hostname === 'gym.lexiaoya.cn') {
+    return 'https://gym.lexiaoya.cn/mteacher/#/guide'
+  } else if (location.hostname === 'dev.gym.lexiaoya.cn') {
+    return 'http://dev.gym.lexiaoya.cn/mteacher/#/guide'
   }
-  return 'https://mteatest.dayaedu.com/#/guide'
+  return 'https://test.gym.lexiaoya.cn/mteacher/#/guide'
 }
 
 export const setPrefix = (url: string): string => {
@@ -1319,10 +1333,10 @@ export const onlyVisible = (xml: string, partIndex: number): string => {
   const rehearsals = [...parts[0]?.getElementsByTagName('rehearsal')]
 
   /** 第一分谱如果是约定的配置分谱则跳过 */
-	if (partListNames[0]?.toLocaleUpperCase?.() === "COMMON") {
-		partIndex++;
-		partListNames.shift();
-	}
+  if (partListNames[0]?.toLocaleUpperCase?.() === "COMMON") {
+    partIndex++;
+    partListNames.shift();
+  }
   const visiblePartInfo = partList[partIndex]
   state.partListNames = partListNames
   if (visiblePartInfo) {
@@ -1636,4 +1650,4 @@ export const setSettionBackground = () => {
     item.height = Math.max(...heights)
     return item
   })
-}
+}

+ 16 - 9
src/pages/detail/tv-popup/index.tsx

@@ -33,7 +33,7 @@ export default defineComponent({
       this.tvShowed = false
     },
     loaded() {
-      (iframeRef.value?.contentWindow as any).IFrameShowImage = (item: any) => {
+      ;(iframeRef.value?.contentWindow as any).IFrameShowImage = (item: any) => {
         ImagePreview([item.src])
       }
     },
@@ -41,7 +41,7 @@ export default defineComponent({
   render() {
     return (
       <>
-        {getTvIconUrl() ? <img id="tips-step-0" class={styles.icon} src={TVIcon} onClick={this.open}/> : null}
+        {getTvIconUrl() ? <img id="tips-step-0" class={styles.icon} src={TVIcon} onClick={this.open} /> : null}
         <Popup
           show={this.tvShow}
           round
@@ -50,7 +50,7 @@ export default defineComponent({
           position="right"
           closeIcon="arrow-left"
           lazyRender={false}
-          class={{[styles.android]: browserInfo.android, [styles.tvPopup]: true}}
+          class={{ [styles.android]: browserInfo.android, [styles.tvPopup]: true }}
           style={{ height: '100%', width: '50%' }}
           closeOnPopstate={true}
           onClickCloseIcon={this.close}
@@ -59,14 +59,21 @@ export default defineComponent({
         >
           {this.opened ? (
             <Tabs line-height={2} title-active-color="#01C1B5" color="#01C1B5">
-              <Tab title="投屏" style={{ height: '100%'}}>
-                <iframe src={getTvIconUrl()}/>
+              <Tab title="投屏" style={{ height: '100%' }}>
+                <iframe src={getTvIconUrl()} />
               </Tab>
-              <Tab title="帮助" style={{ height: '100%'}}>
+              <Tab title="帮助" style={{ height: '100%' }}>
                 <div class={styles.wraper}>
-                  <iframe onLoad={this.loaded} ref={iframeRef} class={styles.iframe} src={getEnvHostname() + '/#/KeepRepaire?mode=accompany'}/>
+                  <iframe
+                    onLoad={this.loaded}
+                    ref={iframeRef}
+                    class={styles.iframe}
+                    src={getEnvHostname() + '/#/KeepRepaire?mode=accompany'}
+                  />
                   <SettingFbcPopup>
-                    <Button class={styles.btn} plain size="small" color="#01C1B5">意见反馈 &gt;</Button>
+                    <Button class={styles.btn} plain size="small" color="#01C1B5">
+                      意见反馈 &gt;
+                    </Button>
                   </SettingFbcPopup>
                 </div>
               </Tab>
@@ -75,5 +82,5 @@ export default defineComponent({
         </Popup>
       </>
     )
-  }
+  },
 })