1 |
- import{i as C}from"./icon_back-c5ec0a72-1724872791500.js";import{P as w,T,b as k,c as I,i as N,a as x}from"./index-ba618019-1724872791500.js";import{i as A}from"./icon_default-d1bcaf5f-1724872791500.js";import{i as B}from"./icon_separator-e0f6c575-1724872791500.js";import{u as P,i as L,a as R,b as z}from"./useSpeak-6168804b-1724872791500.js";import{d as b,a as F,u as W,e as f,A as E,U as D,q as U,f as t,x as M,aP as O,aQ as y,w as h,k as r,j as q,E as G}from"./index-d5898469-1724872791500.js";import{T as j}from"./index-81f77935-1724872791500.js";import{e as $}from"./api-06cc7b3f-1724872791500.js";import{N as V}from"./Slider-a3783332-1724872791500.js";const Q="_container_1acse_1",H="_iconBack_1acse_6",J="_separator_1acse_39",K="_wrap_1acse_44",X="_wrapBottom_1acse_50",Y="_content_1acse_53",Z="_tools_1acse_60",tt="_contentWrap_1acse_74",et="_musicList_1acse_82",st="_instrumentGroup_1acse_96",at="_instrumentImg_1acse_104",it="_otherImg_1acse_110",nt="_instrumentName_1acse_117",ct="_instrumentTag_1acse_125",ot="_wrapList_1acse_130",lt="_titlec_1acse_140",rt="_icon2_1acse_150",ut="_empty_1acse_157",_t="_itemContainer_1acse_163",mt="_item_1acse_163",dt="_active_1acse_185",pt="_arrow_1acse_188",gt="_img_1acse_191",ft="_title_1acse_140",yt="_titleName_1acse_220",ht="_titleDes_1acse_227",St="_btn_1acse_237",vt="_showPlayLoading_1acse_261",Ct="_loadingWrap_1acse_264",wt="_musicStaff_1acse_269",Tt="_musicTitle_1acse_284",kt="_musicTitleLeft_1acse_294",It="_icon1_1acse_298",Nt="_icon3_1acse_299",xt="_musicTitleRight_1acse_311",At="_textRead_1acse_311",Bt="_textClose_1acse_312",Pt="_icon_1acse_6",Lt="_musicContent_1acse_338",Rt="_staffImgs_1acse_356",zt="_changeSizeSection_1acse_373",bt="_iconT_1acse_386",Ft="_iconAddT_1acse_390",Wt="_iconPlusT_1acse_391",Et="_selectionCouser_1acse_418",Dt="_hide_1acse_423",Ut="_textStart_1acse_427",Mt="_textReadOnly_1acse_428",s={container:Q,iconBack:H,separator:J,wrap:K,wrapBottom:X,content:Y,tools:Z,contentWrap:tt,musicList:et,instrumentGroup:st,instrumentImg:at,otherImg:it,instrumentName:nt,instrumentTag:ct,wrapList:ot,titlec:lt,icon2:rt,empty:ut,itemContainer:_t,item:mt,active:dt,arrow:pt,img:gt,title:ft,titleName:yt,titleDes:ht,btn:St,showPlayLoading:vt,loadingWrap:Ct,musicStaff:wt,musicTitle:Tt,musicTitleLeft:kt,icon1:It,icon3:Nt,musicTitleRight:xt,textRead:At,textClose:Bt,icon:Pt,musicContent:Lt,staffImgs:Rt,changeSizeSection:zt,iconT:bt,iconAddT:Ft,iconPlusT:Wt,selectionCouser:Et,hide:Dt,textStart:Ut,textReadOnly:Mt},Kt=b({name:"instrument-detail",setup(){const d=F(),p=W(),n=P(),o=f({page:1,rows:20,status:!0,name:"",type:d.query.type}),e=f({loading:!1,finshed:!1,reshing:!1,details:{},list:[],listActive:0,playState:"pause",showPlayer:!1,showPreivew:!1,previewUrl:"",showCloseBtn:!0,fontSize:18});E(()=>e.playState,()=>{e.playState==="play"&&n.onCloseSpeak()});const S=D(()=>e.list[e.listActive]||{}),_=i=>{const a=e.list.findIndex(u=>u.id===i.id);a>-1&&(e.listActive===a?e.playState=e.playState==="play"?"pause":"play":e.playState="play",e.showPlayer=!0,e.listActive=a)},m=i=>{i==="play"?e.playState="play":i==="pause"?e.playState="pause":i==="pre"?e.list[e.listActive-1]&&_(e.list[e.listActive-1]):i==="next"&&e.list[e.listActive+1]&&_(e.list[e.listActive+1])},v=async()=>{var g;e.loading=!0;let i={};try{i=await $({id:d.query.id})}catch(l){console.log(l)}e.reshing&&(e.list=[],e.reshing=!1),e.finshed=!0,e.list=i.data.knowledgeWikiResources||[],e.list.forEach(l=>{l.audioFileUrl=l.url,l.musicSheetName=l.name});const a=i.data.knowledgeWikiCategories||[];i.data.knowledgeName=a.length>0?a[0].knowledgeWikiCategoryTypeName:"",i.data.intros=i.data.intros.replace(/<video/gi,'<video style="width: 100% !important;" controlslist="nodownload"');const c=new DOMParser().parseFromString(i.data.intros,"text/html");(g=document.querySelector("#musicContent"))==null||g.appendChild(n.processNode(c.body)),e.details=i.data,e.loading=!1};return U(async()=>{v()}),()=>{var i;return t("div",{class:s.container},[t(M,{align:"center",wrapItem:!1,size:16},{default:()=>[t("img",{style:{cursor:"pointer"},src:C,class:s.iconBack,onClick:()=>{const a=o.type==="MUSICIAN"?"/content-musician":"/content-instruments";p.push({path:a})}},null),t(O,{separator:""},{default:()=>[t(y,{onClick:()=>{const a=o.type==="MUSICIAN"?"/content-musician":"/content-instruments";p.push({path:a})}},{default:()=>[o.type==="MUSICIAN"?"音乐家":"乐器百科"]}),t("img",{class:s.separator,src:B},null),t(y,null,{default:()=>[d.query.name]})]})]}),t("div",{class:[s.wrap,e.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.instrumentGroup},[t(h,{class:[s.instrumentImg,o.type==="MUSICIAN"&&s.otherImg],src:(i=e.details)==null?void 0:i.avatar,objectFit:"cover"},null),t("p",{class:s.instrumentName},[e.details.name]),t("p",{class:s.instrumentTag},[e.details.knowledgeName])]),t("div",{class:s.titlec},[t("i",{class:s.icon2},null),r("代表作")]),e.list.map((a,u)=>t("div",{class:s.itemContainer},[t("div",{class:[s.item],onClick:c=>{c.stopPropagation(),_(a)}},[t("div",{class:s.img},[t(h,{lazy:!0,objectFit:"cover",previewDisabled:!0,src:a.titleImg||A,onLoad:c=>{c.target.dataset.loaded="true"}},null),t(w,{class:[e.listActive===u&&e.playState==="play"?"":s.showPlayLoading]},null)]),t("div",{class:s.title},[t("div",{class:s.titleName},[t(T,{text:a.name,style:{marginRight:"12px"}},null)])]),t(q,{color:"#259CFE",textColor:"#fff",round:!0,class:s.btn,type:"primary",onClick:c=>{c.stopPropagation(),_(a)}},{default:()=>[r("播放"),t("img",{src:e.listActive===u&&e.playState==="play"?k:I},null)]}),t("img",{class:s.arrow,src:N},null)])])),!e.finshed&&t("div",{class:s.loadingWrap},[t(G,{show:!0},null)]),!e.loading&&e.list.length===0&&t("div",{class:s.empty},[t(j,{description:"暂无代表作"},null)])])]),t("div",{class:s.musicStaff},[t("div",{class:s.musicTitle},[t("div",{class:s.musicTitleLeft},[t("i",{class:o.type==="MUSICIAN"?s.icon3:s.icon1},null),o.type==="MUSICIAN"?"个人简介":"乐器简介"]),t("div",{class:s.musicTitleRight},[n.isSpeak.value?t("span",{class:s.textClose,onClick:n.onCloseSpeak},[t("i",{class:s.icon},null),r("关闭朗读")]):t("span",{class:s.textRead,onClick:()=>{n.onAllSpeak(),m("pause")}},[t("i",{class:s.icon},null),r("全文朗读")])])]),t("div",{class:[s.musicContent],id:"musicContent",style:{fontSize:e.fontSize+"px"}},[t("div",{id:"selectionCouser",class:[s.selectionCouser,!n.showDom.value&&s.hide]},[t("span",{class:s.textStart,onClick:()=>{n.onTextStart(),m("pause")}},[r("开始朗读"),t("i",{class:s.icon},null)]),t("span",{class:s.textReadOnly,onClick:()=>{n.onTextReadOnly(),m("pause")}},[r("只读这段"),t("i",{class:s.icon},null)])])])]),t("div",{class:s.changeSizeSection},[t("img",{src:L,class:s.iconT},null),t("img",{src:R,class:s.iconAddT,onClick:()=>{e.fontSize>=32||(e.fontSize+=1)}},null),t(V,{value:e.fontSize,"onUpdate:value":a=>e.fontSize=a,placement:"left",vertical:!0,min:12,max:32},null),t("img",{src:z,class:s.iconPlusT,onClick:()=>{e.fontSize<=12||(e.fontSize-=1)}},null)])])])]),e.list.length!==0&&t(x,{show:e.showPlayer,playState:e.playState,item:S.value,onChange:a=>m(a)},null)])}}});export{Kt as default};
|