Files
hedena_gold/apps/user-app/dist/assets/NewestView-D3768UEK.js
T
s.esmaeiliandCursor 7bbdc6cbda Commit release build artifacts for admin, user-app, and API.
Refresh hashed frontend bundles and the API release bundle after build:release.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-16 00:05:48 +03:30

2 lines
2.6 KiB
JavaScript

import{P as x}from"./PageBar-B1e5h7eE.js";import{d as f,b as l,c as r,m as n,h as i,M as P,N as S,O as k,n as b,P as L,Q as _,J as v,g as h,i as d,R as B,S as C,T as E,D as p,F as N,r as $,s as A,G as F,_ as V}from"./index-DFI27khJ.js";import{S as D}from"./SectionHead-BJKEdlj5.js";import{P as I}from"./ProductCard-v1oNlUdc.js";import{u as T}from"./catalogStore-DO1Uwjz0.js";const G={class:"flex justify-center items-center empty"},H=f({__name:"EmptyState",props:{description:{},image:{}},setup(t){return(e,c)=>(l(),r("div",G,[n(i(P),{description:"موردی یافت نشد",image:t.image,class:"h-[200px] w-[200px] opacity-70"},null,8,["image"])]))}}),M="/assets/favoritEmpty-kbtPAdi5.svg",j=f({__name:"ScrollFetchSearch",props:{loading:{type:Boolean},flag:{type:Boolean},padding:{}},emits:["fetch"],setup(t,{emit:e}){const c=e,a=S(),s=d(null);return k(s,()=>{c("fetch")},{distance:50}),(o,u)=>(l(),r("main",{class:"flex flex-col flex-1 overflow-auto no-scrollbar w-[100vw] max-w-screen-md m-auto",style:b({paddingTop:t.padding||i(a).headerHeight+"px"}),ref_key:"scrollArea",ref:s},[L(o.$slots,"default"),n(_,{cls:"my-[10px]",spinning:t.loading,indicator:!0,tip:"درحال دریافت اطلاعات"},null,8,["spinning"]),t.flag?(l(),v(H,{key:0,image:i(M)},null,8,["image"])):h("",!0)],4))}});function z(){const t=T(),e=B({totalPages:0,productList:t.products,flag:!1});return C(()=>t.products,a=>{e.productList=a,e.flag=a.length<1}),{productsData:e,getProducts:async(a,s=!1,o=!1)=>{if(!s){a.value=o||!t.loaded;try{e.productList=await t.load(o),e.flag=e.productList.length<1}catch(u){console.log(u)}finally{a.value=!1}}}}}const J={class:"newest"},O={key:0,class:"newest__grid"},g=20,Q=f({__name:"NewestView",setup(t){const{productsData:e,getProducts:c}=z(),a=d(!1),s=d(!1),o=d(g),u=A(()=>e.productList.slice(0,o.value));E(async()=>{await c(a,!1)});const y=async()=>{if(o.value<e.productList.length){o.value+=g;return}s.value||await c(s,!1,!0)};return(R,Z)=>{const w=F("container");return l(),r("div",J,[n(x,{title:"جدیدترین محصولات","back-to":"home"}),n(_,{spinning:a.value,tip:"درحال دریافت اطلاعات"},{default:p(()=>[n(j,{class:"newest__scroll",loading:s.value,flag:i(e).flag,padding:"0px",onFetch:y},{default:p(()=>[n(w,{class:"newest__body"},{default:p(()=>[n(D,{title:"تازه‌ها",subtitle:"آخرین افزوده‌های مجموعه"}),i(e).productList.length?(l(),r("div",O,[(l(!0),r(N,null,$(u.value,m=>(l(),v(I,{key:m.id,value:m},null,8,["value"]))),128))])):h("",!0)]),_:1})]),_:1},8,["loading","flag"])]),_:1},8,["spinning"])])}}}),Y=V(Q,[["__scopeId","data-v-1566f322"]]);export{Y as default};