index.cb8b5c7c.js 8.9 KB

1
  1. import{d as b,P as y,S as s,w as T,g as h,j as e,F as N,be as E,O as _,Q as L,a2 as x,C as S,U as R}from"./index.394decd7.js";import"./index.3bbf4ddb.js";import"./index.f1b52763.js";import{T as q,a as C}from"./index.ae00317c.js";import{c as F}from"./index.75a0444f.js";import{C as w}from"./index.9e0d46e4.js";import{S as A}from"./index.06b816c0.js";import{L as I}from"./index.dc786267.js";import{M as G}from"./index.9edf267d.js";import{b as P}from"./bg-image-1.694980ec.js";import{g as H}from"./music.a1b63125.js";import{u as k}from"./hooks.9e5ee122.js";import{T as z}from"./index.88270f6d.js";import{C as D}from"./index.e6e212d8.js";import{C as V}from"./index.9462d7c5.js";import{I as O}from"./index.ae2dd816.js";import"./use-id.e2f22365.js";import"./use-tab-status.723110ee.js";import"./use-refs.09b2d19c.js";import"./index.b9aedd1d.js";import"./icon-xin2.4ab2a52d.js";import"./index.9849c993.js";const U="_personal_60b5o_1",W="_bgImg_60b5o_43",j="_pTitle_60b5o_50",K="_practice_60b5o_55",Q="_personalSong_60b5o_56",$="_musicGrid_60b5o_65",B="_tennatCellGroup_60b5o_68",J="_tenantLogo_60b5o_80",X="_tenantCoverImg_60b5o_86",Y="_tenantContent_60b5o_93";var d={personal:U,bgImg:W,pTitle:j,practice:K,personalSong:Q,musicGrid:$,tennatCellGroup:B,tenantLogo:J,tenantCoverImg:X,tenantContent:Y},Z=b({name:"Practice",emits:["favorite"],setup(p,{expose:o,emit:c}){const u=y(),i=s(0),{isLoading:t,state:l,execute:r}=F(n=>T.get("/music/sheet/practice",{prefix:h.platformType==="TEACHER"?"/api-teacher":"/api-student",params:{rows:(n==null?void 0:n.rows)||3}}),null);return o({reload:r}),()=>{var a;const n=((a=l.value)==null?void 0:a.data.rows)||[];return i.value===0&&(i.value=n.length),e(N,null,[i.value>0&&e(N,null,[e(w,{titleClass:d.pTitle,title:"\u6700\u8FD1\u7EC3\u4E60",border:!1},null),e("div",{class:d.practice},[e(A,{showTitleImg:!0,list:n,onDetail:v=>{const g=location.origin+location.pathname+"#/music-detail?id="+v.id;E(g,()=>{u.push({path:"/music-detail",query:{id:v.id}})})}},null)])])])}}}),ee=b({name:"MusicList",emits:["favorite"],props:{gift:{type:Number,default:0}},setup(p,{expose:o,emit:c}){const u=_(),i=y(),t=L({search:u.query.search||"",musicTagIds:u.query.tagids||"",gift:p.gift,page:1}),l=s(null),r=s([]),n=s(!1),a=s(!1),v=s(!1),g=async()=>{if(!n.value){n.value=!0,v.value=!1;try{const m=await T("/music/sheet/my",{method:h.platformType==="TEACHER"?"POST":"GET",prefix:h.platformType==="TEACHER"?"/api-teacher":"/api-student",params:t,data:h.platformType==="TEACHER"?t:{}});r.value=[...r.value,...m.data.rows],l.value=m.data,t.page=m.data.pageNo+1,a.value=m.data.pageNo>=m.data.totalPage}catch{v.value=!0}n.value=!1}};return x(()=>p.gift,m=>{v.value=!1,r.value=[],t.page=1,a.value=!1,t.gift=m,g()}),o({reset:()=>{v.value=!1,r.value=[],t.page=1,a.value=!1,g()},FetchList:g}),()=>e(I,{loading:n.value,finished:a.value,"finished-text":r.value.length?"\u6CA1\u6709\u66F4\u591A\u4E86":"",onLoad:g,error:v.value},{default:()=>[r.value.length?e("div",{class:d.personalSong},[e(A,{showTitleImg:!0,list:r.value,onDetail:m=>{const f=location.origin+location.pathname+"#/music-detail?id="+m.id;E(f,()=>{i.push({path:"/music-detail",query:{id:m.id}})})}},null)]):!n.value&&e(S,{tips:"\u6682\u65E0\u5355\u66F2",classImgSize:"SMALL",btnStatus:!1},null)]})}}),ae=b({name:"MusicList",emits:["favorite"],setup(p,{expose:o,emit:c}){const u=_(),i=y(),t=L({search:u.query.search||"",musicTagIds:u.query.tagids||"",page:1}),l=s([]),r=s(null),n=s(!1),a=s(!1),v=s(!1),g=async()=>{if(!n.value){n.value=!0,v.value=!1;try{const f=await T("/music/sheet/favorite",{prefix:h.platformType==="TEACHER"?"/api-teacher":"/api-student",params:t});l.value=[...l.value,...f.data.rows],r.value=f.data,t.page=f.data.pageNo+1,a.value=f.data.pageNo>=f.data.totalPage}catch{v.value=!0}n.value=!1}};return o({reset:()=>{v.value=!1,l.value=[],t.page=1,a.value=!1,g()},FetchList:g}),()=>e(I,{loading:n.value,finished:a.value,"finished-text":l.value.length?"\u6CA1\u6709\u66F4\u591A\u4E86":"",onLoad:g,error:v.value},{default:()=>[l.value.length?e("div",{class:d.personalSong},[e(A,{showTitleImg:!0,list:l.value,onDetail:f=>{const M=location.origin+location.pathname+"#/music-detail?id="+f.id;E(M,()=>{i.push({path:"/music-detail",query:{id:f.id}})})}},null)]):!n.value&&e(S,{tips:"\u6682\u65E0\u6536\u85CF\u5355\u66F2",classImgSize:"SMALL",btnStatus:!1},null)]})}}),te=b({name:"MusicList",setup(){const p=_(),o=y(),c=L({search:p.query.search||"",musicTagIds:p.query.tagids||"",page:1}),u=s([]),i=s(null),t=s(!1),l=s(!1),r=s(!1),n=async()=>{if(!t.value){t.value=!0,r.value=!1;try{const a=await T("/music/album/favorite",{prefix:h.platformType==="TEACHER"?"/api-teacher":"/api-student",params:c});u.value=[...u.value,...a.data.rows],i.value=a.data,c.page=a.data.pageNo+1,l.value=a.data.pageNo>=a.data.totalPage}catch{r.value=!0}t.value=!1}};return()=>e(I,{loading:t.value,finished:l.value,"finished-text":u.value.length?"\u6CA1\u6709\u66F4\u591A\u4E86":"",onLoad:n,error:r.value},{default:()=>[u.value.length?e("div",{class:d.musicGrid},[e(G,{list:i.value.rows,onGoto:a=>{o.push({name:"music-album-detail",params:{id:a.id}})}},null)]):!t.value&&e(S,{tips:"\u6682\u65E0\u6536\u85CF\u4E13\u8F91",classImgSize:"SMALL",btnStatus:!1},null)]})}}),le=b({name:"MusicList",props:{gift:{type:Number,default:0}},setup(p){_();const o=y(),c=L({page:1,gift:p.gift}),u=s([]),i=s(null),t=s(!1),l=s(!1),r=s(!1),n=async()=>{if(!t.value){t.value=!0,r.value=!1;try{const a=await T("/music/album/purchased",{prefix:h.platformType==="TEACHER"?"/api-teacher":"/api-student",params:c});u.value=[...u.value,...a.data.rows],i.value=a.data,c.page=a.data.pageNo+1,l.value=a.data.pageNo>=a.data.totalPage}catch{r.value=!0}t.value=!1}};return x(()=>p.gift,a=>{r.value=!1,u.value=[],c.page=1,l.value=!1,c.gift=a,n()}),()=>e(I,{loading:t.value,finished:l.value,"finished-text":u.value.length?"\u6CA1\u6709\u66F4\u591A\u4E86":"",onLoad:n,error:r.value},{default:()=>[u.value.length?e("div",{class:d.musicGrid},[e(G,{isHiddenTag:!0,list:i.value.rows,onGoto:a=>{o.push({name:"music-album-detail",params:{id:a.id}})}},null)]):!t.value&&e(S,{tips:"\u6682\u65E0\u4E13\u8F91",classImgSize:"SMALL",btnStatus:!1},null)]})}}),se=b({name:"tenant-album",setup(){const p=y(),o=L({page:1,rows:20}),c=s([]),u=s(null),i=s(!1),t=s(!1),l=s(!1),r=async()=>{if(!i.value){i.value=!0,l.value=!1;try{const a=await T.post("/userTenantAlbumRecord/page",{prefix:h.platformType==="TEACHER"?"/api-teacher":"/api-student",data:o});c.value=[...c.value,...a.data.rows],u.value=a.data,console.log(u.value),o.page=a.data.pageNo+1,t.value=a.data.pageNo>=a.data.totalPage}catch{l.value=!0}i.value=!1}},n=a=>{p.push({path:"/train-tool",query:{albumId:a.id,buy:"1"}})};return()=>e(I,{loading:i.value,finished:t.value,"finished-text":c.value.length?" ":"",onLoad:r,error:l.value},{default:()=>[c.value.length?c.value.map(a=>e(V,{class:d.tennatCellGroup,border:!1,onClick:()=>n(a)},{default:()=>[e(w,{isLink:!0,clickable:!1},{icon:()=>e("img",{src:a.tenantImg,class:d.tenantLogo},null),title:()=>e("div",{class:d.tenantName},[a.tenantName])}),e(w,null,{icon:()=>e(O,{src:a.coverImg,class:d.tenantCoverImg},null),title:()=>e("div",{class:d.tenantContent},[e("h2",null,[a.name]),e("p",{class:"van-multi-ellipsis--l2"},[a.describe])])})]})):!i.value&&e(S,{tips:"\u6682\u65E0\u8BAD\u7EC3\u6559\u7A0B",classImgSize:"SMALL",btnStatus:!1},null)]})}}),Ee=b({name:"MusicPersonal",setup(){localStorage.setItem("behaviorId",H());const p=sessionStorage.getItem("music-personal-tab-value");sessionStorage.removeItem("music-personal-tab-value");const o=s(p||"train-course");sessionStorage.setItem("music-personal-tab-value",o.value);const c=s(),u=s(),i=s();return R(()=>{k("\u6211\u7684\u4E50\u8C31")}),()=>e("div",{class:d.personal},[e(z,{position:"top"},{default:()=>[e(D,{background:"transparent",isFixed:!1,border:!1,color:"#131415"},null)]}),e("img",{class:d.bgImg,src:P},null),e(Z,{ref:i,onFavorite:()=>{var t,l,r,n;o.value==="personal"?(l=(t=c.value)==null?void 0:t.reset)==null||l.call(t):o.value==="collection"&&((n=(r=u.value)==null?void 0:r.reset)==null||n.call(r))}},null),e(q,{color:"var(--van-primary)",background:"transparent",lineWidth:20,shrink:!0,active:o.value,"onUpdate:active":t=>o.value=t,onChange:t=>{o.value=t,sessionStorage.setItem("music-personal-tab-value",t)}},{default:()=>[e(C,{title:"\u8BAD\u7EC3\u6559\u7A0B",name:"train-course"},null),e(C,{title:"\u6211\u7684\u5355\u66F2",name:"personal"},null),e(C,{title:"\u6211\u7684\u4E13\u8F91",name:"personal-album"},null),e(C,{title:"\u6536\u85CF\u5355\u66F2",name:"collection"},null),e(C,{title:"\u6536\u85CF\u4E13\u8F91",name:"album"},null)]}),o.value==="train-course"&&e(se,null,null),(o.value==="personal"||o.value==="personal-gift")&&e(ee,{ref:c,gift:o.value==="personal-gift"?1:0,onFavorite:()=>{var t,l;(l=(t=i.value)==null?void 0:t.reload)==null||l.call(t)}},null),(o.value==="personal-album"||o.value==="album-gift")&&e(le,{gift:o.value==="album-gift"?1:0},null),o.value==="collection"&&e(ae,{ref:u,onFavorite:()=>{var t,l;(l=(t=i.value)==null?void 0:t.reload)==null||l.call(t)}},null),o.value==="album"&&e(te,null,null)])}});export{Ee as default};