1 |
- import{i as C}from"./icon_back-c5ec0a72-1743496079034.js";import{T as d,P as T,b as x,c as k,i as P,a as B}from"./index-f6cdd761-1743496079034.js";import{i as p}from"./icon_default-d1bcaf5f-1743496079034.js";import{i as F}from"./icon_separator-e0f6c575-1743496079034.js";import{u as A,i as I,a as N,b as L}from"./useSpeak-f0fad1e8-1743496079034.js";import{i as R}from"./icon-pan-16e35a82-1743496079034.js";import{d as D,a as z,u as b,e as v,J as W,q as E,f as t,x as O,b5 as q,b6 as h,k as n,w as $,j as G,a9 as U}from"./index-32ff339b-1743496079034.js";import{T as j}from"./index-f645f05d-1743496079034.js";import{e as M}from"./api-a4f14706-1743496079034.js";import{N as V}from"./Slider-6d04791b-1743496079034.js";const J="_container_1of5o_1",H="_iconBack_1of5o_6",K="_separator_1of5o_39",Q="_wrap_1of5o_44",X="_wrapBottom_1of5o_50",Y="_content_1of5o_53",Z="_tools_1of5o_60",tt="_contentWrap_1of5o_74",ot="_musicList_1of5o_82",st="_instrumentGroup_1of5o_96",et="_instrumentImg_1of5o_104",it="_instrumentName_1of5o_110",nt="_instrumentTag_1of5o_118",at="_wrapList_1of5o_123",lt="_titlec_1of5o_133",ct="_icon2_1of5o_143",rt="_empty_1of5o_150",ut="_itemContainer_1of5o_156",_t="_item_1of5o_156",mt="_active_1of5o_178",dt="_arrow_1of5o_181",ft="_img_1of5o_184",pt="_title_1of5o_133",gt="_titleName_1of5o_213",yt="_titleDes_1of5o_220",vt="_btn_1of5o_230",ht="_showPlayLoading_1of5o_254",St="_loadingWrap_1of5o_257",wt="_musicStaff_1of5o_262",Ct="_musicTitle_1of5o_278",Tt="_icon1_1of5o_288",xt="_musicTitleLeft_1of5o_296",kt="_musicTitleRight_1of5o_300",Pt="_textRead_1of5o_300",Bt="_textClose_1of5o_301",Ft="_icon_1of5o_6",At="_musicContent_1of5o_327",It="_staffImgs_1of5o_345",Nt="_changeSizeSection_1of5o_362",Lt="_iconT_1of5o_375",Rt="_iconAddT_1of5o_379",Dt="_iconPlusT_1of5o_380",zt="_musicTop_1of5o_407",bt="_musicInfo_1of5o_408",Wt="_musicImg_1of5o_418",Et="_panSection_1of5o_434",Ot="_img2_1of5o_445",qt="_iconPan_1of5o_452",$t="_info_1of5o_483",Gt="_name_1of5o_486",Ut="_c_1of5o_1",jt="_selectionCouser_1of5o_507",Mt="_hide_1of5o_512",Vt="_textStart_1of5o_516",Jt="_textReadOnly_1of5o_517",s={container:J,iconBack:H,separator:K,wrap:Q,wrapBottom:X,content:Y,tools:Z,contentWrap:tt,musicList:ot,instrumentGroup:st,instrumentImg:et,instrumentName:it,instrumentTag:nt,wrapList:at,titlec:lt,icon2:ct,empty:rt,itemContainer:ut,item:_t,active:mt,arrow:dt,img:ft,title:pt,titleName:gt,titleDes:yt,btn:vt,showPlayLoading:ht,loadingWrap:St,musicStaff:wt,musicTitle:Ct,icon1:Tt,musicTitleLeft:xt,musicTitleRight:kt,textRead:Pt,textClose:Bt,icon:Ft,musicContent:At,staffImgs:It,changeSizeSection:Nt,iconT:Lt,iconAddT:Rt,iconPlusT:Dt,musicTop:zt,musicInfo:bt,musicImg:Wt,panSection:Et,img2:Ot,iconPan:qt,info:$t,name:Gt,c:Ut,selectionCouser:jt,hide:Mt,textStart:Vt,textReadOnly:Jt},io=D({name:"instrument-detail",setup(){const f=z(),g=b(),c=A();v({page:1,rows:20,status:!0,name:"",type:f.query.type});const o=v({loading:!1,finshed:!1,reshing:!1,details:{},list:[],listActive:0,playState:"pause",showPlayer:!1,showPreivew:!1,previewUrl:"",showCloseBtn:!0,fontSize:18}),S=W(()=>o.list[o.listActive]||{}),u=e=>{const a=o.list.findIndex(i=>i.id===e.id);a>-1&&(o.listActive===a?o.playState=o.playState==="play"?"pause":"play":o.playState="play",o.showPlayer=!0,o.listActive=a)},_=e=>{e==="play"?o.playState="play":e==="pause"?o.playState="pause":e==="pre"?o.list[o.listActive-1]&&u(o.list[o.listActive-1]):e==="next"&&o.list[o.listActive+1]&&u(o.list[o.listActive+1])},w=async()=>{var y;o.loading=!0;let e={};try{e=await M({id:f.query.id})}catch(r){console.log(r)}o.reshing&&(o.list=[],o.reshing=!1),o.finshed=!0,o.list=e.data.knowledgeWikiResources||[],o.list.forEach(r=>{r.audioFileUrl=r.url,r.musicSheetName=r.name});const a=e.data.knowledgeWikiCategories||[];e.data.knowledgeName=a.length>0?a[0].name:"",e.data.intros=e.data.intros.replace(/<video/gi,'<video style="width: 100% !important;" controlslist="nodownload"');const m=new DOMParser().parseFromString(e.data.intros,"text/html"),l=document.createElement("div");l.classList.add("html-to-dom"),l.appendChild(c.processNode(m.body)),(y=document.querySelector("#musicContent"))==null||y.appendChild(l),o.details=e.data,o.loading=!1};return E(()=>{w()}),()=>{var e,a;return t("div",{class:s.container},[t(O,{align:"center",wrapItem:!1,size:16},{default:()=>[t("img",{style:{cursor:"pointer"},src:C,class:s.iconBack,onClick:()=>{g.push("/content-music")}},null),t(q,{separator:""},{default:()=>[t(h,{onClick:()=>{g.push("/content-music")}},{default:()=>[n("名曲鉴赏")]}),t("img",{class:s.separator,src:F},null),t(h,null,{default:()=>[f.query.name]})]})]}),t("div",{class:[s.wrap,o.showPlayer?s.wrapBottom:""]},[t("div",{class:s.content},[t("div",{class:s.contentWrap},[t("div",{class:[s.musicList,"musicList-container"]},[t("div",{class:s.wrapList},[t("div",{class:s.musicInfo},[t("div",{class:s.musicImg},[t("img",{src:((e=o.details)==null?void 0:e.avatar)||p,class:s.img},null),t("div",{class:s.panSection},[t("img",{src:R,class:s.iconPan},null),t("img",{src:((a=o.details)==null?void 0:a.avatar)||p,class:s.img2},null)])]),t("div",{class:s.info},[t("div",{class:s.name},[t(d,{text:o.details.name,style:{marginRight:"0"}},null)]),t("div",{class:s.c},[o.details.composers?t("div",null,[t("span",null,[n("作曲:")]),t(d,{text:o.details.composers,style:{marginRight:"0"}},null)]):"",o.details.lyricists?t("div",null,[t("span",null,[n("作词:")]),t(d,{text:o.details.lyricists,style:{marginRight:"0"}},null)]):""])])]),t("div",{class:s.titlec},[t("i",{class:s.icon2},null),n("名曲鉴赏")]),o.list.map((i,m)=>t("div",{class:s.itemContainer},[t("div",{class:[s.item],onClick:l=>{l.stopPropagation(),u(i)}},[t("div",{class:s.img},[t($,{lazy:!0,objectFit:"cover",previewDisabled:!0,src:i.titleImg||p,onLoad:l=>{l.target.dataset.loaded="true"}},null),t(T,{class:[o.listActive===m&&o.playState==="play"?"":s.showPlayLoading]},null)]),t("div",{class:s.title},[t("div",{class:s.titleName},[t(d,{text:i.name,style:{marginRight:"12px"}},null)])]),t(G,{color:"#259CFE",textColor:"#fff",round:!0,class:s.btn,type:"primary",onClick:l=>{l.stopPropagation(),u(i),c.onCloseSpeak()}},{default:()=>[n("播放"),t("img",{src:o.listActive===m&&o.playState==="play"?x:k},null)]}),t("img",{class:s.arrow,src:P},null)])])),!o.finshed&&t("div",{class:s.loadingWrap},[t(U,{show:!0},null)]),!o.loading&&o.list.length===0&&t("div",{class:s.empty},[t(j,{description:"暂无名曲鉴赏",style:{paddingTop:"0px"}},null)])])]),t("div",{class:s.musicStaff},[t("div",{class:s.musicTitle},[t("div",{class:s.musicTitleLeft},[t("i",{class:s.icon1},null),n("名曲故事")]),t("div",{class:s.musicTitleRight},[c.isSpeak.value?t("span",{class:s.textClose,onClick:c.onCloseSpeak},[t("i",{class:s.icon},null),n("关闭朗读")]):t("span",{class:s.textRead,onClick:()=>{c.onAllSpeak(),_("pause")}},[t("i",{class:s.icon},null),n("全文朗读")])])]),t("div",{class:s.musicContent,id:"musicContent",style:{fontSize:o.fontSize+"px"}},[t("div",{id:"selectionCouser",class:[s.selectionCouser,!c.showDom.value&&s.hide]},[t("span",{class:s.textStart,onClick:()=>{c.onTextStart(),_("pause")}},[n("开始朗读"),t("i",{class:s.icon},null)]),t("span",{class:s.textReadOnly,onClick:()=>{c.onTextReadOnly(),_("pause")}},[n("只读这段"),t("i",{class:s.icon},null)])])])]),t("div",{class:s.changeSizeSection},[t("img",{src:I,class:s.iconT},null),t("img",{src:N,class:s.iconAddT,onClick:()=>{o.fontSize>=32||(o.fontSize+=1)}},null),t(V,{value:o.fontSize,"onUpdate:value":i=>o.fontSize=i,placement:"left",vertical:!0,min:12,max:32},null),t("img",{src:L,class:s.iconPlusT,onClick:()=>{o.fontSize<=12||(o.fontSize-=1)}},null)])])])]),o.list.length!==0&&t(B,{show:o.showPlayer,playState:o.playState,item:S.value,onChange:i=>_(i),onShow:i=>{o.showPlayer=i}},null)])}}});export{io as default};
|