index.72c147b3.js 3.8 KB

1
  1. import{d as y,P as k,g as l,y as g,Q as S,j as a,F as _,A as d,N as b,S as I,U as p,be as E,C as N}from"./ResizeObserver.es.39b48a47.js";import{I as L}from"./index.fcbcb027.js";import{C}from"./index.db115763.js";import{c as V}from"./index.dc19bc54.js";import{c as j}from"./index.926ca9c5.js";import{a as T,S as h}from"./hooks.6df65925.js";import{I as D,a as R}from"./icon-xin-active.3d0e362e.js";import{L as F}from"./index.6c529ad4.js";import{S as x}from"./index.fbd2c321.js";import{g as P}from"./music.27f3de35.js";import"./use-tab-status.bcc0c503.js";import"./icon_uploader.21a85a4d.js";import"./icon-xin.797feb04.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";const U="_songbook_1omyu_1",$="_sticky_1omyu_11",H="_title_1omyu_14",q="_cellTitle_1omyu_20",X="_cellValue_1omyu_25",z="_albumContainer_1omyu_34",B="_album_1omyu_34",G="_albumType_1omyu_52",K="_main_1omyu_65",M="_favorite_1omyu_68",Q="_img_1omyu_82",W="_model_1omyu_101",J="_num_1omyu_116",O="_listContainer_1omyu_119";var t={songbook:U,sticky:$,title:H,cellTitle:q,cellValue:X,albumContainer:z,album:B,albumType:G,main:K,favorite:M,img:Q,model:W,num:J,listContainer:O},Y=y({name:"Songbook",setup(){k();const o={};l.version&&(o.version=l.version||"",o.platform=l.platformType==="STUDENT"?"ios-student":"ios-teacher");const n=l.platformType==="STUDENT"?"/api-student":"/api-teacher";o.myself=!1;const r=T(h.SEARCH);r&&(o.subjectIds=r.id);const{isLoading:v,state:e}=V(g.post(`${n}/music/album/list`,{data:{...o}}),null),u=S();return()=>a(_,null,[e.value&&e.value.data.rows.length?a(_,null,[a(C,{class:t.title,titleClass:t.cellTitle,title:"\u4E13\u8F91",to:"/music-album",border:!1},{value:()=>a("span",{class:t.cellValue},[d("\u66F4\u591A"),a(b,{name:"arrow"},null)])}),a("div",{class:t.albumContainer},[e.value.data.rows.map(s=>a("div",{class:t.album,key:s.id,onClick:()=>u.push("/music-album-detail/"+s.id)},[a("div",{class:t.main},[s.paymentType==="CHARGE"&&a("span",{class:t.albumType},[d("\u4ED8\u8D39")]),a(L,{class:t.img,src:s.albumCoverUrl},null),a("div",{class:t.model},[a(b,{name:s.favorite?D:R},null),a("span",{class:t.num},[s.albumFavoriteCount,d("\u4EBA")])])]),a("h4",{class:j(t.title,"van-ellipsis")},[s.albumName])]))])]):null])}}),Z=y({name:"Songbook",setup(){const o=S(),n={};l.version&&(n.version=l.version||"",n.platform=l.platformType==="STUDENT"?"ios-student":"ios-teacher");const r=T(h.SEARCH);r&&(n.subjectIds=r.id);const v=I({auditStatus:"PASS",myself:!1,page:1,...n}),e=p(null),u=p(!1),s=p(!1),f=p(!1),w=async()=>{var c;if(u.value)return;u.value=!0,f.value=!1;const m={...v};try{const i=await g.post(`${l.platformApi}/music/sheet/list`,{data:m});if(e.value){const A=(((c=e.value)==null?void 0:c.rows)||[]).concat(i.data.rows||[]);e.value.rows=A}e.value=e.value||i.data,v.page=i.data.pageNo+1,s.value=i.data.pageNo>=i.data.totalPage}catch{f.value=!0}u.value=!1};return()=>a(_,null,[e.value&&e.value.rows.length>0&&a(C,{class:t.title,titleClass:t.cellTitle,title:"\u66F2\u8C31",to:"/music-list",border:!1},{value:()=>a("span",{class:t.cellValue},[d("\u66F4\u591A"),a(b,{name:"arrow"},null)])}),a(F,{loading:u.value,finished:s.value,"finished-text":e.value&&e.value.rows.length?"\u6CA1\u6709\u66F4\u591A\u4E86":"",onLoad:w,error:f.value},{default:()=>[e.value&&e.value.rows.length?a("div",{class:t.listContainer},[a(x,{list:e.value.rows,onDetail:m=>{const c=location.origin+location.pathname+"#/music-detail?id="+m.id;E(c,()=>{o.push({path:"/music-detail",query:{id:m.id}})})}},null)]):!u.value&&a(N,{tips:"\u6682\u65E0\u66F2\u76EE",classImgSize:"SMALL",btnStatus:!1},null)]})])}}),ya=y({name:"Songbook",setup(){return localStorage.setItem("behaviorId",P()),()=>a("div",{class:t.songbook},[a(Y,null,null),a(Z,null,null)])}});export{ya as default};