Files
nademitex_user/dist/assets/HomeView-Dym5xycI.js
T

1 line
8.0 KiB
JavaScript
Raw Normal View History

2026-09-13 15:36:48 +03:30
import{$ as e,A as t,D as n,E as ee,F as te,I as r,J as i,K as a,L as o,M as s,N as c,R as l,St as u,Tt as d,X as f,_ as ne,j as p,k as m,n as h,pt as g,q as re,wt as _,xt as v}from"./BasicIcon-B6lR-mG3.js";import{o as ie}from"./format-BHJptHdF.js";import{S as y,c as ae,i as oe,l as se,o as ce,r as le,s as b,x}from"./index-DXso6ia7.js";import{t as ue}from"./IconChevronBack-BXRfc2bX.js";import{t as de}from"./IconDiamond-7-J5Q2Ma.js";import{t as S}from"./IconLayoutGrid-DgOvzvMf.js";import{t as fe}from"./PageSkeleton-BImjuI6S.js";import{n as pe,r as me,t as he}from"./crm-DbcoqKAF.js";import{t as ge}from"./useGoBack-yePcdjuj.js";import{t as _e}from"./IconHeart-DjMqqdO0.js";var C=[`width`,`height`],ve=l({__name:`IconMedal`,props:{size:{default:44}},setup(e){return(t,n)=>(i(),c(`svg`,{class:`icon-medal`,width:e.size,height:e.size,viewBox:`0 0 48 48`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`},[...n[0]||=[te(`<path d="M18 28.5L14 44l10-5 10 5-4-15.5" fill="#C0C7D1"></path><path d="M18 28.5L14 44l10-5V28.5H18Z" fill="#A8B0BC"></path><circle cx="24" cy="18" r="14" fill="#D8DEE6"></circle><circle cx="24" cy="18" r="11" fill="#F3F5F8" stroke="#B8C0CB" stroke-width="1.5"></circle><path d="M24 10.5l2.2 4.5 5 .7-3.6 3.5.9 5L24 21.8 19.5 24l.9-5-3.6-3.5 5-.7L24 10.5Z" fill="#8B95A5"></path>`,5)]],8,C))}}),w={class:`page home-page`},T={class:`home-header`},E={class:`home-header__user`},D={class:`home-header__hello`},O={class:`home-header__actions`},k={class:`page__scroll page__scroll--with-nav home-scroll`},A={key:0,class:`home-error`},j=[`aria-label`],M={class:`hero-banner__content`},N={class:`hero-banner__title`},P={key:0},F={key:0,class:`hero-banner__dots`,role:`tablist`,"aria-label":`بنرها`},ye=[`aria-label`,`aria-selected`,`onClick`],be={class:`quick-grid`,"aria-label":`دسترسی سریع`},xe=[`onClick`],Se={class:`quick-card__icon`,"aria-hidden":`true`},Ce={class:`quick-card__label`},we={class:`level-card`,"aria-label":`سطح عضویت`},Te={class:`level-card__top`},Ee={class:`level-card__identity`},De={class:`level-card__text`},Oe={class:`level-card__name`},ke={class:`level-card__next`},Ae={class:`level-card__progress`},I=[`aria-valuenow`],je={class:`level-card__points`},Me={class:`section`},Ne={class:`section__head`},Pe={class:`product-row`},Fe=[`onClick`],Ie={key:0,class:`product-card__badge`},Le={class:`product-card__body`},Re={class:`product-card__name`},ze={class:`product-card__sub`},Be=[`aria-label`,`aria-pressed`,`onClick`],L=h(l({__name:`HomeView`,setup(te){let l=ne(),{goBack:h}=ge(`/`),C=ae(),L=he(),R=se(),z=g(!0),B=g(null),V=g([]),H=g(null),U=g(null),Ve=[{id:`qa-club`,label:`باشگاه مشتریان`,to:`/profile`,icon:y},{id:`qa-cat`,label:`دسته بندی`,to:`/categories`,icon:S},{id:`qa-new`,label:`محصولات جدید`,to:`/products`,icon:de},{id:`qa-swatch`,label:`درخواست کالیته`,to:`/catalog-request`,icon:x}],He=[{id:`qa-customers`,label:`مشتریان من`,to:`/customers`,icon:y},{id:`qa-reminders`,label:`یادآورها`,to:`/reminders`,icon:b},{id:`qa-cat`,label:`دسته بندی`,to:`/categories`,icon:S},{id:`qa-swatch`,label:`درخواست کالیته`,to:`/catalog-request`,icon:x}],Ue=m(()=>C.isAgent?He:Ve),W={id:`fallback`,slot:`home_hero`,title:`کالکشن پاییز و زمستان`,subtitle:`جدیدترین پارچه‌ها`,ctaLabel:`مشاهده کالکشن`,ctaLink:`/categories`,imageUrl:``},G=g([W]),K=g(0),q,J=m(()=>G.value[K.value]??W),We=m(()=>{let e=J.value.imageUrl;if(e)return{"--hero-image":`url("${e}")`}});function Y(){X(),!(G.value.length<2)&&(q=window.setInterval(()=>{K.value=(K.value+1)%G.value.length},5e3))}function X(){q&&window.clearInterval(q),q=void 0}function Ge(e){K.value=e,Y()}let Z=m(()=>C.user?.firstName||`کاربر`),Ke=m(()=>C.user?.lastName||``),Q=m(()=>{if(U.value)return U.value;let e=C.user;return{label:e?.levelLabel||`برنزی`,nextLabel:e?.nextLevelLabel||`نقره‌ای`,pointsRemaining:e?.pointsToNext??0,progressPercent:e?.levelProgress??0}});re(X),a(async()=>{z.value=!0,B.value=null;try{let[e,t]=awa