index.f06ccee0.js 3.8 KB

1
  1. import{d as C,Q as T,U as s,j as a,be as A,aS as F,A as b,B as I,F as w,y as h,g as y,V as x}from"./ResizeObserver.es.39b48a47.js";import"./index.608320e9.js";import"./index.0e35d2fb.js";import{T as P,a as n}from"./index.5d4d28cc.js";import{c as V}from"./index.dc19bc54.js";import{C as k}from"./index.db115763.js";import{s as R}from"./song-empty.5c514691.js";import{s as u,P as B,A as D,C as H,a as M}from"./album-my.5bf98850.js";import{S as N}from"./index.fbd2c321.js";import{g as q}from"./music.27f3de35.js";import{u as U}from"./hooks.6df65925.js";import{C as W}from"./index.970ad07b.js";import"./use-id.b004ff17.js";import"./use-tab-status.bcc0c503.js";import"./use-refs.07204da6.js";import"./index.6c529ad4.js";import"./index.25ff6681.js";import"./index.5416c7b0.js";import"./index.fcbcb027.js";import"./icon-xin.797feb04.js";import"./icon_uploader.21a85a4d.js";import"./icon_album.4957b8e0.js";import"./icon_album_active.cb923735.js";import"./icon_exquisite.01ddc5aa.js";import"./icon_music_active.f55820b3.js";import"./icon-play.bc9e7aab.js";var j=C({name:"Practice",emits:["favorite"],setup(f,{expose:t,emit:v}){const m=T(),o=s(0),e=s(!1),l=s({}),{isLoading:i,state:p,execute:d}=V(r=>h.get("/music/sheet/practice",{prefix:y.platformType==="TEACHER"?"/api-teacher":"/api-student",params:{rows:(r==null?void 0:r.rows)||3}}),null),E=async()=>{try{await h.get("/music/sheet/practice/del/"+l.value.id,{prefix:y.platformType==="TEACHER"?"/api-teacher":"/api-student"}),d(),e.value=!1}catch{}};return t({reload:d}),()=>{var g;const r=((g=p.value)==null?void 0:g.data.rows)||[];return o.value===0&&(o.value=r.length),a(w,null,[o.value>0&&a(k,{title:"\u6700\u8FD1\u7EC3\u4E60",border:!1},null),a("div",{class:u.practice},[a(N,{list:r,onDetail:c=>{if(c.play===1){l.value=c,e.value=!0;return}const S=location.origin+location.pathname+"#/music-detail?id="+c.id;A(S,()=>{m.push({path:"/music-detail",query:{id:c.id}})})}},null)]),a(F,{show:e.value,class:u.songEfficacy,round:!0,onClose:()=>e.value=!1},{default:()=>[a("div",{class:u.songContainer},[a("div",{class:u.title},[b("\u8BE5\u66F2\u76EE\u5DF2\u5931\u6548")]),a("img",{src:R},null),a("div",{class:u.btnGroup},[a(I,{round:!0,onClick:E},{default:()=>[b("\u6211\u77E5\u9053\u4E86")]})])])]})])}}}),fe=C({name:"MusicPersonal",setup(){localStorage.setItem("behaviorId",q());const f=sessionStorage.getItem("music-personal-tab-value");sessionStorage.removeItem("music-personal-tab-value");const t=s(f||"personal");sessionStorage.setItem("music-personal-tab-value",t.value);const v=s(),m=s(),o=s();return x(()=>{U("\u6211\u7684\u4E50\u8C31")}),()=>a("div",{class:u.personal},[a(W,null,null),a(j,{ref:o,onFavorite:()=>{var e,l,i,p;t.value==="personal"?(l=(e=v.value)==null?void 0:e.reset)==null||l.call(e):t.value==="collection"&&((p=(i=m.value)==null?void 0:i.reset)==null||p.call(i))}},null),a(P,{color:"var(--van-primary)",background:"transparent",lineWidth:20,shrink:!0,active:t.value,"onUpdate:active":e=>t.value=e,onChange:e=>{t.value=e,sessionStorage.setItem("music-personal-tab-value",e)}},{default:()=>[a(n,{title:"\u6211\u7684\u5355\u66F2",name:"personal"},null),a(n,{title:"\u6211\u7684\u4E13\u8F91",name:"personal-album"},null),a(n,{title:"\u6536\u85CF\u5355\u66F2",name:"collection"},null),a(n,{title:"\u6536\u85CF\u4E13\u8F91",name:"album"},null),a(n,{title:"\u8D60\u9001\u5355\u66F2",name:"personal-gift"},null),a(n,{title:"\u8D60\u9001\u4E13\u8F91",name:"album-gift"},null)]}),(t.value==="personal"||t.value==="personal-gift")&&a(B,{ref:v,gift:t.value==="personal-gift"?1:0,onFavorite:()=>{var e,l;(l=(e=o.value)==null?void 0:e.reload)==null||l.call(e)}},null),(t.value==="personal-album"||t.value==="album-gift")&&a(D,{gift:t.value==="album-gift"?1:0},null),t.value==="collection"&&a(H,{ref:m,onFavorite:()=>{var e,l;(l=(e=o.value)==null?void 0:e.reload)==null||l.call(e)}},null),t.value==="album"&&a(M,null,null)])}});export{fe as default};