detail-ecf7e5b3-1702462225326.js 6.3 KB

1
  1. import{i as h}from"./icon_back-c5ec0a72-1702462225326.js";import{i as S,P as T,a as C,b as P,c as k,d as I}from"./index-efb8d105-1702462225326.js";import{i as m}from"./icon_default-d1bcaf5f-1702462225326.js";import{i as A,a as N,b as F}from"./icon-plus-t-35f4cdeb-1702462225326.js";import{d as L,a as z,u as B,e as d,O as D,n as x,f as e,w as b,ci as W,cj as v,k as c,t as R,j as E,A as U}from"./index-a8de5ca2-1702462225326.js";import{T as u}from"./index-0ded24f3-1702462225326.js";import{T as $}from"./index-62b5d88d-1702462225326.js";import{c as j}from"./api-73f0d51e-1702462225326.js";import{N as q}from"./Slider-5ac9365c-1702462225326.js";const G="_container_p1fve_1",M="_iconBack_p1fve_6",V="_separator_p1fve_36",H="_wrap_p1fve_41",O="_wrapBottom_p1fve_47",J="_content_p1fve_50",K="_tools_p1fve_57",Q="_contentWrap_p1fve_71",X="_musicList_p1fve_79",Y="_instrumentGroup_p1fve_93",Z="_instrumentImg_p1fve_101",tt="_instrumentName_p1fve_107",et="_instrumentTag_p1fve_115",st="_wrapList_p1fve_120",it="_titlec_p1fve_130",nt="_icon2_p1fve_140",at="_empty_p1fve_147",ot="_itemContainer_p1fve_153",ct="_item_p1fve_153",lt="_active_p1fve_175",rt="_arrow_p1fve_178",ut="_img_p1fve_181",pt="_title_p1fve_130",mt="_titleName_p1fve_210",_t="_titleDes_p1fve_217",ft="_btn_p1fve_227",dt="_showPlayLoading_p1fve_251",vt="_loadingWrap_p1fve_254",gt="_musicStaff_p1fve_259",yt="_musicTitle_p1fve_275",wt="_icon1_p1fve_284",ht="_musicContent_p1fve_292",St="_staffImgs_p1fve_305",Tt="_changeSizeSection_p1fve_322",Ct="_iconT_p1fve_335",Pt="_iconAddT_p1fve_339",kt="_iconPlusT_p1fve_340",It="_musicTop_p1fve_356",At="_musicInfo_p1fve_357",Nt="_musicImg_p1fve_367",Ft="_panSection_p1fve_383",Lt="_img2_p1fve_394",zt="_iconPan_p1fve_401",Bt="_info_p1fve_432",Dt="_name_p1fve_435",xt="_c_p1fve_1",s={container:G,iconBack:M,separator:V,wrap:H,wrapBottom:O,content:J,tools:K,contentWrap:Q,musicList:X,instrumentGroup:Y,instrumentImg:Z,instrumentName:tt,instrumentTag:et,wrapList:st,titlec:it,icon2:nt,empty:at,itemContainer:ot,item:ct,active:lt,arrow:rt,img:ut,title:pt,titleName:mt,titleDes:_t,btn:ft,showPlayLoading:dt,loadingWrap:vt,musicStaff:gt,musicTitle:yt,icon1:wt,musicContent:ht,staffImgs:St,changeSizeSection:Tt,iconT:Ct,iconAddT:Pt,iconPlusT:kt,musicTop:It,musicInfo:At,musicImg:Nt,panSection:Ft,img2:Lt,iconPan:zt,info:Bt,name:Dt,c:xt},bt=""+new URL("icon-pan-3fb957df.png",import.meta.url).href,Vt=L({name:"instrument-detail",setup(){const p=z(),_=B();d({page:1,rows:20,status:!0,name:"",type:p.query.type});const t=d({loading:!1,finshed:!1,reshing:!1,details:{},list:[],listActive:0,playState:"pause",showPlayer:!1,showPreivew:!1,previewUrl:"",showCloseBtn:!0,fontSize:18}),g=D(()=>t.list[t.listActive]||{}),r=i=>{const a=t.list.findIndex(n=>n.id===i.id);a>-1&&(t.listActive===a?t.playState=t.playState==="play"?"pause":"play":t.playState="play",t.showPlayer=!0,t.listActive=a)},y=i=>{i==="play"?t.playState="play":i==="pause"?t.playState="pause":i==="pre"?t.list[t.listActive-1]&&r(t.list[t.listActive-1]):i==="next"&&t.list[t.listActive+1]&&r(t.list[t.listActive+1])},w=async()=>{t.loading=!0;let i={};try{i=await j({id:p.query.id})}catch(n){console.log(n)}t.reshing&&(t.list=[],t.reshing=!1),t.finshed=!0,t.list=i.data.knowledgeWikiResources||[],t.list.forEach(n=>{n.audioFileUrl=n.url,n.musicSheetName=n.name});const a=i.data.knowledgeWikiCategories||[];i.data.knowledgeName=a.length>0?a[0].name:"",i.data.intros=i.data.intros.replace(/<video/gi,'<video style="width: 100% !important;" controlslist="nodownload"'),t.details=i.data,t.loading=!1};return x(()=>{w()}),()=>{var i,a,n;return e("div",{class:s.container},[e(b,{align:"center",wrapItem:!1,size:16},{default:()=>[e("img",{style:{cursor:"pointer"},src:h,class:s.iconBack,onClick:()=>{_.push("/content-music")}},null),e(W,{separator:""},{default:()=>[e(v,{onClick:()=>{_.push("/content-music")}},{default:()=>[c("名曲鉴赏")]}),e("img",{class:s.separator,src:S},null),e(v,null,{default:()=>[p.query.name]})]})]}),e("div",{class:[s.wrap,t.showPlayer?s.wrapBottom:""]},[e("div",{class:s.content},[e("div",{class:s.contentWrap},[e("div",{class:[s.musicList,"musicList-container"]},[e("div",{class:s.wrapList},[e("div",{class:s.musicInfo},[e("div",{class:s.musicImg},[e("img",{src:((i=t.details)==null?void 0:i.avatar)||m,class:s.img},null),e("div",{class:s.panSection},[e("img",{src:bt,class:s.iconPan},null),e("img",{src:((a=t.details)==null?void 0:a.avatar)||m,class:s.img2},null)])]),e("div",{class:s.info},[e("div",{class:s.name},[e(u,{text:t.details.name,style:{marginRight:"0"}},null)]),e("div",{class:s.c},[t.details.composers?e("div",null,[e("span",null,[c("作曲:")]),e(u,{text:t.details.composers,style:{marginRight:"0"}},null)]):"",t.details.lyricists?e("div",null,[e("span",null,[c("作词:")]),e(u,{text:t.details.lyricists,style:{marginRight:"0"}},null)]):""])])]),e("div",{class:s.titlec},[e("i",{class:s.icon2},null),c("名曲鉴赏")]),t.list.map((o,f)=>e("div",{class:s.itemContainer},[e("div",{class:[s.item],onClick:l=>{l.stopPropagation(),r(o)}},[e("div",{class:s.img},[e(R,{lazy:!0,objectFit:"cover",previewDisabled:!0,src:o.titleImg||m,onLoad:l=>{l.target.dataset.loaded="true"}},null),e(T,{class:[t.listActive===f&&t.playState==="play"?"":s.showPlayLoading]},null)]),e("div",{class:s.title},[e("div",{class:s.titleName},[e(u,{text:o.name,style:{marginRight:"12px"}},null)])]),e(E,{color:"#259CFE",textColor:"#fff",round:!0,class:s.btn,type:"primary",onClick:l=>{l.stopPropagation(),r(o)}},{default:()=>[c("播放"),e("img",{src:t.listActive===f&&t.playState==="play"?C:P},null)]}),e("img",{class:s.arrow,src:k},null)])])),!t.finshed&&e("div",{class:s.loadingWrap},[e(U,{show:!0},null)]),!t.loading&&t.list.length===0&&e("div",{class:s.empty},[e($,{description:"暂无名曲鉴赏",style:{paddingTop:"0px"}},null)])])]),e("div",{class:s.musicStaff},[e("div",{class:s.musicTitle},[e("i",{class:s.icon1},null),c("名曲故事")]),e("div",{class:s.musicContent,innerHTML:(n=t.details)==null?void 0:n.intros,style:{fontSize:t.fontSize+"px"}},null)]),e("div",{class:s.changeSizeSection},[e("img",{src:A,class:s.iconT},null),e("img",{src:N,class:s.iconAddT,onClick:()=>{t.fontSize>=32||(t.fontSize+=1)}},null),e(q,{value:t.fontSize,"onUpdate:value":o=>t.fontSize=o,vertical:!0,min:12,max:32},null),e("img",{src:F,class:s.iconPlusT,onClick:()=>{t.fontSize<=12||(t.fontSize-=1)}},null)])])])]),t.list.length!==0&&e(I,{show:t.showPlayer,playState:t.playState,item:g.value,onChange:o=>y(o)},null)])}}});export{Vt as default};