1 |
- import{d as c,P as u,x as m,y as p,z as g,a,V as f,a2 as v}from"./index-869d77fb.js";import{M as r}from"./index-3eb77ad0.js";import{u as y,a as w}from"./index-155c29c2.js";import{s as e,b}from"./banner1-8cdfa8cc.js";import{A as L}from"./index-f6954181.js";import{I as k}from"./index-e76f2a88.js";import"./browser-504037ee.js";import"./index-43d9e077.js";import"./index-1c6c2ec0.js";const I=c({name:"instrument-detail",setup(){u();const t=m({titleOpacity:0,background:"transparent",color:"#fff",detail:{},musicList:[],loading:!1}),d=s=>{var o,n;if(s.data.api==="parent-notes"){const l=s.data.message?JSON.parse(s.data.message):{};t.detail=l||{},t.detail.intros=(o=t.detail.intros)==null?void 0:o.replace(/<video/gi,'<video style="width: 100% !important;" controlslist="nodownload" poster="https://oss.dayaedu.com/ktqy/1701759849244.png"'),t.musicList=(n=l.knowledgeWikiResources)==null?void 0:n.map(i=>({id:i.id,name:i.name,url:i.url}))}};return p(()=>{y(document,"scroll",()=>{const{y:s}=w();t.titleOpacity=s.value>100?1:s.value/100}),g(()=>{window.parent&&window.parent.postMessage({api:"onLoad",status:!0},"*")}),window.addEventListener("message",d)}),()=>a("div",{class:e.detail},[a("div",{class:e.bgSection},[a("img",{class:e.bg,src:t.detail.avatar||b},null)]),a(r,{position:"top"},{default:()=>[a(f,{isBack:!1,border:!1,background:`rgba(255,255,255, ${t.titleOpacity})`,color:`rgba(51,51,51, ${t.titleOpacity})`,title:t.detail.name||""},null)]}),a("div",{class:e.container},[a("div",{class:e.instrumentLogo},[a(k,{class:e.logo,fit:"cover",src:t.detail.avatar},null)]),a("div",{class:e.title},[t.detail.name]),a("div",{class:e.content,innerHTML:t.detail.intros},null),!t.loading&&!t.detail.intros&&a(v,{description:"暂无内容"},null)]),a(r,{position:"bottom"},{default:()=>[t.musicList.length>0&&a(L,{musicList:t.musicList},null)]})])}});export{I as default};
|