import{r as e,o as a,n as l,c as t,b as s,d as o,e as u,f as r,w as n,g as i,h as c,i as d,F as p,k as f,p as h,v as g,A as v,B as _}from"./index-DVkgSHpn.js";import{_ as m}from"./el-navbar.DVIyjZEN.js";import{_ as y}from"./el-refresh.CkIPFmzm.js";import{_ as w,a as b}from"./el-layout._U-vZTft.js";import"./el-empty.CMLN1lgh.js";import"./el-loading-icon.Bh3RKCou.js";const j=w({__name:"index",setup(w){const j=e(),k=e(0);a((()=>{l((()=>{$()}))}));const x=e([]),$=async()=>{var e;null==(e=j.value)||e.resetPage()},P=t((()=>{const{windowHeight:e}=f();return e-k.value})),H=()=>{$()},T=e=>{j.value.isMore()&&(j.value.loadingPage(),setTimeout((()=>{uni.$http.get("ucenter.collect/index",{page:e.page}).then((a=>{1==a.code?(1==e.page&&(x.value=[]),j.value.setData(a.data.total,a.data.list.length),x.value=x.value.concat(a.data.list)):-1==a.code&&(1==e.page&&a.data.list.length<=0&&(x.value=[]),j.value.emptyPage())}))}),100))};return(e,a)=>{const l=s(o("el-navbar"),m),t=_,f=h,w=s(o("el-refresh"),y),B=s(o("el-layout"),b);return u(),r(B,null,{default:n((()=>[i(l,{top:k.value,"onUpdate:top":a[0]||(a[0]=e=>k.value=e),placeholder:!0,fixed:!0,autoBack:!0,border:!0,title:"我的收藏"},null,8,["top"]),i(w,{ref_key:"refreshRef",ref:j,onRefresh:H,onScrolltolower:T,scrollHeight:P.value},{default:n((()=>[i(f,{class:"wrapper"},{default:n((()=>[i(f,{class:"goods-list"},{default:n((()=>[(u(!0),c(p,null,d(x.value,((e,a)=>(u(),r(f,{class:"goods-item",key:a},{default:n((()=>[i(f,{class:"thumb_image"},{default:n((()=>[i(t,{src:e.photo},null,8,["src"])])),_:2},1024),i(f,{class:"info"},{default:n((()=>[i(f,{class:"title"},{default:n((()=>[g(v(e.title),1)])),_:2},1024),i(f,{class:"bottom"},{default:n((()=>[i(f,null,{default:n((()=>[g("￥"+v(e.price),1)])),_:2},1024),i(f,{onClick:l=>((e,a)=>{uni.$layer.showModal("您确定要删除该内容吗？").then((()=>{uni.$http.post("ucenter.collect/delete",{id:e}).then((e=>{e.code?(x.value.splice(a,1),x.value.length<=0&&$(),uni.$layer.showToast("删除成功")):uni.$layer.showToast(e.msg)}))}))})(e.id,a)},{default:n((()=>[g("删除")])),_:2},1032,["onClick"])])),_:2},1024)])),_:2},1024)])),_:2},1024)))),128))])),_:1})])),_:1})])),_:1},8,["scrollHeight"])])),_:1})}}},[["__scopeId","data-v-93815c01"]]);export{j as default};
//# sourceMappingURL=pages-ucenter-collect-index.CZhyCQ5a.js.map
