1 |
- import{i as h}from"./icon_back-c5ec0a72-1724872791500.js";import{T as x,P as S,b as w,c as C,i as T,a as k}from"./index-ba618019-1724872791500.js";import{i as p}from"./icon_default-d1bcaf5f-1724872791500.js";import{i as P}from"./icon_separator-e0f6c575-1724872791500.js";import{u as B,i as F,a as A,b as I}from"./useSpeak-6168804b-1724872791500.js";import{i as N}from"./icon-pan-16e35a82-1724872791500.js";import{d as R,a as L,u as D,e as f,U as b,q as W,f as t,x as E,aP as O,aQ as z,k as a,w as q,j as U,E as $}from"./index-d5898469-1724872791500.js";import{T as G}from"./index-81f77935-1724872791500.js";import{e as j}from"./api-06cc7b3f-1724872791500.js";import{N as M}from"./Slider-a3783332-1724872791500.js";const V="_container_x7xz2_1",Q="_iconBack_x7xz2_6",H="_separator_x7xz2_39",J="_wrap_x7xz2_44",K="_wrapBottom_x7xz2_50",X="_content_x7xz2_53",Y="_tools_x7xz2_60",Z="_contentWrap_x7xz2_74",tt="_musicList_x7xz2_82",st="_instrumentGroup_x7xz2_96",et="_instrumentImg_x7xz2_104",it="_instrumentName_x7xz2_110",nt="_instrumentTag_x7xz2_118",at="_wrapList_x7xz2_123",ot="_titlec_x7xz2_133",lt="_icon2_x7xz2_143",ct="_empty_x7xz2_150",rt="_itemContainer_x7xz2_156",ut="_item_x7xz2_156",_t="_active_x7xz2_178",mt="_arrow_x7xz2_181",xt="_img_x7xz2_184",dt="_title_x7xz2_133",pt="_titleName_x7xz2_213",gt="_titleDes_x7xz2_220",ft="_btn_x7xz2_230",zt="_showPlayLoading_x7xz2_254",yt="_loadingWrap_x7xz2_257",vt="_musicStaff_x7xz2_262",ht="_musicTitle_x7xz2_278",St="_icon1_x7xz2_288",wt="_musicTitleLeft_x7xz2_296",Ct="_musicTitleRight_x7xz2_300",Tt="_textRead_x7xz2_300",kt="_textClose_x7xz2_301",Pt="_icon_x7xz2_6",Bt="_musicContent_x7xz2_327",Ft="_staffImgs_x7xz2_342",At="_changeSizeSection_x7xz2_359",It="_iconT_x7xz2_372",Nt="_iconAddT_x7xz2_376",Rt="_iconPlusT_x7xz2_377",Lt="_musicTop_x7xz2_404",Dt="_musicInfo_x7xz2_405",bt="_musicImg_x7xz2_415",Wt="_panSection_x7xz2_431",Et="_img2_x7xz2_442",Ot="_iconPan_x7xz2_449",qt="_info_x7xz2_480",Ut="_name_x7xz2_483",$t="_c_x7xz2_1",Gt="_selectionCouser_x7xz2_504",jt="_hide_x7xz2_509",Mt="_textStart_x7xz2_513",Vt="_textReadOnly_x7xz2_514",e={container:V,iconBack:Q,separator:H,wrap:J,wrapBottom:K,content:X,tools:Y,contentWrap:Z,musicList:tt,instrumentGroup:st,instrumentImg:et,instrumentName:it,instrumentTag:nt,wrapList:at,titlec:ot,icon2:lt,empty:ct,itemContainer:rt,item:ut,active:_t,arrow:mt,img:xt,title:dt,titleName:pt,titleDes:gt,btn:ft,showPlayLoading:zt,loadingWrap:yt,musicStaff:vt,musicTitle:ht,icon1:St,musicTitleLeft:wt,musicTitleRight:Ct,textRead:Tt,textClose:kt,icon:Pt,musicContent:Bt,staffImgs:Ft,changeSizeSection:At,iconT:It,iconAddT:Nt,iconPlusT:Rt,musicTop:Lt,musicInfo:Dt,musicImg:bt,panSection:Wt,img2:Et,iconPan:Ot,info:qt,name:Ut,c:$t,selectionCouser:Gt,hide:jt,textStart:Mt,textReadOnly:Vt},is=R({name:"instrument-detail",setup(){const d=L(),g=D(),l=B();f({page:1,rows:20,status:!0,name:"",type:d.query.type});const s=f({loading:!1,finshed:!1,reshing:!1,details:{},list:[],listActive:0,playState:"pause",showPlayer:!1,showPreivew:!1,previewUrl:"",showCloseBtn:!0,fontSize:18}),y=b(()=>s.list[s.listActive]||{}),u=i=>{const o=s.list.findIndex(n=>n.id===i.id);o>-1&&(s.listActive===o?s.playState=s.playState==="play"?"pause":"play":s.playState="play",s.showPlayer=!0,s.listActive=o)},_=i=>{i==="play"?s.playState="play":i==="pause"?s.playState="pause":i==="pre"?s.list[s.listActive-1]&&u(s.list[s.listActive-1]):i==="next"&&s.list[s.listActive+1]&&u(s.list[s.listActive+1])},v=async()=>{var c;s.loading=!0;let i={};try{i=await j({id:d.query.id})}catch(r){console.log(r)}s.reshing&&(s.list=[],s.reshing=!1),s.finshed=!0,s.list=i.data.knowledgeWikiResources||[],s.list.forEach(r=>{r.audioFileUrl=r.url,r.musicSheetName=r.name});const o=i.data.knowledgeWikiCategories||[];i.data.knowledgeName=o.length>0?o[0].name:"",i.data.intros=i.data.intros.replace(/<video/gi,'<video style="width: 100% !important;" controlslist="nodownload"');const m=new DOMParser().parseFromString(i.data.intros,"text/html");(c=document.querySelector("#musicContent"))==null||c.appendChild(l.processNode(m.body)),s.details=i.data,s.loading=!1};return W(()=>{v()}),()=>{var i,o;return t("div",{class:e.container},[t(E,{align:"center",wrapItem:!1,size:16},{default:()=>[t("img",{style:{cursor:"pointer"},src:h,class:e.iconBack,onClick:()=>{g.push("/content-music")}},null),t(O,{separator:""},{default:()=>[t(z,{onClick:()=>{g.push("/content-music")}},{default:()=>[a("名曲鉴赏")]}),t("img",{class:e.separator,src:P},null),t(z,null,{default:()=>[d.query.name]})]})]}),t("div",{class:[e.wrap,s.showPlayer?e.wrapBottom:""]},[t("div",{class:e.content},[t("div",{class:e.contentWrap},[t("div",{class:[e.musicList,"musicList-container"]},[t("div",{class:e.wrapList},[t("div",{class:e.musicInfo},[t("div",{class:e.musicImg},[t("img",{src:((i=s.details)==null?void 0:i.avatar)||p,class:e.img},null),t("div",{class:e.panSection},[t("img",{src:N,class:e.iconPan},null),t("img",{src:((o=s.details)==null?void 0:o.avatar)||p,class:e.img2},null)])]),t("div",{class:e.info},[t("div",{class:e.name},[t(x,{text:s.details.name,style:{marginRight:"0"}},null)]),t("div",{class:e.c},[s.details.composers?t("div",null,[t("span",null,[a("作曲:")]),t(x,{text:s.details.composers,style:{marginRight:"0"}},null)]):"",s.details.lyricists?t("div",null,[t("span",null,[a("作词:")]),t(x,{text:s.details.lyricists,style:{marginRight:"0"}},null)]):""])])]),t("div",{class:e.titlec},[t("i",{class:e.icon2},null),a("名曲鉴赏")]),s.list.map((n,m)=>t("div",{class:e.itemContainer},[t("div",{class:[e.item],onClick:c=>{c.stopPropagation(),u(n)}},[t("div",{class:e.img},[t(q,{lazy:!0,objectFit:"cover",previewDisabled:!0,src:n.titleImg||p,onLoad:c=>{c.target.dataset.loaded="true"}},null),t(S,{class:[s.listActive===m&&s.playState==="play"?"":e.showPlayLoading]},null)]),t("div",{class:e.title},[t("div",{class:e.titleName},[t(x,{text:n.name,style:{marginRight:"12px"}},null)])]),t(U,{color:"#259CFE",textColor:"#fff",round:!0,class:e.btn,type:"primary",onClick:c=>{c.stopPropagation(),u(n),l.onCloseSpeak()}},{default:()=>[a("播放"),t("img",{src:s.listActive===m&&s.playState==="play"?w:C},null)]}),t("img",{class:e.arrow,src:T},null)])])),!s.finshed&&t("div",{class:e.loadingWrap},[t($,{show:!0},null)]),!s.loading&&s.list.length===0&&t("div",{class:e.empty},[t(G,{description:"暂无名曲鉴赏",style:{paddingTop:"0px"}},null)])])]),t("div",{class:e.musicStaff},[t("div",{class:e.musicTitle},[t("div",{class:e.musicTitleLeft},[t("i",{class:e.icon1},null),a("名曲故事")]),t("div",{class:e.musicTitleRight},[l.isSpeak.value?t("span",{class:e.textClose,onClick:l.onCloseSpeak},[t("i",{class:e.icon},null),a("关闭朗读")]):t("span",{class:e.textRead,onClick:()=>{l.onAllSpeak(),_("pause")}},[t("i",{class:e.icon},null),a("全文朗读")])])]),t("div",{class:e.musicContent,id:"musicContent",style:{fontSize:s.fontSize+"px"}},[t("div",{id:"selectionCouser",class:[e.selectionCouser,!l.showDom.value&&e.hide]},[t("span",{class:e.textStart,onClick:()=>{l.onTextStart(),_("pause")}},[a("开始朗读"),t("i",{class:e.icon},null)]),t("span",{class:e.textReadOnly,onClick:()=>{l.onTextReadOnly(),_("pause")}},[a("只读这段"),t("i",{class:e.icon},null)])])])]),t("div",{class:e.changeSizeSection},[t("img",{src:F,class:e.iconT},null),t("img",{src:A,class:e.iconAddT,onClick:()=>{s.fontSize>=32||(s.fontSize+=1)}},null),t(M,{value:s.fontSize,"onUpdate:value":n=>s.fontSize=n,placement:"left",vertical:!0,min:12,max:32},null),t("img",{src:I,class:e.iconPlusT,onClick:()=>{s.fontSize<=12||(s.fontSize-=1)}},null)])])])]),s.list.length!==0&&t(k,{show:s.showPlayer,playState:s.playState,item:y.value,onChange:n=>_(n)},null)])}}});export{is as default};
|