view-f033d3ae.js 2.3 KB

1
  1. import{d as m,P as p,x as g,y as v,z as f,a,W as y,A as d,a2 as w}from"./index-521a9826.js";import{M as c}from"./index-c0ea6da9.js";import{u as b,a as k}from"./index-fdaad3c0.js";import{s}from"./index.module-d955ef3a.js";import{m as l,A as L}from"./index-45e9afd1.js";import{N as M}from"./index-6dc4c05e.js";import{I as F}from"./index-25b5c9d0.js";import"./browser-504037ee.js";import"./index-631128d0.js";import"./index-1ad6a58d.js";const H=m({name:"instrument-detail",setup(){p();const t=g({titleOpacity:0,background:"transparent",detail:{},musicList:[],loading:!1}),u=e=>{var o,n;if(e.data.api==="parent-notes"){const r=e.data.message?JSON.parse(e.data.message):{};t.detail=r||{},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=r.knowledgeWikiResources)==null?void 0:n.map(i=>({id:i.id,name:i.name,url:i.url}))}};return v(()=>{b(document,"scroll",()=>{const{y:e}=k();t.titleOpacity=e.value>100?1:e.value/100}),f(()=>{window.parent&&window.parent.postMessage({api:"onLoad",status:!0},"*")}),window.addEventListener("message",u)}),()=>a("div",{class:s.detail},[a("div",{class:s.bgSection},[a("img",{class:s.bg,src:t.detail.avatar||l},null)]),a(c,{position:"top"},{default:()=>[a(y,{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:s.container},[a("div",{class:s.musicHeader},[a("div",{class:s.imgSection},[a(F,{class:s.img,src:t.detail.avatar||l,fit:"cover"},null),a("div",{class:s.pan},[a("img",{src:t.detail.avatar||l},null)])]),a("div",{class:s.musicContent},[a("div",{class:[s.musicTitle,"van-multi-ellipsis--l2"]},[a(M,{scrollable:t.detail.name>=13,background:"transparent",text:t.detail.name||"--"},null)]),a("div",{class:s.musicInto},[t.detail.lyricists&&a("span",null,[d("作词:"),t.detail.lyricists]),t.detail.composers&&a("span",null,[d("作曲:"),t.detail.composers])])])]),t.detail.intros?a("div",{class:s.content,innerHTML:t.detail.intros},null):"",!t.loading&&!t.detail.intros&&a("div",{class:s.content},[a(w,{description:"暂无内容"},null)])]),a(c,{position:"bottom"},{default:()=>[t.musicList.length>0&&a(L,{musicList:t.musicList},null)]})])}});export{H as default};