index.a85f6b14.js 9.4 KB

1
  1. import{d as b,Q as _,U as s,y,g as h,j as e,F as L,bd as A,aS as R,A as x,B as F,P as S,S as T,a3 as N,C,V as P}from"./ResizeObserver.es.b7226882.js";import"./index.f6c44874.js";import"./index.cf00521e.js";import{T as q,a as H}from"./index.dc988884.js";import{c as k}from"./index.1eaf642c.js";import{C as w}from"./index.40f703b6.js";import{S as G}from"./index.3532de0c.js";import{s as D}from"./song-empty.5c514691.js";import{L as E}from"./index.9fec2202.js";import{M}from"./index.03e3393d.js";import{b as z}from"./bg-image-1.a320f35c.js";import{g as V}from"./music.7cc0b22d.js";import{u as B}from"./hooks.a4ed20cb.js";import{T as U}from"./index.1743594f.js";import{C as W}from"./index.969bba7f.js";import{C as j}from"./index.9269bf1e.js";import{I as K}from"./index.20c0f4c5.js";import"./use-id.5d5e6e63.js";import"./use-tab-status.db1f6d2e.js";import"./use-refs.428b450a.js";import"./icon-xin2.4ab2a52d.js";import"./index.023f50db.js";const O="_personal_8myd5_1",Q="_bgImg_8myd5_44",$="_songEfficacy_8myd5_51",J="_songContainer_8myd5_55",X="_title_8myd5_60",Y="_btnGroup_8myd5_72",Z="_pTitle_8myd5_81",ee="_practice_8myd5_86",ae="_personalSong_8myd5_87",te="_musicGrid_8myd5_99",se="_tennatCellGroup_8myd5_102",le="_tenantLogo_8myd5_114",oe="_tenantCoverImg_8myd5_120",ne="_tenantContent_8myd5_127";var p={personal:O,bgImg:Q,songEfficacy:$,songContainer:J,title:X,btnGroup:Y,pTitle:Z,practice:ee,personalSong:ae,musicGrid:te,tennatCellGroup:se,tenantLogo:le,tenantCoverImg:oe,tenantContent:ne},re=b({name:"Practice",emits:["favorite"],setup(f,{expose:o,emit:c}){const r=_(),u=s(0),a=s(!1),l=s({}),{isLoading:n,state:i,execute:t}=k(v=>y.get("/music/sheet/practice",{prefix:h.platformType==="TEACHER"?"/api-teacher":"/api-student",params:{rows:(v==null?void 0:v.rows)||3}}),null),g=async()=>{try{await y.get("/music/sheet/practice/del/"+l.value.id,{prefix:h.platformType==="TEACHER"?"/api-teacher":"/api-student"}),t(),a.value=!1}catch{}};return o({reload:t}),()=>{var m;const v=((m=i.value)==null?void 0:m.data.rows)||[];return u.value===0&&(u.value=v.length),e(L,null,[u.value>0&&e(L,null,[e(w,{titleClass:p.pTitle,title:"\u6700\u8FD1\u7EC3\u4E60",border:!1},null),e("div",{class:p.practice},[e(G,{showTitleImg:!0,list:v,onDetail:d=>{if(d.play===1){l.value=d,a.value=!0;return}const I=location.origin+location.pathname+"#/music-detail?id="+d.id;A(I,()=>{r.push({path:"/music-detail",query:{id:d.id}})})}},null)])]),e(R,{show:a.value,class:p.songEfficacy,round:!0,onClose:()=>a.value=!1},{default:()=>[e("div",{class:p.songContainer},[e("div",{class:p.title},[x("\u8BE5\u66F2\u76EE\u5DF2\u5931\u6548")]),e("img",{src:D},null),e("div",{class:p.btnGroup},[e(F,{round:!0,onClick:g},{default:()=>[x("\u6211\u77E5\u9053\u4E86")]})])])]})])}}}),ue=b({name:"MusicList",emits:["favorite"],props:{gift:{type:Number,default:0}},setup(f,{expose:o,emit:c}){const r=S(),u=_(),a=T({search:r.query.search||"",musicTagIds:r.query.tagids||"",gift:f.gift,page:1}),l=s(null),n=s([]),i=s(!1),t=s(!1),g=s(!1),v=async()=>{if(!i.value){i.value=!0,g.value=!1;try{const m=await y("/music/sheet/my",{method:h.platformType==="TEACHER"?"POST":"GET",prefix:h.platformType==="TEACHER"?"/api-teacher":"/api-student",params:a,data:h.platformType==="TEACHER"?a:{}});n.value=[...n.value,...m.data.rows],l.value=m.data,a.page=m.data.pageNo+1,t.value=m.data.pageNo>=m.data.totalPage}catch{g.value=!0}i.value=!1}};return N(()=>f.gift,m=>{g.value=!1,n.value=[],a.page=1,t.value=!1,a.gift=m,v()}),o({reset:()=>{g.value=!1,n.value=[],a.page=1,t.value=!1,v()},FetchList:v}),console.log("1111"),()=>e(L,null,[e(E,{loading:i.value,finished:t.value,"finished-text":n.value.length?"\u6CA1\u6709\u66F4\u591A\u4E86":"",onLoad:v,error:g.value},{default:()=>[n.value.length?e("div",{class:p.personalSong},[e(G,{showTitleImg:!0,list:n.value,onDetail:m=>{const d=location.origin+location.pathname+"#/music-detail?id="+m.id;A(d,()=>{u.push({path:"/music-detail",query:{id:m.id}})})}},null)]):!i.value&&e(C,{tips:"\u6682\u65E0\u5355\u66F2",classImgSize:"SMALL",btnStatus:!1},null)]})])}}),ie=b({name:"MusicList",emits:["favorite"],setup(f,{expose:o,emit:c}){const r=S(),u=_(),a=T({search:r.query.search||"",musicTagIds:r.query.tagids||"",page:1}),l=s([]),n=s(null),i=s(!1),t=s(!1),g=s(!1),v=async()=>{if(!i.value){i.value=!0,g.value=!1;try{const d=await y("/music/sheet/favorite",{prefix:h.platformType==="TEACHER"?"/api-teacher":"/api-student",params:a});l.value=[...l.value,...d.data.rows],n.value=d.data,a.page=d.data.pageNo+1,t.value=d.data.pageNo>=d.data.totalPage}catch{g.value=!0}i.value=!1}};return o({reset:()=>{g.value=!1,l.value=[],a.page=1,t.value=!1,v()},FetchList:v}),()=>e(E,{loading:i.value,finished:t.value,"finished-text":l.value.length?"\u6CA1\u6709\u66F4\u591A\u4E86":"",onLoad:v,error:g.value},{default:()=>[l.value.length?e("div",{class:p.personalSong},[e(G,{showTitleImg:!0,list:l.value,onDetail:d=>{const I=location.origin+location.pathname+"#/music-detail?id="+d.id;A(I,()=>{u.push({path:"/music-detail",query:{id:d.id}})})}},null)]):!i.value&&e(C,{tips:"\u6682\u65E0\u6536\u85CF\u5355\u66F2",classImgSize:"SMALL",btnStatus:!1},null)]})}}),ce=b({name:"MusicList",setup(){const f=S(),o=_(),c=T({search:f.query.search||"",musicTagIds:f.query.tagids||"",page:1}),r=s([]),u=s(null),a=s(!1),l=s(!1),n=s(!1),i=async()=>{if(!a.value){a.value=!0,n.value=!1;try{const t=await y("/music/album/favorite",{prefix:h.platformType==="TEACHER"?"/api-teacher":"/api-student",params:c});r.value=[...r.value,...t.data.rows],u.value=t.data,c.page=t.data.pageNo+1,l.value=t.data.pageNo>=t.data.totalPage}catch{n.value=!0}a.value=!1}};return()=>e(E,{loading:a.value,finished:l.value,"finished-text":r.value.length?"\u6CA1\u6709\u66F4\u591A\u4E86":"",onLoad:i,error:n.value},{default:()=>[r.value.length?e("div",{class:p.musicGrid},[e(M,{list:u.value.rows,onGoto:t=>{o.push({name:"music-album-detail",params:{id:t.id}})}},null)]):!a.value&&e(C,{tips:"\u6682\u65E0\u6536\u85CF\u4E13\u8F91",classImgSize:"SMALL",btnStatus:!1},null)]})}}),pe=b({name:"MusicList",props:{gift:{type:Number,default:0}},setup(f){S();const o=_(),c=T({page:1,gift:f.gift}),r=s([]),u=s(null),a=s(!1),l=s(!1),n=s(!1),i=async()=>{if(!a.value){a.value=!0,n.value=!1;try{const t=await y("/music/album/purchased",{prefix:h.platformType==="TEACHER"?"/api-teacher":"/api-student",params:c});r.value=[...r.value,...t.data.rows],u.value=t.data,c.page=t.data.pageNo+1,l.value=t.data.pageNo>=t.data.totalPage}catch{n.value=!0}a.value=!1}};return N(()=>f.gift,t=>{n.value=!1,r.value=[],c.page=1,l.value=!1,c.gift=t,i()}),()=>e(E,{loading:a.value,finished:l.value,"finished-text":r.value.length?"\u6CA1\u6709\u66F4\u591A\u4E86":"",onLoad:i,error:n.value},{default:()=>[r.value.length?e("div",{class:p.musicGrid},[e(M,{isHiddenTag:!0,list:u.value.rows,onGoto:t=>{o.push({name:"music-album-detail",params:{id:t.id}})}},null)]):!a.value&&e(C,{tips:"\u6682\u65E0\u4E13\u8F91",classImgSize:"SMALL",btnStatus:!1},null)]})}}),de=b({name:"tenant-album",setup(){const f=_(),o=T({page:1,rows:20}),c=s([]),r=s(null),u=s(!1),a=s(!1),l=s(!1),n=async()=>{if(!u.value){u.value=!0,l.value=!1;try{const t=await y.post("/userTenantAlbumRecord/page",{prefix:h.platformType==="TEACHER"?"/api-teacher":"/api-student",data:o});c.value=[...c.value,...t.data.rows],r.value=t.data,console.log(r.value),o.page=t.data.pageNo+1,a.value=t.data.pageNo>=t.data.totalPage}catch{l.value=!0}u.value=!1}},i=t=>{f.push({path:"/train-tool",query:{albumId:t.id,buy:"1"}})};return()=>e(E,{loading:u.value,finished:a.value,"finished-text":c.value.length?" ":"",onLoad:n,error:l.value},{default:()=>[c.value.length?c.value.map(t=>e(j,{class:p.tennatCellGroup,border:!1,onClick:()=>i(t)},{default:()=>[e(w,{isLink:!0,clickable:!1},{icon:()=>e("img",{src:t.tenantImg,class:p.tenantLogo},null),title:()=>e("div",{class:p.tenantName},[t.tenantName])}),e(w,null,{icon:()=>e(K,{src:t.coverImg,class:p.tenantCoverImg},null),title:()=>e("div",{class:p.tenantContent},[e("h2",null,[t.name]),e("p",null,[t.describe])])})]})):!u.value&&e(C,{tips:"\u6682\u65E0\u8BAD\u7EC3\u6559\u7A0B",classImgSize:"SMALL",btnStatus:!1},null)]})}}),Pe=b({name:"MusicPersonal",setup(){localStorage.setItem("behaviorId",V());const f=sessionStorage.getItem("music-personal-tab-value");sessionStorage.removeItem("music-personal-tab-value");const o=s(f||"train-course");sessionStorage.setItem("music-personal-tab-value",o.value);const c=s(),r=s(),u=s();return P(()=>{B("\u6211\u7684\u4E50\u8C31")}),()=>e("div",{class:p.personal},[e(U,{position:"top"},{default:()=>[e(W,{background:"transparent",isFixed:!1,border:!1,color:"#131415"},null)]}),e("img",{class:p.bgImg,src:z},null),e(re,{ref:u,onFavorite:()=>{var a,l,n,i;o.value==="personal"?(l=(a=c.value)==null?void 0:a.reset)==null||l.call(a):o.value==="collection"&&((i=(n=r.value)==null?void 0:n.reset)==null||i.call(n))}},null),e(q,{color:"var(--van-primary)",background:"transparent",lineWidth:20,shrink:!0,active:o.value,"onUpdate:active":a=>o.value=a,onChange:a=>{o.value=a,sessionStorage.setItem("music-personal-tab-value",a)}},{default:()=>[e(H,{title:"\u8BAD\u7EC3\u6559\u7A0B",name:"train-course"},null)]}),o.value==="train-course"&&e(de,null,null),(o.value==="personal"||o.value==="personal-gift")&&e(ue,{ref:c,gift:o.value==="personal-gift"?1:0,onFavorite:()=>{var a,l;(l=(a=u.value)==null?void 0:a.reload)==null||l.call(a)}},null),(o.value==="personal-album"||o.value==="album-gift")&&e(pe,{gift:o.value==="album-gift"?1:0},null),o.value==="collection"&&e(ie,{ref:r,onFavorite:()=>{var a,l;(l=(a=u.value)==null?void 0:a.reload)==null||l.call(a)}},null),o.value==="album"&&e(ce,null,null)])}});export{Pe as default};