detail-dfe741f5-1726219372904.js 7.5 KB

1
  1. import{i as S}from"./icon_back-c5ec0a72-1726219372904.js";import{T as d,P as w,b as C,c as T,i as x,a as k}from"./index-b48cb97f-1726219372904.js";import{i as g}from"./icon_default-d1bcaf5f-1726219372904.js";import{i as P}from"./icon_separator-e0f6c575-1726219372904.js";import{u as B,i as F,a as A,b as I}from"./useSpeak-0792de8d-1726219372904.js";import{i as N}from"./icon-pan-16e35a82-1726219372904.js";import{d as R,a as L,u as D,e as b,U as z,q as W,f as t,x as E,aR as O,aS as y,k as a,w as q,j as U,E as $}from"./index-1ec0a32d-1726219372904.js";import{T as G}from"./index-2727764b-1726219372904.js";import{e as j}from"./api-da5bf64f-1726219372904.js";import{N as M}from"./Slider-bd832880-1726219372904.js";const V="_container_609br_1",H="_iconBack_609br_6",J="_separator_609br_43",K="_wrap_609br_48",Q="_wrapBottom_609br_54",X="_content_609br_57",Y="_tools_609br_64",Z="_contentWrap_609br_78",tt="_musicList_609br_86",st="_instrumentGroup_609br_100",et="_instrumentImg_609br_108",it="_instrumentName_609br_114",nt="_instrumentTag_609br_122",at="_wrapList_609br_127",ot="_titlec_609br_137",lt="_icon2_609br_147",ct="_empty_609br_154",rt="_itemContainer_609br_160",ut="_item_609br_160",_t="_active_609br_182",mt="_arrow_609br_185",dt="_img_609br_188",pt="_title_609br_137",gt="_titleName_609br_217",ft="_titleDes_609br_224",bt="_btn_609br_234",yt="_showPlayLoading_609br_258",vt="_loadingWrap_609br_261",ht="_musicStaff_609br_266",St="_musicTitle_609br_282",wt="_icon1_609br_292",Ct="_musicTitleLeft_609br_300",Tt="_musicTitleRight_609br_304",xt="_textRead_609br_304",kt="_textClose_609br_305",Pt="_icon_609br_6",Bt="_musicContent_609br_331",Ft="_staffImgs_609br_349",At="_changeSizeSection_609br_366",It="_iconT_609br_379",Nt="_iconAddT_609br_383",Rt="_iconPlusT_609br_384",Lt="_musicTop_609br_411",Dt="_musicInfo_609br_412",zt="_musicImg_609br_422",Wt="_panSection_609br_438",Et="_img2_609br_449",Ot="_iconPan_609br_456",qt="_info_609br_487",Ut="_name_609br_490",$t="_c_609br_1",Gt="_selectionCouser_609br_511",jt="_hide_609br_516",Mt="_textStart_609br_520",Vt="_textReadOnly_609br_521",e={container:V,iconBack:H,separator:J,wrap:K,wrapBottom:Q,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:dt,title:pt,titleName:gt,titleDes:ft,btn:bt,showPlayLoading:yt,loadingWrap:vt,musicStaff:ht,musicTitle:St,icon1:wt,musicTitleLeft:Ct,musicTitleRight:Tt,textRead:xt,textClose:kt,icon:Pt,musicContent:Bt,staffImgs:Ft,changeSizeSection:At,iconT:It,iconAddT:Nt,iconPlusT:Rt,musicTop:Lt,musicInfo:Dt,musicImg:zt,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 p=L(),f=D(),l=B();b({page:1,rows:20,status:!0,name:"",type:p.query.type});const s=b({loading:!1,finshed:!1,reshing:!1,details:{},list:[],listActive:0,playState:"pause",showPlayer:!1,showPreivew:!1,previewUrl:"",showCloseBtn:!0,fontSize:18}),v=z(()=>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])},h=async()=>{var c;s.loading=!0;let i={};try{i=await j({id:p.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(()=>{h()}),()=>{var i,o;return t("div",{class:e.container},[t(E,{align:"center",wrapItem:!1,size:16},{default:()=>[t("img",{style:{cursor:"pointer"},src:S,class:e.iconBack,onClick:()=>{f.push("/content-music")}},null),t(O,{separator:""},{default:()=>[t(y,{onClick:()=>{f.push("/content-music")}},{default:()=>[a("名曲鉴赏")]}),t("img",{class:e.separator,src:P},null),t(y,null,{default:()=>[p.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)||g,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)||g,class:e.img2},null)])]),t("div",{class:e.info},[t("div",{class:e.name},[t(d,{text:s.details.name,style:{marginRight:"0"}},null)]),t("div",{class:e.c},[s.details.composers?t("div",null,[t("span",null,[a("作曲:")]),t(d,{text:s.details.composers,style:{marginRight:"0"}},null)]):"",s.details.lyricists?t("div",null,[t("span",null,[a("作词:")]),t(d,{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||g,onLoad:c=>{c.target.dataset.loaded="true"}},null),t(w,{class:[s.listActive===m&&s.playState==="play"?"":e.showPlayLoading]},null)]),t("div",{class:e.title},[t("div",{class:e.titleName},[t(d,{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"?C:T},null)]}),t("img",{class:e.arrow,src:x},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:v.value,onChange:n=>_(n),onShow:n=>{s.showPlayer=n}},null)])}}});export{is as default};