Files
tehran_taj/apps/user-app-v2/dist/assets/HomeView-DXh7cwwh.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{_ as se}from"./Spinner.vue_vue_type_style_index_0_lang-CvgYqzhC.js";import{d as V,o as Z,a as ne,c as i,b as v,F as B,r as N,e as w,f as o,g,h as O,n as z,i as F,_ as X,j as G,t as U,I as j,k as ae,w as oe,u as I,l as P,m as le,p as ie,q as L,L as W,s as re,v as ce}from"./index-CmYEpHK9.js";import{u as ue,S as de}from"./SingleProduct-CDKWZbYq.js";import{R as ve}from"./RateStrip-D1uTYKLi.js";import{u as _e}from"./cartStore-DSCChC_v.js";import{a as Y}from"./client-WIBW0tF5.js";import{P as pe}from"./index-B-smEwFI.js";import{D as fe}from"./index-DSgZu76n.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./NotifyVant.vue_vue_type_script_setup_true_lang-jgMMdODO.js";import"./DialogVant.vue_vue_type_style_index_0_lang-D7yryjTd.js";import"./dialogEmpty1-Caw7F5KL.js";import"./filters-CLL9nGZ2.js";import"./classCallCheck-Ddn4Ym7v.js";const me={key:0,class:"hero"},ge=["onClick"],he=["src","alt"],ye={key:1,class:"hero__artFallback","aria-hidden":"true"},ke={key:0,class:"hero__dots"},Ie=["aria-label","onClick"],J=46,be=.76,$e=36.6,Pe=.75,Ce=V({__name:"HeroCarousel",props:{slides:{},autoplay:{type:Boolean,default:!0}},emits:["select"],setup(c,{emit:h}){const _=c,b=h,d=g(0),p=g(null),u=g(!1),r=g(0);let y=0,f=null,m;const l=O(()=>_.slides.length);function S(t){let n=t-d.value;l.value>2&&(n>l.value/2&&(n-=l.value),n<-l.value/2&&(n+=l.value));const e=u.value?r.value:0,s=Math.abs(n),C=n*$e+e,k=n===0?1:be,E=s>1?0:s===0?1:Pe;return{transform:`translate3d(${C}%, 0, 0) scale(${k})`,opacity:String(E),zIndex:String(10-s),pointerEvents:s>1?"none":"auto",transition:u.value?"none":"transform .42s cubic-bezier(.22,.61,.36,1), opacity .42s ease"}}function $(t){d.value=(t%l.value+l.value)%l.value,a()}function R(){$(d.value+1)}function D(){$(d.value-1)}function M(t){var n,e;l.value<2||(u.value=!0,y=t.clientX,r.value=0,f=t.pointerId,(e=(n=t.currentTarget).setPointerCapture)==null||e.call(n,t.pointerId),H())}function T(t){var e;if(!u.value||t.pointerId!==f)return;const n=((e=p.value)==null?void 0:e.clientWidth)||1;r.value=(t.clientX-y)/n*100}function x(t){if(!u.value)return;const n=t.clientX-y;u.value=!1,r.value=0,f=null,n>J?D():n<-J?R():a()}function A(t,n){if(!(Math.abs(r.value)>1)){if(t!==d.value){$(t);return}b("select",n)}}function H(){m&&clearInterval(m),m=void 0}function a(){H(),_.autoplay&&l.value>1&&(m=setInterval(R,6e3))}return Z(a),ne(H),(t,n)=>c.slides.length?(o(),i("section",me,[v("div",{class:"hero__stage",ref_key:"stage",ref:p,onPointerdown:M,onPointermove:T,onPointerup:x,onPointercancel:x},[(o(!0),i(B,null,N(c.slides,(e,s)=>(o(),i("article",{key:e.key,class:F(["hero__card",{"is-active":s===d.value}]),style:z(S(s)),onClick:C=>A(s,e)},[e.image?(o(),i("img",{key:0,src:e.image,alt:e.title,class:"hero__art",draggable:"false"},null,8,he)):(o(),i("div",ye))],14,ge))),128))],544),c.slides.length>1?(o(),i("div",ke,[(o(!0),i(B,null,N(c.slides,(e,s)=>(o(),i("button",{key:e.key,type:"button",class:F(["hero__dot",{"is-active":s===d.value}]),"aria-label":e.title,onClick:C=>$(s)},null,10,Ie))),128))])):w("",!0)])):w("",!0)}}),Se=X(Ce,[["__scopeId","data-v-97560afa"]]),we={class:"cats no-scrollbar"},xe=["onClick"],Ee={class:"cats__mark","aria-hidden":"true"},He=["src"],Le={class:"cats__title"},Oe=V({__name:"CategoryGrid",props:{categories:{},activeId:{}},emits:["select"],setup(c,{emit:h}){const _=h;return(b,d)=>(o(),i("div",we,[(o(!0),i(B,null,N(c.categories,p=>{var u;return o(),i("button",{key:p.id,type:"button",class:F(["cats__tile",{"is-active":p.id===c.activeId}]),onClick:r=>_("select",p)},[v("span",Ee,[(u=p.icon)!=null&&u.image?(o(),i("img",{key:0,src:p.icon.image,alt:""},null,8,He)):(o(),G(j,{key:1,icon:"vuesax-linear:3d-cube-scan",size:"27"}))]),v("span",Le,U(p.title),1)],10,xe)}),128))]))}}),Re=X(Oe,[["__scopeId","data-v-aef04be0"]]),Me={class:"panel__art"},ze=["alt"],Be={class:"panel__title"},De={class:"panel__meta"},Te={class:"panel__weight"},Ae={key:0,class:"panel__wageOld"},Ue={class:"panel__wage"},Ge=V({__name:"ProductPanel",props:{value:{},wageBefore:{}},emits:["open"],setup(c,{emit:h}){const _=c,b=h,{image:d,title:p,min_gram:u,wage:r}=_e(_.value);function y(f){return f%1===0?String(f):f.toFixed(2)}return(f,m)=>{const l=ae("lazy");return o(),i("article",{class:"panel",onClick:m[0]||(m[0]=S=>b("open",c.value))},[v("div",Me,[oe(v("img",{alt:I(p)},null,8,ze),[[l,I(d)]])]),v("h3",Be,U(I(p)),1),v("div",De,[v("span",Te,U(I(u))+" گرم",1),I(r)!=null?(o(),i(B,{key:0},[m[1]||(m[1]=v("span",{class:"panel__sep","aria-hidden":"true"},null,-1)),c.wageBefore!=null?(o(),i("span",Ae,"اجرت "+U(y(c.wageBefore))+"٪",1)):w("",!0),v("span",Ue,U(y(I(r)))+"٪ اجرت",1)],64)):w("",!0)])])}}}),ee=X(Ge,[["__scopeId","data-v-138b61b8"]]),Ne={class:"reel"},Fe=["onClick"],Ve={class:"reel__allMark","aria-hidden":"true"},K=46,Xe=.78,Q=92.5,qe=.62,We=V({__name:"ProductCarousel",props:{products:{}},emits:["open","all"],setup(c,{emit:h}){const _=c,b=h,d=g(0),p=g(null),u=g(!1),r=g(0);let y=0,f=null;const m=O(()=>[..._.products.map(a=>({key:a.id,kind:"product",product:a})),{key:"__all__",kind:"all"}]),l=O(()=>m.value.length);function S(a){let t=a-d.value;l.value>2&&(t>l.value/2&&(t-=l.value),t<-l.value/2&&(t+=l.value));const n=u.value?r.value:0,e=t*Q+n,s=Math.min(Math.abs(t+n/Q),1),C=1-(1-Xe)*s,k=1-(1-qe)*s,E=Math.abs(t)<=1,q=E?k:0;return{transform:`translate3d(${e}%, 0, 0) scale(${C})`,opacity:String(q),zIndex:String(10-Math.abs(t)),pointerEvents:E?"auto":"none",transition:u.value?"none":"transform .55s cubic-bezier(.21,1.02,.36,1), opacity .45s ease"}}function $(a){d.value=(a%l.value+l.value)%l.value}function R(){$(d.value+1)}function D(){$(d.value-1)}function M(a){var t,n;l.value<2||(u.value=!0,y=a.clientX,r.value=0,f=a.pointerId,(n=(t=a.currentTarget).setPointerCapture)==null||n.call(t,a.pointerId))}function T(a){var n;if(!u.value||a.pointerId!==f)return;const t=((n=p.value)==null?void 0:n.clientWidth)||1;r.value=(a.clientX-y)/t*100}function x(a){if(!u.value)return;const t=a.clientX-y;u.value=!1,r.value=0,f=null,t>K?D():t<-K&&R()}function A(a,t){if(!(Math.abs(r.value)>1)){if(a!==d.value){$(a);return}b("open",t)}}function H(a){if(!(Math.abs(r.value)>1)){if(a!==d.value){$(a);return}b("all")}}return(a,t)=>(o(),i("section",Ne,[v("div",{class:"reel__stage",ref_key:"stage",ref:p,onPointerdown:M,onPointermove:T,onPointerup:x,onPointercancel:x},[(o(!0),i(B,null,N(m.value,(n,e)=>(o(),i("div",{key:n.key,class:F(["reel__cell",{"is-active":e===d.value}]),style:z(S(e))},[n.kind==="product"?(o(),G(ee,{key:0,value:n.product,onOpen:s=>A(e,s)},null,8,["value","onOpen"])):(o(),i("button",{key:1,type:"button",class:"reel__all",onClick:s=>H(e)},[v("span",Ve,[P(j,{icon:"vuesax-linear:arrow-left-2",size:"26"})]),t[0]||(t[0]=v("span",{class:"reel__allText"},"مشاهده همه محصولات جدید",-1))],8,Fe))],6))),128))],544)]))}}),Ye=X(We,[["__scopeId","data-v-b79ea2a7"]]),je="/assets/shipping-and-delivery-CyUGL93q.png",Je="/assets/sports-and-competition-ao926_SX.png",te="/assets/montzar-logo-05_bmbid.png",Ke=[{type:"popup",src:je,text:"ارسال سریع و مطمئن سفارش‌های شما به سراسر کشور.",link:void 0},{type:"popup",src:Je,text:"جدیدترین محصولات منتزر را در بخش محصولات جدید ببینید.",link:void 0},{type:"popup",src:te,text:"منتزر، همراه شما در خرید و فروش طلا.",link:void 0}],Qe=le("config",{state:()=>({config:{main_slider:Ke},cats:[],loaded:!1}),actions:{setCats(c){this.cats=c},async init(){try{const c=await Y.listProducts(),h=new Map;for(const _ of c)_.category&&!h.has(_.category.id)&&h.set(_.category.id,{id:_.category.id,title:_.category.title,icon:{image:te}});this.cats=[...h.values()],this.loaded=!0}catch(c){console.log(c)}}}}),Ze={class:"home"},et={class:"home__bar"},tt={class:"home__barInner"},st={class:"home__list"},nt={key:3,class:"home__empty"},at=70,ot=6,lt=4,it=V({__name:"HomeView",setup(c){let h=!1;const _=ce(),b=Qe(),d=ue(),p=g(!0),u=g(!1),r=g([]),y=g(null),f=g(!1),m=g(null),l=g(h);function S(e){return{"--reveal-delay":`${e*at}ms`}}const $=O(()=>r.value),R=O(()=>r.value.slice(0,ot)),D=O(()=>r.value.slice(0,lt)),M=O(()=>b.cats.slice(0,5).map(e=>({key:e.id,title:e.title,image:T(e.id),categoryId:e.id})));function T(e){var C,k;const s=r.value.find(E=>{var q;return((q=E.category)==null?void 0:q.id)===e});return(k=(C=s==null?void 0:s.images)==null?void 0:C[0])==null?void 0:k.url}function x(e){m.value=e.id,f.value=!0}function A(e){d.query.cats=[e.id],_.push({name:"search"})}function H(e){e.categoryId&&(d.query.cats=[e.categoryId]),_.push({name:"search"})}function a(){_.push({name:"newestProduct"})}async function t(){try{const[e]=await Promise.all([Y.listProducts(),b.init()]);r.value=e}catch(e){console.log(e)}try{y.value=await Y.getLatestGoldPrice()}catch{y.value=null}}async function n(){await t(),u.value=!1}return Z(async()=>{await t(),p.value=!1,!l.value&&(await ie(),requestAnimationFrame(()=>{l.value=!0,h=!0}))}),(e,s)=>{const C=re("container");return o(),i("div",Ze,[v("header",et,[v("div",tt,[s[3]||(s[3]=v("img",{src:se,alt:"منتزر",class:"home__logo"},null,-1)),P(ve,{quote:y.value,compact:"",class:"home__rate"},null,8,["quote"])])]),P(I(pe),{modelValue:u.value,"onUpdate:modelValue":s[0]||(s[0]=k=>u.value=k),onRefresh:n},{pulling:L(()=>[P(I(W),{size:"18"})]),loosing:L(()=>[P(I(W),{size:"18"})]),loading:L(()=>[P(I(W),{size:"18"})]),success:L(()=>[...s[4]||(s[4]=[v("span",null,null,-1)])]),default:L(()=>[P(C,{class:F(["home__body",{"is-revealed":l.value}])},{default:L(()=>[M.value.length?(o(),G(Se,{key:0,slides:M.value,class:"home__hero home__reveal",style:z(S(0)),onSelect:H},null,8,["slides","style"])):w("",!0),I(b).cats.length?(o(),i("section",{key:1,class:"home__section home__reveal",style:z(S(1))},[s[5]||(s[5]=v("h2",{class:"home__heading"},"دسته بندی ها",-1)),P(Re,{categories:I(b).cats,"active-id":null,onSelect:A},null,8,["categories"])],4)):w("",!0),$.value.length?(o(),i("section",{key:2,class:"home__section home__reveal",style:z(S(2))},[s[6]||(s[6]=v("h2",{class:"home__heading"},"محصولات جدید",-1)),P(Ye,{products:R.value,onOpen:x,onAll:a},null,8,["products"]),v("div",st,[(o(!0),i(B,null,N(D.value,(k,E)=>(o(),G(ee,{key:k.id,value:k,class:"home__reveal",style:z(S(3+E)),onOpen:x},null,8,["value","style"]))),128))])],4)):w("",!0),!p.value&&!r.value.length?(o(),i("section",nt,[P(j,{icon:"vuesax-linear:box",size:"26"}),s[7]||(s[7]=v("p",null,"هنوز محصولی در مجموعه ثبت نشده است.",-1))])):w("",!0)]),_:1},8,["class"])]),_:1},8,["modelValue"]),P(I(fe),{visible:f.value,"onUpdate:visible":s[2]||(s[2]=k=>f.value=k),placement:"bottom",closable:!1,class:"rtl",height:"100vh",bodyStyle:{padding:0,position:"relative"}},{default:L(()=>[m.value?(o(),G(de,{key:0,id:m.value,onCloseDrawer:s[1]||(s[1]=k=>f.value=!1)},null,8,["id"])):w("",!0)]),_:1},8,["visible"])])}}}),bt=X(it,[["__scopeId","data-v-0f8e1ca4"]]);export{bt as default};