Files
appco_dist/.output/public/_nuxt/iVqVBBR5.js
T
2026-01-27 16:02:45 +03:30

2 lines
2.8 KiB
JavaScript

import{d as S,u as $,r as l,k as A,G as R,a3 as T,a4 as V,$ as F,ai as G,y as o,z as s,A as t,C as I,J as i,R as _,a5 as k,F as B,a0 as b,a1 as M,a6 as q,ae as E}from"./Cbt2tPBc.js";import{S as J}from"./DIW3nMve.js";import{_ as L}from"./Ctsa2335.js";import{g as O}from"./SolGyfyY.js";import{l as C}from"./DkLizs-G.js";import{u as H}from"./CBJoCjDV.js";import"./Bbd_Ti14.js";import"./BgR2E6gQ.js";import"./pFOmwm6m.js";const K={class:"absolute top-0 w-inherit right-0 left-0"},Q={class:"flex justify-between w-full p-4"},U={class:"h-90vh overflow-y-auto pb-5vh"},W={key:0,class:"w-full grid grid-cols-3 gap-2px"},X=["onClick"],Y=["alt"],Z={key:1,class:"relative w-full h-full"},ee=["src"],te=["src","alt"],se=S({__name:"index",async setup(N){let n,m;const y=$(),c=l([]),r=l(!1),P=l({}),j=A(()=>v.sellerConfig?.store),v=R(),p=l(!1),h=l(0),z=l(15),g=l(0),w=l();T(w,async([{isIntersecting:d}])=>{if(d&&!r.value&&!p.value){r.value=!0;const e=h.value+1;setTimeout(async()=>{const u=await x(e);u.rows?.length&&(c.value.push(...u.rows),h.value=e)},100),c.value?.length>=g.value&&(p.value=!0),r.value=!1}},{threshold:.2,rootMargin:"0px 0px 200px 0px"});const x=async(d=1)=>{try{const e=j.value?.user_id;return await E(),await O(e,{page:d,limit:z.value,filters:[]})}catch(e){return console.error(e),{data:[],count:0}}finally{r.value=!1}},{data:f}=([n,m]=V(()=>H("explore",async()=>x(1))),n=await n,m(),n);return F(f,()=>{f.value&&(c.value=f.value.rows,g.value=f.value.count,h.value=1,c.value?.length>=g.value&&(p.value=!0))}),(d,e)=>{const u=G("lazy");return s(),o("div",null,[t("div",K,[t("div",Q,[I(J,{class:"w-full mt-2",onClick:e[0]||(e[0]=a=>i(y).push({name:"search-main"}))})]),t("div",U,[r.value?_("",!0):(s(),o("div",W,[(s(!0),o(b,null,M(c.value,(a,D)=>(s(),o("div",{key:D,class:"w-full aspect-square relative",onClick:ae=>i(y).push({name:"product_detail-id",params:{id:a.id}})},[a.files?.length?(s(),o(b,{key:0},[a.files[0].type==="image"?k((s(),o("img",{key:0,class:"w-full h-full object-cover",alt:i(v).appName.en},null,8,Y)),[[u,{src:i(v).useDataStorage(a.files[0].url),loading:i(C),error:i(C)}]]):a.files[0].type==="video"?(s(),o("div",Z,[t("video",{ref_for:!0,ref:"videoRefs",src:a.files[0].url,class:"hidden"},null,8,ee),t("img",{src:P.value[a.files[0].url],class:"w-full h-full object-cover",alt:i(v).appName.en},null,8,te),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))])):_("",!0)],64)):_("",!0)],8,X))),128))])),k(t("div",{ref_key:"observer",ref:w,class:"w-full opacity-0 relative"}," load ",512),[[q,!r.value]]),r.value?(s(),B(L,{key:1})):_("",!0)])])])}}}),de=S({__name:"index",setup(N){return(n,m)=>(s(),B(se))}});export{de as default};