index-fd8cbe1a.js 1.7 KB

1
  1. import{d as r,P as d,x as c,y as u,a,W as m,a2 as p,D as g}from"./index-521a9826.js";import{M as o}from"./index-c0ea6da9.js";import{u as f,a as y}from"./index-fdaad3c0.js";import{s as i,b as v}from"./banner1-8cdfa8cc.js";import{A as b}from"./index-45e9afd1.js";import{I as k}from"./index-25b5c9d0.js";import"./browser-504037ee.js";import"./index-631128d0.js";import"./index-1ad6a58d.js";const S=r({name:"instrument-detail",setup(){const l=d(),t=c({titleOpacity:0,background:"transparent",color:"#fff",detail:{},musicList:[],loading:!1}),n=async()=>{t.loading=!0;try{const{data:e}=await g.get("/edu-app/knowledgeWiki/detail/"+l.query.id);e.intros=e.intros.replace(/<video/gi,'<video style="width: 100% !important;" controlslist="nodownload" poster="https://oss.dayaedu.com/ktqy/1701759849244.png"'),t.detail=e||{},t.musicList=e.knowledgeWikiResources.map(s=>({id:s.id,name:s.name,url:s.url}))}catch(e){}t.loading=!1};return u(()=>{f(document,"scroll",()=>{const{y:e}=y();t.titleOpacity=e.value>100?1:e.value/100}),n()}),()=>a("div",{class:i.detail},[a("div",{class:i.bgSection},[a("img",{class:i.bg,src:t.detail.avatar||v},null)]),a(o,{position:"top"},{default:()=>[a(m,{border:!1,background:`rgba(255,255,255, ${t.titleOpacity})`,color:`rgba(51,51,51, ${t.titleOpacity})`,title:t.detail.name||""},null)]}),a("div",{class:i.container},[a("div",{class:i.instrumentLogo},[a(k,{class:i.logo,fit:"cover",src:t.detail.avatar},null)]),a("div",{class:i.title},[t.detail.name]),a("div",{class:i.content,innerHTML:t.detail.intros},null),!t.loading&&!t.detail.intros&&a(p,{description:"暂无内容"},null)]),a(o,{position:"bottom"},{default:()=>[t.musicList.length>0&&a(b,{musicList:t.musicList},null)]})])}});export{S as default};