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
7.8 KiB
JavaScript
2 lines
7.8 KiB
JavaScript
import{d as B,k as L,f as l,c as r,b as e,u as o,w as T,l as n,I as g,t as m,e as P,C as I,h as A,_ as S,D as M,o as j,p as W,q as i,j as z,g as D,A as F,i as G,F as H,r as X,L as R,v as J,s as K,n as Q}from"./index-CmYEpHK9.js";import{l as Y}from"./dialogEmpty1-Caw7F5KL.js";import{P as Z}from"./PageBar-D80e377v.js";import{a as tt}from"./Spinner.vue_vue_type_style_index_0_lang-CvgYqzhC.js";import{_ as U}from"./DialogVant.vue_vue_type_style_index_0_lang-D7yryjTd.js";import{a as N,u as et}from"./cartStore-DSCChC_v.js";import{a as st}from"./client-WIBW0tF5.js";import{D as ot}from"./index-DSgZu76n.js";import{P as at}from"./index-B-smEwFI.js";import{F as nt,T as it,a as lt}from"./index-BNDtSOlu.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./classCallCheck-Ddn4Ym7v.js";import"./FormItemContext-LH987h9F.js";const rt="/assets/dialogEmpty4-Bh_UXocp.svg",ct={class:"ci"},dt={class:"ci__art"},ut=["alt"],mt={key:1,class:"ci__artEmpty","aria-hidden":"true"},_t={class:"ci__main"},pt={class:"ci__title"},vt={class:"ci__meta"},yt={class:"ci__weight"},ft={key:0,class:"ci__wage"},gt={class:"ci__row"},bt={class:"ci__qty"},wt={class:"ci__qtyValue"},kt={key:0,class:"ci__noteText"},xt=B({__name:"CartItem",props:{value:{}},emits:["note"],setup(u,{emit:h}){const d=u,c=h,_=N(),p=_.find_index(d.value),k=()=>{_.updateFeild(d.value.qty+1,p,d.value,"qty")},x=()=>{_.updateFeild(d.value.qty-1,p,d.value,"qty")},{image:C,title:s,selectedVariant:v,wage:$}=et(d.value.product,_.variant(d.value)),q=A(()=>{const f=$.value;return f==null?"":f%1===0?String(f):f.toFixed(2)});return(f,b)=>{var t;const y=L("lazy");return l(),r("article",ct,[e("div",dt,[o(C)?T((l(),r("img",{key:0,alt:o(s)},null,8,ut)),[[y,o(C)]]):(l(),r("div",mt,[n(g,{icon:"vuesax-linear:diamonds",size:"20"})]))]),e("div",_t,[e("h3",pt,m(o(s)),1),e("div",vt,[e("span",yt,m((t=o(v))==null?void 0:t.rashWeightGrams)+" گرم",1),o($)!=null?(l(),r("span",ft,"اجرت "+m(q.value)+"٪",1)):P("",!0)]),e("div",gt,[e("div",bt,[e("button",{type:"button",class:"ci__qtyBtn","aria-label":"افزودن",onClick:k},[n(g,{icon:"vuesax-linear:add",size:"16"})]),e("span",wt,m(u.value.qty),1),u.value.qty===1?(l(),r("button",{key:0,type:"button",class:"ci__qtyBtn ci__qtyBtn--danger","aria-label":"حذف",onClick:b[0]||(b[0]=w=>o(_).remove(u.value))},[n(g,{icon:"vuesax-linear:trash",size:"16"})])):(l(),r("button",{key:1,type:"button",class:"ci__qtyBtn","aria-label":"کاهش",onClick:x},[n(g,{icon:"vuesax-linear:minus",size:"16"})]))]),e("button",{type:"button",class:"ci__note",onClick:b[1]||(b[1]=w=>c("note",o(p)))},[n(g,{icon:"vuesax-linear:note-text",size:"15"}),I(" "+m(!u.value.note||u.value.note===""?"توضیحات":"ویرایش توضیحات"),1)])]),u.value.note?(l(),r("p",kt,m(u.value.note),1)):P("",!0)])])}}}),ht=S(xt,[["__scopeId","data-v-d8c9a21d"]]),Ct={class:"cart"},$t={key:1,class:"cart__empty"},It={key:1,class:"cart__done"},Pt={class:"cart__doneIcon","aria-hidden":"true"},qt={class:"cart__doneSub"},zt={key:0,class:"cart__bar"},Dt={class:"cart__barInner"},Rt={class:"cart__total"},Vt={class:"cart__totalValue"},Ft={class:"sheet"},Ut={class:"sheet__title"},Bt=["src"],St=["src"],Nt=60,Ot=B({__name:"CartView",setup(u){let h=!1;const d=J(),c=N(),_=M(),p=D(!1),k=D(!1),x=D(h);function C(y){return{"--reveal-delay":`${y*Nt}ms`}}const s=F({loadingPage:!1,showPopUp:!1,step:1,notify:!1,orderID:"",tempRowIndex:-1,tempRow:{product:void 0}}),v=F({note:void 0}),$=()=>{c.updateFeild(v.note,s.tempRowIndex,s.tempRow,"note"),s.showPopUp=!1,v.note=void 0,s.tempRow={product:void 0}},q=async()=>{await d.push({name:"ordersList"}),s.step=1},f=async()=>{if(s.notify=!1,!_.customerId){p.value=!0;return}try{s.loadingPage=!0;const y=await st.createOrder({customerId:_.customerId,items:c.items.map(t=>{const w=c.variant(t);return{productVariantId:t.vid,quantity:t.qty,wagePercent:w?parseFloat(w.defaultWagePercent):0}})});s.orderID=y.orderNumber,s.step=2,c.clear()}catch(y){console.log(y)}finally{s.loadingPage=!1}};async function b(){await c.init(),k.value=!1}return j(async()=>{await c.init(),!x.value&&(await W(),requestAnimationFrame(()=>{x.value=!0,h=!0}))}),(y,t)=>{var V;const w=K("container");return l(),r("div",Ct,[n(Z,{title:"سبد خرید","back-to":"home"}),n(tt,{spinning:s.loadingPage,tip:"درحال دریافت اطلاعات"},{default:i(()=>[n(w,{class:"cart__body"},{default:i(()=>[s.step===1?(l(),z(o(at),{key:0,modelValue:k.value,"onUpdate:modelValue":t[1]||(t[1]=a=>k.value=a),onRefresh:b},{pulling:i(()=>[n(o(R),{size:"18"})]),loosing:i(()=>[n(o(R),{size:"18"})]),loading:i(()=>[n(o(R),{size:"18"})]),success:i(()=>[...t[10]||(t[10]=[e("span",null,null,-1)])]),default:i(()=>[o(c).items.length?(l(),r("div",{key:0,class:G(["cart__items",{"is-revealed":x.value}])},[(l(!0),r(H,null,X(o(c).items,(a,O)=>(l(),z(ht,{key:a.pid+a.vid,value:a,class:"cart__row",style:Q(C(O)),onNote:E=>{s.tempRow=a,s.showPopUp=!0,s.tempRowIndex=E,v.note=a.note??void 0}},null,8,["value","style","onNote"]))),128))],2)):(l(),r("section",$t,[n(g,{icon:"vuesax-linear:bag-2",size:"26"}),t[11]||(t[11]=e("p",null,"سبد خرید شما خالی است.",-1)),e("button",{type:"button",class:"cart__emptyCta",onClick:t[0]||(t[0]=a=>o(d).push({name:"home"}))}," دیدن محصولات ")]))]),_:1},8,["modelValue"])):(l(),r("section",It,[e("div",Pt,[n(g,{icon:"vuesax-linear:tick-circle",size:"30"})]),t[13]||(t[13]=e("h2",{class:"cart__doneTitle"},"سفارش شما ثبت شد",-1)),e("p",qt,[t[12]||(t[12]=I(" شماره سفارش ",-1)),e("b",null,m(s.orderID),1)]),t[14]||(t[14]=e("p",{class:"cart__doneHint"},"برای پیگیری وضعیت، به فهرست سفارشها مراجعه کنید.",-1)),e("button",{type:"button",class:"cart__doneCta",onClick:q},"فهرست سفارشها")]))]),_:1})]),_:1},8,["spinning"]),o(c).items.length>0&&s.step===1?(l(),r("div",zt,[e("div",Dt,[e("div",Rt,[t[16]||(t[16]=e("span",{class:"cart__totalLabel"},"جمع وزن",-1)),e("span",Vt,[I(m(o(c).total())+" ",1),t[15]||(t[15]=e("i",null,"گرم",-1))])]),e("button",{type:"button",class:"cart__submit",onClick:t[2]||(t[2]=a=>s.notify=!0)},"ثبت نهایی سفارش")])])):P("",!0),(V=s.tempRow)!=null&&V.product?(l(),z(o(ot),{key:1,visible:s.showPopUp,"onUpdate:visible":t[4]||(t[4]=a=>s.showPopUp=a),placement:"bottom",closable:!1,height:"300px",class:"rtl",bodyStyle:{padding:0}},{default:i(()=>[e("div",Ft,[e("h3",Ut,"توضیح برای "+m(s.tempRow.product.title),1),n(o(lt),{model:v,name:"noteForm",layout:"vertical",autocomplete:"off",onFinish:$},{default:i(()=>[n(o(nt),{"has-feedback":"",name:"note"},{default:i(()=>[n(o(it),{value:v.note,"onUpdate:value":t[3]||(t[3]=a=>v.note=a),rows:4,placeholder:"مثلاً سایز یا جزئیات سفارش"},null,8,["value"])]),_:1}),t[17]||(t[17]=e("button",{type:"submit",class:"sheet__cta"},"ثبت توضیحات",-1))]),_:1},8,["model"])])]),_:1},8,["visible"])):P("",!0),n(U,{timeOut:-1,show:s.notify,"onUpdate:show":t[6]||(t[6]=a=>s.notify=a),closeOnClickOverlay:!0},{img:i(()=>[e("img",{src:o(rt),alt:"",class:"opacity-70"},null,8,Bt)]),title:i(()=>[...t[18]||(t[18]=[I("آیا مطمئن به ثبت سفارش هستید ؟",-1)])]),button:i(()=>[e("div",{class:"text-center text-[#1C2D56]",onClick:f},"بله"),e("div",{class:"text-center text-[#6b7280]",onClick:t[5]||(t[5]=a=>s.notify=!1)},"بی خیال")]),_:1},8,["show"]),n(U,{timeOut:-1,show:p.value,"onUpdate:show":t[9]||(t[9]=a=>p.value=a),closeOnClickOverlay:!0},{img:i(()=>[e("img",{src:o(Y),alt:"",class:"opacity-80"},null,8,St)]),title:i(()=>[...t[19]||(t[19]=[e("div",{class:"p-8 text-justify"},"برای ثبت سفارش ابتدا باید وارد حساب کاربری خود شوید.",-1)])]),button:i(()=>[e("div",{class:"text-center text-[#1C2D56]",onClick:t[7]||(t[7]=a=>o(d).push({name:"login"}))},"ورود/ثبت نام"),e("div",{class:"text-center text-danger",onClick:t[8]||(t[8]=a=>p.value=!1)},"بیخیال")]),_:1},8,["show"])])}}}),Yt=S(Ot,[["__scopeId","data-v-b9a90729"]]);export{Yt as default};
|