1 |
- import{i as w}from"./icon_back-c5ec0a72-1701846880218.js";import{i as h,P as S,a as C,b as T,c as N,d as k}from"./index-6afe6330-1701846880218.js";import{i as I}from"./icon_default-d1bcaf5f-1701846880218.js";import{i as A,a as P,b as L}from"./icon-plus-t-35f4cdeb-1701846880218.js";import{d as z,a as B,u as W,e as _,O as b,n as x,f as e,w as E,ci as U,cj as d,t as g,k as p,j as M,A as D}from"./index-cbeba841-1701846880218.js";import{T as F}from"./index-7e9f3876-1701846880218.js";import{T as j}from"./index-fc4f32fa-1701846880218.js";import{c as G}from"./api-99498516-1701846880218.js";import{N as R}from"./Slider-9c7c1b5b-1701846880218.js";const q="_container_16m8g_1",$="_iconBack_16m8g_6",V="_separator_16m8g_36",H="_wrap_16m8g_41",O="_wrapBottom_16m8g_47",J="_content_16m8g_50",K="_tools_16m8g_57",Q="_contentWrap_16m8g_71",X="_musicList_16m8g_79",Y="_instrumentGroup_16m8g_93",Z="_instrumentImg_16m8g_101",tt="_instrumentName_16m8g_110",et="_instrumentTag_16m8g_118",st="_wrapList_16m8g_123",it="_titlec_16m8g_133",at="_icon2_16m8g_143",nt="_empty_16m8g_150",ot="_itemContainer_16m8g_156",ct="_item_16m8g_156",lt="_active_16m8g_178",rt="_arrow_16m8g_181",mt="_img_16m8g_184",ut="_title_16m8g_133",_t="_titleName_16m8g_213",dt="_titleDes_16m8g_220",gt="_btn_16m8g_230",pt="_showPlayLoading_16m8g_254",ft="_loadingWrap_16m8g_257",yt="_musicStaff_16m8g_262",vt="_musicTitle_16m8g_277",wt="_icon1_16m8g_286",ht="_icon3_16m8g_287",St="_musicContent_16m8g_299",Ct="_staffImgs_16m8g_312",Tt="_changeSizeSection_16m8g_329",Nt="_iconT_16m8g_342",kt="_iconAddT_16m8g_346",It="_iconPlusT_16m8g_347",s={container:q,iconBack:$,separator:V,wrap:H,wrapBottom:O,content:J,tools:K,contentWrap:Q,musicList:X,instrumentGroup:Y,instrumentImg:Z,instrumentName:tt,instrumentTag:et,wrapList:st,titlec:it,icon2:at,empty:nt,itemContainer:ot,item:ct,active:lt,arrow:rt,img:mt,title:ut,titleName:_t,titleDes:dt,btn:gt,showPlayLoading:pt,loadingWrap:ft,musicStaff:yt,musicTitle:vt,icon1:wt,icon3:ht,musicContent:St,staffImgs:Ct,changeSizeSection:Tt,iconT:Nt,iconAddT:kt,iconPlusT:It},Ut=z({name:"instrument-detail",setup(){const r=B(),m=W(),o=_({page:1,rows:20,status:!0,name:"",type:r.query.type}),t=_({loading:!1,finshed:!1,reshing:!1,details:{},list:[],listActive:0,playState:"pause",showPlayer:!1,showPreivew:!1,previewUrl:"",showCloseBtn:!0,fontSize:18}),f=b(()=>t.list[t.listActive]||{}),l=a=>{const n=t.list.findIndex(i=>i.id===a.id);n>-1&&(t.listActive===n?t.playState=t.playState==="play"?"pause":"play":t.playState="play",t.showPlayer=!0,t.listActive=n)},y=a=>{a==="play"?t.playState="play":a==="pause"?t.playState="pause":a==="pre"?t.list[t.listActive-1]&&l(t.list[t.listActive-1]):a==="next"&&t.list[t.listActive+1]&&l(t.list[t.listActive+1])},v=async()=>{t.loading=!0;let a={};try{a=await G({id:r.query.id})}catch(i){console.log(i)}t.reshing&&(t.list=[],t.reshing=!1),t.finshed=!0,t.list=a.data.knowledgeWikiResources||[],t.list.forEach(i=>{i.audioFileUrl=i.url,i.musicSheetName=i.name});const n=a.data.knowledgeWikiCategories||[];a.data.knowledgeName=n.length>0?n[0].knowledgeWikiCategoryTypeName:"",a.data.intros=a.data.intros.replace(/<video/gi,'<video style="width: 100% !important;" controlslist="nodownload"'),t.details=a.data,t.loading=!1};return x(()=>{v()}),()=>{var a,n;return e("div",{class:s.container},[e(E,{align:"center",wrapItem:!1,size:16},{default:()=>[e("img",{style:{cursor:"pointer"},src:w,class:s.iconBack,onClick:()=>{const i=o.type==="MUSICIAN"?"/content-musician":"/content-instruments";m.push({path:i})}},null),e(U,{separator:""},{default:()=>[e(d,{onClick:()=>{const i=o.type==="MUSICIAN"?"/content-musician":"/content-instruments";m.push({path:i})}},{default:()=>[o.type==="MUSICIAN"?"音乐家":"乐器百科"]}),e("img",{class:s.separator,src:h},null),e(d,null,{default:()=>[r.query.name]})]})]}),e("div",{class:[s.wrap,t.showPlayer?s.wrapBottom:""]},[e("div",{class:s.content},[e("div",{class:s.contentWrap},[e("div",{class:[s.musicList,"musicList-container"]},[e("div",{class:s.wrapList},[e("div",{class:s.instrumentGroup},[e(g,{class:s.instrumentImg,src:(a=t.details)==null?void 0:a.avatar,objectFit:"cover"},null),e("p",{class:s.instrumentName},[t.details.name]),e("p",{class:s.instrumentTag},[t.details.knowledgeName])]),e("div",{class:s.titlec},[e("i",{class:s.icon2},null),p("代表作")]),t.list.map((i,u)=>e("div",{class:s.itemContainer},[e("div",{class:[s.item],onClick:c=>{c.stopPropagation(),l(i)}},[e("div",{class:s.img},[e(g,{lazy:!0,objectFit:"cover",previewDisabled:!0,src:i.titleImg||I,onLoad:c=>{c.target.dataset.loaded="true"}},null),e(S,{class:[t.listActive===u&&t.playState==="play"?"":s.showPlayLoading]},null)]),e("div",{class:s.title},[e("div",{class:s.titleName},[e(F,{text:i.name,style:{marginRight:"12px"}},null)])]),e(M,{color:"#259CFE",textColor:"#fff",round:!0,class:s.btn,type:"primary",onClick:c=>{c.stopPropagation(),l(i)}},{default:()=>[p("播放"),e("img",{src:t.listActive===u&&t.playState==="play"?C:T},null)]}),e("img",{class:s.arrow,src:N},null)])])),!t.finshed&&e("div",{class:s.loadingWrap},[e(D,{show:!0},null)]),!t.loading&&t.list.length===0&&e("div",{class:s.empty},[e(j,{description:"暂无代表作"},null)])])]),e("div",{class:s.musicStaff},[e("div",{class:s.musicTitle},[e("i",{class:o.type==="MUSICIAN"?s.icon3:s.icon1},null),o.type==="MUSICIAN"?"个人简介":"乐器简介"]),e("div",{class:s.musicContent,innerHTML:(n=t.details)==null?void 0:n.intros,style:{fontSize:t.fontSize+"px"}},null)]),e("div",{class:s.changeSizeSection},[e("img",{src:A,class:s.iconT},null),e("img",{src:P,class:s.iconAddT,onClick:()=>{t.fontSize>=32||(t.fontSize+=1)}},null),e(R,{value:t.fontSize,"onUpdate:value":i=>t.fontSize=i,vertical:!0,min:12,max:32},null),e("img",{src:L,class:s.iconPlusT,onClick:()=>{t.fontSize<=12||(t.fontSize-=1)}},null)])])])]),t.list.length!==0&&e(k,{show:t.showPlayer,playState:t.playState,item:f.value,onChange:i=>y(i)},null)])}}});export{Ut as default};
|