Files
tehran_taj/apps/user-app-v2/dist/assets/SingleProduct-CDKWZbYq.js
T
s.esmaeili 53a304b5d5 SearchView: Removed the dynamic collection-tile grid (e.g. "پرفروش‌های این هفته") and the "نتایج / N محصول" section header from the UI. Underlying data/filtering logic untouched.
DashboardView ("میز کار"): Rebuilt from scratch with a new structure, distinct from the old card+grid layout but visually aligned with HomeView (same blurred bar, @ink/@wine palette, staged reveal animation on mount):

Single hero card (ink→wine gradient) showing balance, gold/fiat debt, and identity — no quick-action icons inside it anymore.

Live gold rate folded into a slim inline row at the bottom instead of a titled section.
Iterated shadow/spacing on the hero card per feedback (softer, less clipped).
DialogVant / DialogVantOneButton (shared modal components, used in 7+ call sites: Dashboard, Cart, SingleProduct, Register, App): Replaced Vant's default dialog chrome with the app's own rounded-card language — circular icon badge for the illustration, pill-shaped primary/secondary buttons. No call-site markup changed.

LoginView: Rebuilt from scratch — full-bleed dark hero (brand + step copy) overlapped by a floating white form sheet, animated crossfade transition between the mobile-number and OTP steps, same staged entrance animation as Home/Dashboard. All auth logic (API check, OTP stub, session login) unchanged.
2026-09-18 12:54:45 +03:30

2 lines
11 KiB
JavaScript

import{g as _,m as de,d as ze,E as qe,B as $e,u as f,j as Q,q as x,e as r,f as a,b as t,i as C,l as u,t as n,I as d,c as o,n as Ie,F as W,r as G,C as b,v as Fe,h as l,s as Oe,_ as Re}from"./index-CmYEpHK9.js";import{a as Ve}from"./Spinner.vue_vue_type_style_index_0_lang-CvgYqzhC.js";import{_ as De}from"./NotifyVant.vue_vue_type_script_setup_true_lang-jgMMdODO.js";import{_ as Be}from"./DialogVant.vue_vue_type_style_index_0_lang-D7yryjTd.js";import{a as Ee,u as Le}from"./cartStore-DSCChC_v.js";import{a as Me}from"./client-WIBW0tF5.js";import{l as Xe}from"./dialogEmpty1-Caw7F5KL.js";function Ne(y){const m=_(!1),h=_(!1),q=_(!1),k=_(null);return{loading:m,flag:h,notFound:q,productRef:k,load:async()=>{m.value=!0;try{const v=(await Me.listProducts()).find(L=>L.id===y)??null;k.value=v,q.value=!v,h.value=!0}catch(V){console.log(V)}finally{m.value=!1}}}}const je=de("favorites",{state:()=>({ids:[]}),actions:{toggle(y){const m=this.ids.indexOf(y);m===-1?this.ids.push(y):this.ids.splice(m,1)},isFavorite(y){return this.ids.includes(y)}}}),ue={colors:[],brands:[],ciny_id:[],limit_percent:[],limit_gram:[],has_discount:!1,text:void 0,cats:void 0,page:0},Ae=de("filters",{state:()=>({query:{...ue}}),actions:{reset(){this.query={...ue}}}});function He(){return localStorage.getItem("appToken")}const Ue={class:"pd__controls"},Qe={class:"pd__headerTitle"},We={class:"pd__controlsEnd"},Ge={key:0,class:"pd__roundBadge"},Je={class:"pd__gallery"},Ke=["src","alt"],Ye={key:0,class:"pd__rail"},Ze=["aria-label","onClick"],et={key:1,class:"pd__stage pd__stage--empty"},tt={class:"pd__scroll"},st={class:"pd__sheet"},lt={class:"pd__eyebrow"},at={class:"pd__eyebrowText"},ot={class:"pd__head"},nt={class:"pd__headMain"},it={class:"pd__title"},ut={key:0,class:"pd__code"},rt={class:"pd__figures"},dt={class:"pd__figure"},ct={class:"pd__figureValue"},vt={key:0,class:"pd__figure pd__figure--accent"},_t={class:"pd__figureValue"},pt={key:0,class:"pd__chips no-scrollbar"},gt=["onClick"],ft={key:1,class:"pd__block"},yt={class:"pd__block"},mt={class:"pd__specs"},bt={class:"pd__spec"},ht={key:0,class:"pd__spec"},kt={key:1,class:"pd__spec"},xt={key:2,class:"pd__spec"},Ct={key:3,class:"pd__spec"},St={class:"pd__bar"},Tt={key:0,class:"pd__qty"},Pt=["aria-label"],wt={class:"pd__qtyValue"},zt={class:"pd__pillText"},qt=["disabled"],$t=["src"],It=56,re=48,Ft=ze({__name:"SingleProduct",props:{id:{}},emits:["closeDrawer"],setup(y,{emit:m}){const h=y,q=m,k=Fe(),R=je(),V=Ae(),v=Ee(),L=()=>{q("closeDrawer"),k.currentRoute.value.name==="singleProduct"&&k.back()},M=_(!1),D=_(!1),g=_(0),B=_(!1),J=_(null),K=_(!1);function ce(){var O;const s=J.value;if(!s)return;const e=((O=s.querySelector(".pd__gallery"))==null?void 0:O.clientHeight)??0;K.value=s.scrollTop>Math.max(e-It,0)}const c=Ne(h.id),ve=c.loading,_e=c.flag,Y={id:h.id,title:"",description:null,variants:[],images:[],category:null,brand:null,collections:[]},p=l(()=>Le(c.productRef.value??Y)),Z=l(()=>p.value.id.value),X=l(()=>p.value.title.value),ee=l(()=>p.value.productCode.value),N=l(()=>p.value.variants.value),$=l({get:()=>p.value.selectedVariant.value,set:s=>p.value.selectedVariant.value=s}),te=l(()=>p.value.min_gram.value),j=l(()=>p.value.wage.value),A=l(()=>p.value.qty.value),se=l(()=>p.value.isPreOrder.value),H=l(()=>p.value.is_exist.value),U=l(()=>{var s;return((s=c.productRef.value)==null?void 0:s.description)??""}),pe=l(()=>U.value.length>120),le=l(()=>{var s,e;return((e=(s=c.productRef.value)==null?void 0:s.category)==null?void 0:e.id)??""}),I=l(()=>{var s,e;return((e=(s=c.productRef.value)==null?void 0:s.category)==null?void 0:e.title)??""}),ae=l(()=>{var s,e;return((e=(s=c.productRef.value)==null?void 0:s.brand)==null?void 0:e.title)??""}),ge=l(()=>{var s;return(((s=c.productRef.value)==null?void 0:s.images.length)??0)>0}),S=l(()=>{var s;return((s=c.productRef.value)==null?void 0:s.images.map(e=>e.url))??[]});qe(S,s=>{g.value>s.length-1&&(g.value=0)});const F=_(0),T=_(!1);let oe=0;const fe=l(()=>T.value?`calc(${g.value*100}% + ${F.value}px)`:`${g.value*100}%`);function ye(s){S.value.length<2||(oe=s.touches[0].clientX,F.value=0,T.value=!0)}function me(s){T.value&&(F.value=s.touches[0].clientX-oe)}function be(){if(!T.value)return;const s=F.value;T.value=!1,F.value=0,s<=-re&&g.value<S.value.length-1?g.value++:s>=re&&g.value>0&&g.value--}const ne=l(()=>{const s=j.value;return s==null?"":s%1===0?String(s):s.toFixed(2)}),he=l(()=>A.value>0?`${A.value} عدد موجود`:se.value?"پیش‌سفارش":"ناموجود"),ke=l(()=>A.value>0?"is-in":se.value?"is-pre":"is-out"),P=l(()=>{var s,e;return{vid:((s=$.value)==null?void 0:s.id)??"",note:null,pid:((e=c.productRef.value)==null?void 0:e.id)??h.id,product:c.productRef.value??Y,qty:1}}),ie=l(()=>v.isInCart(P.value)),E=l(()=>v.find_index(P.value)),w=l(()=>E.value>-1?v.items[E.value].qty:0),xe=()=>v.updateFeild(w.value+1,E.value,P.value,"qty"),Ce=()=>{if(w.value<=1){v.remove(P.value);return}v.updateFeild(w.value-1,E.value,P.value,"qty")},Se=()=>{v.addToCart(P.value),M.value=!0},Te=s=>{s.stopPropagation(),R.toggle(h.id)},Pe=()=>{le.value&&(V.query.cats=[le.value],q("closeDrawer"),k.push({name:"search"}))};return $e(async()=>{await c.load()}),(s,e)=>{const O=Oe("router-link");return f(_e)&&f(c).productRef.value?(a(),Q(Ve,{key:0,spinning:f(ve),tip:"درحال دریافت اطلاعات"},{default:x(()=>[t("article",{class:"pd",ref_key:"scroller",ref:J,onScrollPassive:ce},[t("header",{class:C(["pd__header",{"is-solid":K.value}])},[t("div",Ue,[t("button",{type:"button",class:"pd__round","aria-label":"بازگشت",onClick:L},[u(d,{icon:"vuesax-linear:arrow-right-1",size:"18"})]),t("h2",Qe,n(X.value),1),t("div",We,[t("button",{type:"button",class:C(["pd__round",{"is-on":f(R).isFavorite(Z.value)}]),"aria-label":"علاقه‌مندی",onClick:Te},[u(d,{icon:f(R).isFavorite(Z.value)?"vuesax-linear:heart-fill":"vuesax-linear:heart",size:"18"},null,8,["icon"])],2),u(O,{class:"pd__round",to:{name:"cart"},"aria-label":"سبد خرید"},{default:x(()=>[u(d,{icon:"vuesax-linear:bag-2",size:"18"}),f(v).items.length?(a(),o("span",Ge,n(f(v).items.length),1)):r("",!0)]),_:1})])])],2),t("div",Je,[ge.value?(a(),o("div",{key:0,class:"pd__stage",onTouchstartPassive:ye,onTouchmovePassive:me,onTouchend:be},[t("div",{class:C(["pd__track",{"is-dragging":T.value}]),style:Ie({transform:`translate3d(${fe.value}, 0, 0)`})},[(a(!0),o(W,null,G(S.value,i=>(a(),o("div",{key:i,class:"pd__slide"},[t("img",{src:i,alt:X.value,class:"pd__art"},null,8,Ke)]))),128))],6),S.value.length>1?(a(),o("div",Ye,[(a(!0),o(W,null,G(S.value,(i,z)=>(a(),o("button",{key:i,type:"button",class:C(["pd__railDot",{"is-on":z===g.value}]),"aria-label":`تصویر ${z+1}`,onClick:we=>g.value=z},null,10,Ze))),128))])):r("",!0)],32)):(a(),o("div",et,[u(d,{icon:"vuesax-linear:diamonds",size:"27"})]))]),t("div",tt,[t("div",st,[e[16]||(e[16]=t("div",{class:"pd__grip","aria-hidden":"true"},null,-1)),t("div",lt,[t("span",at,n(I.value||"محصول"),1),t("span",{class:C(["pd__stock",ke.value])},[e[6]||(e[6]=t("span",{class:"pd__stockDot","aria-hidden":"true"},null,-1)),b(" "+n(he.value),1)],2)]),t("header",ot,[t("div",nt,[t("h1",it,n(X.value),1),ee.value?(a(),o("p",ut,n(ee.value),1)):r("",!0)]),t("div",rt,[t("div",dt,[t("span",ct,n(te.value),1),e[7]||(e[7]=t("span",{class:"pd__figureLabel"},"گرم",-1))]),j.value!=null?(a(),o("div",vt,[t("span",_t,n(ne.value)+"٪",1),e[8]||(e[8]=t("span",{class:"pd__figureLabel"},"اجرت",-1))])):r("",!0)])]),N.value&&N.value.length>1?(a(),o("section",pt,[(a(!0),o(W,null,G(N.value,i=>{var z;return a(),o("button",{key:i.id,type:"button",class:C(["pd__chip",{"is-on":((z=$.value)==null?void 0:z.id)===i.id}]),onClick:we=>$.value=i},n(i.title),11,gt)}),128))])):r("",!0),U.value?(a(),o("section",ft,[e[9]||(e[9]=t("h2",{class:"pd__blockTitle"},"توضیحات",-1)),t("p",{class:C(["pd__body",{"is-clamped":!B.value}])},n(U.value),3),pe.value?(a(),o("button",{key:0,type:"button",class:"pd__more",onClick:e[0]||(e[0]=i=>B.value=!B.value)},n(B.value?"بستن":"ادامه مطلب"),1)):r("",!0)])):r("",!0),t("section",yt,[e[15]||(e[15]=t("h2",{class:"pd__blockTitle"},"مشخصات",-1)),t("dl",mt,[t("div",bt,[t("dt",null,[u(d,{icon:"vuesax-linear:weight",size:"15"}),e[10]||(e[10]=b(" وزن",-1))]),t("dd",null,n(te.value)+" گرم",1)]),j.value!=null?(a(),o("div",ht,[t("dt",null,[u(d,{icon:"vuesax-linear:percentage-square",size:"15"}),e[11]||(e[11]=b(" اجرت",-1))]),t("dd",null,n(ne.value)+"٪",1)])):r("",!0),$.value?(a(),o("div",kt,[t("dt",null,[u(d,{icon:"vuesax-linear:diamonds",size:"15"}),e[12]||(e[12]=b(" تنوع",-1))]),t("dd",null,n($.value.title),1)])):r("",!0),I.value?(a(),o("div",xt,[t("dt",null,[u(d,{icon:"vuesax-linear:category",size:"15"}),e[13]||(e[13]=b(" دسته‌بندی",-1))]),t("dd",null,n(I.value),1)])):r("",!0),ae.value?(a(),o("div",Ct,[t("dt",null,[u(d,{icon:"vuesax-linear:shop",size:"15"}),e[14]||(e[14]=b(" برند",-1))]),t("dd",null,n(ae.value),1)])):r("",!0)])])])]),t("div",St,[ie.value?(a(),o("div",Tt,[t("button",{type:"button",class:"pd__qtyBtn","aria-label":w.value===1?"حذف":"کاهش",onClick:Ce},[u(d,{icon:w.value===1?"vuesax-linear:trash":"vuesax-linear:minus",size:"15"},null,8,["icon"])],8,Pt),t("span",wt,n(w.value),1),t("button",{type:"button",class:"pd__qtyBtn","aria-label":"افزایش",onClick:xe},[u(d,{icon:"vuesax-linear:add",size:"15"})])])):I.value?(a(),o("button",{key:1,type:"button",class:"pd__pill",onClick:Pe},[u(d,{icon:"vuesax-linear:category",size:"17"}),t("span",zt,n(I.value),1)])):r("",!0),ie.value?(a(),Q(O,{key:3,class:"pd__cta",to:{name:"cart"}},{default:x(()=>[u(d,{icon:"vuesax-linear:bag-2",size:"17"}),e[17]||(e[17]=b(" مشاهده سبد خرید ",-1))]),_:1})):(a(),o("button",{key:2,type:"button",class:"pd__cta",disabled:!H.value,onClick:e[1]||(e[1]=i=>f(He)()?Se():D.value=!0)},[H.value?(a(),Q(d,{key:0,icon:"vuesax-linear:bag-2",size:"17"})):r("",!0),b(" "+n(H.value?"افزودن به سفارش":"ناموجود"),1)],8,qt))])],544),u(De,{timeOut:3e3,modelValue:M.value,"onUpdate:modelValue":e[2]||(e[2]=i=>M.value=i),color:"background-color: #14161A"},{default:x(()=>[...e[18]||(e[18]=[t("div",{class:"font-bold text-right mb-2"},"ثبت سفارش",-1),t("div",null,"محصول با موفقیت به سبد خرید افزوده شد",-1)])]),_:1},8,["modelValue"]),u(Be,{timeOut:-1,show:D.value,"onUpdate:show":e[5]||(e[5]=i=>D.value=i),closeOnClickOverlay:!0},{img:x(()=>[t("img",{src:f(Xe),alt:"",class:"opacity-80"},null,8,$t)]),title:x(()=>[...e[19]||(e[19]=[t("div",{class:"p-8 text-justify"}," برای دسترسی به تمامی امکانات نرم افزار منتزر، ابتدا گزینه ورود/ثبت نام را لمس کنید و در صورت نداشتن حساب کاربری، ثبت نام نمایید. ",-1)])]),button:x(()=>[t("div",{class:"text-center font-bold",onClick:e[3]||(e[3]=i=>f(k).push({name:"login"}))},"ورود/ثبت نام"),t("div",{class:"text-center",onClick:e[4]||(e[4]=i=>D.value=!1)},"بیخیال")]),_:1},8,["show"])]),_:1},8,["spinning"])):r("",!0)}}}),Ot=Re(Ft,[["__scopeId","data-v-bf4ca901"]]),Xt=Object.freeze(Object.defineProperty({__proto__:null,default:Ot},Symbol.toStringTag,{value:"Module"}));export{Ot as S,je as a,Xt as b,Ae as u};