baseIndex-48cf31dc.js 3.0 KB

1
  1. import{d as w,q as y,r as l,x as p,y as j,a as t,h as k,a0 as b,a5 as u,M as h}from"./index-4498bb4b.js";import{i as S,a as T,b as B}from"./api-355f5ac1.js";import{M}from"./index-b7e31309.js";import{q as C}from"./base-aba1ba3e.js";import{N as L}from"./Image-dbc1bd17.js";import"./index-87d73a1a.js";import"./index-e27a5f5e.js";import"./fade-in-scale-up.cssr-9c9eacde.js";const W="_container_j4689_1",q="_back_j4689_10",x="_centerSearch_j4689_25",D="_section_j4689_39",N="_directorySection_j4689_43",V="_directionc_j4689_50",A="_dirItem_j4689_63",E="_active_j4689_77",H="_content_j4689_83",P="_wrap_j4689_96",F="_emtpyWrap_j4689_102",G="_wrapfirstI_j4689_117",R="_wrapItem_j4689_120",z="_item_j4689_131",J="_name_j4689_162",K="_favoriteBtn_j4689_169",O="_containerImg_j4689_175",Q="_cover_j4689_201",U="_loaded_j4689_231",e={container:W,back:q,centerSearch:x,section:D,directorySection:N,directionc:V,dirItem:A,active:E,content:H,wrap:P,emtpyWrap:F,wrapfirstI:G,wrapItem:R,item:z,name:J,favoriteBtn:K,containerImg:O,cover:Q,loaded:U},sa=w({name:"baseIndex-list",setup(){y(),l(!1);const i=l([]),g=()=>{u({api:"goBack"})},c=p({musicTagId:null,keyword:null,page:1,rows:999}),v=l(!1),o=p({list:[],loading:!1,favoriteList:[],details:[],bookData:{},showBook:!1,book:{}}),I=async()=>{try{const{data:a}=await T();i.value=a||[],i.value.length>0&&(c.musicTagId=i.value[0].id)}catch(a){}},d=async()=>{var _,m;o.loading=!0;const{musicTagId:a,...n}=c,s=await B({musicTagIds:[a],subjectId:((_=h.user.data)==null?void 0:_.subjectId)||"",...n});(s==null?void 0:s.code)===200&&Array.isArray((m=s==null?void 0:s.data)==null?void 0:m.rows)&&(o.list=s.data.rows.map(r=>(r.load=!1,r.key=Date.now()+r.id,r))),o.loading=!1,v.value=!0};j(async()=>{await I(),await d()});const f=a=>{const n=C.stringify({musicTagId:c.musicTagId,id:a.id,name:a.name}),s=location.origin+location.pathname+"#/co-ai-detail?"+n;console.log("🚀 ~ url:",s),u({api:"openWebView",content:{url:s,orientation:0,isHideTitle:!1,c_orientation:0}})};return()=>t("div",{class:e.container},[t("div",{class:e.back,onClick:g},[t("img",{src:S},null)]),t("div",{class:e.centerSearch},[t("div",{id:"coai-0"},[t(M,{class:["searchNotice"],shape:"round",background:"transparent",clearable:!1,placeholder:"请输入关键字",onSearch:a=>{c.keyword=a,d()}},null)])]),t("div",{class:e.section},[t("div",{class:e.directorySection},[t("div",{class:e.directionc},[i.value.map(a=>t("p",{class:[e.dirItem,c.musicTagId==a.id?e.active:""],onClick:()=>{c.musicTagId=a.id,d()}},[a.name]))])]),t("div",{class:e.content},[t("div",{class:[e.wrap,o.list.length<=0&&!o.loading?e.emtpyWrap:""]},[o.list.map((a,n)=>t("div",{class:[e.wrapItem,o.bookData.id===a.id&&o.showBook?e.wrapItemHide:""],key:a.key,onClick:()=>f(a)},[t("div",{class:e.item},[t(L,k({"data-id":a.id},{id:n==0?"courseware-0":""},{class:[e.cover,a.load?e.loaded:""],objectFit:"cover",src:a.coverImg,onLoad:()=>{a.load=!0},onError:()=>{a.load=!0}}),null)]),t("div",{class:e.name},[a.name])])),o.list.length<=0&&!o.loading&&t(b,{image:"list",description:"暂无数据"},null)])])])])}});export{sa as default};