detail-17dcc4f3-1720699367816.js 5.9 KB

1
  1. import{i as w}from"./icon_back-c5ec0a72-1720699367816.js";import{P as h,T as S,i as C,a as I,b as T,c as N}from"./index-96385afb-1720699367816.js";import{i as k}from"./icon_default-d1bcaf5f-1720699367816.js";import{i as A}from"./icon_separator-e0f6c575-1720699367816.js";import{i as P,a as L,b as z}from"./icon-plus-t-35f4cdeb-1720699367816.js";import{d as B,a as W,u as b,e as m,U as x,q as E,f as s,x as U,aQ as M,aR as _,w as g,k as p,j as D,E as F}from"./index-b48b51d2-1720699367816.js";import{T as R}from"./index-a2dc20f3-1720699367816.js";import{e as q}from"./api-b5ee56f7-1720699367816.js";import{N as G}from"./Slider-e8b4d094-1720699367816.js";const j="_container_1ndgs_1",$="_iconBack_1ndgs_6",V="_separator_1ndgs_36",H="_wrap_1ndgs_41",Q="_wrapBottom_1ndgs_47",J="_content_1ndgs_50",K="_tools_1ndgs_57",O="_contentWrap_1ndgs_71",X="_musicList_1ndgs_79",Y="_instrumentGroup_1ndgs_93",Z="_instrumentImg_1ndgs_101",tt="_otherImg_1ndgs_107",st="_instrumentName_1ndgs_114",nt="_instrumentTag_1ndgs_122",et="_wrapList_1ndgs_127",it="_titlec_1ndgs_137",at="_icon2_1ndgs_147",ot="_empty_1ndgs_154",lt="_itemContainer_1ndgs_160",ct="_item_1ndgs_160",rt="_active_1ndgs_182",dt="_arrow_1ndgs_185",ut="_img_1ndgs_188",mt="_title_1ndgs_137",_t="_titleName_1ndgs_217",gt="_titleDes_1ndgs_224",pt="_btn_1ndgs_234",ft="_showPlayLoading_1ndgs_258",yt="_loadingWrap_1ndgs_261",vt="_musicStaff_1ndgs_266",wt="_musicTitle_1ndgs_281",ht="_icon1_1ndgs_290",St="_icon3_1ndgs_291",Ct="_musicContent_1ndgs_303",It="_staffImgs_1ndgs_316",Tt="_changeSizeSection_1ndgs_333",Nt="_iconT_1ndgs_346",kt="_iconAddT_1ndgs_350",At="_iconPlusT_1ndgs_351",n={container:j,iconBack:$,separator:V,wrap:H,wrapBottom:Q,content:J,tools:K,contentWrap:O,musicList:X,instrumentGroup:Y,instrumentImg:Z,otherImg:tt,instrumentName:st,instrumentTag:nt,wrapList:et,titlec:it,icon2:at,empty:ot,itemContainer:lt,item:ct,active:rt,arrow:dt,img:ut,title:mt,titleName:_t,titleDes:gt,btn:pt,showPlayLoading:ft,loadingWrap:yt,musicStaff:vt,musicTitle:wt,icon1:ht,icon3:St,musicContent:Ct,staffImgs:It,changeSizeSection:Tt,iconT:Nt,iconAddT:kt,iconPlusT:At},Mt=B({name:"instrument-detail",setup(){const r=W(),d=b(),o=m({page:1,rows:20,status:!0,name:"",type:r.query.type}),t=m({loading:!1,finshed:!1,reshing:!1,details:{},list:[],listActive:0,playState:"pause",showPlayer:!1,showPreivew:!1,previewUrl:"",showCloseBtn:!0,fontSize:18}),f=x(()=>t.list[t.listActive]||{}),c=i=>{const a=t.list.findIndex(e=>e.id===i.id);a>-1&&(t.listActive===a?t.playState=t.playState==="play"?"pause":"play":t.playState="play",t.showPlayer=!0,t.listActive=a)},y=i=>{i==="play"?t.playState="play":i==="pause"?t.playState="pause":i==="pre"?t.list[t.listActive-1]&&c(t.list[t.listActive-1]):i==="next"&&t.list[t.listActive+1]&&c(t.list[t.listActive+1])},v=async()=>{t.loading=!0;let i={};try{i=await q({id:r.query.id})}catch(e){console.log(e)}t.reshing&&(t.list=[],t.reshing=!1),t.finshed=!0,t.list=i.data.knowledgeWikiResources||[],t.list.forEach(e=>{e.audioFileUrl=e.url,e.musicSheetName=e.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"'),t.details=i.data,t.loading=!1};return E(()=>{v()}),()=>{var i,a;return s("div",{class:n.container},[s(U,{align:"center",wrapItem:!1,size:16},{default:()=>[s("img",{style:{cursor:"pointer"},src:w,class:n.iconBack,onClick:()=>{const e=o.type==="MUSICIAN"?"/content-musician":"/content-instruments";d.push({path:e})}},null),s(M,{separator:""},{default:()=>[s(_,{onClick:()=>{const e=o.type==="MUSICIAN"?"/content-musician":"/content-instruments";d.push({path:e})}},{default:()=>[o.type==="MUSICIAN"?"音乐家":"乐器百科"]}),s("img",{class:n.separator,src:A},null),s(_,null,{default:()=>[r.query.name]})]})]}),s("div",{class:[n.wrap,t.showPlayer?n.wrapBottom:""]},[s("div",{class:n.content},[s("div",{class:n.contentWrap},[s("div",{class:[n.musicList,"musicList-container"]},[s("div",{class:n.wrapList},[s("div",{class:n.instrumentGroup},[s(g,{class:[n.instrumentImg,o.type==="MUSICIAN"&&n.otherImg],src:(i=t.details)==null?void 0:i.avatar,objectFit:"cover"},null),s("p",{class:n.instrumentName},[t.details.name]),s("p",{class:n.instrumentTag},[t.details.knowledgeName])]),s("div",{class:n.titlec},[s("i",{class:n.icon2},null),p("代表作")]),t.list.map((e,u)=>s("div",{class:n.itemContainer},[s("div",{class:[n.item],onClick:l=>{l.stopPropagation(),c(e)}},[s("div",{class:n.img},[s(g,{lazy:!0,objectFit:"cover",previewDisabled:!0,src:e.titleImg||k,onLoad:l=>{l.target.dataset.loaded="true"}},null),s(h,{class:[t.listActive===u&&t.playState==="play"?"":n.showPlayLoading]},null)]),s("div",{class:n.title},[s("div",{class:n.titleName},[s(S,{text:e.name,style:{marginRight:"12px"}},null)])]),s(D,{color:"#259CFE",textColor:"#fff",round:!0,class:n.btn,type:"primary",onClick:l=>{l.stopPropagation(),c(e)}},{default:()=>[p("播放"),s("img",{src:t.listActive===u&&t.playState==="play"?C:I},null)]}),s("img",{class:n.arrow,src:T},null)])])),!t.finshed&&s("div",{class:n.loadingWrap},[s(F,{show:!0},null)]),!t.loading&&t.list.length===0&&s("div",{class:n.empty},[s(R,{description:"暂无代表作"},null)])])]),s("div",{class:n.musicStaff},[s("div",{class:n.musicTitle},[s("i",{class:o.type==="MUSICIAN"?n.icon3:n.icon1},null),o.type==="MUSICIAN"?"个人简介":"乐器简介"]),s("div",{class:n.musicContent,innerHTML:(a=t.details)==null?void 0:a.intros,style:{fontSize:t.fontSize+"px"}},null)]),s("div",{class:n.changeSizeSection},[s("img",{src:P,class:n.iconT},null),s("img",{src:L,class:n.iconAddT,onClick:()=>{t.fontSize>=32||(t.fontSize+=1)}},null),s(G,{value:t.fontSize,"onUpdate:value":e=>t.fontSize=e,placement:"left",vertical:!0,min:12,max:32},null),s("img",{src:z,class:n.iconPlusT,onClick:()=>{t.fontSize<=12||(t.fontSize-=1)}},null)])])])]),t.list.length!==0&&s(N,{show:t.showPlayer,playState:t.playState,item:f.value,onChange:e=>y(e)},null)])}}});export{Mt as default};