Files
tehran_taj/apps/user-app-v2/dist/assets/SingleProduct-CD0WkR4b.js
T

2 lines
14 KiB
JavaScript
Raw Normal View History

import{d as he,ae as De,a as ke,f as l,c as o,b as t,n as Fe,F as G,r as Q,t as u,e as c,A as Me,i as z,af as fe,g as m,h as n,_ as xe,p as Ve,m as Ce,G as Be,C as Ae,u as w,j as L,s as $,l as d,I as _,D as O,ag as Le,Y as ge,T as Ue,x as Xe,v as Ee}from"./index-l-_Vq2SS.js";import{a as Ne}from"./Spinner.vue_vue_type_style_index_0_lang-BnT11ju8.js";import{_ as je}from"./NotifyVant.vue_vue_type_script_setup_true_lang-CuI1q2lG.js";import{_ as Ge}from"./DialogVant.vue_vue_type_style_index_0_lang-BjHJx5gQ.js";import{a as Qe,i as He,u as We}from"./cartStore-BjOjwx0l.js";import{l as Ye}from"./dialogEmpty1-Caw7F5KL.js";const Je=["src","alt"],Ke={key:0,class:"gs__counter"},ye=.18,Ze=6,et=he({__name:"GallerySlider",props:fe({slides:{},alt:{},fit:{default:"cover"},showCounter:{type:Boolean,default:!1}},{index:{default:0},indexModifiers:{}}),emits:fe(["tap"],["update:index"]),setup(v,{emit:x}){const h=v,f=De(v,"index"),P=x,F=n(()=>h.fit==="contain"?"gs__img--contain":"gs__img--cover"),S=m(null),r=m(!1),C=m(0);let b=null,R=0,g=0;function M(a){var k;if(h.slides.length<2||b!==null)return;const y=S.value;y&&(b=a.pointerId,R=a.clientX,g=y.getBoundingClientRect().width||1,C.value=0,r.value=!0,(k=y.setPointerCapture)==null||k.call(y,a.pointerId))}function U(a){!r.value||a.pointerId!==b||(C.value=a.clientX-R)}function X(){if(!r.value)return;const a=C.value,y=a/g;r.value=!1,b=null,C.value=0,y<=-ye&&f.value<h.slides.length-1?f.value++:y>=ye&&f.value>0&&f.value--,Math.abs(a)<=Ze&&P("tap")}function H(a){a.pointerId===b&&X()}function p(a){a.pointerId===b&&(r.value=!1,b=null,C.value=0)}function W(){}function Y(a){f.value=a}const E=n(()=>{const a=-f.value*100,y=g?C.value/g*100:0;return{transform:`translate3d(${a+y}%, 0, 0)`,transition:r.value?"none":void 0}});return ke(()=>{if(b!==null&&S.value)try{S.value.releasePointerCapture(b)}catch{}}),(a,y)=>(l(),o("div",{ref_key:"root",ref:S,class:z(["gs",{"is-dragging":r.value}]),onPointerdown:M,onPointermove:U,onPointerup:H,onPointercancel:p,onClick:W},[t("div",{class:"gs__track",style:Fe(E.value)},[(l(!0),o(G,null,Q(v.slides,k=>(l(),o("div",{key:k,class:"gs__cell"},[t("img",{src:k,alt:v.alt,class:z(["gs__img",F.value]),draggable:"false"},null,10,Je)]))),128))],4),v.showCounter&&v.slides.length>1?(l(),o("div",Ke,u(f.value+1)+"/"+u(v.slides.length),1)):c("",!0),Me(a.$slots,"dots",{index:f.value,go:Y},void 0,!0)],34))}}),me=xe(et,[["__scopeId","data-v-c30d71a6"]]);function tt(v){const x=m(!1),h=m(!1),f=m(!1),P=m(null);return{loading:x,flag:h,notFound:f,productRef:P,load:async()=>{x.value=!0;try{const r=(await Ve.listProducts()).find(C=>C.id===v)??null;P.value=r,f.value=!r,h.value=!0}catch(S){console.log(S)}finally{x.value=!1}}}}const st=Ce("favorites",{state:()=>({ids:[]}),actions:{toggle(v){const x=this.ids.indexOf(v);x===-1?this.ids.push(v):this.ids.splice(x,1)},isFavorite(v){return this.ids.includes(v)}}}),be={colors:[],brands:[],ciny_id:[],limit_percent:[],limit_gram:[],has_discount:!1,text:void 0,cats:void 0,page:0},lt=Ce("filters",{state:()=>({query:{...be}}),actions:{reset(){this.query={...be}}}});function at(){return localStorage.getItem("appToken")}const nt={class:"pd__controls"},ot={class:"pd__headerTitle"},it={class:"pd__controlsEnd"},ut={key:0,class:"pd__roundBadge"},rt={class:"pd__gallery"},dt={key:0,class:"pd__rail"},ct=["aria-label","onClick"],vt={key:1,class:"pd__stage pd__stage--empty"},_t={key:2,class:"pd__expand","aria-hidden":"true"},pt={class:"pd__scroll"},ft={class:"pd__sheet"},gt={class:"pd__eyebrow"},yt={class:"pd__eyebrowText"},mt={class:"pd__head"},bt={class:"pd__headMain"},ht={class:"pd__title"},kt={key:0,class:"pd__code"},xt={class:"pd__figures"},Ct={class:"pd__figure"},wt={class:"pd__figureValue"},Pt={key:0,class:"pd__figure pd__figure--accent"},St={class:"pd__figureValue"},It={key:0,class:"pd__chips no-scrollbar"},Tt=["disabled","onClick"],$t={key:1,class:"pd__block"},zt={class:"pd__block"},Ot={class:"pd__specs"},Rt={class:"pd__spec"},qt={key:0,class:"pd__spec"},Dt={key:1,class:"pd__spec"},Ft={key:2,class:"pd__spec"},Mt={key:3,class:"pd__spec"},Vt={class:"pd__bar"},Bt={key:0,