|
@@ -218,7 +218,7 @@ export default defineComponent({
|
|
}
|
|
}
|
|
|
|
|
|
const handleGetList = async () => {
|
|
const handleGetList = async () => {
|
|
- // state.listActive = 0;
|
|
|
|
|
|
+ state.listActive = 0
|
|
// data.showPlayer = false;
|
|
// data.showPlayer = false;
|
|
// data.playState = 'pause';
|
|
// data.playState = 'pause';
|
|
document.querySelector(".musicList-container")?.scroll(0, 0)
|
|
document.querySelector(".musicList-container")?.scroll(0, 0)
|
|
@@ -230,7 +230,7 @@ export default defineComponent({
|
|
|
|
|
|
const musicIframeLoad = async () => {
|
|
const musicIframeLoad = async () => {
|
|
const iframeRef: any = document.getElementById("staffIframeRef")
|
|
const iframeRef: any = document.getElementById("staffIframeRef")
|
|
- if (iframeRef && iframeRef.contentWindow.renderXml) {
|
|
|
|
|
|
+ if (iframeRef && iframeRef.contentWindow?.renderXml) {
|
|
const res = await requestOrigin.get(activeItem.value.xmlUrl, { mode: "cors" })
|
|
const res = await requestOrigin.get(activeItem.value.xmlUrl, { mode: "cors" })
|
|
const parseXmlInfo = getCustomInfo(res)
|
|
const parseXmlInfo = getCustomInfo(res)
|
|
const xml = formatXML(parseXmlInfo.parsedXML)
|
|
const xml = formatXML(parseXmlInfo.parsedXML)
|
|
@@ -240,7 +240,7 @@ export default defineComponent({
|
|
}
|
|
}
|
|
const resetRender = async () => {
|
|
const resetRender = async () => {
|
|
const iframeRef: any = document.getElementById("staffIframeRef")
|
|
const iframeRef: any = document.getElementById("staffIframeRef")
|
|
- if (iframeRef && iframeRef.contentWindow.renderXml) {
|
|
|
|
|
|
+ if (iframeRef && iframeRef.contentWindow?.renderXml) {
|
|
const res = await requestOrigin.get(activeItem.value.xmlUrl, { mode: "cors" })
|
|
const res = await requestOrigin.get(activeItem.value.xmlUrl, { mode: "cors" })
|
|
const parseXmlInfo = getCustomInfo(res)
|
|
const parseXmlInfo = getCustomInfo(res)
|
|
const xml = formatXML(parseXmlInfo.parsedXML)
|
|
const xml = formatXML(parseXmlInfo.parsedXML)
|
|
@@ -251,7 +251,8 @@ export default defineComponent({
|
|
|
|
|
|
const renderStaff = async () => {
|
|
const renderStaff = async () => {
|
|
try {
|
|
try {
|
|
- state.iframeSrc = `${URL_TEACH_GYM}/osmd/index.html`
|
|
|
|
|
|
+ // ${location.origin}${location.pathname}
|
|
|
|
+ state.iframeSrc = `/osmd/index.html`
|
|
} catch (error) {
|
|
} catch (error) {
|
|
//
|
|
//
|
|
}
|
|
}
|
|
@@ -366,7 +367,13 @@ export default defineComponent({
|
|
|
|
|
|
<div class={styles.wrapList}>
|
|
<div class={styles.wrapList}>
|
|
{state.list.map((item: any, index: number) => (
|
|
{state.list.map((item: any, index: number) => (
|
|
- <div class={[styles.item, index === state.listActive && styles.active]}>
|
|
|
|
|
|
+ <div
|
|
|
|
+ class={[styles.item, index === state.listActive && styles.active]}
|
|
|
|
+ onClick={() => {
|
|
|
|
+ state.listActive = index
|
|
|
|
+ resetRender()
|
|
|
|
+ }}
|
|
|
|
+ >
|
|
<div class={styles.itemInfo}>
|
|
<div class={styles.itemInfo}>
|
|
<div class={styles.img}>
|
|
<div class={styles.img}>
|
|
<NImage
|
|
<NImage
|
|
@@ -413,22 +420,22 @@ export default defineComponent({
|
|
<div class={styles.rightContainer}>
|
|
<div class={styles.rightContainer}>
|
|
<div class={styles.musicName}>{activeItem.value.name}</div>
|
|
<div class={styles.musicName}>{activeItem.value.name}</div>
|
|
<div class={styles.staffImgs}>
|
|
<div class={styles.staffImgs}>
|
|
- {musicImg.value.length > 0
|
|
|
|
- ? musicImg.value.map((item: string) => {
|
|
|
|
- return <img src={item} key={item} />
|
|
|
|
- })
|
|
|
|
- : state.iframeSrc && (
|
|
|
|
- <iframe
|
|
|
|
- id="staffIframeRef"
|
|
|
|
- style={{
|
|
|
|
- opacity: loading.value ? 0 : 1,
|
|
|
|
- width: "100%",
|
|
|
|
- height: "100%"
|
|
|
|
- }}
|
|
|
|
- src={state.iframeSrc}
|
|
|
|
- onLoad={musicIframeLoad}
|
|
|
|
- ></iframe>
|
|
|
|
- )}
|
|
|
|
|
|
+ {state.iframeSrc || musicImg.value.length > 0 ? (
|
|
|
|
+ <iframe
|
|
|
|
+ id="staffIframeRef"
|
|
|
|
+ style={{
|
|
|
|
+ // opacity: loading.value ? 0 : 1,
|
|
|
|
+ width: "100%",
|
|
|
|
+ height: "100%"
|
|
|
|
+ }}
|
|
|
|
+ src={state.iframeSrc}
|
|
|
|
+ onLoad={musicIframeLoad}
|
|
|
|
+ ></iframe>
|
|
|
|
+ ) : (
|
|
|
|
+ musicImg.value.map((item: string) => {
|
|
|
|
+ return <img src={item} key={item} />
|
|
|
|
+ })
|
|
|
|
+ )}
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<img
|
|
<img
|