1 |
- import{i as w}from"./icon_back-c5ec0a72-1720699367816.js";import{T as u,P as h,i as S,a as T,b as C,c as P}from"./index-96385afb-1720699367816.js";import{i as m}from"./icon_default-d1bcaf5f-1720699367816.js";import{i as I}from"./icon_separator-e0f6c575-1720699367816.js";import{i as N,a as A,b as F}from"./icon-plus-t-35f4cdeb-1720699367816.js";import{i as L}from"./icon-pan-16e35a82-1720699367816.js";import{d as z,a as B,u as x,e as d,U as D,q as W,f as a,x as b,aQ as R,aR as f,k as l,w as E,j as q,E as U}from"./index-b48b51d2-1720699367816.js";import{T as $}from"./index-a2dc20f3-1720699367816.js";import{e as G}from"./api-b5ee56f7-1720699367816.js";import{N as j}from"./Slider-e8b4d094-1720699367816.js";const M="_container_1gkpa_1",V="_iconBack_1gkpa_6",H="_separator_1gkpa_36",Q="_wrap_1gkpa_41",J="_wrapBottom_1gkpa_47",K="_content_1gkpa_50",O="_tools_1gkpa_57",X="_contentWrap_1gkpa_71",Y="_musicList_1gkpa_79",Z="_instrumentGroup_1gkpa_93",tt="_instrumentImg_1gkpa_101",at="_instrumentName_1gkpa_107",st="_instrumentTag_1gkpa_115",it="_wrapList_1gkpa_120",nt="_titlec_1gkpa_130",et="_icon2_1gkpa_140",ot="_empty_1gkpa_147",lt="_itemContainer_1gkpa_153",ct="_item_1gkpa_153",rt="_active_1gkpa_175",ut="_arrow_1gkpa_178",pt="_img_1gkpa_181",mt="_title_1gkpa_130",_t="_titleName_1gkpa_210",gt="_titleDes_1gkpa_217",dt="_btn_1gkpa_227",ft="_showPlayLoading_1gkpa_251",kt="_loadingWrap_1gkpa_254",vt="_musicStaff_1gkpa_259",yt="_musicTitle_1gkpa_275",wt="_icon1_1gkpa_284",ht="_musicContent_1gkpa_292",St="_staffImgs_1gkpa_305",Tt="_changeSizeSection_1gkpa_322",Ct="_iconT_1gkpa_335",Pt="_iconAddT_1gkpa_339",It="_iconPlusT_1gkpa_340",Nt="_musicTop_1gkpa_357",At="_musicInfo_1gkpa_358",Ft="_musicImg_1gkpa_368",Lt="_panSection_1gkpa_384",zt="_img2_1gkpa_395",Bt="_iconPan_1gkpa_402",xt="_info_1gkpa_433",Dt="_name_1gkpa_436",Wt="_c_1gkpa_1",s={container:M,iconBack:V,separator:H,wrap:Q,wrapBottom:J,content:K,tools:O,contentWrap:X,musicList:Y,instrumentGroup:Z,instrumentImg:tt,instrumentName:at,instrumentTag:st,wrapList:it,titlec:nt,icon2:et,empty:ot,itemContainer:lt,item:ct,active:rt,arrow:ut,img:pt,title:mt,titleName:_t,titleDes:gt,btn:dt,showPlayLoading:ft,loadingWrap:kt,musicStaff:vt,musicTitle:yt,icon1:wt,musicContent:ht,staffImgs:St,changeSizeSection:Tt,iconT:Ct,iconAddT:Pt,iconPlusT:It,musicTop:Nt,musicInfo:At,musicImg:Ft,panSection:Lt,img2:zt,iconPan:Bt,info:xt,name:Dt,c:Wt},Ht=z({name:"instrument-detail",setup(){const p=B(),_=x();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}),k=D(()=>t.list[t.listActive]||{}),r=i=>{const e=t.list.findIndex(n=>n.id===i.id);e>-1&&(t.listActive===e?t.playState=t.playState==="play"?"pause":"play":t.playState="play",t.showPlayer=!0,t.listActive=e)},v=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])},y=async()=>{t.loading=!0;let i={};try{i=await G({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 e=i.data.knowledgeWikiCategories||[];i.data.knowledgeName=e.length>0?e[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 W(()=>{y()}),()=>{var i,e,n;return a("div",{class:s.container},[a(b,{align:"center",wrapItem:!1,size:16},{default:()=>[a("img",{style:{cursor:"pointer"},src:w,class:s.iconBack,onClick:()=>{_.push("/content-music")}},null),a(R,{separator:""},{default:()=>[a(f,{onClick:()=>{_.push("/content-music")}},{default:()=>[l("名曲鉴赏")]}),a("img",{class:s.separator,src:I},null),a(f,null,{default:()=>[p.query.name]})]})]}),a("div",{class:[s.wrap,t.showPlayer?s.wrapBottom:""]},[a("div",{class:s.content},[a("div",{class:s.contentWrap},[a("div",{class:[s.musicList,"musicList-container"]},[a("div",{class:s.wrapList},[a("div",{class:s.musicInfo},[a("div",{class:s.musicImg},[a("img",{src:((i=t.details)==null?void 0:i.avatar)||m,class:s.img},null),a("div",{class:s.panSection},[a("img",{src:L,class:s.iconPan},null),a("img",{src:((e=t.details)==null?void 0:e.avatar)||m,class:s.img2},null)])]),a("div",{class:s.info},[a("div",{class:s.name},[a(u,{text:t.details.name,style:{marginRight:"0"}},null)]),a("div",{class:s.c},[t.details.composers?a("div",null,[a("span",null,[l("作曲:")]),a(u,{text:t.details.composers,style:{marginRight:"0"}},null)]):"",t.details.lyricists?a("div",null,[a("span",null,[l("作词:")]),a(u,{text:t.details.lyricists,style:{marginRight:"0"}},null)]):""])])]),a("div",{class:s.titlec},[a("i",{class:s.icon2},null),l("名曲鉴赏")]),t.list.map((o,g)=>a("div",{class:s.itemContainer},[a("div",{class:[s.item],onClick:c=>{c.stopPropagation(),r(o)}},[a("div",{class:s.img},[a(E,{lazy:!0,objectFit:"cover",previewDisabled:!0,src:o.titleImg||m,onLoad:c=>{c.target.dataset.loaded="true"}},null),a(h,{class:[t.listActive===g&&t.playState==="play"?"":s.showPlayLoading]},null)]),a("div",{class:s.title},[a("div",{class:s.titleName},[a(u,{text:o.name,style:{marginRight:"12px"}},null)])]),a(q,{color:"#259CFE",textColor:"#fff",round:!0,class:s.btn,type:"primary",onClick:c=>{c.stopPropagation(),r(o)}},{default:()=>[l("播放"),a("img",{src:t.listActive===g&&t.playState==="play"?S:T},null)]}),a("img",{class:s.arrow,src:C},null)])])),!t.finshed&&a("div",{class:s.loadingWrap},[a(U,{show:!0},null)]),!t.loading&&t.list.length===0&&a("div",{class:s.empty},[a($,{description:"暂无名曲鉴赏",style:{paddingTop:"0px"}},null)])])]),a("div",{class:s.musicStaff},[a("div",{class:s.musicTitle},[a("i",{class:s.icon1},null),l("名曲故事")]),a("div",{class:s.musicContent,innerHTML:(n=t.details)==null?void 0:n.intros,style:{fontSize:t.fontSize+"px"}},null)]),a("div",{class:s.changeSizeSection},[a("img",{src:N,class:s.iconT},null),a("img",{src:A,class:s.iconAddT,onClick:()=>{t.fontSize>=32||(t.fontSize+=1)}},null),a(j,{value:t.fontSize,"onUpdate:value":o=>t.fontSize=o,placement:"left",vertical:!0,min:12,max:32},null),a("img",{src:F,class:s.iconPlusT,onClick:()=>{t.fontSize<=12||(t.fontSize-=1)}},null)])])])]),t.list.length!==0&&a(P,{show:t.showPlayer,playState:t.playState,item:k.value,onChange:o=>v(o)},null)])}}});export{Ht as default};
|