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

2 lines
9.9 KiB
JavaScript
Raw Normal View History

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