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.
2 lines
5.5 KiB
JavaScript
2 lines
5.5 KiB
JavaScript
import{d as L,D as T,o as z,c,b as s,u as n,l as a,q as l,g as h,A as B,f as _,t as r,C as b,i as C,I as g,F,r as P,v as U,h as y,s as q,_ as G}from"./index-CmYEpHK9.js";import{S as k}from"./SectionHead-L1TLZGJP.js";import{R as E}from"./RateStrip-D1uTYKLi.js";import{_ as w}from"./DialogVant.vue_vue_type_style_index_0_lang-D7yryjTd.js";import{l as H}from"./dialogEmpty1-Caw7F5KL.js";import{p as M}from"./filters-CLL9nGZ2.js";import{a as D}from"./client-WIBW0tF5.js";import{P as j}from"./index-B-smEwFI.js";import"./_commonjsHelpers-Cpj98o6Y.js";const A="/assets/dialogEmpty5-DWebUDaI.svg",W={class:"dash"},J={class:"dash__bar"},K={class:"dash__barInner"},Q={key:1,class:"dash__barSpacer","aria-hidden":"true"},X={key:0,class:"dash__balance"},Y={class:"dash__balanceHead"},Z={class:"dash__eyebrow"},ss={class:"dash__figure"},ts={class:"dash__balanceRow"},es={class:"dash__rowValue"},as={class:"dash__identity"},os={class:"dash__name"},is={class:"dash__mobile"},ns={key:1,class:"dash__invite"},ls={class:"dash__inviteIcon","aria-hidden":"true"},ds={class:"dash__section"},rs={class:"dash__grid"},us=["onClick"],cs={class:"dash__tileIcon","aria-hidden":"true"},_s={class:"dash__tileTitle"},fs={class:"dash__section"},ps=["src"],vs=["src"],ms=L({__name:"DashboardView",setup(hs){const d=U(),u=T(),i=h(null),p=h(null),v=h(!1),m=y(()=>i.value?parseFloat(i.value.goldDebtGrams)>0:!1),I=y(()=>m.value?"بدهکار گرمی":"بستانکار گرمی"),N=y(()=>i.value?Math.abs(parseFloat(i.value.goldDebtGrams)):0),o=B({notify:!1,loginNotify:!1}),V=[{id:0,icon:"vuesax-linear:box",title:"سفارشات",disabled:!1},{id:1,icon:"vuesax-linear:receipt-text",title:"اسناد",disabled:!1},{id:2,icon:"vuesax-linear:user",title:"پروفایل",disabled:!1},{id:3,icon:"vuesax-linear:heart",title:"علاقمندی",disabled:!1}];function S(f){if(!u.customerId){o.loginNotify=!0;return}f===0&&d.push({name:"ordersList"}),f===1&&d.push({name:"transactionsList"}),f===2&&d.push({name:"profileData"}),f===3&&d.push({name:"favoritesList"})}function O(){u.logout(),o.notify=!1,d.push({name:"home"})}async function x(){u.customerId&&(i.value=await D.getCustomer(u.customerId));try{p.value=await D.getLatestGoldPrice()}catch{p.value=null}}async function R(){await x(),v.value=!1}return z(x),(f,t)=>{const $=q("container");return _(),c("div",W,[s("header",J,[s("div",K,[t[8]||(t[8]=s("span",{class:"dash__barSpacer","aria-hidden":"true"},null,-1)),t[9]||(t[9]=s("h1",{class:"dash__barTitle"},"میز کار",-1)),n(u).customerId?(_(),c("button",{key:0,type:"button",class:"dash__barBtn","aria-label":"خروج",onClick:t[0]||(t[0]=e=>o.notify=!0)},[a(g,{icon:"vuesax-linear:logout",size:"19"})])):(_(),c("span",Q))])]),a(n(j),{modelValue:v.value,"onUpdate:modelValue":t[2]||(t[2]=e=>v.value=e),onRefresh:R},{default:l(()=>[a($,{class:"dash__body"},{default:l(()=>[i.value?(_(),c("section",X,[s("div",Y,[s("div",null,[s("div",Z,r(I.value),1),s("div",ss,[b(r(N.value)+" ",1),t[10]||(t[10]=s("span",{class:"dash__unit"},"گرم",-1))])]),s("span",{class:C(["dash__seal",m.value?"is-debtor":"is-creditor"])},r(m.value?"بدهکار":"بستانکار"),3)]),s("div",ts,[t[12]||(t[12]=s("span",{class:"dash__rowLabel"},"بدهی ریالی",-1)),s("span",es,[b(r(n(M)(i.value.fiatDebtRial))+" ",1),t[11]||(t[11]=s("i",null,"ریال",-1))])]),s("div",as,[s("span",os,r(i.value.fullName),1),s("span",is,r(n(u).mobile),1)])])):(_(),c("section",ns,[s("div",ls,[a(g,{icon:"vuesax-linear:security-user",size:"20"})]),t[13]||(t[13]=s("div",{class:"dash__inviteCopy"},[s("h3",null,"حساب گرمی شما"),s("p",null,"برای دیدن موجودی، سفارشها و اسناد خود وارد شوید.")],-1)),s("button",{type:"button",class:"dash__inviteCta",onClick:t[1]||(t[1]=e=>n(d).push({name:"login"}))}," ورود / ثبتنام ")])),s("section",ds,[a(k,{title:"دسترسیها",subtitle:"بخشهای حساب شما"}),s("div",rs,[(_(),c(F,null,P(V,e=>s("button",{key:e.id,type:"button",class:C(["dash__tile",{"is-disabled":e.disabled}]),onClick:bs=>S(e.id)},[s("span",cs,[a(g,{icon:e.icon,size:"20"},null,8,["icon"])]),s("span",_s,r(e.title),1)],10,us)),64))])]),s("section",fs,[a(k,{title:"نرخ روز",subtitle:"آخرین نرخ اعلامشده"}),a(E,{quote:p.value},null,8,["quote"])])]),_:1})]),_:1},8,["modelValue"]),a(w,{timeOut:-1,show:o.notify,"onUpdate:show":t[4]||(t[4]=e=>o.notify=e),closeOnClickOverlay:!0},{img:l(()=>[s("img",{src:n(A),alt:"",class:"opacity-70 mb-8"},null,8,ps)]),title:l(()=>[...t[14]||(t[14]=[b("آیا می خواهید از برنامه خارج شوید؟",-1)])]),button:l(()=>[s("div",{class:"text-center text-[#1C2D56]",onClick:O},"بله"),s("div",{class:"text-center text-[#6b7280]",onClick:t[3]||(t[3]=e=>o.notify=!1)},"بی خیال")]),_:1},8,["show"]),a(w,{timeOut:-1,show:o.loginNotify,"onUpdate:show":t[7]||(t[7]=e=>o.loginNotify=e),closeOnClickOverlay:!0},{img:l(()=>[s("img",{src:n(H),alt:"",class:"opacity-80"},null,8,vs)]),title:l(()=>[...t[15]||(t[15]=[s("div",{class:"p-8 text-justify"}," برای دسترسی به تمامی امکانات نرم افزار منتزر، ابتدا گزینه ورود/ثبت نام را لمس کنید و در صورت نداشتن حساب کاربری، ثبت نام نمایید. ",-1)])]),button:l(()=>[s("div",{class:"text-center text-[#1C2D56]",onClick:t[5]||(t[5]=e=>n(d).push({name:"login"}))},"ورود/ثبت نام"),s("div",{class:"text-center text-danger",onClick:t[6]||(t[6]=e=>o.loginNotify=!1)},"بیخیال")]),_:1},8,["show"])])}}}),Vs=G(ms,[["__scopeId","data-v-a9e43f33"]]);export{Vs as default};
|