index-ac99e9ca.js 2.2 KB

1
  1. import{d,P as u,x as m,y as p,a,V as g,A as o,a2 as v,D as y}from"./index-869d77fb.js";import{M as n}from"./index-3eb77ad0.js";import{u as f,a as b}from"./index-155c29c2.js";import{s as i}from"./index.module-d955ef3a.js";import{m as l,A as k}from"./index-f6954181.js";import{I as F}from"./index-e76f2a88.js";import{N as L}from"./index-09c5ac7f.js";import"./browser-504037ee.js";import"./index-43d9e077.js";import"./index-1c6c2ec0.js";const q=d({name:"instrument-detail",setup(){const r=u(),t=m({titleOpacity:0,background:"transparent",detail:{},musicList:[],loading:!1}),c=async()=>{t.loading=!0;try{const{data:s}=await y.get("/edu-app/knowledgeWiki/detail/"+r.query.id);s.intros=s.intros.replace(/<video/gi,'<video style="width: 100% !important;" controlslist="nodownload" poster="https://oss.dayaedu.com/ktqy/1701759849244.png"'),t.detail=s||{},t.musicList=s.knowledgeWikiResources.map(e=>({id:e.id,name:e.name,url:e.url}))}catch(s){}t.loading=!1};return p(()=>{f(document,"scroll",()=>{const{y:s}=b();t.titleOpacity=s.value>100?1:s.value/100}),c()}),()=>a("div",{class:i.detail},[a("div",{class:i.bgSection},[a("img",{class:i.bg,src:t.detail.avatar||l},null)]),a(n,{position:"top"},{default:()=>[a(g,{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.musicHeader},[a("div",{class:i.imgSection},[a(F,{class:i.img,src:t.detail.avatar||l,fit:"cover"},null),a("div",{class:i.pan},[a("img",{src:t.detail.avatar||l},null)])]),a("div",{class:i.musicContent},[a("div",{class:[i.musicTitle,"van-multi-ellipsis--l2"]},[a(L,{scrollable:t.detail.name>=13,background:"transparent",text:t.detail.name||"--"},null)]),a("div",{class:i.musicInto},[t.detail.lyricists&&a("span",null,[o("作词:"),t.detail.lyricists]),t.detail.composers&&a("span",null,[o("作曲:"),t.detail.composers])])])]),t.detail.intros?a("div",{class:i.content,innerHTML:t.detail.intros},null):"",!t.loading&&!t.detail.intros&&a("div",{class:i.content},[a(v,{description:"暂无内容"},null)])]),a(n,{position:"bottom"},{default:()=>[t.musicList.length>0&&a(k,{musicList:t.musicList},null)]})])}});export{q as default};