detail-05b4cef9-1726219372904.js 7.1 KB

1
  1. import{i as v}from"./icon_back-c5ec0a72-1726219372904.js";import{P as w,T as C,b as T,c as k,i as I,a as N}from"./index-b48cb97f-1726219372904.js";import{i as x}from"./icon_default-d1bcaf5f-1726219372904.js";import{i as A}from"./icon_separator-e0f6c575-1726219372904.js";import{u as B,i as P,a as L,b as R}from"./useSpeak-0792de8d-1726219372904.js";import{d as z,a as b,u as F,e as f,A as W,U as E,q as D,f as t,x as U,aR as M,aS as y,w as h,k as r,j as O,E as G}from"./index-1ec0a32d-1726219372904.js";import{T as j}from"./index-2727764b-1726219372904.js";import{e as $}from"./api-da5bf64f-1726219372904.js";import{N as V}from"./Slider-bd832880-1726219372904.js";const H="_container_dq20o_1",J="_iconBack_dq20o_6",K="_separator_dq20o_43",Q="_wrap_dq20o_48",X="_wrapBottom_dq20o_54",Y="_content_dq20o_57",Z="_tools_dq20o_64",tt="_contentWrap_dq20o_78",et="_musicList_dq20o_86",st="_instrumentGroup_dq20o_100",ot="_instrumentImg_dq20o_108",it="_otherImg_dq20o_114",at="_instrumentName_dq20o_121",nt="_instrumentTag_dq20o_129",lt="_wrapList_dq20o_134",ct="_titlec_dq20o_144",rt="_icon2_dq20o_154",dt="_empty_dq20o_161",ut="_itemContainer_dq20o_167",_t="_item_dq20o_167",mt="_active_dq20o_189",pt="_arrow_dq20o_192",gt="_img_dq20o_195",ft="_title_dq20o_144",yt="_titleName_dq20o_224",ht="_titleDes_dq20o_231",St="_btn_dq20o_241",qt="_showPlayLoading_dq20o_265",vt="_loadingWrap_dq20o_268",wt="_musicStaff_dq20o_273",Ct="_musicTitle_dq20o_288",Tt="_musicTitleLeft_dq20o_298",kt="_icon1_dq20o_302",It="_icon3_dq20o_303",Nt="_musicTitleRight_dq20o_315",xt="_textRead_dq20o_315",At="_textClose_dq20o_316",Bt="_icon_dq20o_6",Pt="_musicContent_dq20o_342",Lt="_staffImgs_dq20o_361",Rt="_changeSizeSection_dq20o_378",zt="_iconT_dq20o_391",bt="_iconAddT_dq20o_395",Ft="_iconPlusT_dq20o_396",Wt="_selectionCouser_dq20o_423",Et="_hide_dq20o_428",Dt="_textStart_dq20o_432",Ut="_textReadOnly_dq20o_433",s={container:H,iconBack:J,separator:K,wrap:Q,wrapBottom:X,content:Y,tools:Z,contentWrap:tt,musicList:et,instrumentGroup:st,instrumentImg:ot,otherImg:it,instrumentName:at,instrumentTag:nt,wrapList:lt,titlec:ct,icon2:rt,empty:dt,itemContainer:ut,item:_t,active:mt,arrow:pt,img:gt,title:ft,titleName:yt,titleDes:ht,btn:St,showPlayLoading:qt,loadingWrap:vt,musicStaff:wt,musicTitle:Ct,musicTitleLeft:Tt,icon1:kt,icon3:It,musicTitleRight:Nt,textRead:xt,textClose:At,icon:Bt,musicContent:Pt,staffImgs:Lt,changeSizeSection:Rt,iconT:zt,iconAddT:bt,iconPlusT:Ft,selectionCouser:Wt,hide:Et,textStart:Dt,textReadOnly:Ut},Qt=z({name:"instrument-detail",setup(){const m=b(),p=F(),a=B(),l=f({page:1,rows:20,status:!0,name:"",type:m.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});W(()=>e.playState,()=>{e.playState==="play"&&a.onCloseSpeak()});const S=E(()=>e.list[e.listActive]||{}),u=i=>{const o=e.list.findIndex(d=>d.id===i.id);o>-1&&(e.listActive===o?e.playState=e.playState==="play"?"pause":"play":e.playState="play",e.showPlayer=!0,e.listActive=o)},_=i=>{i==="play"?e.playState="play":i==="pause"?e.playState="pause":i==="pre"?e.list[e.listActive-1]&&u(e.list[e.listActive-1]):i==="next"&&e.list[e.listActive+1]&&u(e.list[e.listActive+1])},q=async()=>{var g;e.loading=!0;let i={};try{i=await $({id:m.query.id})}catch(c){console.log(c)}e.reshing&&(e.list=[],e.reshing=!1),e.finshed=!0,e.list=i.data.knowledgeWikiResources||[],e.list.forEach(c=>{c.audioFileUrl=c.url,c.musicSheetName=c.name});const o=i.data.knowledgeWikiCategories||[];i.data.knowledgeName=o.length>0?o[0].knowledgeWikiCategoryTypeName:"",i.data.intros=i.data.intros.replace(/<video/gi,'<video style="width: 100% !important;" controlslist="nodownload"');const n=new DOMParser().parseFromString(i.data.intros,"text/html");(g=document.querySelector("#musicContent"))==null||g.appendChild(a.processNode(n.body)),e.details=i.data,e.loading=!1};return D(async()=>{q()}),()=>{var i;return t("div",{class:s.container},[t(U,{align:"center",wrapItem:!1,size:16},{default:()=>[t("img",{style:{cursor:"pointer"},src:v,class:s.iconBack,onClick:()=>{const o=l.type==="MUSICIAN"?"/content-musician":"/content-instruments";p.push({path:o})}},null),t(M,{separator:""},{default:()=>[t(y,{onClick:()=>{const o=l.type==="MUSICIAN"?"/content-musician":"/content-instruments";p.push({path:o})}},{default:()=>[l.type==="MUSICIAN"?"音乐家":"乐器百科"]}),t("img",{class:s.separator,src:A},null),t(y,null,{default:()=>[m.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,l.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((o,d)=>t("div",{class:s.itemContainer},[t("div",{class:[s.item],onClick:n=>{n.stopPropagation(),u(o)}},[t("div",{class:s.img},[t(h,{lazy:!0,objectFit:"cover",previewDisabled:!0,src:o.titleImg||x,onLoad:n=>{n.target.dataset.loaded="true"}},null),t(w,{class:[e.listActive===d&&e.playState==="play"?"":s.showPlayLoading]},null)]),t("div",{class:s.title},[t("div",{class:s.titleName},[t(C,{text:o.name,style:{marginRight:"12px"}},null)])]),t(O,{color:"#259CFE",textColor:"#fff",round:!0,class:s.btn,type:"primary",onClick:n=>{n.stopPropagation(),u(o)}},{default:()=>[r("播放"),t("img",{src:e.listActive===d&&e.playState==="play"?T:k},null)]}),t("img",{class:s.arrow,src:I},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:l.type==="MUSICIAN"?s.icon3:s.icon1},null),l.type==="MUSICIAN"?"个人简介":"乐器简介"]),t("div",{class:s.musicTitleRight},[a.isSpeak.value?t("span",{class:s.textClose,onClick:a.onCloseSpeak},[t("i",{class:s.icon},null),r("关闭朗读")]):t("span",{class:s.textRead,onClick:()=>{a.onAllSpeak(),_("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,!a.showDom.value&&s.hide]},[t("span",{class:s.textStart,onClick:()=>{a.onTextStart(),_("pause")}},[r("开始朗读"),t("i",{class:s.icon},null)]),t("span",{class:s.textReadOnly,onClick:()=>{a.onTextReadOnly(),_("pause")}},[r("只读这段"),t("i",{class:s.icon},null)])])])]),t("div",{class:s.changeSizeSection},[t("img",{src:P,class:s.iconT},null),t("img",{src:L,class:s.iconAddT,onClick:()=>{e.fontSize>=32||(e.fontSize+=1)}},null),t(V,{value:e.fontSize,"onUpdate:value":o=>e.fontSize=o,placement:"left",vertical:!0,min:12,max:32},null),t("img",{src:R,class:s.iconPlusT,onClick:()=>{e.fontSize<=12||(e.fontSize-=1)}},null)])])])]),e.list.length!==0&&t(N,{show:e.showPlayer,playState:e.playState,item:S.value,onChange:o=>_(o),onShow:o=>{e.showPlayer=o}},null)])}}});export{Qt as default};