baseIndex-353af80a.js 3.0 KB

1
  1. import{d as I,q as y,r as l,x as p,y as k,a as e,h as b,a0 as h,a5 as u,M as S}from"./index-d09fbffb.js";import{i as T,a as B,b as M}from"./api-609d60f5.js";import{M as C}from"./index-b4d0c8cc.js";import{q as L}from"./base-aba1ba3e.js";import{N as W}from"./Image-0ac729b7.js";import"./index-cc78c517.js";import"./index-14fc28c2.js";import"./fade-in-scale-up.cssr-1dbb36e0.js";const q="_container_1dwaf_1",x="_back_1dwaf_10",D="_centerSearch_1dwaf_25",N="_section_1dwaf_39",j="_directorySection_1dwaf_43",V="_directionc_1dwaf_50",A="_dirItem_1dwaf_63",E="_active_1dwaf_77",H="_content_1dwaf_83",P="_wrap_1dwaf_97",F="_emtpyWrap_1dwaf_104",G="_wrapItem_1dwaf_119",R="_item_1dwaf_130",z="_name_1dwaf_161",J="_favoriteBtn_1dwaf_168",K="_containerImg_1dwaf_174",O="_cover_1dwaf_200",Q="_loaded_1dwaf_230",t={container:q,back:x,centerSearch:D,section:N,directorySection:j,directionc:V,dirItem:A,active:E,content:H,wrap:P,emtpyWrap:F,wrapItem:G,item:R,name:z,favoriteBtn:J,containerImg:K,cover:O,loaded:Q},oa=I({name:"baseIndex-list",setup(){y(),l(!1);const i=l([]),f=()=>{u({api:"goBack"})},c=p({musicTagId:null,keyword:null,page:1,rows:999}),w=l(!1),o=p({list:[],loading:!1,favoriteList:[],details:[],bookData:{},showBook:!1,book:{}}),g=async()=>{try{const{data:a}=await B();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 M({musicTagIds:[a],subjectId:((_=S.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,w.value=!0};k(async()=>{await g(),await d()});const v=a=>{const n=L.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()=>e("div",{class:t.container},[e("div",{class:t.back,onClick:f},[e("img",{src:T},null)]),e("div",{class:t.centerSearch},[e("div",{id:"coai-0"},[e(C,{class:["searchNotice"],shape:"round",background:"transparent",clearable:!1,placeholder:"请输入关键字",onSearch:a=>{c.keyword=a,d()}},null)])]),e("div",{class:t.section},[e("div",{class:t.directorySection},[e("div",{class:t.directionc},[i.value.map(a=>e("p",{class:[t.dirItem,c.musicTagId==a.id?t.active:""],onClick:()=>{c.musicTagId=a.id,d()}},[a.name]))])]),e("div",{class:t.content},[e("div",{class:[t.wrap,o.list.length<=0&&!o.loading?t.emtpyWrap:""]},[o.list.map((a,n)=>e("div",{class:[t.wrapItem,o.bookData.id===a.id&&o.showBook?t.wrapItemHide:""],key:a.key,onClick:()=>v(a)},[e("div",{class:t.item},[e(W,b({"data-id":a.id},{id:n==0?"courseware-0":""},{class:[t.cover,a.load?t.loaded:""],objectFit:"cover",src:a.coverImg,onLoad:()=>{a.load=!0},onError:()=>{a.load=!0}}),null)]),e("div",{class:t.name},[a.name])])),o.list.length<=0&&!o.loading&&e(h,{image:"list",description:"暂无数据"},null)])])])])}});export{oa as default};