Files
tehran_taj/apps/user-app-v2/dist/assets/HomeView-D0l6SeRe.js
T

2 lines
11 KiB
JavaScript
Raw Normal View History

import{d as j,u as ue,o as oe,a as de,b as t,c as n,e as u,F as M,r as G,n as z,f as U,g as R,h as P,i as E,_ as Y,j as W,t as V,I as Q,k as _e,l as ve,w as pe,m as H,p as T,q as fe,s as K,v as re,x as J,y as me,z as ge,K as Z,A as he,B as ye,C as ke,D as ee,E as $e,G as be,H as Ce,J as Ie}from"./index-EoS2nJiE.js";import{A as Pe}from"./AppPullRefresh-C7pbU37b.js";import{R as Se}from"./RateStrip-BeoPgcR5.js";import{P as we,a as xe}from"./ProductCard-Cih-7WFG.js";import{u as Ee}from"./catalogStore-CI7_N2W4.js";import"./filters-Dh48Mu12.js";const Re={key:0,class:"hero"},Ae=["onClick"],He=["src"],Oe={key:1,class:"hero__artFallback","aria-hidden":"true"},Te={key:0,class:"hero__dots"},Me=["aria-label","onClick"],te=46,Be=.76,Le=36.6,De=.75,ze=j({__name:"HeroCarousel",props:{slides:{},autoplay:{type:Boolean,default:!0}},setup(v){const k=v,p=P(0),x=P(null),f=P(!1),l=P(0);let _=0,$=null,b;const C=ue(),r=E(()=>k.slides.length);function S(i){let c=i-p.value;r.value>2&&(c>r.value/2&&(c-=r.value),c<-r.value/2&&(c+=r.value));const h=f.value?l.value:0,y=Math.abs(c),e=c*Le+h,s=c===0?1:Be,d=y>1?0:y===0?1:De;return{transform:`translate3d(${e}%, 0, 0) scale(${s})`,opacity:String(d),zIndex:String(10-y),pointerEvents:y>1?"none":"auto",transition:f.value?"none":"transform .42s cubic-bezier(.22,.61,.36,1), opacity .42s ease"}}function w(i){p.value=(i%r.value+r.value)%r.value,D()}function m(){w(p.value+1)}function A(){w(p.value-1)}function I(i){var c,h;r.value<2||(f.value=!0,_=i.clientX,l.value=0,$=i.pointerId,(h=(c=i.currentTarget).setPointerCapture)==null||h.call(c,i.pointerId),L())}function B(i){var h;if(!f.value||i.pointerId!==$)return;const c=((h=x.value)==null?void 0:h.clientWidth)||1;l.value=(i.clientX-_)/c*100}function F(i){if(!f.value)return;const c=i.clientX-_;f.value=!1,l.value=0,$=null,c>te?A():c<-te?m():D()}function X(i){Math.abs(l.value)>1||i!==p.value&&w(i)}function L(){b&&clearInterval(b),b=void 0}function D(){L(),k.autoplay&&!C.isReducedMotion&&r.value>1&&(b=setInterval(m,6e3))}return oe(D),de(L),(i,c)=>v.slides.length?(t(),n("section",Re,[u("div",{class:"hero__stage",ref_key:"stage",ref:x,onPointerdown:I,onPointermove:B,onPointerup:F,onPointercancel:F},[(t(!0),n(M,null,G(v.slides,(h,y)=>(t(),n("article",{key:h.key,class:U(["hero__card",{"is-active":y===p.value}]),style:z(S(y)),onClick:e=>X(y)},[h.image?(t(),n("img",{key:0,src:h.image,alt:"",class:"hero__art",draggable:"false"},null,8,He)):(t(),n("div",Oe))],14,Ae))),128))],544),v.slides.length>1?(t(),n("div",Te,[(t(!0),n(M,null,G(v.slides,(h,y)=>(t(),n("button",{key:h.key,type:"button",class:U(["hero__dot",{"is-active":y===p.value}]),"aria-label":`اسلاید ${y+1}`,onClick:e=>w(y)},null,10,Me))),128))])):R("",!0)])):R("",!0)}}),Ge=Y(ze,[["__scopeId","data-v-ddde804b"]]),Ue={class:"cats no-scrollbar"},Fe=["onClick"],Ne={class:"cats__mark","aria-hidden":"true"},Ve=["src"],Xe={class:"cats__title"},qe=j({__name:"CategoryGrid",props:{categories:{},activeId:{}},emits:["select"],setup(v,{emit:k}){const p=k;return(x,f)=>(t(),n("div",Ue,[(t(!0),n(M,null,G(v.categories,l=>{var _;return t(),n("button",{key:l.id,type:"button",class:U(["cats__tile",{"is-active":l.id===v.activeId}]),onClick:$=>p("select",l)},[u("span",Ne,[(_=l.icon)!=null&&_.image?(t(),n("img",{key:0,src:l.icon.image,alt:""},null,8,Ve)):(t(),W(Q,{key:1,icon:"vuesax-linear:3d-cube-scan",size:"27"}))]),u("span",Xe,V(l.title),1)],10,Fe)}),128))]))}}),We=Y(qe,[["__scopeId","data-v-155beefb"]]),je={class:"panel__art"},Ye=["alt"],Ke={class:"panel__title"},Je={class:"panel__meta"},Qe={class:"panel__weight"},Ze={key:0,class:"panel__wageOld"},et={class:"panel__wage"},tt=j({__name:"ProductPanel",props:{value:{},wageBefore:{}},emits:["open"],setup(v,{emit:k}){const p=v,x=k,{image:f,title:l,min_gram:_,wage:$}=_e(p.value);function b(C){return C%1===0?String(C):C.toFixed(2)}return(C,r)=>{const S=ve("lazy");return t(),n("article",{class:"panel","data-product-origin":"",onClick:r[0]||(r[0]=w=>x("open",v.value))},[u("div",je,[pe(u("img",{alt:H(l)},null,8,Ye),[[S,H(f)]]),T(we,{tags:v.value.tags,class:"panel__tags"},null,8,["tags"])]),u(