Files
appco_dist/.output/public/_nuxt/By5EHrAq.js
T
2025-08-25 21:57:52 +03:30

2 lines
2.8 KiB
JavaScript

import{d as S,u as A,r as l,k as D,H as I,a6 as V,a7 as $,a2 as q,ak as F,y as o,z as s,A as t,C as M,I as v,T as d,a8 as k,F as C,a3 as x,a4 as R,a9 as E,af as G,al as H}from"./LXNkq-sH.js";import{S as L}from"./QmFj4iIw.js";import{S as O}from"./CJ3fNCGf.js";import{g as U}from"./Dd8_UWlZ.js";import{l as b}from"./0e7Ee5Nl.js";import{u as J}from"./B2DCzZuD.js";import"./WJ-soBQ4.js";import"./BgR2E6gQ.js";import"./CNG7y2yv.js";const K={class:"absolute top-0 w-inherit right-0 left-0"},Q={class:"flex justify-between w-full p-4"},W={class:"h-90vh overflow-y-auto pb-5vh"},X={key:0,class:"w-full grid grid-cols-3 gap-2px"},Y=["onClick"],Z=["alt"],ee={key:1,class:"relative w-full h-full"},te=["src"],se=["src","alt"],ae=S({__name:"index",async setup(P){let n,m;const g=A(),u=l([]),r=l(!1),B=l({}),j=D(()=>N.sellerConfig?.store),N=I(),p=l(!1),_=l(0),z=l(15),h=l(0),y=l();V(y,async([{isIntersecting:i}])=>{if(i&&!r.value&&!p.value){r.value=!0;const e=_.value+1;setTimeout(async()=>{const c=await w(e);c.rows?.length&&(u.value.push(...c.rows),_.value=e)},100),u.value?.length>=h.value&&(p.value=!0),r.value=!1}},{threshold:.2,rootMargin:"0px 0px 200px 0px"});const w=async(i=1)=>{try{const e=j.value?.user_id;return await G(),await U(e,{page:i,limit:z.value,filters:[]})}catch(e){return console.error(e),{data:[],count:0}}finally{r.value=!1}},{data:f}=([n,m]=$(()=>J("explore",async()=>w(1))),n=await n,m(),n);return q(f,()=>{f.value&&(u.value=f.value.rows,h.value=f.value.count,_.value=1,u.value?.length>=h.value&&(p.value=!0))}),(i,e)=>{const c=F("lazy");return s(),o("div",null,[t("div",K,[t("div",Q,[M(L,{class:"w-full mt-2",onClick:e[0]||(e[0]=a=>v(g).push({name:"search-main"}))})]),t("div",W,[r.value?d("",!0):(s(),o("div",X,[(s(!0),o(x,null,R(u.value,(a,T)=>(s(),o("div",{key:T,class:"w-full aspect-square relative",onClick:le=>v(g).push({name:"product_detail-id",params:{id:a.id}})},[a.files?.length?(s(),o(x,{key:0},[a.files[0].type==="image"?k((s(),o("img",{key:0,class:"w-full h-full object-cover",alt:i.reactiveProjectName},null,8,Z)),[[c,{src:v(H)(a.files[0].url),loading:v(b),error:v(b)}]]):a.files[0].type==="video"?(s(),o("div",ee,[t("video",{ref_for:!0,ref:"videoRefs",src:a.files[0].url,class:"hidden"},null,8,te),t("img",{src:B.value[a.files[0].url],class:"w-full h-full object-cover",alt:i.appName.en},null,8,se),e[1]||(e[1]=t("div",{class:"absolute inset-0 flex items-center justify-center bg-black bg-opacity-30"},[t("svg",{class:"w-12 h-12 text-white",fill:"currentColor",viewBox:"0 0 24 24"},[t("path",{d:"M8 5v14l11-7z"})])],-1))])):d("",!0)],64)):d("",!0)],8,Y))),128))])),k(t("div",{ref_key:"observer",ref:y,class:"w-full opacity-0 relative"}," load ",512),[[E,!r.value]]),r.value?(s(),C(O,{key:1})):d("",!0)])])])}}}),me=S({__name:"index",setup(P){return(n,m)=>(s(),C(ae))}});export{me as default};