index.395fb153.js 1.1 KB

1
  1. import{T as p}from"./index.87de90a8.js";import{T as m,r as d}from"./request.a45d1be5.js";import{d as h,r as a,o as f,c as s,_ as w,a as _}from"./index.3718c0a8.js";import{S,a as y}from"./index.7077e759.js";import{c as M}from"./utils.e748d7c8.js";const v="_hotMusic_olatt_1",b="_title_olatt_4",I="_swipeItem_olatt_7",i={hotMusic:v,title:b,swipeItem:I};function g(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!w(e)}const N=h({name:"HotMusic",setup(){const e=_(),c=a([]),l=async()=>{try{const{data:t}=await d.post("/api-website/open/music/sheet/list",{data:{albumStatus:"PASS",page:1,rows:12,state:1}});t&&Array.isArray(t.rows)&&(c.value=M(t.rows,4))}catch{}};f(()=>{l(),n()});const r=a(312),o=a(!1),n=()=>{o.value=!1;const t=document.body.clientWidth>750?750:document.body.clientWidth;r.value=t-63,o.value=!0};return()=>{let t;return s("div",{class:i.hotMusic},[s(m,{class:i.title,title:"\u70ED\u95E8\u66F2\u76EE",onMore:()=>e.push("/search")},null),o.value&&s(S,{showIndicators:!1,loop:!1,width:r.value},g(t=c.value.map(u=>s(y,{class:i.swipeItem},{default:()=>[s(p,{list:u},null)]})))?t:{default:()=>[t]})])}}});export{N as H};