fix(money,orders): wage/gram-debt parity, atomic document confirm, expert edit, made-to-order, QA fixes
- Rial wage and gram-debt arithmetic matched to the reference; order corrections keep debt in sync - Document confirm/un-confirm is a compare-and-swap (no double-applied cache under concurrency) - Settlement document and expert inputs validated (400 instead of 500) - Expert: edit / activate-deactivate own customers, adjust raw weights only - Made-to-order flow in the app, PreOrder.quantity migration - Order grids: customer column, sort keys; panel select search; pre-order quantity save - Rebuilt release artifacts Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
959a272227
commit
6514b05d18
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
import{d as u,b as i,c,f as r,e,_ as h,u as v,p as o,C as b,E as k,F as f,r as w,m as n,t as d,g as x,I as _,R as g}from"./index-CN-v7uYp.js";import{P as y}from"./PageBar-DNaPusPm.js";const C=u({__name:"ToggleSwitch",props:{on:{type:Boolean}},setup(p){return(a,l)=>(i(),c("span",{class:r(["tsw",{"is-on":p.on}]),"aria-hidden":"true"},[...l[0]||(l[0]=[e("span",{class:"tsw__knob"},null,-1)])],2))}}),B=h(C,[["__scopeId","data-v-a25f88d8"]]),T={class:"ap"},S={class:"ap__section"},V={class:"ap__themes",role:"radiogroup","aria-labelledby":"ap-theme"},I=["aria-checked","onClick"],L={class:"ap__themeLabel"},M={class:"ap__check","aria-hidden":"true"},z={key:0,class:"ap__note"},E={class:"ap__section"},N=["aria-checked"],$={class:"ap__rowIcon","aria-hidden":"true"},A=u({__name:"AppearanceView",setup(p){const a=v(),l=[{value:"light",label:"روشن",icon:"vuesax-linear:sun-1"},{value:"dark",label:"تیره",icon:"vuesax-linear:moon"},{value:"system",label:"مطابق سیستم",icon:"vuesax-linear:monitor-mobbile"}];return(P,s)=>{const m=k("container");return i(),c("div",T,[o(y,{title:"تنظیمات ظاهری","back-to":"userPage::hasSubRoute"}),o(m,{class:"ap__body"},{default:b(()=>[e("section",S,[s[2]||(s[2]=e("header",{class:"ap__head"},[e("h2",{id:"ap-theme",class:"ap__title"},"پوسته برنامه"),e("p",{class:"ap__sub"},"ظاهر روشن یا تیره، یا هماهنگ با تنظیمات گوشی شما")],-1)),e("div",V,[(i(),c(f,null,w(l,t=>e("button",{key:t.value,type:"button",role:"radio",class:r(["ap__theme",{"is-on":n(a).theme===t.value}]),"aria-checked":n(a).theme===t.value,onClick:R=>n(a).setTheme(t.value)},[e("span",{class:r(["ap__preview",`ap__preview--${t.value}`]),"aria-hidden":"true"},[...s[1]||(s[1]=[e("span",{class:"ap__pvBar"},null,-1),e("span",{class:"ap__pvCard"},null,-1),e("span",{class:"ap__pvLine"},null,-1),e("span",{class:"ap__pvLine ap__pvLine--short"},null,-1),e("span",{class:"ap__pvBtn"},null,-1)])],2),e("span",L,[o(_,{icon:t.icon,size:"15"},null,8,["icon"]),g(" "+d(t.label),1)]),e("span",M,[o(_,{icon:"vuesax-linear:tick-circle",size:"18"})])],10,I)),64))]),n(a).theme==="system"?(i(),c("p",z," الان "+d(n(a).resolvedTheme==="dark"?"تیره":"روشن")+" است، مطابق تنظیمات گوشی. ",1)):x("",!0)]),e("section",E,[s[4]||(s[4]=e("header",{class:"ap__head"},[e("h2",{class:"ap__title"},"انیمیشنها"),e("p",{class:"ap__sub"},"برای سرعت بیشتر روی گوشیهای ضعیفتر")],-1)),e("button",{type:"button",role:"switch",class:"ap__row","aria-checked":n(a).reduceMotion,onClick:s[0]||(s[0]=t=>n(a).setReduceMotion(!n(a).reduceMotion))},[e("span",$,[o(_,{icon:"vuesax-linear:flash",size:"18"})]),s[3]||(s[3]=e("span",{class:"ap__rowText"},[e("b",null,"حالت سبک و سریع"),e("small",null," حرکتهای سنگین، افکتهای شیشهای و اسلاید خودکار خاموش میشوند؛ بازخورد کوتاه لمسها و جابهجاییهای سریع باقی میمانند تا برنامه خشک و بیروح نشود. ")],-1)),o(B,{on:n(a).reduceMotion},null,8,["on"])],8,N)])]),_:1})])}}}),H=h(A,[["__scopeId","data-v-f5d35ecf"]]);export{H as default};
|
||||
import{d as u,b as i,c,f as r,e,_ as h,u as v,p as o,C as b,E as k,F as f,r as w,m as n,t as d,g as x,I as _,R as g}from"./index-6E0fX61D.js";import{P as y}from"./PageBar-HEcoSwjE.js";const C=u({__name:"ToggleSwitch",props:{on:{type:Boolean}},setup(p){return(a,l)=>(i(),c("span",{class:r(["tsw",{"is-on":p.on}]),"aria-hidden":"true"},[...l[0]||(l[0]=[e("span",{class:"tsw__knob"},null,-1)])],2))}}),B=h(C,[["__scopeId","data-v-a25f88d8"]]),T={class:"ap"},S={class:"ap__section"},V={class:"ap__themes",role:"radiogroup","aria-labelledby":"ap-theme"},I=["aria-checked","onClick"],L={class:"ap__themeLabel"},M={class:"ap__check","aria-hidden":"true"},z={key:0,class:"ap__note"},E={class:"ap__section"},N=["aria-checked"],$={class:"ap__rowIcon","aria-hidden":"true"},A=u({__name:"AppearanceView",setup(p){const a=v(),l=[{value:"light",label:"روشن",icon:"vuesax-linear:sun-1"},{value:"dark",label:"تیره",icon:"vuesax-linear:moon"},{value:"system",label:"مطابق سیستم",icon:"vuesax-linear:monitor-mobbile"}];return(P,s)=>{const m=k("container");return i(),c("div",T,[o(y,{title:"تنظیمات ظاهری","back-to":"userPage::hasSubRoute"}),o(m,{class:"ap__body"},{default:b(()=>[e("section",S,[s[2]||(s[2]=e("header",{class:"ap__head"},[e("h2",{id:"ap-theme",class:"ap__title"},"پوسته برنامه"),e("p",{class:"ap__sub"},"ظاهر روشن یا تیره، یا هماهنگ با تنظیمات گوشی شما")],-1)),e("div",V,[(i(),c(f,null,w(l,t=>e("button",{key:t.value,type:"button",role:"radio",class:r(["ap__theme",{"is-on":n(a).theme===t.value}]),"aria-checked":n(a).theme===t.value,onClick:R=>n(a).setTheme(t.value)},[e("span",{class:r(["ap__preview",`ap__preview--${t.value}`]),"aria-hidden":"true"},[...s[1]||(s[1]=[e("span",{class:"ap__pvBar"},null,-1),e("span",{class:"ap__pvCard"},null,-1),e("span",{class:"ap__pvLine"},null,-1),e("span",{class:"ap__pvLine ap__pvLine--short"},null,-1),e("span",{class:"ap__pvBtn"},null,-1)])],2),e("span",L,[o(_,{icon:t.icon,size:"15"},null,8,["icon"]),g(" "+d(t.label),1)]),e("span",M,[o(_,{icon:"vuesax-linear:tick-circle",size:"18"})])],10,I)),64))]),n(a).theme==="system"?(i(),c("p",z," الان "+d(n(a).resolvedTheme==="dark"?"تیره":"روشن")+" است، مطابق تنظیمات گوشی. ",1)):x("",!0)]),e("section",E,[s[4]||(s[4]=e("header",{class:"ap__head"},[e("h2",{class:"ap__title"},"انیمیشنها"),e("p",{class:"ap__sub"},"برای سرعت بیشتر روی گوشیهای ضعیفتر")],-1)),e("button",{type:"button",role:"switch",class:"ap__row","aria-checked":n(a).reduceMotion,onClick:s[0]||(s[0]=t=>n(a).setReduceMotion(!n(a).reduceMotion))},[e("span",$,[o(_,{icon:"vuesax-linear:flash",size:"18"})]),s[3]||(s[3]=e("span",{class:"ap__rowText"},[e("b",null,"حالت سبک و سریع"),e("small",null," حرکتهای سنگین، افکتهای شیشهای و اسلاید خودکار خاموش میشوند؛ بازخورد کوتاه لمسها و جابهجاییهای سریع باقی میمانند تا برنامه خشک و بیروح نشود. ")],-1)),o(B,{on:n(a).reduceMotion},null,8,["on"])],8,N)])]),_:1})])}}}),H=h(A,[["__scopeId","data-v-f5d35ecf"]]);export{H as default};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
.cho__barExtra[data-v-2f662786]{padding:0 16px 12px}.cho__body[data-v-2f662786]{padding-top:132px;padding-bottom:90px}.cho__list[data-v-2f662786]{display:flex;flex-direction:column;padding-top:8px}.cho__card[data-v-2f662786]{padding:18px 2px;background:transparent;border:none;border-bottom:1px solid var(--c-hairline);cursor:pointer}.cho__card[data-v-2f662786]:last-child{border-bottom:none}.cho__card[data-v-2f662786]:active{opacity:.75}.cho__top[data-v-2f662786]{display:flex;justify-content:space-between;gap:12px}.cho__right[data-v-2f662786]{display:flex;flex-direction:column;align-items:flex-end;gap:8px}.cho__num[data-v-2f662786]{font-size:15px;font-weight:700;margin-bottom:10px}.cho__muted[data-v-2f662786]{color:var(--c-inkFaint);font-weight:500;margin-left:4px}.cho__meta[data-v-2f662786]{display:flex;align-items:baseline;gap:4px}.cho__strong[data-v-2f662786]{font-size:15px;font-weight:700}.cho__unit[data-v-2f662786]{font-size:12px;color:var(--c-inkFaint)}.cho__status[data-v-2f662786]{padding:5px 14px;border-radius:999px;font-size:11.5px;font-weight:600;color:#06b6d4;background:#06b6d41f;white-space:nowrap}.cho__divider[data-v-2f662786]{height:10px}.cho__bottom[data-v-2f662786]{display:flex;justify-content:space-between;align-items:center}.cho__customer[data-v-2f662786]{font-size:13.5px;font-weight:600;color:var(--c-inkMuted)}.cho__more[data-v-2f662786],.cho__sentinel[data-v-2f662786]{padding:12px 0;text-align:center;font-size:12px;color:var(--c-inkFaint)}.cho__empty[data-v-2f662786]{margin-top:8px;padding:34px 20px;border:1px dashed var(--c-hairline);border-radius:18px;display:flex;flex-direction:column;align-items:center;gap:10px;color:var(--c-inkFaint)}.cho__empty p[data-v-2f662786]{margin:0;font-size:12.5px}.cho__retry[data-v-2f662786]{padding:8px 18px;border-radius:999px;border:1px solid var(--c-hairline);background:var(--c-canvas);font-family:inherit;font-size:12px;font-weight:600;cursor:pointer}.cho__detail[data-v-2f662786]{padding:20px 16px 24px}.cho__detailTitle[data-v-2f662786]{margin:0 0 16px;font-size:17px;font-weight:700}.cho__rows[data-v-2f662786]{margin:0;display:flex;flex-direction:column}.cho__row[data-v-2f662786]{display:flex;justify-content:space-between;align-items:center;padding:13px 2px;border-bottom:1px solid var(--c-hairline)}.cho__row[data-v-2f662786]:last-child{border-bottom:none}.cho__row dt[data-v-2f662786]{font-size:13px;color:var(--c-inkFaint)}.cho__row dd[data-v-2f662786]{margin:0;font-size:14px;font-weight:600}.cho__editTitle[data-v-2f662786]{margin:18px 0 6px;font-size:13px;font-weight:800;color:var(--c-ink)}.cho__line[data-v-2f662786]{padding:12px 0;border-bottom:1px solid var(--c-hairline)}.cho__lineHead[data-v-2f662786]{display:flex;justify-content:space-between;gap:10px;margin-bottom:8px;font-size:12.5px}.cho__lineName[data-v-2f662786]{font-weight:700;color:var(--c-ink)}.cho__lineQty[data-v-2f662786]{color:var(--c-inkFaint);white-space:nowrap}.cho__input[data-v-2f662786]{width:100%}.cho__lineSum[data-v-2f662786]{margin-top:6px;font-size:12px;font-weight:700;color:var(--c-inkSoft)}.cho__previewTotal[data-v-2f662786]{display:flex;justify-content:space-between;padding:14px 0 4px;font-size:13px}.cho__error[data-v-2f662786]{margin:10px 0 0;font-size:12.5px;color:#c0392b}.cho__actions[data-v-2f662786]{display:flex;gap:10px;margin-top:14px}.cho__save[data-v-2f662786],.cho__final[data-v-2f662786]{flex:1;padding:12px;border:1px solid var(--c-wine);border-radius:14px;background:transparent;color:var(--c-wine);font-family:inherit;font-size:13.5px;font-weight:700;cursor:pointer}.cho__final[data-v-2f662786]{background:var(--c-wine);color:#fff}.cho__save[data-v-2f662786]:disabled,.cho__final[data-v-2f662786]:disabled{opacity:.5;cursor:default}.cho__confirm[data-v-2f662786]{display:flex;flex-direction:column;gap:8px;margin:12px 0 0;font-size:12.5px;color:var(--c-inkSoft)}.cho__link[data-v-2f662786]{border:none;background:transparent;color:var(--c-inkFaint);font-family:inherit;font-size:12.5px;cursor:pointer}.cho__close[data-v-2f662786]{margin-top:18px;width:100%;padding:13px;border:none;border-radius:14px;background:var(--c-wine);color:#fff;font-family:inherit;font-size:14px;font-weight:700;cursor:pointer}
|
||||
@@ -1 +0,0 @@
|
||||
.cho__barExtra[data-v-65173363]{padding:0 16px 12px}.cho__body[data-v-65173363]{padding-top:132px;padding-bottom:90px}.cho__list[data-v-65173363]{display:flex;flex-direction:column;padding-top:8px}.cho__card[data-v-65173363]{padding:18px 2px;background:transparent;border:none;border-bottom:1px solid var(--c-hairline);cursor:pointer}.cho__card[data-v-65173363]:last-child{border-bottom:none}.cho__card[data-v-65173363]:active{opacity:.75}.cho__top[data-v-65173363]{display:flex;justify-content:space-between;gap:12px}.cho__right[data-v-65173363]{display:flex;flex-direction:column;align-items:flex-end;gap:8px}.cho__num[data-v-65173363]{font-size:15px;font-weight:700;margin-bottom:10px}.cho__muted[data-v-65173363]{color:var(--c-inkFaint);font-weight:500;margin-left:4px}.cho__meta[data-v-65173363]{display:flex;align-items:baseline;gap:4px}.cho__strong[data-v-65173363]{font-size:15px;font-weight:700}.cho__unit[data-v-65173363]{font-size:12px;color:var(--c-inkFaint)}.cho__status[data-v-65173363]{padding:5px 14px;border-radius:999px;font-size:11.5px;font-weight:600;color:#06b6d4;background:#06b6d41f;white-space:nowrap}.cho__divider[data-v-65173363]{height:10px}.cho__bottom[data-v-65173363]{display:flex;justify-content:space-between;align-items:center}.cho__customer[data-v-65173363]{font-size:13.5px;font-weight:600;color:var(--c-inkMuted)}.cho__more[data-v-65173363],.cho__sentinel[data-v-65173363]{padding:12px 0;text-align:center;font-size:12px;color:var(--c-inkFaint)}.cho__empty[data-v-65173363]{margin-top:8px;padding:34px 20px;border:1px dashed var(--c-hairline);border-radius:18px;display:flex;flex-direction:column;align-items:center;gap:10px;color:var(--c-inkFaint)}.cho__empty p[data-v-65173363]{margin:0;font-size:12.5px}.cho__retry[data-v-65173363]{padding:8px 18px;border-radius:999px;border:1px solid var(--c-hairline);background:var(--c-canvas);font-family:inherit;font-size:12px;font-weight:600;cursor:pointer}.cho__detail[data-v-65173363]{padding:20px 16px 24px}.cho__detailTitle[data-v-65173363]{margin:0 0 16px;font-size:17px;font-weight:700}.cho__rows[data-v-65173363]{margin:0;display:flex;flex-direction:column}.cho__row[data-v-65173363]{display:flex;justify-content:space-between;align-items:center;padding:13px 2px;border-bottom:1px solid var(--c-hairline)}.cho__row[data-v-65173363]:last-child{border-bottom:none}.cho__row dt[data-v-65173363]{font-size:13px;color:var(--c-inkFaint)}.cho__row dd[data-v-65173363]{margin:0;font-size:14px;font-weight:600}.cho__close[data-v-65173363]{margin-top:18px;width:100%;padding:13px;border:none;border-radius:14px;background:var(--c-wine);color:#fff;font-family:inherit;font-size:14px;font-weight:700;cursor:pointer}
|
||||
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
import{d as b,W as B,a as M,o as V,c as n,p as t,C as f,N as g,i,b as o,m as s,F as N,r as S,g as v,I as q,e as E,h as F,E as L,Y as O,j,_ as z}from"./index-CN-v7uYp.js";import{P as A}from"./PageBar-DNaPusPm.js";import{S as H}from"./SectionHead-CvKB7By7.js";import{P as R}from"./ProductCard-aZrPdL37.js";import{u as T}from"./usePagedProducts-CQhfR9Yx.js";const U={class:"coll"},W={key:0,class:"coll__grid"},Y={key:2,class:"coll__empty"},$=b({__name:"CollectionView",setup(D){const u=O(),{rows:a,loading:y,loadingMore:h,hasMore:d,resetAndLoad:k,loadMore:x}=T(),_=i(()=>y.value&&a.value.length===0),w=i(()=>u.query.page||"مجموعه"),C=i(()=>String(u.params.id??"")),l=F(null);let e;function m(){return{collectionId:C.value,sort:"newest"}}function I(){e==null||e.disconnect(),l.value&&(e=new IntersectionObserver(c=>{c.some(r=>r.isIntersecting)&&d.value&&x(m())},{rootMargin:"400px"}),e.observe(l.value))}return B(l,I),M(()=>e==null?void 0:e.disconnect()),V(async()=>{try{await k(m())}catch(c){console.log(c)}}),(c,r)=>{const P=L("container");return o(),n("div",U,[t(A,{title:w.value,"back-to":"search"},null,8,["title"]),t(g,{spinning:_.value,tip:"درحال دریافت اطلاعات"},{default:f(()=>[t(P,{class:"coll__body"},{default:f(()=>[t(H,{title:"محصولات این مجموعه",subtitle:"برای دیدن جزئیات، روی محصول ضربه بزنید"}),s(a).length?(o(),n("div",W,[(o(!0),n(N,null,S(s(a),p=>(o(),j(R,{key:p.id,value:p},null,8,["value"]))),128))])):v("",!0),s(d)||s(h)?(o(),n("div",{key:1,ref_key:"sentinel",ref:l,class:"coll__more"},[t(g,{spinning:!0,indicator:!0,fixed:!1,tip:"",cls:"my-[10px]"})],512)):!_.value&&!s(a).length?(o(),n("section",Y,[t(q,{icon:"vuesax-linear:box",size:"26"}),r[0]||(r[0]=E("p",null,"در این مجموعه محصولی ثبت نشده است.",-1))])):v("",!0)]),_:1})]),_:1},8,["spinning"])])}}}),Z=z($,[["__scopeId","data-v-24baa11f"]]);export{Z as default};
|
||||
import{d as b,W as B,a as M,o as V,c as n,p as t,C as f,N as g,i,b as o,m as s,F as N,r as S,g as v,I as q,e as E,h as F,E as L,Y as O,j,_ as z}from"./index-6E0fX61D.js";import{P as A}from"./PageBar-HEcoSwjE.js";import{S as H}from"./SectionHead-YsBbRh09.js";import{P as R}from"./ProductCard-Rxk1Fz5I.js";import{u as T}from"./usePagedProducts-Dfd2dvnx.js";const U={class:"coll"},W={key:0,class:"coll__grid"},Y={key:2,class:"coll__empty"},$=b({__name:"CollectionView",setup(D){const u=O(),{rows:a,loading:y,loadingMore:h,hasMore:d,resetAndLoad:k,loadMore:x}=T(),_=i(()=>y.value&&a.value.length===0),w=i(()=>u.query.page||"مجموعه"),C=i(()=>String(u.params.id??"")),l=F(null);let e;function m(){return{collectionId:C.value,sort:"newest"}}function I(){e==null||e.disconnect(),l.value&&(e=new IntersectionObserver(c=>{c.some(r=>r.isIntersecting)&&d.value&&x(m())},{rootMargin:"400px"}),e.observe(l.value))}return B(l,I),M(()=>e==null?void 0:e.disconnect()),V(async()=>{try{await k(m())}catch(c){console.log(c)}}),(c,r)=>{const P=L("container");return o(),n("div",U,[t(A,{title:w.value,"back-to":"search"},null,8,["title"]),t(g,{spinning:_.value,tip:"درحال دریافت اطلاعات"},{default:f(()=>[t(P,{class:"coll__body"},{default:f(()=>[t(H,{title:"محصولات این مجموعه",subtitle:"برای دیدن جزئیات، روی محصول ضربه بزنید"}),s(a).length?(o(),n("div",W,[(o(!0),n(N,null,S(s(a),p=>(o(),j(R,{key:p.id,value:p},null,8,["value"]))),128))])):v("",!0),s(d)||s(h)?(o(),n("div",{key:1,ref_key:"sentinel",ref:l,class:"coll__more"},[t(g,{spinning:!0,indicator:!0,fixed:!1,tip:"",cls:"my-[10px]"})],512)):!_.value&&!s(a).length?(o(),n("section",Y,[t(q,{icon:"vuesax-linear:box",size:"26"}),r[0]||(r[0]=E("p",null,"در این مجموعه محصولی ثبت نشده است.",-1))])):v("",!0)]),_:1})]),_:1},8,["spinning"])])}}}),Z=z($,[["__scopeId","data-v-24baa11f"]]);export{Z as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{d as v,c as u,p as i,C as p,N as b,T as h,h as l,b as d,e as r,t as w,g as y,aS as C,O as x,E as S,D as P,$ as k,v as D,U as V,K as B,_ as N}from"./index-6E0fX61D.js";import{P as E}from"./PageBar-HEcoSwjE.js";import{S as _}from"./SingleImageUploader-Cogbl9FI.js";const U={class:"cpf"},$={key:0,class:"cpf__error"},I=["disabled"],K=v({__name:"CompleteProfileView",setup(R){const c=P(),s=x({business_license_image_id:null,shop_image_id:null,ncode_image_id:null}),o=l(!1),n=l(!1),t=l(null);async function m(){if(t.value=null,!s.business_license_image_id||!s.shop_image_id||!s.ncode_image_id){k.warning("لطفا تمامی عکس های خواسته شده را آپلود کنید");return}o.value=!0;try{await D.completeProfile({business_license_image_id:s.business_license_image_id,shop_image_id:s.shop_image_id,ncode_image_id:s.ncode_image_id}),V().invalidate(B.profile),n.value=!0}catch{t.value="ثبت اطلاعات انجام نشد. دوباره تلاش کنید."}finally{o.value=!1}}function f(){n.value=!1,c.replace({name:"home"})}return(M,e)=>{const g=S("container");return d(),u("div",U,[i(E,{title:"تکمیل پروفایل","back-to":"userPage::hasSubRoute"}),i(b,{spinning:o.value,tip:"در حال ثبت اطلاعات"},{default:p(()=>[i(g,{class:"cpf__body"},{default:p(()=>[e[4]||(e[4]=r("p",{class:"cpf__lead"}," برای تکمیل پروفایل، سه مدرک زیر را بارگذاری کنید. ",-1)),r("form",{class:"cpf__form",onSubmit:C(m,["prevent"])},[i(_,{"upload-text":"بارگذاری عکس جواز کسب",purpose:"business-license",onDone:e[0]||(e[0]=a=>s.business_license_image_id=a)}),i(_,{"upload-text":"بارگذاری عکس سردر مغازه",purpose:"shop-image",onDone:e[1]||(e[1]=a=>s.shop_image_id=a)}),i(_,{"upload-text":"بارگذاری عکس کارت ملی",purpose:"national-card",onDone:e[2]||(e[2]=a=>s.ncode_image_id=a)}),t.value?(d(),u("p",$,w(t.value),1)):y("",!0),r("button",{type:"submit",class:"cpf__submit",disabled:o.value}," بارگذاری اطلاعات ",8,I)],32)]),_:1})]),_:1},8,["spinning"]),i(h,{show:n.value,"onUpdate:show":e[3]||(e[3]=a=>n.value=a),art:"success",title:"تکمیل اطلاعات شما با موفقیت انجام شد.",description:"مدارک شما با موفقیت بارگذاری شد.","confirm-text":"متوجه شدم","close-on-click-overlay":!1,onConfirm:f},null,8,["show"])])}}}),Y=N(K,[["__scopeId","data-v-978e9d9e"]]);export{Y as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{d as S,b as r,c,f as I,e as d,p as n,I as w,t as h,g as x,h as o,v as $,_ as B,C,N as P,T as D,aS as U,O as V,E as z,D as E,$ as N,U as R,K as T}from"./index-CN-v7uYp.js";import{P as j}from"./PageBar-DNaPusPm.js";const K=["disabled"],L=["src"],M={key:1,class:"siu__icon"},O={class:"siu__text"},Y={key:2,class:"siu__badge"},A={key:0,class:"siu__error"},Q=8*1024*1024,W=S({__name:"SingleImageUploader",props:{uploadText:{},purpose:{}},emits:["done"],setup(g,{emit:b}){const a=g,_=b,l=o(null),i=o(!1),t=o(null),u=o(null),m=o(null);async function s(v){var f;const e=v.target,p=(f=e.files)==null?void 0:f[0];if(e.value="",!!p){if(t.value=null,p.size>Q){t.value="حجم فایل بیش از حد مجاز است (۸ مگابایت)";return}i.value=!0;try{const k=await $.uploadDocument(p,a.purpose);u.value=k.id,m.value=p.type.startsWith("image/")?URL.createObjectURL(p):null,_("done",k.id)}catch{t.value="بارگذاری انجام نشد. دوباره تلاش کنید.",u.value=null,m.value=null}finally{i.value=!1}}}return(v,e)=>(r(),c("div",{class:I(["siu",{"is-done":!!u.value,"is-error":!!t.value}])},[d("input",{ref_key:"input",ref:l,type:"file",accept:"image/jpeg,image/png,image/webp,application/pdf",class:"siu__input",onChange:s},null,544),d("button",{type:"button",class:"siu__box",disabled:i.value,onClick:e[0]||(e[0]=p=>{var f;return(f=l.value)==null?void 0:f.click()})},[m.value?(r(),c("img",{key:0,src:m.value,class:"siu__preview",alt:""},null,8,L)):(r(),c("span",M,[n(w,{icon:i.value?"vuesax-linear:refresh":"vuesax-linear:gallery-add",size:"26"},null,8,["icon"])])),d("span",O,h(i.value?"در حال بارگذاری…":u.value?"تغییر تصویر":g.uploadText),1),u.value&&!i.value?(r(),c("span",Y,[n(w,{icon:"vuesax-linear:tick-circle",size:"16"})])):x("",!0)],8,K),t.value?(r(),c("p",A,h(t.value),1)):x("",!0)],2))}}),y=B(W,[["__scopeId","data-v-3a42e270"]]),X={class:"cpf"},q={key:0,class:"cpf__error"},F=["disabled"],G=S({__name:"CompleteProfileView",setup(g){const b=E(),a=V({business_license_image_id:null,shop_image_id:null,ncode_image_id:null}),_=o(!1),l=o(!1),i=o(null);async function t(){if(i.value=null,!a.business_license_image_id||!a.shop_image_id||!a.ncode_image_id){N.warning("لطفا تمامی عکس های خواسته شده را آپلود کنید");return}_.value=!0;try{await $.completeProfile({business_license_image_id:a.business_license_image_id,shop_image_id:a.shop_image_id,ncode_image_id:a.ncode_image_id}),R().invalidate(T.profile),l.value=!0}catch{i.value="ثبت اطلاعات انجام نشد. دوباره تلاش کنید."}finally{_.value=!1}}function u(){l.value=!1,b.replace({name:"home"})}return(m,s)=>{const v=z("container");return r(),c("div",X,[n(j,{title:"تکمیل پروفایل","back-to":"userPage::hasSubRoute"}),n(P,{spinning:_.value,tip:"در حال ثبت اطلاعات"},{default:C(()=>[n(v,{class:"cpf__body"},{default:C(()=>[s[4]||(s[4]=d("p",{class:"cpf__lead"}," برای تکمیل پروفایل، سه مدرک زیر را بارگذاری کنید. ",-1)),d("form",{class:"cpf__form",onSubmit:U(t,["prevent"])},[n(y,{"upload-text":"بارگذاری عکس جواز کسب",purpose:"business-license",onDone:s[0]||(s[0]=e=>a.business_license_image_id=e)}),n(y,{"upload-text":"بارگذاری عکس سردر مغازه",purpose:"shop-image",onDone:s[1]||(s[1]=e=>a.shop_image_id=e)}),n(y,{"upload-text":"بارگذاری عکس کارت ملی",purpose:"national-card",onDone:s[2]||(s[2]=e=>a.ncode_image_id=e)}),i.value?(r(),c("p",q,h(i.value),1)):x("",!0),d("button",{type:"submit",class:"cpf__submit",disabled:_.value}," بارگذاری اطلاعات ",8,F)],32)]),_:1})]),_:1},8,["spinning"]),n(D,{show:l.value,"onUpdate:show":s[3]||(s[3]=e=>l.value=e),art:"success",title:"تکمیل اطلاعات شما با موفقیت انجام شد.",description:"مدارک شما با موفقیت بارگذاری شد.","confirm-text":"متوجه شدم","close-on-click-overlay":!1,onConfirm:u},null,8,["show"])])}}}),Z=B(G,[["__scopeId","data-v-978e9d9e"]]);export{Z as default};
|
||||
@@ -0,0 +1 @@
|
||||
.cpf__body[data-v-978e9d9e]{padding-top:84px;padding-bottom:110px}.cpf__lead[data-v-978e9d9e]{margin:4px 0 6px;font-size:13px;color:var(--c-inkMuted)}.cpf__form[data-v-978e9d9e]{display:flex;flex-direction:column}.cpf__error[data-v-978e9d9e]{margin:12px 2px 0;font-size:12.5px;color:var(--c-red)}.cpf__submit[data-v-978e9d9e]{position:fixed;left:16px;right:16px;bottom:20px;z-index:20;max-width:736px;margin:0 auto;padding:15px;border:none;border-radius:999px;background:var(--c-wine);color:#fff;font-family:inherit;font-size:15px;font-weight:700;cursor:pointer}.cpf__submit[data-v-978e9d9e]:disabled{opacity:.6;cursor:progress}
|
||||
@@ -0,0 +1 @@
|
||||
.cch__barExtra[data-v-fc544d48]{padding:0 16px 12px}.cch__body[data-v-fc544d48]{padding-top:132px;padding-bottom:90px}.cch__list[data-v-fc544d48]{display:flex;flex-direction:column;padding-top:8px}.cch__card[data-v-fc544d48]{padding:18px 2px;background:transparent;border:none;border-bottom:1px solid var(--c-hairline);cursor:pointer}.cch__card[data-v-fc544d48]:last-child{border-bottom:none}.cch__card[data-v-fc544d48]:active{opacity:.75}.cch__head[data-v-fc544d48]{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:12px}.cch__name[data-v-fc544d48]{margin:0;font-size:15.5px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cch__state[data-v-fc544d48]{flex:0 0 auto;padding:4px 12px;border-radius:999px;font-size:11.5px;font-weight:600}.cch__state.is-on[data-v-fc544d48]{color:var(--c-green);background:rgb(var(--c-green-rgb) / 14%)}.cch__state.is-off[data-v-fc544d48]{color:var(--c-red);background:rgb(var(--c-red-rgb) / 12%)}.cch__facts[data-v-fc544d48]{display:flex;flex-direction:column;gap:7px}.cch__fact[data-v-fc544d48]{display:flex;align-items:center;gap:7px;font-size:13px;font-weight:600;color:var(--c-inkFaint)}.cch__empty[data-v-fc544d48]{margin-top:8px;padding:34px 20px;border:1px dashed var(--c-hairline);border-radius:18px;display:flex;flex-direction:column;align-items:center;gap:10px;color:var(--c-inkFaint)}.cch__empty p[data-v-fc544d48]{margin:0;font-size:12.5px}.cch__retry[data-v-fc544d48]{padding:8px 18px;border-radius:999px;border:1px solid var(--c-hairline);background:var(--c-canvas);font-family:inherit;font-size:12px;font-weight:600;cursor:pointer}.cch__detail[data-v-fc544d48]{padding:20px 16px 24px}.cch__detailTitle[data-v-fc544d48]{margin:0 0 16px;font-size:17px;font-weight:700}.cch__rows[data-v-fc544d48]{margin:0;display:flex;flex-direction:column}.cch__row[data-v-fc544d48]{display:flex;justify-content:space-between;align-items:center;padding:13px 2px;border-bottom:1px solid var(--c-hairline)}.cch__row[data-v-fc544d48]:last-child{border-bottom:none}.cch__row dt[data-v-fc544d48]{font-size:13px;color:var(--c-inkFaint)}.cch__row dd[data-v-fc544d48]{margin:0;font-size:14px;font-weight:600}.cch__enter[data-v-fc544d48]{margin-top:18px;width:100%;padding:13px;border:none;border-radius:14px;background:var(--c-wine);color:#fff;font-family:inherit;font-size:14px;font-weight:700;cursor:pointer}.cch__enter[data-v-fc544d48]:disabled{opacity:.6;cursor:default}.cch__actions[data-v-fc544d48]{display:flex;gap:10px;margin-top:10px}.cch__act[data-v-fc544d48]{flex:1;padding:12px;border:1px solid var(--c-wine);border-radius:14px;background:transparent;color:var(--c-wine);font-family:inherit;font-size:13.5px;font-weight:700;cursor:pointer}.cch__act.is-danger[data-v-fc544d48]{border-color:var(--c-red);color:var(--c-red)}.cch__act[data-v-fc544d48]:disabled{opacity:.5;cursor:default}.cch__confirm[data-v-fc544d48]{display:flex;align-items:center;gap:10px;margin:12px 0 0;font-size:13px;color:var(--c-inkSoft)}.cch__link[data-v-fc544d48]{border:none;background:transparent;color:var(--c-inkFaint);font-family:inherit;font-size:12.5px;cursor:pointer}.cch__field[data-v-fc544d48]{display:flex;flex-direction:column;gap:5px;padding:8px 0;font-size:12.5px;color:var(--c-inkSoft)}.cch__field input[data-v-fc544d48],.cch__field textarea[data-v-fc544d48]{width:100%;padding:10px 12px;border:1px solid var(--c-hairline);border-radius:12px;background:transparent;color:var(--c-ink);font-family:inherit;font-size:14px}.cch__error[data-v-fc544d48]{margin:8px 0 0;font-size:12.5px;color:var(--c-red)}.cch__close[data-v-fc544d48]{margin-top:10px;width:100%;padding:13px;border:1px solid rgb(var(--c-ink-rgb) / 35%);border-radius:14px;background:transparent;color:var(--c-ink);font-family:inherit;font-size:14px;font-weight:700;cursor:pointer}
|
||||
@@ -1 +0,0 @@
|
||||
.cch__barExtra[data-v-bd288253]{padding:0 16px 12px}.cch__body[data-v-bd288253]{padding-top:132px;padding-bottom:90px}.cch__list[data-v-bd288253]{display:flex;flex-direction:column;padding-top:8px}.cch__card[data-v-bd288253]{padding:18px 2px;background:transparent;border:none;border-bottom:1px solid var(--c-hairline);cursor:pointer}.cch__card[data-v-bd288253]:last-child{border-bottom:none}.cch__card[data-v-bd288253]:active{opacity:.75}.cch__head[data-v-bd288253]{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:12px}.cch__name[data-v-bd288253]{margin:0;font-size:15.5px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cch__state[data-v-bd288253]{flex:0 0 auto;padding:4px 12px;border-radius:999px;font-size:11.5px;font-weight:600}.cch__state.is-on[data-v-bd288253]{color:var(--c-green);background:rgb(var(--c-green-rgb) / 14%)}.cch__state.is-off[data-v-bd288253]{color:var(--c-red);background:rgb(var(--c-red-rgb) / 12%)}.cch__facts[data-v-bd288253]{display:flex;flex-direction:column;gap:7px}.cch__fact[data-v-bd288253]{display:flex;align-items:center;gap:7px;font-size:13px;font-weight:600;color:var(--c-inkFaint)}.cch__empty[data-v-bd288253]{margin-top:8px;padding:34px 20px;border:1px dashed var(--c-hairline);border-radius:18px;display:flex;flex-direction:column;align-items:center;gap:10px;color:var(--c-inkFaint)}.cch__empty p[data-v-bd288253]{margin:0;font-size:12.5px}.cch__retry[data-v-bd288253]{padding:8px 18px;border-radius:999px;border:1px solid var(--c-hairline);background:var(--c-canvas);font-family:inherit;font-size:12px;font-weight:600;cursor:pointer}.cch__detail[data-v-bd288253]{padding:20px 16px 24px}.cch__detailTitle[data-v-bd288253]{margin:0 0 16px;font-size:17px;font-weight:700}.cch__rows[data-v-bd288253]{margin:0;display:flex;flex-direction:column}.cch__row[data-v-bd288253]{display:flex;justify-content:space-between;align-items:center;padding:13px 2px;border-bottom:1px solid var(--c-hairline)}.cch__row[data-v-bd288253]:last-child{border-bottom:none}.cch__row dt[data-v-bd288253]{font-size:13px;color:var(--c-inkFaint)}.cch__row dd[data-v-bd288253]{margin:0;font-size:14px;font-weight:600}.cch__enter[data-v-bd288253]{margin-top:18px;width:100%;padding:13px;border:none;border-radius:14px;background:var(--c-wine);color:#fff;font-family:inherit;font-size:14px;font-weight:700;cursor:pointer}.cch__enter[data-v-bd288253]:disabled{opacity:.6;cursor:default}.cch__close[data-v-bd288253]{margin-top:10px;width:100%;padding:13px;border:1px solid rgb(var(--c-ink-rgb) / 35%);border-radius:14px;background:transparent;color:var(--c-ink);font-family:inherit;font-size:14px;font-weight:700;cursor:pointer}
|
||||
@@ -1 +0,0 @@
|
||||
import{d as A,S as D,Q as P,o as R,c,p as n,C as _,N as B,m as E,h as i,v as F,b as r,e as s,F as I,r as U,I as v,t as o,g as b,$ as L,E as M,D as O,f as Q,_ as T}from"./index-CN-v7uYp.js";import{A as j}from"./AppPullRefresh-D5o9arkH.js";import{P as q}from"./PageBar-DNaPusPm.js";import{S as G}from"./SearchInput-CvqnREPV.js";import{D as H}from"./index-CQtdsSs3.js";import"./KeyCode-Dl7BYvJp.js";import"./classCallCheck-DJjGN2cU.js";import"./raf-nDFcuFT6.js";const J={class:"cch"},K={class:"cch__barExtra"},W={key:0,class:"cch__list"},X=["onClick"],Y={class:"cch__head"},Z={class:"cch__name"},ss={class:"cch__facts"},es={class:"cch__fact"},ts={dir:"ltr"},as={class:"cch__fact"},os={dir:"ltr"},ls={key:0,class:"cch__fact"},ns={key:1,class:"cch__empty"},cs={key:2,class:"cch__empty"},is={key:0,class:"cch__detail"},rs={class:"cch__detailTitle"},ds={class:"cch__rows"},us={class:"cch__row"},_s={dir:"ltr"},vs={class:"cch__row"},hs={dir:"ltr"},ps={class:"cch__row"},fs={class:"cch__row"},ms={class:"cch__row"},bs={dir:"ltr"},ys={class:"cch__row"},gs={dir:"ltr"},ws={class:"cch__row"},Cs=["disabled"],ks=A({__name:"CustomerChoiceView",setup(xs){const C=O(),k=D(),x=P(),h=i(!1),d=i([]),p=i(!1),y=i(!1),f=i(!1),g=i(null),u=i(!1),l=i(null);function w(t){const e=Number(t??0);return Number.isFinite(e)?e.toFixed(3):"0.000"}async function m(){p.value=!0,f.value=!1;try{d.value=await F.getExpertCustomers(g.value)}catch{f.value=!0,d.value=[]}finally{p.value=!1}}async function S(t){g.value=t!=null&&t.trim()?t.trim():null,await m()}async function V(){try{await m()}finally{y.value=!1}}function z(t){l.value=t,u.value=!0}async function N(t){h.value=!0;try{x.clear(),k.setActingAs({id:t.id,name:t.name??t.fullName??t.mobile??""}),u.value=!1,await C.push({name:"userPage::hasSubRoute"}),L.success(`وارد حساب ${t.name??""} شدید`)}finally{h.value=!1}}return R(m),(t,e)=>{const $=M("container");return r(),c("div",J,[n(q,{title:"لیست مشتریان","back-to":"userPage::hasSubRoute"},{below:_(()=>[s("div",K,[n(G,{onSearch:S,"place-holder":"جستجو"})])]),_:1}),n(B,{spinning:p.value&&!d.value.length,tip:"درحال دریافت اطلاعات"},{default:_(()=>[n(j,{modelValue:y.value,"onUpdate:modelValue":e[0]||(e[0]=a=>y.value=a),onRefresh:V},{default:_(()=>[n($,{class:"cch__body"},{default:_(()=>[d.value.length?(r(),c("div",W,[(r(!0),c(I,null,U(d.value,a=>(r(),c("article",{key:a.id,class:"cch__card",onClick:Ss=>z(a)},[s("div",Y,[s("h3",Z,o(a.name),1),s("span",{class:Q(["cch__state",a.active===1?"is-on":"is-off"])},o(a.active===1?"فعال":"غیرفعال"),3)]),s("div",ss,[s("div",es,[n(v,{icon:"vuesax-linear:mobile",size:"15"}),s("span",ts,o(a.mobile||"—"),1)]),s("div",as,[n(v,{icon:"vuesax-linear:call",size:"15"}),s("span",os,o(a.phone||"—"),1)]),a.store_name?(r(),c("div",ls,[n(v,{icon:"vuesax-linear:shop",size:"15"}),s("span",null,o(a.store_name),1)])):b("",!0)])],8,X))),128))])):!p.value&&!f.value?(r(),c("section",ns,[n(v,{icon:"vuesax-linear:profile-2user",size:"26"}),s("p",null,o(g.value?"مشتری با این مشخصات پیدا نشد.":"هنوز مشتریای به شما معرفی نشده است."),1)])):b("",!0),f.value?(r(),c("section",cs,[n(v,{icon:"vuesax-linear:danger",size:"26"}),e[4]||(e[4]=s("p",null,"دریافت اطلاعات با خطا روبهرو شد.",-1)),s("button",{type:"button",class:"cch__retry",onClick:m},"تلاش دوباره")])):b("",!0)]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["spinning"]),n(E(H),{visible:u.value,"onUpdate:visible":e[3]||(e[3]=a=>u.value=a),placement:"bottom",height:"auto",closable:!1,"body-style":{padding:"0"}},{default:_(()=>[l.value?(r(),c("div",is,[s("h2",rs,o(l.value.name),1),s("dl",ds,[s("div",us,[e[5]||(e[5]=s("dt",null,"موبایل",-1)),s("dd",_s,o(l.value.mobile||"—"),1)]),s("div",vs,[e[6]||(e[6]=s("dt",null,"تلفن",-1)),s("dd",hs,o(l.value.phone||"—"),1)]),s("div",ps,[e[7]||(e[7]=s("dt",null,"نام مغازه",-1)),s("dd",null,o(l.value.store_name||"—"),1)]),s("div",fs,[e[8]||(e[8]=s("dt",null,"نام پاساژ",-1)),s("dd",null,o(l.value.pasazh_name||"—"),1)]),s("div",ms,[e[9]||(e[9]=s("dt",null,"سقف اعتبار",-1)),s("dd",bs,o(w(l.value.gram_level))+" گرم",1)]),s("div",ys,[e[10]||(e[10]=s("dt",null,"بدهی گرمی",-1)),s("dd",gs,o(w(l.value.remain))+" گرم",1)]),s("div",ws,[e[11]||(e[11]=s("dt",null,"وضعیت",-1)),s("dd",null,o(l.value.active===1?"فعال":"غیرفعال"),1)])]),s("button",{type:"button",class:"cch__enter",disabled:h.value,onClick:e[1]||(e[1]=a=>N(l.value))},o(h.value?"در حال ورود…":"ورود به حساب این مشتری"),9,Cs),s("button",{type:"button",class:"cch__close",onClick:e[2]||(e[2]=a=>u.value=!1)},"بستن")])):b("",!0)]),_:1},8,["visible"])])}}}),Bs=T(ks,[["__scopeId","data-v-bd288253"]]);export{Bs as default};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
import{d as g,aT as h,o as y,W as b,c as r,p as a,C as v,N as k,h as _,v as C,b as s,F as f,e as u,r as P,I as B,m as F,g as w,D as x,i as V,E as I,j as N,_ as S}from"./index-CN-v7uYp.js";import{P as $}from"./PageBar-DNaPusPm.js";import{S as j}from"./SectionHead-CvKB7By7.js";import{P as E}from"./ProductCard-aZrPdL37.js";const R={class:"favs"},z={class:"favs__grid"},D={key:1,class:"favs__empty"},H=g({__name:"FavoritesView",setup(L){const p=x(),i=h(),o=_(!1),n=_([]),l=V(()=>n.value.filter(t=>i.isFavorite(t.id)));async function d(){const t=i.ids;if(t.length===0){n.value=[];return}o.value=n.value.length===0;try{n.value=await C.getProductsByIds(t)}catch(e){console.log(e)}finally{o.value=!1}}return y(d),b(()=>i.ids.join(","),d),(t,e)=>{const m=I("container");return s(),r("div",R,[a($,{title:"علاقهمندی","back-to":"userPage::hasSubRoute"}),a(k,{spinning:o.value,tip:"در حال دریافت اطلاعات"},{default:v(()=>[a(m,{class:"favs__body"},{default:v(()=>[l.value.length?(s(),r(f,{key:0},[a(j,{title:"ذخیرهشدهها",subtitle:`${l.value.length} محصول`},null,8,["subtitle"]),u("div",z,[(s(!0),r(f,null,P(l.value,c=>(s(),N(E,{key:c.id,value:c},null,8,["value"]))),128))])],64)):o.value?w("",!0):(s(),r("section",D,[a(B,{icon:"vuesax-linear:heart",size:"26"}),e[1]||(e[1]=u("p",null,"هنوز محصولی را به علاقهمندیها اضافه نکردهاید.",-1)),u("button",{type:"button",class:"favs__emptyCta",onClick:e[0]||(e[0]=c=>F(p).push({name:"home"}))}," دیدن محصولات ")]))]),_:1})]),_:1},8,["spinning"])])}}}),A=S(H,[["__scopeId","data-v-44c1c9b1"]]);export{A as default};
|
||||
import{d as g,aT as h,o as y,W as b,c as r,p as a,C as v,N as k,h as _,v as C,b as s,F as f,e as u,r as P,I as B,m as F,g as w,D as x,i as V,E as I,j as N,_ as S}from"./index-6E0fX61D.js";import{P as $}from"./PageBar-HEcoSwjE.js";import{S as j}from"./SectionHead-YsBbRh09.js";import{P as E}from"./ProductCard-Rxk1Fz5I.js";const R={class:"favs"},z={class:"favs__grid"},D={key:1,class:"favs__empty"},H=g({__name:"FavoritesView",setup(L){const p=x(),i=h(),o=_(!1),n=_([]),l=V(()=>n.value.filter(t=>i.isFavorite(t.id)));async function d(){const t=i.ids;if(t.length===0){n.value=[];return}o.value=n.value.length===0;try{n.value=await C.getProductsByIds(t)}catch(e){console.log(e)}finally{o.value=!1}}return y(d),b(()=>i.ids.join(","),d),(t,e)=>{const m=I("container");return s(),r("div",R,[a($,{title:"علاقهمندی","back-to":"userPage::hasSubRoute"}),a(k,{spinning:o.value,tip:"در حال دریافت اطلاعات"},{default:v(()=>[a(m,{class:"favs__body"},{default:v(()=>[l.value.length?(s(),r(f,{key:0},[a(j,{title:"ذخیرهشدهها",subtitle:`${l.value.length} محصول`},null,8,["subtitle"]),u("div",z,[(s(!0),r(f,null,P(l.value,c=>(s(),N(E,{key:c.id,value:c},null,8,["value"]))),128))])],64)):o.value?w("",!0):(s(),r("section",D,[a(B,{icon:"vuesax-linear:heart",size:"26"}),e[1]||(e[1]=u("p",null,"هنوز محصولی را به علاقهمندیها اضافه نکردهاید.",-1)),u("button",{type:"button",class:"favs__emptyCta",onClick:e[0]||(e[0]=c=>F(p).push({name:"home"}))}," دیدن محصولات ")]))]),_:1})]),_:1},8,["spinning"])])}}}),A=S(H,[["__scopeId","data-v-44c1c9b1"]]);export{A as default};
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
import{aL as p,aB as g,a7 as F,aP as C,an as x,W as y,af as v,a as h,a8 as b,i as f,h as P,d as j,at as m}from"./index-6E0fX61D.js";function B(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,e=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,n=t;if(Array.isArray(t)&&(n=p(t)[0]),!n)return null;var o=g(n,r,e);return o.props=a?F(F({},o.props),r):o.props,C(x(o.props.class)!=="object","class must be string"),o}var u=Symbol("ContextProps"),l=Symbol("InternalContextProps"),K=function(r){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f(function(){return!0}),e=P(new Map),n=function(i,I){e.value.set(i,I),e.value=new Map(e.value)},o=function(i){e.value.delete(i),e.value=new Map(e.value)};y([a,e],function(){}),m(u,r),m(l,{addFormItemField:n,removeFormItemField:o})},s={id:f(function(){}),onFieldBlur:function(){},onFieldChange:function(){},clearValidate:function(){}},d={addFormItemField:function(){},removeFormItemField:function(){}},M=function(){var r=v(l,d),a=Symbol("FormItemFieldKey"),e=b();return r.addFormItemField(a,e.type),h(function(){r.removeFormItemField(a)}),m(l,d),m(u,s),v(u,s)};const S=j({compatConfig:{MODE:3},name:"AFormItemRest",setup:function(r,a){var e=a.slots;return m(l,d),m(u,s),function(){var n;return(n=e.default)===null||n===void 0?void 0:n.call(e)}}});export{S as F,M as a,B as c,K as u};
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
import{d as c,S as i,o as m,v as r,c as l,D as _,b as p}from"./index-CN-v7uYp.js";const g={style:{"min-height":"100vh",display:"grid","place-items":"center"}},h=c({__name:"IamCallback",setup(u){const a=_(),s=i();function o(){sessionStorage.setItem("gb_iam_sso_skip","1");const e=sessionStorage.getItem("gb_iam_return");sessionStorage.removeItem("gb_iam_return");const t=e&&e.startsWith("/")&&!e.startsWith("//")?e:"/";return a.replace(t)}return m(async()=>{const e=new URLSearchParams(window.location.search);if(sessionStorage.removeItem("gb_iam_sso_checked"),e.get("error")||!e.get("code")||!e.get("state")){await o();return}try{const t=await r.ssoCallback(e.get("code"),e.get("state"));s.login(t.token,t.customer.id,t.customer.mobile);try{const n=await r.getExpertIdentity();s.setSalesExpert(n.isSalesExpert)}catch{s.setSalesExpert(!1)}await a.replace({name:"home"})}catch{await o()}}),(e,t)=>(p(),l("div",g,"در حال ورود..."))}});export{h as default};
|
||||
import{d as c,S as i,o as m,v as r,c as l,D as _,b as p}from"./index-6E0fX61D.js";const g={style:{"min-height":"100vh",display:"grid","place-items":"center"}},h=c({__name:"IamCallback",setup(u){const a=_(),s=i();function o(){sessionStorage.setItem("gb_iam_sso_skip","1");const e=sessionStorage.getItem("gb_iam_return");sessionStorage.removeItem("gb_iam_return");const t=e&&e.startsWith("/")&&!e.startsWith("//")?e:"/";return a.replace(t)}return m(async()=>{const e=new URLSearchParams(window.location.search);if(sessionStorage.removeItem("gb_iam_sso_checked"),e.get("error")||!e.get("code")||!e.get("state")){await o();return}try{const t=await r.ssoCallback(e.get("code"),e.get("state"));s.login(t.token,t.customer.id,t.customer.mobile);try{const n=await r.getExpertIdentity();s.setSalesExpert(n.isSalesExpert)}catch{s.setSalesExpert(!1)}await a.replace({name:"home"})}catch{await o()}}),(e,t)=>(p(),l("div",g,"در حال ورود..."))}});export{h as default};
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
import{af as d,i as f,at as g,d as P,ah as p,P as C,W as R,a3 as T,z as h,a as m,p as x,aR as y}from"./index-CN-v7uYp.js";var E=!1;try{var c=Object.defineProperty({},"passive",{get:function(){E=!0}});window.addEventListener("testPassive",null,c),window.removeEventListener("testPassive",null,c)}catch{}var j=Symbol("TriggerContextKey"),N=function(e){return e?d(j,{setPortal:function(){},popPortal:!1}):{setPortal:function(){},popPortal:!1}},v=Symbol("PortalContextKey"),D=function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{inTriggerContext:!0};g(v,{inTriggerContext:i.inTriggerContext,shouldRender:f(function(){var n=e||{},u=n.sPopupVisible,t=n.popupRef,l=n.forceRender,r=n.autoDestroy,s=!1;return(u||t||l)&&(s=!0),!u&&r&&(s=!1),s})})},I=function(){D({},{inTriggerContext:!1});var e=d(v,{shouldRender:f(function(){return!1}),inTriggerContext:!1});return{shouldRender:f(function(){return e.shouldRender.value||e.inTriggerContext===!1})}};const b=P({compatConfig:{MODE:3},name:"Portal",inheritAttrs:!1,props:{getContainer:p.func.isRequired,didUpdate:Function},setup:function(e,i){var n=i.slots,u=!0,t,l=I(),r=l.shouldRender;C(function(){u=!1,r.value&&(t=e.getContainer())});var s=R(r,function(){r.value&&!t&&(t=e.getContainer()),t&&s()});return T(function(){h(function(){if(r.value){var o;(o=e.didUpdate)===null||o===void 0||o.call(e,e)}})}),m(function(){t&&t.parentNode&&t.parentNode.removeChild(t)}),function(){if(!r.value)return null;if(u){var o;return(o=n.default)===null||o===void 0?void 0:o.call(n)}return t?x(y,{to:t},n):null}}});var w={ESC:27,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40};export{w as K,b as P,N as a,E as s,D as u};
|
||||
import{af as d,i as f,at as g,d as P,ah as p,P as C,W as R,a3 as T,z as h,a as m,p as x,aR as y}from"./index-6E0fX61D.js";var E=!1;try{var c=Object.defineProperty({},"passive",{get:function(){E=!0}});window.addEventListener("testPassive",null,c),window.removeEventListener("testPassive",null,c)}catch{}var j=Symbol("TriggerContextKey"),K=function(e){return e?d(j,{setPortal:function(){},popPortal:!1}):{setPortal:function(){},popPortal:!1}},v=Symbol("PortalContextKey"),N=function(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{inTriggerContext:!0};g(v,{inTriggerContext:i.inTriggerContext,shouldRender:f(function(){var n=e||{},u=n.sPopupVisible,t=n.popupRef,l=n.forceRender,r=n.autoDestroy,s=!1;return(u||t||l)&&(s=!0),!u&&r&&(s=!1),s})})},D=function(){N({},{inTriggerContext:!1});var e=d(v,{shouldRender:f(function(){return!1}),inTriggerContext:!1});return{shouldRender:f(function(){return e.shouldRender.value||e.inTriggerContext===!1})}};const b=P({compatConfig:{MODE:3},name:"Portal",inheritAttrs:!1,props:{getContainer:p.func.isRequired,didUpdate:Function},setup:function(e,i){var n=i.slots,u=!0,t,l=D(),r=l.shouldRender;C(function(){u=!1,r.value&&(t=e.getContainer())});var s=R(r,function(){r.value&&!t&&(t=e.getContainer()),t&&s()});return T(function(){h(function(){if(r.value){var o;(o=e.didUpdate)===null||o===void 0||o.call(e,e)}})}),m(function(){t&&t.parentNode&&t.parentNode.removeChild(t)}),function(){if(!r.value)return null;if(u){var o;return(o=n.default)===null||o===void 0?void 0:o.call(n)}return t?x(y,{to:t},n):null}}});var w={ENTER:13,ESC:27,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40};export{w as K,b as P,K as a,E as s,N as u};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
.mks__body[data-v-61838cff]{padding-top:84px;padding-bottom:90px}.mks__card[data-v-61838cff]{padding:18px 2px;border-bottom:1px solid var(--c-hairline)}.mks__track[data-v-61838cff]{display:flex;justify-content:space-between;gap:4px;margin:0 0 16px;padding:0;list-style:none}.mks__track li[data-v-61838cff]{flex:1;display:flex;flex-direction:column;align-items:center;gap:6px;text-align:center;font-size:10.5px;color:var(--c-inkFaint)}.mks__track i[data-v-61838cff]{display:block;width:100%;height:3px;border-radius:999px;background:var(--c-hairline)}.mks__track li.is-done[data-v-61838cff]{color:var(--c-inkSoft)}.mks__track li.is-done i[data-v-61838cff]{background:var(--c-wine)}.mks__track li.is-now[data-v-61838cff]{color:var(--c-wine);font-weight:800}.mks__track li.is-now i[data-v-61838cff]{background:var(--c-wine);opacity:.55}.mks__cancelled[data-v-61838cff]{margin:0 0 12px;font-size:12.5px;font-weight:700;color:var(--c-red)}.mks__facts[data-v-61838cff]{display:grid;grid-template-columns:1fr 1fr;gap:8px 14px;margin:0}.mks__facts div[data-v-61838cff]{display:flex;gap:6px;font-size:12.5px}.mks__facts dt[data-v-61838cff]{color:var(--c-inkFaint)}.mks__facts dd[data-v-61838cff]{margin:0;font-weight:700;color:var(--c-ink)}.mks__note[data-v-61838cff]{margin:12px 0 0;font-size:12.5px;color:var(--c-inkSoft)}.mks__photo[data-v-61838cff]{display:block;width:100%;max-height:260px;margin-top:12px;border-radius:14px;-o-object-fit:cover;object-fit:cover}.mks__empty[data-v-61838cff]{display:flex;flex-direction:column;align-items:center;gap:10px;padding:48px 0;color:var(--c-inkFaint);text-align:center}.mks__cta[data-v-61838cff]{padding:11px 22px;border:none;border-radius:999px;background:var(--c-wine);color:#fff;font-family:inherit;font-size:13.5px;font-weight:700;cursor:pointer}
|
||||
@@ -0,0 +1 @@
|
||||
import{d as A,o as B,c as e,p as o,C as m,N as O,h as i,v as z,b as n,F as y,r as g,I as b,e as s,m as w,g as _,D as M,E as N,f as R,t as a,_ as D}from"./index-6E0fX61D.js";import{A as E}from"./AppPullRefresh-B0f-tYJA.js";import{P as I}from"./PageBar-HEcoSwjE.js";import{j as L}from"./filters-CmtC5ctw.js";const T={class:"mks"},j=["aria-label"],F={key:1,class:"mks__cancelled"},$={class:"mks__facts"},G={dir:"ltr"},U={dir:"ltr"},Z={key:2,class:"mks__note"},q=["src"],H={key:0,class:"mks__empty"},J={key:1,class:"mks__empty"},K=A({__name:"MakeOrderStatusView",setup(Q){const C=M(),V=["ثبت سفارش","تایید ادمین","تایید کارگاه","ارسال","تحویل شده"],r=i([]),u=i(!1),p=i(!1),d=i(!1);function x(c){return new Date(c).toLocaleTimeString("en-GB",{hour:"2-digit",minute:"2-digit",timeZone:"Asia/Tehran"})}async function f(){u.value=!0,d.value=!1;try{r.value=(await z.getMyPreOrders()).rows}catch{d.value=!0}finally{u.value=!1}}async function S(){try{await f()}finally{p.value=!1}}return B(f),(c,l)=>{const P=N("container");return n(),e("div",T,[o(I,{title:"وضعیت سفارش","back-to":"userPage::hasSubRoute"}),o(O,{spinning:u.value&&!r.value.length,tip:"درحال دریافت اطلاعات"},{default:m(()=>[o(E,{modelValue:p.value,"onUpdate:modelValue":l[1]||(l[1]=t=>p.value=t),onRefresh:S},{default:m(()=>[o(P,{class:"mks__body"},{default:m(()=>[(n(!0),e(y,null,g(r.value,t=>(n(),e("article",{key:t.id,class:"mks__card"},[t.step>0?(n(),e("ol",{key:0,class:"mks__track","aria-label":t.sts_str_fa},[(n(),e(y,null,g(V,(v,k)=>s("li",{key:v,class:R({"is-done":t.step>k+1,"is-now":t.step===k+1})},[l[2]||(l[2]=s("i",{"aria-hidden":"true"},null,-1)),s("span",null,a(v),1)],2)),64))],8,j)):(n(),e("p",F,"این سفارش لغو شده است.")),s("dl",$,[s("div",null,[l[3]||(l[3]=s("dt",null,"رنگ محصول",-1)),s("dd",null,a(t.color||"—"),1)]),s("div",null,[l[4]||(l[4]=s("dt",null,"سایز محصول",-1)),s("dd",null,a(t.size||"—"),1)]),s("div",null,[l[5]||(l[5]=s("dt",null,"رنگ مینا",-1)),s("dd",null,a(t.color_mina||"—"),1)]),s("div",null,[l[6]||(l[6]=s("dt",null,"رنگ سنگ",-1)),s("dd",null,a(t.color_stone||"—"),1)]),s("div",null,[l[7]||(l[7]=s("dt",null,"تعداد",-1)),s("dd",null,a(t.sum),1)]),s("div",null,[l[8]||(l[8]=s("dt",null,"وضعیت",-1)),s("dd",null,a(t.sts_str_fa),1)]),s("div",null,[l[9]||(l[9]=s("dt",null,"تاریخ ثبت",-1)),s("dd",G,a(w(L)(t.createdAt)),1)]),s("div",null,[l[10]||(l[10]=s("dt",null,"ساعت ثبت",-1)),s("dd",U,a(x(t.createdAt)),1)])]),t.description?(n(),e("p",Z,a(t.description),1)):_("",!0),t.image?(n(),e("img",{key:3,class:"mks__photo",src:t.image,alt:""},null,8,q)):_("",!0)]))),128)),!r.value.length&&!u.value&&!d.value?(n(),e("section",H,[o(b,{icon:"vuesax-linear:box",size:"26"}),l[11]||(l[11]=s("p",null,"هنوز سفارش ساختی ثبت نکردهاید.",-1)),s("button",{type:"button",class:"mks__cta",onClick:l[0]||(l[0]=t=>w(C).push({name:"makeOrderList"}))},"ثبت سفارش")])):_("",!0),d.value?(n(),e("section",J,[o(b,{icon:"vuesax-linear:danger",size:"26"}),l[12]||(l[12]=s("p",null,"دریافت اطلاعات با خطا روبهرو شد.",-1)),s("button",{type:"button",class:"mks__cta",onClick:f},"تلاش دوباره")])):_("",!0)]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["spinning"])])}}}),ss=D(K,[["__scopeId","data-v-61838cff"]]);export{ss as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{d as b,W as k,c as u,p as a,C as d,N as g,h as m,b as p,e as o,w as n,aU as i,t as x,g as y,aS as V,O as w,E as U,D as S,v as z,$ as C,_ as M}from"./index-6E0fX61D.js";import{P as N}from"./PageBar-HEcoSwjE.js";import{S as O}from"./SingleImageUploader-Cogbl9FI.js";const B={class:"mko"},D={class:"mko__field"},P={class:"mko__field"},I={class:"mko__field"},E={class:"mko__field"},R={class:"mko__field"},$={class:"mko__field"},T={key:0,class:"mko__error"},W=["disabled"],j=b({__name:"MakeOrderView",setup(q){const _=S(),e=w({file_id:null,color:"",size:"",color_mina:"",color_stone:"",sum:1,description:""}),r=m(!1),l=m(null);k(e,()=>l.value=null);function f(){return e.file_id?e.color?e.size?e.color_mina?e.color_stone?!Number.isInteger(e.sum)||e.sum<1?"لطفا تعداد را وارد کنید":null:"لطفا رنگ سنگ را وارد کنید":"لطفا رنگ مینا را وارد کنید":"لطفا سایز محصول را وارد کنید":"لطفا رنگ محصول را وارد کنید":"لطفا تصویر سفارش را آپلود کنید"}async function c(){if(l.value=f(),!l.value){r.value=!0;try{await z.createPreOrder({color:e.color,size:e.size,color_mina:e.color_mina,color_stone:e.color_stone,sum:e.sum,file_id:e.file_id,description:e.description||void 0}),C.success("سفارش با موفقیت ثبت شد"),_.replace({name:"makeOrderStatus"})}catch{l.value="خطا در ثبت سفارش"}finally{r.value=!1}}}return(A,t)=>{const v=U("container");return p(),u("div",B,[a(N,{title:"سفارش ساخت","back-to":"userPage::hasSubRoute"}),a(g,{spinning:r.value,tip:"در حال ثبت اطلاعات"},{default:d(()=>[a(v,{class:"mko__body"},{default:d(()=>[o("form",{class:"mko__form",novalidate:"",onSubmit:V(c,["prevent"])},[a(O,{"upload-text":"بارگذاری عکس سفارش",purpose:"preorder-design",onDone:t[0]||(t[0]=s=>e.file_id=s)}),t[13]||(t[13]=o("p",{class:"mko__lead"},"لطفا به سوالات زیر پاسخ دهید",-1)),o("label",D,[t[7]||(t[7]=o("span",null,"رنگ محصول",-1)),n(o("input",{"onUpdate:modelValue":t[1]||(t[1]=s=>e.color=s),type:"text",maxlength:"100"},null,512),[[i,e.color,void 0,{trim:!0}]])]),o("label",P,[t[8]||(t[8]=o("span",null,"سایز محصول",-1)),n(o("input",{"onUpdate:modelValue":t[2]||(t[2]=s=>e.size=s),type:"text",maxlength:"100"},null,512),[[i,e.size,void 0,{trim:!0}]])]),o("label",I,[t[9]||(t[9]=o("span",null,"رنگ مینا",-1)),n(o("input",{"onUpdate:modelValue":t[3]||(t[3]=s=>e.color_mina=s),type:"text",maxlength:"100"},null,512),[[i,e.color_mina,void 0,{trim:!0}]])]),o("label",E,[t[10]||(t[10]=o("span",null,"رنگ سنگ",-1)),n(o("input",{"onUpdate:modelValue":t[4]||(t[4]=s=>e.color_stone=s),type:"text",maxlength:"100"},null,512),[[i,e.color_stone,void 0,{trim:!0}]])]),o("label",R,[t[11]||(t[11]=o("span",null,"تعداد",-1)),n(o("input",{"onUpdate:modelValue":t[5]||(t[5]=s=>e.sum=s),type:"number",inputmode:"numeric",min:"1",step:"1"},null,512),[[i,e.sum,void 0,{number:!0}]])]),o("label",$,[t[12]||(t[12]=o("span",null,"توضیحات",-1)),n(o("textarea",{"onUpdate:modelValue":t[6]||(t[6]=s=>e.description=s),rows:"3",maxlength:"1000"},null,512),[[i,e.description,void 0,{trim:!0}]])]),l.value?(p(),u("p",T,x(l.value),1)):y("",!0),o("button",{type:"submit",class:"mko__submit",disabled:r.value},"ارسال اطلاعات",8,W)],32)]),_:1})]),_:1},8,["spinning"])])}}}),J=M(j,[["__scopeId","data-v-2e17d169"]]);export{J as default};
|
||||
@@ -0,0 +1 @@
|
||||
.mko__body[data-v-2e17d169]{padding-top:84px;padding-bottom:110px}.mko__form[data-v-2e17d169]{display:flex;flex-direction:column}.mko__lead[data-v-2e17d169]{margin:18px 2px 4px;font-size:13px;font-weight:700;color:var(--c-inkMuted)}.mko__field[data-v-2e17d169]{display:flex;flex-direction:column;gap:6px;padding:12px 0;border-bottom:1px solid var(--c-hairline);font-size:12.5px;color:var(--c-inkSoft)}.mko__field input[data-v-2e17d169],.mko__field textarea[data-v-2e17d169]{width:100%;padding:11px 12px;border:1px solid var(--c-hairline);border-radius:12px;background:transparent;color:var(--c-ink);font-family:inherit;font-size:14px}.mko__error[data-v-2e17d169]{margin:12px 2px 0;font-size:12.5px;color:var(--c-red)}.mko__submit[data-v-2e17d169]{position:fixed;left:16px;right:16px;bottom:20px;z-index:20;max-width:736px;margin:0 auto;padding:15px;border:none;border-radius:999px;background:var(--c-wine);color:#fff;font-family:inherit;font-size:15px;font-weight:700;cursor:pointer}.mko__submit[data-v-2e17d169]:disabled{opacity:.6;cursor:progress}
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{d as m,b as n,c as r,p as o,m as c,H as x,J as P,L as k,n as S,M,N as v,j as y,g as h,h as p,O as B,P as C,C as f,F as E,r as L,I as b,e as A,E as N,_ as I}from"./index-CN-v7uYp.js";import{P as V}from"./PageBar-DNaPusPm.js";import{S as $}from"./SectionHead-CvKB7By7.js";import{P as F}from"./ProductCard-aZrPdL37.js";import{u as H,C as T}from"./usePagedProducts-CQhfR9Yx.js";const j={class:"flex justify-center items-center empty"},z=m({__name:"EmptyState",props:{description:{},image:{}},setup(e){return(t,s)=>(n(),r("div",j,[o(c(x),{description:"موردی یافت نشد",image:e.image,class:"h-[200px] w-[200px] opacity-70"},null,8,["image"])]))}}),D="/assets/favoritEmpty-kbtPAdi5.svg",G=m({__name:"ScrollFetchSearch",props:{loading:{type:Boolean},flag:{type:Boolean},padding:{}},emits:["fetch"],setup(e,{emit:t}){const s=t,i=P(),a=p(null);return k(a,()=>{s("fetch")},{distance:50}),(l,d)=>(n(),r("main",{class:"flex flex-col flex-1 overflow-auto no-scrollbar w-[100vw] max-w-screen-md m-auto",style:S({paddingTop:e.padding||c(i).headerHeight+"px"}),ref_key:"scrollArea",ref:a},[M(l.$slots,"default"),o(v,{cls:"my-[10px]",spinning:e.loading,indicator:!0,tip:"درحال دریافت اطلاعات"},null,8,["spinning"]),e.flag?(n(),y(z,{key:0,image:c(D)},null,8,["image"])):h("",!0)],4))}});function O(){const e=H(),t=B({totalPages:0,productList:[],flag:!1});function s(){t.productList=e.rows.value,t.totalPages=Math.ceil(e.total.value/T)||0,t.flag=e.total.value<1&&!e.loading.value}return{productsData:t,getProducts:async(a,l=!1,d=!1)=>{if(l){if(!e.hasMore.value||e.loadingMore.value)return;a.value=!0;try{await e.loadMore({sort:"newest"}),s()}catch(u){console.log(u)}finally{a.value=!1}return}a.value=!0;try{await e.resetAndLoad({sort:"newest"}),s()}catch(u){console.log(u)}finally{a.value=!1}},hasMore:e.hasMore}}const J={class:"newest"},Z={key:0,class:"newest__grid"},q={key:1,class:"newest__empty"},K=m({__name:"NewestView",setup(e){const{productsData:t,getProducts:s,hasMore:i}=O(),a=p(!1),l=p(!1);C(async()=>{await s(a,!1)});const d=async()=>{l.value||!i.value||await s(l,!0)};return(u,_)=>{const w=N("container");return n(),r("div",J,[o(V,{title:"جدیدترین محصولات","back-to":"home"}),o(v,{spinning:a.value,tip:"درحال دریافت اطلاعات"},{default:f(()=>[o(G,{class:"newest__scroll",loading:l.value,flag:c(t).flag,padding:"0px",onFetch:d},{default:f(()=>[o(w,{class:"newest__body"},{default:f(()=>[o($,{title:"تازهها",subtitle:"آخرین افزودههای مجموعه"}),c(t).productList.length?(n(),r("div",Z,[(n(!0),r(E,null,L(c(t).productList,g=>(n(),y(F,{key:g.id,value:g},null,8,["value"]))),128))])):a.value?h("",!0):(n(),r("section",q,[o(b,{icon:"vuesax-linear:box",size:"26"}),_[0]||(_[0]=A("p",null,"هنوز محصولی در مجموعه ثبت نشده است.",-1))]))]),_:1})]),_:1},8,["loading","flag"])]),_:1},8,["spinning"])])}}}),Y=I(K,[["__scopeId","data-v-fe755016"]]);export{Y as default};
|
||||
import{d as m,b as n,c as r,p as o,m as c,H as x,J as P,L as k,n as S,M,N as v,j as y,g as h,h as p,O as B,P as C,C as f,F as E,r as L,I as b,e as A,E as N,_ as I}from"./index-6E0fX61D.js";import{P as V}from"./PageBar-HEcoSwjE.js";import{S as $}from"./SectionHead-YsBbRh09.js";import{P as F}from"./ProductCard-Rxk1Fz5I.js";import{u as H,C as T}from"./usePagedProducts-Dfd2dvnx.js";const j={class:"flex justify-center items-center empty"},z=m({__name:"EmptyState",props:{description:{},image:{}},setup(e){return(t,s)=>(n(),r("div",j,[o(c(x),{description:"موردی یافت نشد",image:e.image,class:"h-[200px] w-[200px] opacity-70"},null,8,["image"])]))}}),D="/assets/favoritEmpty-kbtPAdi5.svg",G=m({__name:"ScrollFetchSearch",props:{loading:{type:Boolean},flag:{type:Boolean},padding:{}},emits:["fetch"],setup(e,{emit:t}){const s=t,i=P(),a=p(null);return k(a,()=>{s("fetch")},{distance:50}),(l,d)=>(n(),r("main",{class:"flex flex-col flex-1 overflow-auto no-scrollbar w-[100vw] max-w-screen-md m-auto",style:S({paddingTop:e.padding||c(i).headerHeight+"px"}),ref_key:"scrollArea",ref:a},[M(l.$slots,"default"),o(v,{cls:"my-[10px]",spinning:e.loading,indicator:!0,tip:"درحال دریافت اطلاعات"},null,8,["spinning"]),e.flag?(n(),y(z,{key:0,image:c(D)},null,8,["image"])):h("",!0)],4))}});function O(){const e=H(),t=B({totalPages:0,productList:[],flag:!1});function s(){t.productList=e.rows.value,t.totalPages=Math.ceil(e.total.value/T)||0,t.flag=e.total.value<1&&!e.loading.value}return{productsData:t,getProducts:async(a,l=!1,d=!1)=>{if(l){if(!e.hasMore.value||e.loadingMore.value)return;a.value=!0;try{await e.loadMore({sort:"newest"}),s()}catch(u){console.log(u)}finally{a.value=!1}return}a.value=!0;try{await e.resetAndLoad({sort:"newest"}),s()}catch(u){console.log(u)}finally{a.value=!1}},hasMore:e.hasMore}}const J={class:"newest"},Z={key:0,class:"newest__grid"},q={key:1,class:"newest__empty"},K=m({__name:"NewestView",setup(e){const{productsData:t,getProducts:s,hasMore:i}=O(),a=p(!1),l=p(!1);C(async()=>{await s(a,!1)});const d=async()=>{l.value||!i.value||await s(l,!0)};return(u,_)=>{const w=N("container");return n(),r("div",J,[o(V,{title:"جدیدترین محصولات","back-to":"home"}),o(v,{spinning:a.value,tip:"درحال دریافت اطلاعات"},{default:f(()=>[o(G,{class:"newest__scroll",loading:l.value,flag:c(t).flag,padding:"0px",onFetch:d},{default:f(()=>[o(w,{class:"newest__body"},{default:f(()=>[o($,{title:"تازهها",subtitle:"آخرین افزودههای مجموعه"}),c(t).productList.length?(n(),r("div",Z,[(n(!0),r(E,null,L(c(t).productList,g=>(n(),y(F,{key:g.id,value:g},null,8,["value"]))),128))])):a.value?h("",!0):(n(),r("section",q,[o(b,{icon:"vuesax-linear:box",size:"26"}),_[0]||(_[0]=A("p",null,"هنوز محصولی در مجموعه ثبت نشده است.",-1))]))]),_:1})]),_:1},8,["loading","flag"])]),_:1},8,["spinning"])])}}}),Y=I(K,[["__scopeId","data-v-fe755016"]]);export{Y as default};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{d as n,c as a,p as o,C as i,E as c,b as _,e,I as r,_ as p}from"./index-CN-v7uYp.js";import{P as f}from"./PageBar-DNaPusPm.js";const l={class:"notif"},d={class:"notif__empty"},m=n({__name:"NotificationsView",setup(u){return(x,t)=>{const s=c("container");return _(),a("div",l,[o(f,{title:"اعلانها","back-to":"home"}),o(s,{class:"notif__body"},{default:i(()=>[e("section",d,[o(r,{icon:"vuesax-linear:notification",size:"26"}),t[0]||(t[0]=e("p",null,"اعلانی برای نمایش وجود ندارد.",-1))])]),_:1})])}}}),B=p(m,[["__scopeId","data-v-6887fb26"]]);export{B as default};
|
||||
import{d as n,c as a,p as o,C as i,E as c,b as _,e,I as r,_ as p}from"./index-6E0fX61D.js";import{P as f}from"./PageBar-HEcoSwjE.js";const l={class:"notif"},d={class:"notif__empty"},m=n({__name:"NotificationsView",setup(u){return(x,t)=>{const s=c("container");return _(),a("div",l,[o(f,{title:"اعلانها","back-to":"home"}),o(s,{class:"notif__body"},{default:i(()=>[e("section",d,[o(r,{icon:"vuesax-linear:notification",size:"26"}),t[0]||(t[0]=e("p",null,"اعلانی برای نمایش وجود ندارد.",-1))])]),_:1})])}}}),B=p(m,[["__scopeId","data-v-6887fb26"]]);export{B as default};
|
||||
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -1 +1 @@
|
||||
import{d as b,bp as u,c as o,e,p as d,I as p,t as k,M as i,b as n,D as h,_ as f}from"./index-CN-v7uYp.js";const m={class:"bar"},B={class:"bar__inner"},v={key:1,class:"bar__spacer","aria-hidden":"true"},g={class:"bar__title"},y={class:"bar__trailing"},A=b({__name:"PageBar",props:{title:{},back:{type:Boolean,default:!0},backTo:{},backAction:{}},setup(t){const a=t,s=h(),l=u();function _(){if(a.backAction){a.backAction();return}if(l.canGoBack){s.back();return}if(a.backTo){s.push({name:a.backTo});return}s.push({name:"home"})}return(r,c)=>(n(),o("header",m,[e("div",B,[t.back?(n(),o("button",{key:0,type:"button",class:"bar__btn","aria-label":"بازگشت",onClick:_},[d(p,{icon:"vuesax-linear:arrow-right-1",size:"20"})])):(n(),o("span",v)),e("h1",g,k(t.title),1),e("div",y,[i(r.$slots,"trailing",{},()=>[c[0]||(c[0]=e("span",{class:"bar__spacer","aria-hidden":"true"},null,-1))],!0)])]),i(r.$slots,"below",{},void 0,!0)]))}}),N=f(A,[["__scopeId","data-v-bc8960e7"]]);export{N as P};
|
||||
import{d as b,bq as u,c as o,e,p as d,I as p,t as k,M as i,b as n,D as h,_ as f}from"./index-6E0fX61D.js";const m={class:"bar"},B={class:"bar__inner"},v={key:1,class:"bar__spacer","aria-hidden":"true"},g={class:"bar__title"},y={class:"bar__trailing"},A=b({__name:"PageBar",props:{title:{},back:{type:Boolean,default:!0},backTo:{},backAction:{}},setup(t){const a=t,s=h(),l=u();function _(){if(a.backAction){a.backAction();return}if(l.canGoBack){s.back();return}if(a.backTo){s.push({name:a.backTo});return}s.push({name:"home"})}return(r,c)=>(n(),o("header",m,[e("div",B,[t.back?(n(),o("button",{key:0,type:"button",class:"bar__btn","aria-label":"بازگشت",onClick:_},[d(p,{icon:"vuesax-linear:arrow-right-1",size:"20"})])):(n(),o("span",v)),e("h1",g,k(t.title),1),e("div",y,[i(r.$slots,"trailing",{},()=>[c[0]||(c[0]=e("span",{class:"bar__spacer","aria-hidden":"true"},null,-1))],!0)])]),i(r.$slots,"below",{},void 0,!0)]))}}),N=f(A,[["__scopeId","data-v-bc8960e7"]]);export{N as P};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{d as B,aT as P,k as z,l as F,b as s,c as t,e as a,m as e,w as N,p as h,I as m,aS as S,f as V,g as _,t as r,R as D,h as I,G as E,_ as O}from"./index-CN-v7uYp.js";const T={class:"pc__art"},q=["alt"],G={key:1,class:"pc__artEmpty","aria-hidden":"true"},L=["aria-label"],M={key:2,class:"pc__flag"},R={key:3,class:"pc__flag pc__flag--soft"},U={class:"pc__title"},$={class:"pc__weight"},j={key:0,class:"pc__meta"},A={key:0,class:"pc__wageOld"},H={class:"pc__wage"},J=B({__name:"ProductCard",props:{value:{},wageBefore:{}},setup(l){const d=l,o=P(),{image:p,id:i,title:u,min_gram:y,wage:f,is_exist:k,qty:w,isPreOrder:x}=z(d.value),g=I(null);function C(){E(d.value,g.value)}function v(n){return n%1===0?String(n):n.toFixed(2)}return(n,c)=>{const b=F("lazy");return s(),t("article",{ref_key:"root",ref:g,class:"pc","data-product-origin":"",onClick:C},[a("div",T,[e(p)?N((s(),t("img",{key:0,alt:e(u)},null,8,q)),[[b,e(p)]]):(s(),t("div",G,[h(m,{icon:"vuesax-linear:diamonds",size:"26"})])),a("button",{type:"button",class:V(["pc__fav",{"is-on":e(o).isFavorite(e(i))}]),"aria-label":e(o).isFavorite(e(i))?"حذف از علاقهمندی":"افزودن به علاقهمندی",onClick:c[0]||(c[0]=S(K=>e(o).toggle(e(i)),["stop"]))},[h(m,{icon:e(o).isFavorite(e(i))?"vuesax-linear:heart-fill":"vuesax-linear:heart",size:"16"},null,8,["icon"])],10,L),e(k)?e(x)&&e(w)===0?(s(),t("span",R,"پیشسفارش")):_("",!0):(s(),t("span",M,"ناموجود"))]),a("h3",U,r(e(u)),1),a("p",$,[D(r(e(y))+" ",1),c[1]||(c[1]=a("span",{class:"pc__weightUnit"},"گرم",-1))]),e(f)!=null?(s(),t("div",j,[l.wageBefore!=null?(s(),t("span",A,"اجرت "+r(v(l.wageBefore))+"٪",1)):_("",!0),a("span",H,r(v(e(f)))+"٪ اجرت",1)])):_("",!0)],512)}}}),W=O(J,[["__scopeId","data-v-2d367664"]]);export{W as P};
|
||||
import{d as B,aT as P,k as z,l as F,b as s,c as t,e as a,m as e,w as N,p as h,I as m,aS as S,f as V,g as _,t as r,R as D,h as I,G as E,_ as O}from"./index-6E0fX61D.js";const T={class:"pc__art"},q=["alt"],G={key:1,class:"pc__artEmpty","aria-hidden":"true"},L=["aria-label"],M={key:2,class:"pc__flag"},R={key:3,class:"pc__flag pc__flag--soft"},U={class:"pc__title"},$={class:"pc__weight"},j={key:0,class:"pc__meta"},A={key:0,class:"pc__wageOld"},H={class:"pc__wage"},J=B({__name:"ProductCard",props:{value:{},wageBefore:{}},setup(l){const d=l,o=P(),{image:p,id:i,title:u,min_gram:y,wage:f,is_exist:k,qty:w,isPreOrder:x}=z(d.value),g=I(null);function C(){E(d.value,g.value)}function v(n){return n%1===0?String(n):n.toFixed(2)}return(n,c)=>{const b=F("lazy");return s(),t("article",{ref_key:"root",ref:g,class:"pc","data-product-origin":"",onClick:C},[a("div",T,[e(p)?N((s(),t("img",{key:0,alt:e(u)},null,8,q)),[[b,e(p)]]):(s(),t("div",G,[h(m,{icon:"vuesax-linear:diamonds",size:"26"})])),a("button",{type:"button",class:V(["pc__fav",{"is-on":e(o).isFavorite(e(i))}]),"aria-label":e(o).isFavorite(e(i))?"حذف از علاقهمندی":"افزودن به علاقهمندی",onClick:c[0]||(c[0]=S(K=>e(o).toggle(e(i)),["stop"]))},[h(m,{icon:e(o).isFavorite(e(i))?"vuesax-linear:heart-fill":"vuesax-linear:heart",size:"16"},null,8,["icon"])],10,L),e(k)?e(x)&&e(w)===0?(s(),t("span",R,"پیشسفارش")):_("",!0):(s(),t("span",M,"ناموجود"))]),a("h3",U,r(e(u)),1),a("p",$,[D(r(e(y))+" ",1),c[1]||(c[1]=a("span",{class:"pc__weightUnit"},"گرم",-1))]),e(f)!=null?(s(),t("div",j,[l.wageBefore!=null?(s(),t("span",A,"اجرت "+r(v(l.wageBefore))+"٪",1)):_("",!0),a("span",H,r(v(e(f)))+"٪ اجرت",1)])):_("",!0)],512)}}}),W=O(J,[["__scopeId","data-v-2d367664"]]);export{W as P};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{d as L,S as w,y as F,h as _,K as g,o as M,c as n,p as r,C as $,E as O,b as i,e,I as k,t as a,g as c,f as v,R as T,m as U,i as m,D as z,_ as A}from"./index-CN-v7uYp.js";import{P as K}from"./PageBar-DNaPusPm.js";import{S}from"./SectionHead-CvKB7By7.js";const W={class:"prof"},H={class:"prof__identity"},J={class:"prof__avatar","aria-hidden":"true"},Y={class:"prof__name"},j={key:0,class:"prof__mobile"},q={key:0,class:"prof__block"},G={class:"prof__specs"},Q={class:"prof__spec"},X={class:"prof__spec"},Z={class:"prof__spec"},ee={class:"prof__spec"},se={key:1,class:"prof__block"},te={class:"prof__specs"},oe={class:"prof__spec"},le={class:"prof__spec"},ae={key:2,class:"prof__block"},ne={key:3,class:"prof__empty"},ie=L({__name:"ProfileView",setup(re){const b={UNVERIFIED:"احراز نشده",STEP_ONE_SUBMITTED:"مرحله اول ثبت شده",STEP_TWO_SUBMITTED:"مرحله دوم ثبت شده",VERIFIED:"تایید شده",REJECTED:"رد شده"},h=w(),d=F(),o=_(d.peek(g.profile)??null),p=_(!1),C=m(()=>{var s;return((s=o.value)==null?void 0:s.verificationStep)==="VERIFIED"}),R=m(()=>{var t;const s=(t=o.value)==null?void 0:t.verificationStep;return!!s&&s!=="VERIFIED"&&s!=="STEP_TWO_SUBMITTED"}),D=z(),l=_(d.peek(g.balance)??null),f=_(!1),u=s=>Number(s??0),E=s=>u(s)>0?"بدهکار":u(s)<0?"بستانکار":"",y=s=>u(s)>0?"is-debt":u(s)<0?"is-credit":"",V=s=>`${Math.abs(u(s)).toLocaleString("fa-IR",{maximumFractionDigits:3})} گرم`,B=s=>`${Math.abs(u(s)).toLocaleString("fa-IR")} ریال`,N=m(()=>{const s=l.value;if(!(s!=null&&s.at))return"";const t=new Date(s.at).toLocaleString("fa-IR",{dateStyle:"short",timeStyle:"short"});return s.source==="stored"?`آخرین ماندهی ثبتشده — ${t}`:`از ${s.provider??"حسابداری"} — ${t}`});async function P(){f.value=!l.value;try{l.value=await d.accountingBalance({force:!0})}catch{l.value=null}finally{f.value=!1}}return M(async()=>{if(h.isLoggedIn){P(),p.value=!o.value;try{o.value=await d.me({force:!0})}finally{p.value=!1}}}),(s,t)=>{const x=O("container");return i(),n("div",W,[r(K,{title:"اطلاعات کاربری","back-to":"userPage::hasSubRoute"}),r(x,{class:"prof__body"},{default:$(()=>{var I;return[e("section",H,[e("div",J,[r(k,{icon:"vuesax-linear:user",size:"30"})]),e("h2",Y,a(((I=o.value)==null?void 0:I.fullName)??"—"),1),o.value?(i(),n("p",j,a(o.value.mobile),1)):c("",!0),o.value?(i(),n("span",{key:1,class:v(["prof__seal",C.value?"is-ok":"is-pending"])},a(b[o.value.verificationStep]??o.value.verificationStep),3)):c("",!0)]),o.value?(i(),n("section",q,[r(S,{title:"مشخصات",subtitle:"اطلاعات ثبتشده حساب شما"}),e("dl",G,[e("div",Q,[t[1]||(t[1]=e("dt",null,"نام و نام خانوادگی",-1)),e("dd",null,a(o.value.fullName),1)]),e("div",X,[t[2]||(t[2]=e("dt",null,"تلفن همراه",-1)),e("dd",null,a(o.value.mobile),1)]),e("div",Z,[t[3]||(t[3]=e("dt",null,"کد ملی",-1)),e("dd",null,a(o.value.nationalCode||"-"),1)]),e("div",ee,[t[4]||(t[4]=e("dt",null,"وضعیت احراز هویت",-1)),e("dd",null,a(b[o.value.verificationStep]??o.value.verificationStep),1)])])])):c("",!0),l.value&&l.value.source!=="none"?(i(),n("section",se,[r(S,{title:"ماندهی حساب",subtitle:N.value},null,8,["subtitle"]),e("dl",te,[e("div",oe,[t[5]||(t[5]=e("dt",null,"ماندهی طلا",-1)),e("dd",{class:v(y(l.value.gold))},[T(a(V(l.value.gold))+" ",1),e("small",null,a(E(l.value.gold)),1)],2)]),e("div",le,[t[6]||(t[6]=e("dt",null,"ماندهی ریالی",-1)),e("dd",{class:v(y(l.value.rial))},[T(a(B(l.value.rial))+" ",1),e("small",null,a(E(l.value.rial)),1)],2)])])])):f.value?(i(),n("section",ae,[r(S,{title:"ماندهی حساب",subtitle:"در حال دریافت از حسابداری…"}),t[7]||(t[7]=e("div",{class:"prof__specs prof__skeleton"},null,-1))])):p.value?c("",!0):(i(),n("section",ne,[r(k,{icon:"vuesax-linear:user",size:"26"}),t[8]||(t[8]=e("p",null,"اطلاعات حساب در دسترس نیست.",-1))])),R.value?(i(),n("button",{key:4,type:"button",class:"prof__complete",onClick:t[0]||(t[0]=ue=>U(D).push({name:"completeProfile"}))}," تکمیل پروفایل ")):c("",!0)]}),_:1})])}}}),pe=A(ie,[["__scopeId","data-v-a61d0c61"]]);export{pe as default};
|
||||
import{d as L,S as w,y as F,h as _,K as g,o as M,c as n,p as r,C as $,E as O,b as i,e,I as k,t as a,g as c,f as v,R as T,m as U,i as m,D as z,_ as A}from"./index-6E0fX61D.js";import{P as K}from"./PageBar-HEcoSwjE.js";import{S}from"./SectionHead-YsBbRh09.js";const W={class:"prof"},H={class:"prof__identity"},J={class:"prof__avatar","aria-hidden":"true"},Y={class:"prof__name"},j={key:0,class:"prof__mobile"},q={key:0,class:"prof__block"},G={class:"prof__specs"},Q={class:"prof__spec"},X={class:"prof__spec"},Z={class:"prof__spec"},ee={class:"prof__spec"},se={key:1,class:"prof__block"},te={class:"prof__specs"},oe={class:"prof__spec"},le={class:"prof__spec"},ae={key:2,class:"prof__block"},ne={key:3,class:"prof__empty"},ie=L({__name:"ProfileView",setup(re){const b={UNVERIFIED:"احراز نشده",STEP_ONE_SUBMITTED:"مرحله اول ثبت شده",STEP_TWO_SUBMITTED:"مرحله دوم ثبت شده",VERIFIED:"تایید شده",REJECTED:"رد شده"},h=w(),d=F(),o=_(d.peek(g.profile)??null),p=_(!1),C=m(()=>{var s;return((s=o.value)==null?void 0:s.verificationStep)==="VERIFIED"}),R=m(()=>{var t;const s=(t=o.value)==null?void 0:t.verificationStep;return!!s&&s!=="VERIFIED"&&s!=="STEP_TWO_SUBMITTED"}),D=z(),l=_(d.peek(g.balance)??null),f=_(!1),u=s=>Number(s??0),E=s=>u(s)>0?"بدهکار":u(s)<0?"بستانکار":"",y=s=>u(s)>0?"is-debt":u(s)<0?"is-credit":"",V=s=>`${Math.abs(u(s)).toLocaleString("fa-IR",{maximumFractionDigits:3})} گرم`,B=s=>`${Math.abs(u(s)).toLocaleString("fa-IR")} ریال`,N=m(()=>{const s=l.value;if(!(s!=null&&s.at))return"";const t=new Date(s.at).toLocaleString("fa-IR",{dateStyle:"short",timeStyle:"short"});return s.source==="stored"?`آخرین ماندهی ثبتشده — ${t}`:`از ${s.provider??"حسابداری"} — ${t}`});async function P(){f.value=!l.value;try{l.value=await d.accountingBalance({force:!0})}catch{l.value=null}finally{f.value=!1}}return M(async()=>{if(h.isLoggedIn){P(),p.value=!o.value;try{o.value=await d.me({force:!0})}finally{p.value=!1}}}),(s,t)=>{const x=O("container");return i(),n("div",W,[r(K,{title:"اطلاعات کاربری","back-to":"userPage::hasSubRoute"}),r(x,{class:"prof__body"},{default:$(()=>{var I;return[e("section",H,[e("div",J,[r(k,{icon:"vuesax-linear:user",size:"30"})]),e("h2",Y,a(((I=o.value)==null?void 0:I.fullName)??"—"),1),o.value?(i(),n("p",j,a(o.value.mobile),1)):c("",!0),o.value?(i(),n("span",{key:1,class:v(["prof__seal",C.value?"is-ok":"is-pending"])},a(b[o.value.verificationStep]??o.value.verificationStep),3)):c("",!0)]),o.value?(i(),n("section",q,[r(S,{title:"مشخصات",subtitle:"اطلاعات ثبتشده حساب شما"}),e("dl",G,[e("div",Q,[t[1]||(t[1]=e("dt",null,"نام و نام خانوادگی",-1)),e("dd",null,a(o.value.fullName),1)]),e("div",X,[t[2]||(t[2]=e("dt",null,"تلفن همراه",-1)),e("dd",null,a(o.value.mobile),1)]),e("div",Z,[t[3]||(t[3]=e("dt",null,"کد ملی",-1)),e("dd",null,a(o.value.nationalCode||"-"),1)]),e("div",ee,[t[4]||(t[4]=e("dt",null,"وضعیت احراز هویت",-1)),e("dd",null,a(b[o.value.verificationStep]??o.value.verificationStep),1)])])])):c("",!0),l.value&&l.value.source!=="none"?(i(),n("section",se,[r(S,{title:"ماندهی حساب",subtitle:N.value},null,8,["subtitle"]),e("dl",te,[e("div",oe,[t[5]||(t[5]=e("dt",null,"ماندهی طلا",-1)),e("dd",{class:v(y(l.value.gold))},[T(a(V(l.value.gold))+" ",1),e("small",null,a(E(l.value.gold)),1)],2)]),e("div",le,[t[6]||(t[6]=e("dt",null,"ماندهی ریالی",-1)),e("dd",{class:v(y(l.value.rial))},[T(a(B(l.value.rial))+" ",1),e("small",null,a(E(l.value.rial)),1)],2)])])])):f.value?(i(),n("section",ae,[r(S,{title:"ماندهی حساب",subtitle:"در حال دریافت از حسابداری…"}),t[7]||(t[7]=e("div",{class:"prof__specs prof__skeleton"},null,-1))])):p.value?c("",!0):(i(),n("section",ne,[r(k,{icon:"vuesax-linear:user",size:"26"}),t[8]||(t[8]=e("p",null,"اطلاعات حساب در دسترس نیست.",-1))])),R.value?(i(),n("button",{key:4,type:"button",class:"prof__complete",onClick:t[0]||(t[0]=ue=>U(D).push({name:"completeProfile"}))}," تکمیل پروفایل ")):c("",!0)]}),_:1})])}}}),pe=A(ie,[["__scopeId","data-v-a61d0c61"]]);export{pe as default};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{p as n,j as d}from"./filters-C_cKdZcl.js";import{d as l,c as a,f as m,e as s,R as u,t as i,m as c,g as _,i as v,b as r,_ as q}from"./index-CN-v7uYp.js";const f={key:0,class:"rate-strip__value"},y={class:"rate-strip__num"},k={key:1,class:"rate-strip__value rate-strip__value--muted"},R={key:2,class:"rate-strip__time"},x=l({__name:"RateStrip",props:{quote:{},compact:{type:Boolean}},setup(t){const o=t,p=v(()=>o.quote?o.quote.pricePerGramRial.split(".")[0]:"");return(B,e)=>(r(),a("div",{class:m(["rate-strip",{"is-empty":!t.quote,"rate-strip--compact":t.compact}])},[e[1]||(e[1]=s("div",{class:"rate-strip__label"},[s("span",{class:"rate-strip__dot","aria-hidden":"true"}),u(" نرخ طلای ۱۸ عیار ")],-1)),t.quote?(r(),a("div",f,[s("span",y,i(c(n)(p.value)),1),e[0]||(e[0]=s("span",{class:"rate-strip__unit"},"ریال / گرم",-1))])):(r(),a("div",k,"در انتظار اعلام نرخ")),t.quote?(r(),a("div",R,i(c(d)(t.quote.quotedAt)),1)):_("",!0)],2))}}),N=q(x,[["__scopeId","data-v-d1bea229"]]);export{N as R};
|
||||
import{p as n,j as d}from"./filters-CmtC5ctw.js";import{d as l,c as a,f as m,e as s,R as u,t as i,m as c,g as _,i as v,b as r,_ as q}from"./index-6E0fX61D.js";const f={key:0,class:"rate-strip__value"},y={class:"rate-strip__num"},k={key:1,class:"rate-strip__value rate-strip__value--muted"},R={key:2,class:"rate-strip__time"},x=l({__name:"RateStrip",props:{quote:{},compact:{type:Boolean}},setup(t){const o=t,p=v(()=>o.quote?o.quote.pricePerGramRial.split(".")[0]:"");return(B,e)=>(r(),a("div",{class:m(["rate-strip",{"is-empty":!t.quote,"rate-strip--compact":t.compact}])},[e[1]||(e[1]=s("div",{class:"rate-strip__label"},[s("span",{class:"rate-strip__dot","aria-hidden":"true"}),u(" نرخ طلای ۱۸ عیار ")],-1)),t.quote?(r(),a("div",f,[s("span",y,i(c(n)(p.value)),1),e[0]||(e[0]=s("span",{class:"rate-strip__unit"},"ریال / گرم",-1))])):(r(),a("div",k,"در انتظار اعلام نرخ")),t.quote?(r(),a("div",R,i(c(d)(t.quote.quotedAt)),1)):_("",!0)],2))}}),N=q(x,[["__scopeId","data-v-d1bea229"]]);export{N as R};
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
import{d as v,b8 as h,W as m,b as t,c as l,p as n,I as r,w as b,b9 as f,e as x,ba as k,g as I,O as w,h as y,_ as C}from"./index-CN-v7uYp.js";const S={class:"si"},V=["placeholder"],B=v({__name:"SearchInput",props:{placeHolder:{}},emits:["search"],setup(i,{emit:d}){const c=d,a=w({clear:!1}),e=y(void 0),s=()=>{c("search",e.value)},u=()=>{e.value=void 0,a.clear=!1,c("search",void 0)},p=h(e,700);return m(p,()=>{e?a.clear=!0:a.clear=!1,s()}),(N,o)=>(t(),l("div",S,[n(r,{icon:"vuesax-linear:search-normal-1",class:"si__icon",size:"18",onClick:s}),b(x("input",{"onUpdate:modelValue":o[0]||(o[0]=_=>e.value=_),class:"si__input",placeholder:i.placeHolder,onKeyup:k(s,["enter"])},null,40,V),[[f,e.value]]),a.clear?(t(),l("button",{key:0,type:"button",class:"si__clear","aria-label":"پاک کردن",onClick:u},[n(r,{icon:"vuesax-linear:add",size:"16"})])):I("",!0)]))}}),D=C(B,[["__scopeId","data-v-8ebd3183"]]);export{D as S};
|
||||
import{d as v,ba as h,W as m,b as t,c as l,p as n,I as r,w as b,aU as f,e as x,bb as k,g as I,O as w,h as y,_ as C}from"./index-6E0fX61D.js";const S={class:"si"},V=["placeholder"],B=v({__name:"SearchInput",props:{placeHolder:{}},emits:["search"],setup(i,{emit:d}){const c=d,a=w({clear:!1}),e=y(void 0),s=()=>{c("search",e.value)},u=()=>{e.value=void 0,a.clear=!1,c("search",void 0)},p=h(e,700);return m(p,()=>{e?a.clear=!0:a.clear=!1,s()}),(N,o)=>(t(),l("div",S,[n(r,{icon:"vuesax-linear:search-normal-1",class:"si__icon",size:"18",onClick:s}),b(x("input",{"onUpdate:modelValue":o[0]||(o[0]=_=>e.value=_),class:"si__input",placeholder:i.placeHolder,onKeyup:k(s,["enter"])},null,40,V),[[f,e.value]]),a.clear?(t(),l("button",{key:0,type:"button",class:"si__clear","aria-label":"پاک کردن",onClick:u},[n(r,{icon:"vuesax-linear:add",size:"16"})])):I("",!0)]))}}),D=C(B,[["__scopeId","data-v-8ebd3183"]]);export{D as S};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
import{d,b as t,c as s,e as o,t as a,g as n,R as r,p as _,I as u,_ as m}from"./index-CN-v7uYp.js";const b={class:"sec"},x={class:"sec__text"},f={class:"sec__title"},h={key:0,class:"sec__sub"},k=d({__name:"SectionHead",props:{title:{},subtitle:{},actionLabel:{}},emits:["action"],setup(e,{emit:i}){const l=i;return(p,c)=>(t(),s("header",b,[o("div",x,[o("h2",f,a(e.title),1),e.subtitle?(t(),s("p",h,a(e.subtitle),1)):n("",!0)]),e.actionLabel?(t(),s("button",{key:0,type:"button",class:"sec__action",onClick:c[0]||(c[0]=v=>l("action"))},[r(a(e.actionLabel)+" ",1),_(u,{icon:"vuesax-linear:arrow-left-1",size:"15"})])):n("",!0)]))}}),N=m(k,[["__scopeId","data-v-10172dc1"]]);export{N as S};
|
||||
import{d,b as t,c as s,e as o,t as a,g as n,R as r,p as _,I as u,_ as m}from"./index-6E0fX61D.js";const b={class:"sec"},x={class:"sec__text"},f={class:"sec__title"},h={key:0,class:"sec__sub"},k=d({__name:"SectionHead",props:{title:{},subtitle:{},actionLabel:{}},emits:["action"],setup(e,{emit:i}){const l=i;return(p,c)=>(t(),s("header",b,[o("div",x,[o("h2",f,a(e.title),1),e.subtitle?(t(),s("p",h,a(e.subtitle),1)):n("",!0)]),e.actionLabel?(t(),s("button",{key:0,type:"button",class:"sec__action",onClick:c[0]||(c[0]=v=>l("action"))},[r(a(e.actionLabel)+" ",1),_(u,{icon:"vuesax-linear:arrow-left-1",size:"15"})])):n("",!0)]))}}),N=m(k,[["__scopeId","data-v-10172dc1"]]);export{N as S};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
.siu__input[data-v-3a42e270]{display:none}.siu__box[data-v-3a42e270]{position:relative;width:100%;padding:18px 2px;display:flex;flex-direction:row-reverse;align-items:center;justify-content:flex-end;gap:12px;border:none;border-bottom:1px solid var(--c-hairline);background:transparent;font-family:inherit;text-align:right;cursor:pointer;overflow:hidden}.siu__box[data-v-3a42e270]:disabled{cursor:progress}.siu__box[data-v-3a42e270]:active{opacity:.75}.is-done .siu__box[data-v-3a42e270]{border-bottom-color:var(--c-green)}.is-error .siu__box[data-v-3a42e270]{border-bottom-color:var(--c-red)}.siu__preview[data-v-3a42e270]{width:46px;height:46px;flex:0 0 auto;-o-object-fit:cover;object-fit:cover;border-radius:12px;order:-1}.siu__icon[data-v-3a42e270]{display:flex;flex:0 0 auto;align-items:center;justify-content:center;width:46px;height:46px;border-radius:12px;background:var(--c-canvasSoft);color:var(--c-inkMuted);order:-1}.siu__text[data-v-3a42e270]{flex:1;font-size:13.5px;font-weight:600;color:var(--c-ink)}.siu__badge[data-v-3a42e270]{flex:0 0 auto;display:flex;color:var(--c-green)}.siu__error[data-v-3a42e270]{margin:7px 2px 0;font-size:12px;color:var(--c-red)}.cpf__body[data-v-978e9d9e]{padding-top:84px;padding-bottom:110px}.cpf__lead[data-v-978e9d9e]{margin:4px 0 6px;font-size:13px;color:var(--c-inkMuted)}.cpf__form[data-v-978e9d9e]{display:flex;flex-direction:column}.cpf__error[data-v-978e9d9e]{margin:12px 2px 0;font-size:12.5px;color:var(--c-red)}.cpf__submit[data-v-978e9d9e]{position:fixed;left:16px;right:16px;bottom:20px;z-index:20;max-width:736px;margin:0 auto;padding:15px;border:none;border-radius:999px;background:var(--c-wine);color:#fff;font-family:inherit;font-size:15px;font-weight:700;cursor:pointer}.cpf__submit[data-v-978e9d9e]:disabled{opacity:.6;cursor:progress}
|
||||
.siu__input[data-v-3a42e270]{display:none}.siu__box[data-v-3a42e270]{position:relative;width:100%;padding:18px 2px;display:flex;flex-direction:row-reverse;align-items:center;justify-content:flex-end;gap:12px;border:none;border-bottom:1px solid var(--c-hairline);background:transparent;font-family:inherit;text-align:right;cursor:pointer;overflow:hidden}.siu__box[data-v-3a42e270]:disabled{cursor:progress}.siu__box[data-v-3a42e270]:active{opacity:.75}.is-done .siu__box[data-v-3a42e270]{border-bottom-color:var(--c-green)}.is-error .siu__box[data-v-3a42e270]{border-bottom-color:var(--c-red)}.siu__preview[data-v-3a42e270]{width:46px;height:46px;flex:0 0 auto;-o-object-fit:cover;object-fit:cover;border-radius:12px;order:-1}.siu__icon[data-v-3a42e270]{display:flex;flex:0 0 auto;align-items:center;justify-content:center;width:46px;height:46px;border-radius:12px;background:var(--c-canvasSoft);color:var(--c-inkMuted);order:-1}.siu__text[data-v-3a42e270]{flex:1;font-size:13.5px;font-weight:600;color:var(--c-ink)}.siu__badge[data-v-3a42e270]{flex:0 0 auto;display:flex;color:var(--c-green)}.siu__error[data-v-3a42e270]{margin:7px 2px 0;font-size:12px;color:var(--c-red)}
|
||||
@@ -0,0 +1 @@
|
||||
import{d as B,b as o,c as i,f as I,e as r,p as f,I as m,t as g,g as y,h as u,v as C,_ as S}from"./index-6E0fX61D.js";const w=["disabled"],z=["src"],U={key:1,class:"siu__icon"},N={class:"siu__text"},T={key:2,class:"siu__badge"},V={key:0,class:"siu__error"},j=8*1024*1024,D=B({__name:"SingleImageUploader",props:{uploadText:{},purpose:{}},emits:["done"],setup(p,{emit:k}){const b=p,h=k,_=u(null),e=u(!1),a=u(null),l=u(null),c=u(null);async function x(d){var n;const t=d.target,s=(n=t.files)==null?void 0:n[0];if(t.value="",!!s){if(a.value=null,s.size>j){a.value="حجم فایل بیش از حد مجاز است (۸ مگابایت)";return}e.value=!0;try{const v=await C.uploadDocument(s,b.purpose);l.value=v.id,c.value=s.type.startsWith("image/")?URL.createObjectURL(s):null,h("done",v.id)}catch{a.value="بارگذاری انجام نشد. دوباره تلاش کنید.",l.value=null,c.value=null}finally{e.value=!1}}}return(d,t)=>(o(),i("div",{class:I(["siu",{"is-done":!!l.value,"is-error":!!a.value}])},[r("input",{ref_key:"input",ref:_,type:"file",accept:"image/jpeg,image/png,image/webp,application/pdf",class:"siu__input",onChange:x},null,544),r("button",{type:"button",class:"siu__box",disabled:e.value,onClick:t[0]||(t[0]=s=>{var n;return(n=_.value)==null?void 0:n.click()})},[c.value?(o(),i("img",{key:0,src:c.value,class:"siu__preview",alt:""},null,8,z)):(o(),i("span",U,[f(m,{icon:e.value?"vuesax-linear:refresh":"vuesax-linear:gallery-add",size:"26"},null,8,["icon"])])),r("span",N,g(e.value?"در حال بارگذاری…":l.value?"تغییر تصویر":p.uploadText),1),l.value&&!e.value?(o(),i("span",T,[f(m,{icon:"vuesax-linear:tick-circle",size:"16"})])):y("",!0)],8,w),a.value?(o(),i("p",V,g(a.value),1)):y("",!0)],2))}}),L=S(D,[["__scopeId","data-v-3a42e270"]]);export{L as S};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{d as A,S as D,y as N,h as u,K as g,o as w,c as i,p as r,C as E,N as L,j as P,m,g as h,b as l,F as R,e as s,r as M,I as T,t as o,f as p,E as O,_ as B}from"./index-CN-v7uYp.js";import{P as U}from"./PageBar-DNaPusPm.js";import{S as I}from"./SectionHead-CvKB7By7.js";import{j as S,p as V}from"./filters-C_cKdZcl.js";import{D as Y}from"./index-CQtdsSs3.js";import"./KeyCode-Dl7BYvJp.js";import"./classCallCheck-DJjGN2cU.js";import"./raf-nDFcuFT6.js";const $={class:"tx"},j={class:"tx__list"},z=["onClick"],F={class:"tx__main"},G={class:"tx__head"},H={class:"tx__kind"},K={key:0,class:"tx__note"},J={class:"tx__foot"},Q={class:"tx__date"},W={key:1,class:"tx__empty"},q={class:"sheet"},X={class:"sheet__specs"},Z={class:"sheet__spec"},ss={class:"sheet__spec"},es={class:"sheet__spec"},ts={class:"sheet__spec"},os={class:"sheet__spec"},ns=A({__name:"TransactionsView",setup(as){const x={ORDER_STOCK:"سفارش",ORDER_PRE_ORDER:"سفارش ساخت",REPAYMENT_MELTED_GOLD:"طلای آبشده",REPAYMENT_TRANSFER:"حواله",REPAYMENT_CHEQUE:"چک",REPAYMENT_CASH:"پولی",WALLET_BONUS:"پاداش",ADJUSTMENT:"اصلاحیه"},k=D(),v=N(),_=u(!1),d=u(v.peek(g.ledger)??[]),f=u(!1),n=u(null),c=a=>a.direction==="CREDIT",y=a=>a.currency==="GOLD_GRAM"?`${a.amount} گرم`:`${V(a.amount)} ریال`,C=a=>{n.value=a,f.value=!0};return w(async()=>{if(k.isLoggedIn){_.value=v.peek(g.ledger)===void 0;try{d.value=await v.myLedgerEntries({force:!0})}finally{_.value=!1}}}),(a,e)=>{const b=O("container");return l(),i("div",$,[r(U,{title:"اسناد","back-to":"userPage::hasSubRoute"}),r(L,{spinning:_.value,tip:"درحال دریافت اطلاعات"},{default:E(()=>[r(b,{class:"tx__body"},{default:E(()=>[d.value.length?(l(),i(R,{key:0},[r(I,{title:"گردش حساب",subtitle:`${d.value.length} سند`},null,8,["subtitle"]),s("div",j,[(l(!0),i(R,null,M(d.value,t=>(l(),i("article",{key:t.id,class:"tx__row",onClick:ls=>C(t)},[s("span",{class:p(["tx__mark",c(t)?"is-in":"is-out"]),"aria-hidden":"true"},[r(T,{icon:c(t)?"vuesax-linear:arrow-down":"vuesax-linear:arrow-up",size:"16"},null,8,["icon"])],2),s("div",F,[s("div",G,[s("h3",H,o(x[t.sourceType]??t.sourceType),1),s("span",{class:p(["tx__amount",c(t)?"is-in":"is-out"])},o(y(t)),3)]),t.note?(l(),i("p",K,o(t.note),1)):h("",!0),s("div",J,[s("span",Q,o(m(S)(t.createdAt)),1),s("span",{class:p(["tx__state",{"is-pending":!t.confirmed}])},o(t.confirmed?"تایید شده":"در انتظار تایید"),3)])])],8,z))),128))])],64)):_.value?h("",!0):(l(),i("section",W,[r(T,{icon:"vuesax-linear:receipt-text",size:"26"}),e[1]||(e[1]=s("p",null,"سندی برای حساب شما ثبت نشده است.",-1))]))]),_:1})]),_:1},8,["spinning"]),n.value?(l(),P(m(Y),{key:0,visible:f.value,"onUpdate:visible":e[0]||(e[0]=t=>f.value=t),placement:"bottom",closable:!1,height:"420px",class:"rtl",bodyStyle:{padding:0}},{default:E(()=>[s("div",q,[e[7]||(e[7]=s("h3",{class:"sheet__title"},"جزئیات سند",-1)),s("dl",X,[s("div",Z,[e[2]||(e[2]=s("dt",null,"نوع سند",-1)),s("dd",null,o(x[n.value.sourceType]??n.value.sourceType),1)]),s("div",ss,[e[3]||(e[3]=s("dt",null,"مبلغ",-1)),s("dd",{class:p(c(n.value)?"is-in":"is-out")},o(y(n.value)),3)]),s("div",es,[e[4]||(e[4]=s("dt",null,"وضعیت",-1)),s("dd",null,o(n.value.confirmed?"تایید شده":"در انتظار تایید"),1)]),s("div",ts,[e[5]||(e[5]=s("dt",null,"تاریخ",-1)),s("dd",null,o(m(S)(n.value.createdAt)),1)]),s("div",os,[e[6]||(e[6]=s("dt",null,"توضیحات",-1)),s("dd",null,o(n.value.note||"—"),1)])])])]),_:1},8,["visible"])):h("",!0)])}}}),fs=B(ns,[["__scopeId","data-v-4e8ef6ab"]]);export{fs as default};
|
||||
import{d as A,S as D,y as N,h as u,K as g,o as w,c as i,p as r,C as E,N as L,j as P,m,g as h,b as l,F as R,e as s,r as M,I as T,t as o,f as p,E as O,_ as B}from"./index-6E0fX61D.js";import{P as U}from"./PageBar-HEcoSwjE.js";import{S as I}from"./SectionHead-YsBbRh09.js";import{j as S,p as V}from"./filters-CmtC5ctw.js";import{D as Y}from"./index-BRKIhLwl.js";import"./KeyCode-CJkaCAgc.js";import"./classCallCheck-BINKwNli.js";import"./raf-nDFcuFT6.js";const $={class:"tx"},j={class:"tx__list"},z=["onClick"],F={class:"tx__main"},G={class:"tx__head"},H={class:"tx__kind"},K={key:0,class:"tx__note"},J={class:"tx__foot"},Q={class:"tx__date"},W={key:1,class:"tx__empty"},q={class:"sheet"},X={class:"sheet__specs"},Z={class:"sheet__spec"},ss={class:"sheet__spec"},es={class:"sheet__spec"},ts={class:"sheet__spec"},os={class:"sheet__spec"},ns=A({__name:"TransactionsView",setup(as){const x={ORDER_STOCK:"سفارش",ORDER_PRE_ORDER:"سفارش ساخت",REPAYMENT_MELTED_GOLD:"طلای آبشده",REPAYMENT_TRANSFER:"حواله",REPAYMENT_CHEQUE:"چک",REPAYMENT_CASH:"پولی",WALLET_BONUS:"پاداش",ADJUSTMENT:"اصلاحیه"},k=D(),v=N(),_=u(!1),d=u(v.peek(g.ledger)??[]),f=u(!1),n=u(null),c=a=>a.direction==="CREDIT",y=a=>a.currency==="GOLD_GRAM"?`${a.amount} گرم`:`${V(a.amount)} ریال`,C=a=>{n.value=a,f.value=!0};return w(async()=>{if(k.isLoggedIn){_.value=v.peek(g.ledger)===void 0;try{d.value=await v.myLedgerEntries({force:!0})}finally{_.value=!1}}}),(a,e)=>{const b=O("container");return l(),i("div",$,[r(U,{title:"اسناد","back-to":"userPage::hasSubRoute"}),r(L,{spinning:_.value,tip:"درحال دریافت اطلاعات"},{default:E(()=>[r(b,{class:"tx__body"},{default:E(()=>[d.value.length?(l(),i(R,{key:0},[r(I,{title:"گردش حساب",subtitle:`${d.value.length} سند`},null,8,["subtitle"]),s("div",j,[(l(!0),i(R,null,M(d.value,t=>(l(),i("article",{key:t.id,class:"tx__row",onClick:ls=>C(t)},[s("span",{class:p(["tx__mark",c(t)?"is-in":"is-out"]),"aria-hidden":"true"},[r(T,{icon:c(t)?"vuesax-linear:arrow-down":"vuesax-linear:arrow-up",size:"16"},null,8,["icon"])],2),s("div",F,[s("div",G,[s("h3",H,o(x[t.sourceType]??t.sourceType),1),s("span",{class:p(["tx__amount",c(t)?"is-in":"is-out"])},o(y(t)),3)]),t.note?(l(),i("p",K,o(t.note),1)):h("",!0),s("div",J,[s("span",Q,o(m(S)(t.createdAt)),1),s("span",{class:p(["tx__state",{"is-pending":!t.confirmed}])},o(t.confirmed?"تایید شده":"در انتظار تایید"),3)])])],8,z))),128))])],64)):_.value?h("",!0):(l(),i("section",W,[r(T,{icon:"vuesax-linear:receipt-text",size:"26"}),e[1]||(e[1]=s("p",null,"سندی برای حساب شما ثبت نشده است.",-1))]))]),_:1})]),_:1},8,["spinning"]),n.value?(l(),P(m(Y),{key:0,visible:f.value,"onUpdate:visible":e[0]||(e[0]=t=>f.value=t),placement:"bottom",closable:!1,height:"420px",class:"rtl",bodyStyle:{padding:0}},{default:E(()=>[s("div",q,[e[7]||(e[7]=s("h3",{class:"sheet__title"},"جزئیات سند",-1)),s("dl",X,[s("div",Z,[e[2]||(e[2]=s("dt",null,"نوع سند",-1)),s("dd",null,o(x[n.value.sourceType]??n.value.sourceType),1)]),s("div",ss,[e[3]||(e[3]=s("dt",null,"مبلغ",-1)),s("dd",{class:p(c(n.value)?"is-in":"is-out")},o(y(n.value)),3)]),s("div",es,[e[4]||(e[4]=s("dt",null,"وضعیت",-1)),s("dd",null,o(n.value.confirmed?"تایید شده":"در انتظار تایید"),1)]),s("div",ts,[e[5]||(e[5]=s("dt",null,"تاریخ",-1)),s("dd",null,o(m(S)(n.value.createdAt)),1)]),s("div",os,[e[6]||(e[6]=s("dt",null,"توضیحات",-1)),s("dd",null,o(n.value.note||"—"),1)])])])]),_:1},8,["visible"])):h("",!0)])}}}),fs=B(ns,[["__scopeId","data-v-4e8ef6ab"]]);export{fs as default};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{q as g,U as f,K as s,V as p,h as v,i as y,v as h}from"./index-CN-v7uYp.js";const S=g("catalog",()=>{const o=f(),n=o.peek(s.catalog),t=p(n??[]),c=v(n!==void 0),r=y(()=>{const e=new Map;for(const a of t.value)a.category&&!e.has(a.category.id)&&e.set(a.category.id,{id:a.category.id,title:a.category.title});return[...e.values()]});async function i(e=!1){const a=await o.fetch(s.catalog,async()=>(await h.listProductsPaged({page:1,limit:100,sort:"newest"})).rows,{force:e});return t.value=a,c.value=!0,a}function l(e){t.value=e,c.value=!0}function u(e){return t.value.find(a=>a.id===e)??null}function d(){o.invalidate(s.catalog)}return{products:t,loaded:c,categories:r,load:i,replace:l,byId:u,invalidate:d}});export{S as u};
|
||||
import{q as g,U as f,K as s,V as p,h as v,i as y,v as h}from"./index-6E0fX61D.js";const S=g("catalog",()=>{const o=f(),n=o.peek(s.catalog),t=p(n??[]),c=v(n!==void 0),r=y(()=>{const e=new Map;for(const a of t.value)a.category&&!e.has(a.category.id)&&e.set(a.category.id,{id:a.category.id,title:a.category.title});return[...e.values()]});async function i(e=!1){const a=await o.fetch(s.catalog,async()=>(await h.listProductsPaged({page:1,limit:100,sort:"newest"})).rows,{force:e});return t.value=a,c.value=!0,a}function l(e){t.value=e,c.value=!0}function u(e){return t.value.find(a=>a.id===e)??null}function d(){o.invalidate(s.catalog)}return{products:t,loaded:c,categories:r,load:i,replace:l,byId:u,invalidate:d}});export{S as u};
|
||||
@@ -0,0 +1 @@
|
||||
import{a6 as o,a_ as l}from"./index-6E0fX61D.js";function c(a,r){for(var t=o({},a),e=0;e<r.length;e+=1){var n=r[e];delete t[n]}return t}function s(a,r){for(var t=0;t<r.length;t++){var e=r[t];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(a,l(e.key),e)}}function i(a,r,t){return r&&s(a.prototype,r),Object.defineProperty(a,"prototype",{writable:!1}),a}function u(a,r){if(!(a instanceof r))throw new TypeError("Cannot call a class as a function")}export{i as _,u as a,c as o};
|
||||
@@ -1 +0,0 @@
|
||||
import{a6 as n}from"./index-CN-v7uYp.js";function l(a,t){for(var r=n({},a),e=0;e<t.length;e+=1){var o=t[e];delete r[o]}return r}function c(a,t,r){return Object.defineProperty(a,"prototype",{writable:!1}),a}function f(a,t){if(!(a instanceof t))throw new TypeError("Cannot call a class as a function")}export{c as _,f as a,l as o};
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+21
-21
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+2
-2
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
import{v as f,i as m,h as s}from"./index-CN-v7uYp.js";const d=20;function P(){const e=s([]),a=s(0),l=s(0),o=s(!1),n=s(!1),c=m(()=>e.value.length<a.value);async function p(t,u={}){(!u.preserveRows||e.value.length===0)&&(o.value=!0),l.value=1;try{const i=await f.listProductsPaged({...t,page:1,limit:t.limit??d});e.value=i.rows,a.value=i.total}finally{o.value=!1}}async function g(t){if(o.value||n.value||!c.value)return;n.value=!0;const u=l.value+1;try{const r=await f.listProductsPaged({...t,page:u,limit:t.limit??d});l.value=u;const i=new Set(e.value.map(v=>v.id));e.value=[...e.value,...r.rows.filter(v=>!i.has(v.id))],a.value=r.total}finally{n.value=!1}}function w(){e.value=[],a.value=0,l.value=0}return{rows:e,total:a,page:l,loading:o,loadingMore:n,hasMore:c,resetAndLoad:p,loadMore:g,clear:w}}export{d as C,P as u};
|
||||
import{v as f,i as m,h as s}from"./index-6E0fX61D.js";const d=20;function P(){const e=s([]),a=s(0),l=s(0),o=s(!1),n=s(!1),c=m(()=>e.value.length<a.value);async function p(t,u={}){(!u.preserveRows||e.value.length===0)&&(o.value=!0),l.value=1;try{const i=await f.listProductsPaged({...t,page:1,limit:t.limit??d});e.value=i.rows,a.value=i.total}finally{o.value=!1}}async function g(t){if(o.value||n.value||!c.value)return;n.value=!0;const u=l.value+1;try{const r=await f.listProductsPaged({...t,page:u,limit:t.limit??d});l.value=u;const i=new Set(e.value.map(v=>v.id));e.value=[...e.value,...r.rows.filter(v=>!i.has(v.id))],a.value=r.total}finally{n.value=!1}}function w(){e.value=[],a.value=0,l.value=0}return{rows:e,total:a,page:l,loading:o,loadingMore:n,hasMore:c,resetAndLoad:p,loadMore:g,clear:w}}export{d as C,P as u};
|
||||
Vendored
+1
-1
@@ -32,7 +32,7 @@
|
||||
html.theme-dark, html.theme-dark body { background-color: #15171A !important; }
|
||||
</style>
|
||||
<title>طلای تهران تاج</title>
|
||||
<script type="module" crossorigin src="/assets/index-CN-v7uYp.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-6E0fX61D.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-C3cFbOta.css">
|
||||
<link rel="manifest" href="/manifest.webmanifest"></head>
|
||||
<body style="background-color: #ffffff">
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+4
-4
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"app": "user-app-v2",
|
||||
"build": 219,
|
||||
"version": "1.219",
|
||||
"commit": "5204544",
|
||||
"builtAt": "2026-10-28T12:54:55.503Z",
|
||||
"build": 220,
|
||||
"version": "1.220",
|
||||
"commit": "959a272",
|
||||
"builtAt": "2026-10-29T14:37:56.345Z",
|
||||
"history": [
|
||||
{
|
||||
"build": 191,
|
||||
|
||||
@@ -337,6 +337,15 @@ export interface ExpertCustomer {
|
||||
phone: string | null;
|
||||
store_name: string | null;
|
||||
pasazh_name: string | null;
|
||||
/** What «ویرایش مشتری» opens with. */
|
||||
fname: string;
|
||||
lname: string;
|
||||
address: string | null;
|
||||
zone: string | null;
|
||||
city_id: string | null;
|
||||
national_code: string | null;
|
||||
/** Gregorian YYYY-MM-DD, or null. */
|
||||
birth_date: string | null;
|
||||
gram_level: string;
|
||||
remain: string;
|
||||
rial_remain: string;
|
||||
@@ -344,6 +353,47 @@ export interface ExpertCustomer {
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
/** The contact details an expert may change on one of their customers — never the percent or credit. */
|
||||
export interface ExpertCustomerEdit {
|
||||
fname: string;
|
||||
lname: string;
|
||||
mobile?: string;
|
||||
phone?: string | null;
|
||||
address?: string | null;
|
||||
store_name?: string | null;
|
||||
pasazh_name?: string | null;
|
||||
national_code?: string | null;
|
||||
birth_date?: string | null;
|
||||
}
|
||||
|
||||
/** One «سفارش ساخت» request as the customer sees it. */
|
||||
export interface PreOrderRow {
|
||||
id: string;
|
||||
status: string;
|
||||
/** The reference's label: ثبت سفارش، تایید ادمین، تایید کارگاه، … */
|
||||
sts_str_fa: string;
|
||||
/** 1–5 on the tracker; 0 = cancelled. */
|
||||
step: number;
|
||||
color: string | null;
|
||||
size: string | null;
|
||||
color_mina: string | null;
|
||||
color_stone: string | null;
|
||||
sum: number;
|
||||
description: string | null;
|
||||
image: string | null;
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
export interface PreOrderInput {
|
||||
color: string;
|
||||
size?: string;
|
||||
color_mina?: string;
|
||||
color_stone?: string;
|
||||
sum: number;
|
||||
file_id?: string | null;
|
||||
description?: string;
|
||||
}
|
||||
|
||||
/** One row of "سفارش مشتریان". */
|
||||
export interface ExpertChildOrder {
|
||||
id: string;
|
||||
@@ -592,6 +642,30 @@ export const api = {
|
||||
'/expert/child-orders',
|
||||
{ method: 'POST', body: JSON.stringify({ page, search: search ?? null }) },
|
||||
),
|
||||
/**
|
||||
* The expert's real weight for each piece of an order in their hands, and
|
||||
* optionally «ثبت نهایی» (hand it to the customer). Only raw weights travel:
|
||||
* the making charge, the totals and the debt are the server's to compute.
|
||||
* Mirrors legacy PUT /order/child/{id}.
|
||||
*/
|
||||
/** Switch one of the expert's customers off or on (legacy customer/toggle-active). */
|
||||
toggleExpertCustomer: (customerId: string) =>
|
||||
request<{ id: string; active: number }>(`/expert/customers/${encodeURIComponent(customerId)}/toggle-active`, { method: 'POST' }),
|
||||
/** Correct a customer's contact details (legacy customer/update). */
|
||||
updateExpertCustomer: (customerId: string, body: ExpertCustomerEdit) =>
|
||||
request<{ id: string; name: string; mobile: string }>(`/expert/customers/${encodeURIComponent(customerId)}`, {
|
||||
method: 'PUT',
|
||||
body: JSON.stringify(body),
|
||||
}),
|
||||
// ── «سفارش ساخت» (legacy create-custom-order / get-custom-orders) ──
|
||||
createPreOrder: (body: PreOrderInput) =>
|
||||
request<PreOrderRow>('/customer/me/pre-orders', { method: 'POST', body: JSON.stringify(body) }),
|
||||
getMyPreOrders: () => request<{ rows: PreOrderRow[] }>('/customer/me/pre-orders'),
|
||||
adjustExpertChildOrder: (orderId: string, items: { id: string; rash_weight: number }[], finalSubmit: boolean) =>
|
||||
request<{ id: string; status: string }>(`/expert/child-orders/${encodeURIComponent(orderId)}`, {
|
||||
method: 'PUT',
|
||||
body: JSON.stringify({ items, final_submit: finalSubmit }),
|
||||
}),
|
||||
|
||||
// ── complete_profile ─────────────────────────────────────────────────
|
||||
// Ports POST /major/complete (henza_server Major/CustomerController::complete)
|
||||
|
||||
@@ -4,9 +4,12 @@
|
||||
hairline borders, wine accent.
|
||||
|
||||
Ported originally from legacy henza_pwa/src/components/product/cartItem.vue.
|
||||
Dropped there and still absent: the "اجرت ریالی" (Rial wage) block, which
|
||||
displayed `selectedVariant.rial_pay` — no such per-variant Rial field exists
|
||||
anywhere in our domain model, so there is nothing honest to show.
|
||||
The "اجرت ریالی" (Rial wage) block of legacy's cart line is back: it shows
|
||||
`selectedVariant.rial_pay`, which the catalog serves from the variant's
|
||||
`rialWage` and which the server copies onto the order line (OrdersService),
|
||||
where it becomes rial debt on delivery. An earlier note here claimed no such
|
||||
field existed; that was wrong, and the customer was charged a figure the cart
|
||||
never showed.
|
||||
|
||||
All cart behaviour is unchanged: quantity increment/decrement, remove at
|
||||
qty 1, and the note affordance that opens the parent's drawer.
|
||||
@@ -26,6 +29,7 @@
|
||||
<div class="ci__meta">
|
||||
<span class="ci__weight">{{ selectedVariant?.rashWeightGrams }} گرم</span>
|
||||
<span v-if="wage != null" class="ci__wage">اجرت {{ wageLabel }}٪</span>
|
||||
<span v-if="rialWage > 0" class="ci__wage">اجرت ریالی {{ price(rialWage) }} ریال</span>
|
||||
</div>
|
||||
|
||||
<div class="ci__row">
|
||||
@@ -76,6 +80,7 @@ import { computed } from 'vue'
|
||||
import Icon from '../icon/Icon.vue'
|
||||
import { useProduct } from '../../composables/useProduct'
|
||||
import { useCartStore, type CartItem } from '../../stores/cartStore'
|
||||
import { price } from '../../utils/filters'
|
||||
|
||||
const props = defineProps<{ value: CartItem }>()
|
||||
const emit = defineEmits<{ (e: 'note', value: number): void }>()
|
||||
@@ -98,6 +103,9 @@ const decrement = () => {
|
||||
|
||||
const { image, title, selectedVariant, wage } = useProduct(props.value.product, cart.variant(props.value))
|
||||
|
||||
/** The variant's fixed rial making charge, per unit. */
|
||||
const rialWage = computed(() => Number(selectedVariant.value?.rial_pay ?? 0) || 0)
|
||||
|
||||
const wageLabel = computed(() => {
|
||||
const w = wage.value
|
||||
if (w == null) return ''
|
||||
|
||||
@@ -40,6 +40,10 @@ export const router = createRouter({
|
||||
},
|
||||
{ path: '/profile', name: 'profileData', component: () => import('../views/user/ProfileView.vue'), meta: { requiresAuth: true } },
|
||||
{ path: '/favorites', name: 'favoritesList', component: () => import('../views/user/FavoritesView.vue'), meta: { requiresAuth: true } },
|
||||
// «سفارش ساخت» — ask for a piece to be made, and follow the request.
|
||||
// Reference paths and names kept (henza_pwa router/index.ts:113-128).
|
||||
{ path: '/makeOrder', name: 'makeOrderList', component: () => import('../views/user/MakeOrderView.vue'), meta: { requiresAuth: true } },
|
||||
{ path: '/makeOrder_status', name: 'makeOrderStatus', component: () => import('../views/user/MakeOrderStatusView.vue'), meta: { requiresAuth: true } },
|
||||
// Theme + reduced motion. Device preferences, so no requiresAuth.
|
||||
{ path: '/settings/appearance', name: 'appearanceSettings', component: () => import('../views/user/AppearanceView.vue') },
|
||||
// D21 — the sales expert's two screens. Reference paths and names kept
|
||||
|
||||
@@ -145,6 +145,18 @@ export const useCartStore = defineStore('cart', {
|
||||
}, 0)
|
||||
.toFixed(2)
|
||||
},
|
||||
/**
|
||||
* The fixed rial making charge («اجرت ریالی») of the whole cart, in rial:
|
||||
* each variant's `rial_pay` × quantity. This is what the server copies onto
|
||||
* the order lines (OrdersService) and what becomes rial debt on delivery,
|
||||
* so the cart shows it beside the weight.
|
||||
*/
|
||||
totalRial(): number {
|
||||
return this.items.reduce((sum, item) => {
|
||||
const v = this.variant(item)
|
||||
return sum + (v?.rial_pay ? Number(v.rial_pay) * item.qty : 0)
|
||||
}, 0)
|
||||
},
|
||||
clear() {
|
||||
this.items = []
|
||||
persist(this.items)
|
||||
|
||||
@@ -85,6 +85,9 @@
|
||||
{{ cart.total() }}
|
||||
<i>گرم</i>
|
||||
</span>
|
||||
<span v-if="cart.totalRial() > 0" class="cart__totalRial">
|
||||
+ اجرت ریالی {{ price(cart.totalRial()) }} <i>ریال</i>
|
||||
</span>
|
||||
</div>
|
||||
<button type="button" class="cart__submit" @click="cartData.notify = true">ثبت نهایی سفارش</button>
|
||||
</div>
|
||||
@@ -146,6 +149,7 @@ import CartItem from '../components/product/CartItem.vue'
|
||||
import { useCartStore, type CartItem as CartItemType } from '../stores/cartStore'
|
||||
import { useSessionStore } from '../stores/session'
|
||||
import { api } from '../api/client'
|
||||
import { price } from '../utils/filters'
|
||||
import { useCatalogStore } from '../stores/catalogStore'
|
||||
import { KEYS, useQueryCache } from '../stores/queryCache'
|
||||
|
||||
@@ -441,6 +445,16 @@ onMounted(async () => {
|
||||
font-weight: 800;
|
||||
color: @ink;
|
||||
}
|
||||
.cart__totalRial {
|
||||
font-size: 11.5px;
|
||||
font-weight: 700;
|
||||
color: @inkSoft;
|
||||
}
|
||||
.cart__totalRial i {
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
color: @inkFaint;
|
||||
}
|
||||
.cart__totalValue i {
|
||||
font-style: normal;
|
||||
font-size: 11px;
|
||||
|
||||
@@ -16,11 +16,15 @@
|
||||
returns orders at that status (`where('sts', 5)`, ApiMobileController:766)
|
||||
- the card is tappable, as the reference's was (:29)
|
||||
|
||||
Deliberately NOT ported: the reference's edit-order drawer behind that tap
|
||||
(toEditOrder -> PUT /order/child/{id}) recalculated an order's weights and
|
||||
prices from values the CLIENT sent. Bringing that across during a delivery
|
||||
would put a money path in the app with no server-side recomputation; the tap
|
||||
opens a read-only summary instead. Recorded in D21/DELIVERY.md.
|
||||
The reference's edit-order drawer behind that tap (toEditOrder ->
|
||||
PUT /order/child/{id}) is back, in a form that keeps the reason it was held
|
||||
back: it used to recalculate an order's weights and prices from values the
|
||||
CLIENT sent. Here the expert enters ONLY the real raw weight of each piece;
|
||||
the server applies the making charge the order was placed at, recomputes the
|
||||
totals and the customer's debt, and refuses anyone but the expert the order
|
||||
belongs to (OrdersService.expertAdjust). The figures shown under each field
|
||||
are a preview of that formula, not what is saved. «ثبت نهایی» hands the order
|
||||
to the customer.
|
||||
|
||||
Scope is the server's: every row belongs to a customer this expert referred.
|
||||
No id travels from the client.
|
||||
@@ -133,6 +137,37 @@
|
||||
<dd>تحویل مسئول فروش</dd>
|
||||
</div>
|
||||
</dl>
|
||||
|
||||
<!-- The real weight of each piece. Only the raw weight is sent; the making
|
||||
charge, totals and debt are worked out by the server, and the figure
|
||||
shown under each field is a preview of that. -->
|
||||
<h3 v-if="drafts.length" class="cho__editTitle">وزن واقعی هر عدد (گرم)</h3>
|
||||
<div v-for="d in drafts" :key="d.id" class="cho__line">
|
||||
<div class="cho__lineHead">
|
||||
<span class="cho__lineName">{{ d.title }}</span>
|
||||
<span class="cho__lineQty" dir="rtl"><bdi>{{ d.qty }}</bdi> عدد · اجرت <bdi>{{ d.netPercent }}٪</bdi></span>
|
||||
</div>
|
||||
<InputNumber v-model:value="d.weight" class="cho__input" :min="0.001" :step="0.01" :precision="3" size="large" />
|
||||
<div class="cho__lineSum" dir="ltr">
|
||||
{{ grams(preview(d)) }} g
|
||||
<span class="cho__muted">({{ d.qty }} × {{ grams(unitPreview(d)) }})</span>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="drafts.length" class="cho__previewTotal">
|
||||
<span>جمع وزن پس از ثبت</span>
|
||||
<b dir="ltr">{{ grams(previewTotal) }} گرم</b>
|
||||
</div>
|
||||
<p v-if="saveError" class="cho__error">{{ saveError }}</p>
|
||||
<div v-if="drafts.length" class="cho__actions">
|
||||
<button type="button" class="cho__save" :disabled="saving" @click="save(false)">ثبت تغییرات</button>
|
||||
<button type="button" class="cho__final" :disabled="saving" @click="confirmFinal = true">ثبت نهایی</button>
|
||||
</div>
|
||||
<p v-if="confirmFinal" class="cho__confirm">
|
||||
آیا مطمئن به ثبت نهایی هستید؟ پس از آن سفارش تحویل مشتری میشود.
|
||||
<button type="button" class="cho__final" :disabled="saving" @click="save(true)">بله، ثبت نهایی</button>
|
||||
<button type="button" class="cho__link" @click="confirmFinal = false">بیخیال</button>
|
||||
</p>
|
||||
|
||||
<button type="button" class="cho__close" @click="detailOpen = false">بستن</button>
|
||||
</div>
|
||||
</Drawer>
|
||||
@@ -140,8 +175,8 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onBeforeUnmount, onMounted, ref } from 'vue'
|
||||
import { Drawer } from 'ant-design-vue'
|
||||
import { computed, onBeforeUnmount, onMounted, ref } from 'vue'
|
||||
import { Drawer, InputNumber } from 'ant-design-vue'
|
||||
import AppPullRefresh from '../../components/ui/AppPullRefresh.vue'
|
||||
import Icon from '../../components/icon/Icon.vue'
|
||||
import PageBar from '../../components/ui/PageBar.vue'
|
||||
@@ -212,11 +247,67 @@ async function onRefresh() {
|
||||
}
|
||||
}
|
||||
|
||||
/** One line of the order as the expert edits it: the raw weight is the only input. */
|
||||
interface Draft {
|
||||
id: string
|
||||
title: string
|
||||
qty: number
|
||||
/** The percent the order was placed at (charge − promotion), kept as it is. */
|
||||
netPercent: number
|
||||
weight: number | undefined
|
||||
}
|
||||
|
||||
const drafts = ref<Draft[]>([])
|
||||
const saving = ref(false)
|
||||
const saveError = ref('')
|
||||
const confirmFinal = ref(false)
|
||||
|
||||
function openDetail(item: ExpertChildOrder) {
|
||||
active.value = item
|
||||
drafts.value = (item.items ?? []).map((i) => ({
|
||||
id: i.id,
|
||||
title: [i.productVariant?.product?.title, i.productVariant?.title].filter(Boolean).join(' — ') || 'محصول',
|
||||
qty: i.quantity,
|
||||
netPercent: Number(i.wagePercentSnapshot) - Number(i.discountPercentSnapshot),
|
||||
weight: Number(i.rashWeightGramsSnapshot),
|
||||
}))
|
||||
saveError.value = ''
|
||||
confirmFinal.value = false
|
||||
detailOpen.value = true
|
||||
}
|
||||
|
||||
/** rash × (1 + net/100) — the server's own formula, shown so the effect is visible before saving. */
|
||||
const unitPreview = (d: Draft) => (d.weight ?? 0) * (1 + d.netPercent / 100)
|
||||
const preview = (d: Draft) => unitPreview(d) * d.qty
|
||||
const previewTotal = computed(() => drafts.value.reduce((s, d) => s + preview(d), 0))
|
||||
|
||||
async function save(finalSubmit: boolean) {
|
||||
if (!active.value || saving.value) return
|
||||
if (drafts.value.some((d) => !d.weight || d.weight <= 0)) {
|
||||
saveError.value = 'وزن هر عدد باید بیشتر از صفر باشد.'
|
||||
return
|
||||
}
|
||||
saving.value = true
|
||||
saveError.value = ''
|
||||
try {
|
||||
await api.adjustExpertChildOrder(
|
||||
active.value.id,
|
||||
drafts.value.map((d) => ({ id: d.id, rash_weight: d.weight as number })),
|
||||
finalSubmit,
|
||||
)
|
||||
detailOpen.value = false
|
||||
await reload()
|
||||
} catch (e) {
|
||||
// The server's Persian reason (not found, wrong status, accounting busy, …) is in the body.
|
||||
const text = e instanceof Error ? e.message : ''
|
||||
const m = text.match(/"message":"([^"]+)"/)
|
||||
saveError.value = m ? m[1] : 'ثبت تغییرات انجام نشد؛ دوباره تلاش کنید.'
|
||||
} finally {
|
||||
saving.value = false
|
||||
confirmFinal.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// Infinite scroll, the reference's behaviour (useInfiniteScroll at :216/:330).
|
||||
const sentinel = ref<HTMLElement | null>(null)
|
||||
let observer: IntersectionObserver | null = null
|
||||
@@ -415,6 +506,109 @@ onBeforeUnmount(() => observer?.disconnect())
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.cho__editTitle {
|
||||
margin: 18px 0 6px;
|
||||
font-size: 13px;
|
||||
font-weight: 800;
|
||||
color: @ink;
|
||||
}
|
||||
|
||||
.cho__line {
|
||||
padding: 12px 0;
|
||||
border-bottom: 1px solid @hairline;
|
||||
}
|
||||
|
||||
.cho__lineHead {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 10px;
|
||||
margin-bottom: 8px;
|
||||
font-size: 12.5px;
|
||||
}
|
||||
|
||||
.cho__lineName {
|
||||
font-weight: 700;
|
||||
color: @ink;
|
||||
}
|
||||
|
||||
.cho__lineQty {
|
||||
color: @inkFaint;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.cho__input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.cho__lineSum {
|
||||
margin-top: 6px;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
color: @inkSoft;
|
||||
}
|
||||
|
||||
.cho__previewTotal {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 14px 0 4px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.cho__error {
|
||||
margin: 10px 0 0;
|
||||
font-size: 12.5px;
|
||||
color: #c0392b;
|
||||
}
|
||||
|
||||
.cho__actions {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
margin-top: 14px;
|
||||
}
|
||||
|
||||
.cho__save,
|
||||
.cho__final {
|
||||
flex: 1;
|
||||
padding: 12px;
|
||||
border: 1px solid @wine;
|
||||
border-radius: 14px;
|
||||
background: transparent;
|
||||
color: @wine;
|
||||
font-family: inherit;
|
||||
font-size: 13.5px;
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.cho__final {
|
||||
background: @wine;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.cho__save:disabled,
|
||||
.cho__final:disabled {
|
||||
opacity: 0.5;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.cho__confirm {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
margin: 12px 0 0;
|
||||
font-size: 12.5px;
|
||||
color: @inkSoft;
|
||||
}
|
||||
|
||||
.cho__link {
|
||||
border: none;
|
||||
background: transparent;
|
||||
color: @inkFaint;
|
||||
font-family: inherit;
|
||||
font-size: 12.5px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.cho__close {
|
||||
margin-top: 18px;
|
||||
width: 100%;
|
||||
|
||||
@@ -22,10 +22,11 @@
|
||||
expert keeps their own token and the client names the customer in a header,
|
||||
which the server re-authorises on every request.
|
||||
|
||||
Still deliberately NOT ported (D21):
|
||||
- The activate/deactivate toggle and the edit button, which posted to
|
||||
`/customer/toggle-active` and the customer form. Those are admin-panel
|
||||
operations here. The state is shown, read-only.
|
||||
The activate/deactivate toggle and the edit button (the reference's
|
||||
`/customer/toggle-active` and `/customer/update`) are back, scoped the way
|
||||
the reference's update was and its toggle was not: the server only lets an
|
||||
expert touch THEIR OWN customers, and the edit covers contact details only —
|
||||
never the percent, the credit limit, the kind or the account switches.
|
||||
|
||||
Scope is the server's: `referredByAgentId` = this expert, from the token.
|
||||
-->
|
||||
@@ -129,14 +130,56 @@
|
||||
<button type="button" class="cch__enter" :disabled="entering" @click="enterAccount(active)">
|
||||
{{ entering ? 'در حال ورود…' : 'ورود به حساب این مشتری' }}
|
||||
</button>
|
||||
<div class="cch__actions">
|
||||
<button type="button" class="cch__act" @click="startEdit(active)">ویرایش اطلاعات</button>
|
||||
<button
|
||||
type="button"
|
||||
class="cch__act"
|
||||
:class="{ 'is-danger': active.active === 1 }"
|
||||
:disabled="toggling"
|
||||
@click="confirmToggle = true"
|
||||
>
|
||||
{{ active.active === 1 ? 'غیرفعال کردن' : 'فعال کردن' }}
|
||||
</button>
|
||||
</div>
|
||||
<p v-if="confirmToggle" class="cch__confirm">
|
||||
{{ active.active === 1 ? 'کاربر غیرفعال شود؟' : 'کاربر فعال شود؟' }}
|
||||
<button type="button" class="cch__act is-danger" :disabled="toggling" @click="toggleActive(active)">بله</button>
|
||||
<button type="button" class="cch__link" @click="confirmToggle = false">بیخیال</button>
|
||||
</p>
|
||||
<button type="button" class="cch__close" @click="detailOpen = false">بستن</button>
|
||||
</div>
|
||||
</Drawer>
|
||||
|
||||
<!-- «ویرایش مشتری»: contact details only. -->
|
||||
<Drawer v-model:visible="editOpen" placement="bottom" height="auto" :closable="false" :body-style="{ padding: '0' }">
|
||||
<form class="cch__detail" @submit.prevent="saveEdit">
|
||||
<h2 class="cch__detailTitle">ویرایش اطلاعات مشتری</h2>
|
||||
<label class="cch__field"><span>نام</span><input v-model.trim="edit.fname" type="text" maxlength="100" /></label>
|
||||
<label class="cch__field"><span>نام خانوادگی</span><input v-model.trim="edit.lname" type="text" maxlength="100" /></label>
|
||||
<label class="cch__field">
|
||||
<span>موبایل</span>
|
||||
<input v-model.trim="edit.mobile" type="tel" dir="ltr" maxlength="11" inputmode="numeric" />
|
||||
</label>
|
||||
<label class="cch__field"><span>تلفن ثابت</span><input v-model.trim="edit.phone" type="tel" dir="ltr" maxlength="30" /></label>
|
||||
<label class="cch__field"><span>نام فروشگاه</span><input v-model.trim="edit.store_name" type="text" maxlength="150" /></label>
|
||||
<label class="cch__field"><span>نام پاساژ</span><input v-model.trim="edit.pasazh_name" type="text" maxlength="150" /></label>
|
||||
<label class="cch__field">
|
||||
<span>کد ملی</span>
|
||||
<input v-model.trim="edit.national_code" type="text" dir="ltr" maxlength="10" inputmode="numeric" />
|
||||
</label>
|
||||
<label class="cch__field"><span>تاریخ تولد</span><input v-model="edit.birth_date" type="date" dir="ltr" /></label>
|
||||
<label class="cch__field"><span>آدرس</span><textarea v-model.trim="edit.address" rows="2" maxlength="500" /></label>
|
||||
<p v-if="editError" class="cch__error">{{ editError }}</p>
|
||||
<button type="submit" class="cch__enter" :disabled="saving">{{ saving ? 'در حال ثبت…' : 'ثبت تغییرات' }}</button>
|
||||
<button type="button" class="cch__close" @click="editOpen = false">بستن</button>
|
||||
</form>
|
||||
</Drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { onMounted, reactive, ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { Drawer } from 'ant-design-vue'
|
||||
import AppPullRefresh from '../../components/ui/AppPullRefresh.vue'
|
||||
@@ -228,6 +271,91 @@ async function enterAccount(item: ExpertCustomer) {
|
||||
}
|
||||
}
|
||||
|
||||
// ── «فعال/غیرفعال کردن» and «ویرایش» (reference customer/toggle-active, customer/update)
|
||||
const toggling = ref(false)
|
||||
const confirmToggle = ref(false)
|
||||
|
||||
async function toggleActive(item: ExpertCustomer) {
|
||||
toggling.value = true
|
||||
try {
|
||||
const res = await api.toggleExpertCustomer(item.id)
|
||||
item.active = res.active
|
||||
const row = rows.value.find((r) => r.id === item.id)
|
||||
if (row) row.active = res.active
|
||||
toast.success(res.active === 1 ? 'کاربر فعال شد' : 'کاربر غیرفعال شد')
|
||||
} catch {
|
||||
toast.error('تغییر وضعیت انجام نشد؛ دوباره تلاش کنید.')
|
||||
} finally {
|
||||
toggling.value = false
|
||||
confirmToggle.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const editOpen = ref(false)
|
||||
const saving = ref(false)
|
||||
const editError = ref('')
|
||||
const edit = reactive({
|
||||
id: '',
|
||||
fname: '',
|
||||
lname: '',
|
||||
mobile: '',
|
||||
phone: '',
|
||||
store_name: '',
|
||||
pasazh_name: '',
|
||||
national_code: '',
|
||||
birth_date: '',
|
||||
address: '',
|
||||
})
|
||||
|
||||
function startEdit(item: ExpertCustomer) {
|
||||
Object.assign(edit, {
|
||||
id: item.id,
|
||||
fname: item.fname ?? '',
|
||||
lname: item.lname ?? '',
|
||||
mobile: item.mobile ?? '',
|
||||
phone: item.phone ?? '',
|
||||
store_name: item.store_name ?? '',
|
||||
pasazh_name: item.pasazh_name ?? '',
|
||||
national_code: item.national_code ?? '',
|
||||
birth_date: item.birth_date ?? '',
|
||||
address: item.address ?? '',
|
||||
})
|
||||
editError.value = ''
|
||||
detailOpen.value = false
|
||||
editOpen.value = true
|
||||
}
|
||||
|
||||
async function saveEdit() {
|
||||
if (!edit.fname || !edit.lname) {
|
||||
editError.value = 'نام و نام خانوادگی الزامی است.'
|
||||
return
|
||||
}
|
||||
saving.value = true
|
||||
editError.value = ''
|
||||
try {
|
||||
await api.updateExpertCustomer(edit.id, {
|
||||
fname: edit.fname,
|
||||
lname: edit.lname,
|
||||
mobile: edit.mobile || undefined,
|
||||
phone: edit.phone,
|
||||
store_name: edit.store_name,
|
||||
pasazh_name: edit.pasazh_name,
|
||||
national_code: edit.national_code,
|
||||
birth_date: edit.birth_date,
|
||||
address: edit.address,
|
||||
})
|
||||
editOpen.value = false
|
||||
toast.success('اطلاعات مشتری ثبت شد')
|
||||
await load()
|
||||
} catch (e) {
|
||||
// The server's Persian reason (duplicate mobile, bad date, …) is in the body.
|
||||
const m = (e instanceof Error ? e.message : '').match(/"message":"([^"]+)"/)
|
||||
editError.value = m ? m[1] : 'ثبت تغییرات انجام نشد؛ دوباره تلاش کنید.'
|
||||
} finally {
|
||||
saving.value = false
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(load)
|
||||
</script>
|
||||
|
||||
@@ -405,6 +533,80 @@ onMounted(load)
|
||||
}
|
||||
|
||||
/* Secondary now that "enter the account" is the primary action here. */
|
||||
.cch__actions {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.cch__act {
|
||||
flex: 1;
|
||||
padding: 12px;
|
||||
border: 1px solid @wine;
|
||||
border-radius: 14px;
|
||||
background: transparent;
|
||||
color: @wine;
|
||||
font-family: inherit;
|
||||
font-size: 13.5px;
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
|
||||
&.is-danger {
|
||||
border-color: @red;
|
||||
color: @red;
|
||||
}
|
||||
|
||||
&:disabled {
|
||||
opacity: 0.5;
|
||||
cursor: default;
|
||||
}
|
||||
}
|
||||
|
||||
.cch__confirm {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
margin: 12px 0 0;
|
||||
font-size: 13px;
|
||||
color: @inkSoft;
|
||||
}
|
||||
|
||||
.cch__link {
|
||||
border: none;
|
||||
background: transparent;
|
||||
color: @inkFaint;
|
||||
font-family: inherit;
|
||||
font-size: 12.5px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.cch__field {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 5px;
|
||||
padding: 8px 0;
|
||||
font-size: 12.5px;
|
||||
color: @inkSoft;
|
||||
}
|
||||
|
||||
.cch__field input,
|
||||
.cch__field textarea {
|
||||
width: 100%;
|
||||
padding: 10px 12px;
|
||||
border: 1px solid @hairline;
|
||||
border-radius: 12px;
|
||||
background: transparent;
|
||||
color: @ink;
|
||||
font-family: inherit;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.cch__error {
|
||||
margin: 8px 0 0;
|
||||
font-size: 12.5px;
|
||||
color: @red;
|
||||
}
|
||||
|
||||
.cch__close {
|
||||
margin-top: 10px;
|
||||
width: 100%;
|
||||
|
||||
@@ -195,6 +195,18 @@
|
||||
mcode, so every signed-in customer sees it and the server scopes it
|
||||
to their token.
|
||||
-->
|
||||
<button type="button" class="dash__row" @click="goToDetails(7)">
|
||||
<span class="dash__rowIcon" aria-hidden="true">
|
||||
<Icon icon="vuesax-linear:3d-cube-scan" size="18" />
|
||||
</span>
|
||||
<span class="dash__rowText">
|
||||
<b>سفارش ساخت</b>
|
||||
</span>
|
||||
<span class="dash__rowChevron" aria-hidden="true">
|
||||
<Icon icon="vuesax-linear:arrow-left-1" size="16" />
|
||||
</span>
|
||||
</button>
|
||||
|
||||
<button type="button" class="dash__row" @click="goToDetails(6)">
|
||||
<span class="dash__rowIcon" aria-hidden="true">
|
||||
<Icon icon="vuesax-linear:chart-2" size="18" />
|
||||
@@ -279,6 +291,14 @@
|
||||
cancel-text="بیخیال"
|
||||
@confirm="router.push({ name: 'login' })"
|
||||
/>
|
||||
|
||||
<!-- «سفارش ساخت»: place a request, or see the ones already placed. -->
|
||||
<Drawer v-model:visible="makeOrderChoice" placement="bottom" height="auto" :closable="false" :body-style="{ padding: '0' }">
|
||||
<div class="dash__choice">
|
||||
<button type="button" class="dash__choiceBtn" @click="chooseMakeOrder('makeOrderList')">ثبت سفارش</button>
|
||||
<button type="button" class="dash__choiceBtn is-quiet" @click="chooseMakeOrder('makeOrderStatus')">مشاهده سفارش</button>
|
||||
</div>
|
||||
</Drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -286,6 +306,7 @@
|
||||
import { brand } from '../../brand'
|
||||
import { computed, nextTick, onActivated, onMounted, reactive, ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { Drawer } from 'ant-design-vue'
|
||||
import AppPullRefresh from '../../components/ui/AppPullRefresh.vue'
|
||||
import Icon from '../../components/icon/Icon.vue'
|
||||
import PageBar from '../../components/ui/PageBar.vue'
|
||||
@@ -344,6 +365,15 @@ function goToDetails(id: number) {
|
||||
if (id === 4) router.push({ name: 'ChildOrder' })
|
||||
if (id === 5) router.push({ name: 'customerChoice' })
|
||||
if (id === 6) router.push({ name: 'report' })
|
||||
if (id === 7) makeOrderChoice.value = true
|
||||
}
|
||||
|
||||
// «سفارش ساخت»: the reference opened a two-button dialog — place a request, or
|
||||
// see the ones already placed.
|
||||
const makeOrderChoice = ref(false)
|
||||
function chooseMakeOrder(name: 'makeOrderList' | 'makeOrderStatus') {
|
||||
makeOrderChoice.value = false
|
||||
router.push({ name })
|
||||
}
|
||||
|
||||
async function logOut() {
|
||||
@@ -802,4 +832,28 @@ onMounted(async () => {
|
||||
.dash__rate {
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.dash__choice {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
padding: 20px 16px 24px;
|
||||
}
|
||||
|
||||
.dash__choiceBtn {
|
||||
padding: 15px;
|
||||
border: 1px solid @wine;
|
||||
border-radius: 14px;
|
||||
background: @wine;
|
||||
color: #fff;
|
||||
font-family: inherit;
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.dash__choiceBtn.is-quiet {
|
||||
background: transparent;
|
||||
color: @wine;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,237 @@
|
||||
<!--
|
||||
"وضعیت سفارش" — where each «سفارش ساخت» request stands.
|
||||
|
||||
Ported from henza_pwa/src/views/user/src/components/makeOrderStatus.vue
|
||||
(route /makeOrder_status, name makeOrderStatus), restyled into this app's
|
||||
design language.
|
||||
|
||||
Kept from the reference:
|
||||
- the header title "وضعیت سفارش"
|
||||
- one card per request, newest first, with the five-step tracker
|
||||
ثبت سفارش → تایید ادمین → تایید کارگاه → ارسال → تحویل شده
|
||||
- the facts it listed: رنگ محصول، سایز محصول، رنگ مینا، رنگ سنگ، تعداد، وضعیت،
|
||||
تاریخ ثبت، ساعت ثبت, and the photo
|
||||
|
||||
Deliberately NOT ported: the «تایید سفارش» / «ارسال سفارش» buttons the reference
|
||||
showed to workshop-type users. Both posted the same `sts: 2` and the server
|
||||
checked neither who asked nor whose request it was. Moving a request along is
|
||||
the admin screen's job («سفارشات ساختنی»).
|
||||
-->
|
||||
<template>
|
||||
<div class="mks">
|
||||
<PageBar title="وضعیت سفارش" back-to="userPage::hasSubRoute" />
|
||||
|
||||
<Spinner :spinning="loading && !rows.length" tip="درحال دریافت اطلاعات">
|
||||
<AppPullRefresh v-model="refreshing" @refresh="onRefresh">
|
||||
<container class="mks__body">
|
||||
<article v-for="item in rows" :key="item.id" class="mks__card">
|
||||
<ol v-if="item.step > 0" class="mks__track" :aria-label="item.sts_str_fa">
|
||||
<li
|
||||
v-for="(label, i) in STEPS"
|
||||
:key="label"
|
||||
:class="{ 'is-done': item.step > i + 1, 'is-now': item.step === i + 1 }"
|
||||
>
|
||||
<i aria-hidden="true" />
|
||||
<span>{{ label }}</span>
|
||||
</li>
|
||||
</ol>
|
||||
<p v-else class="mks__cancelled">این سفارش لغو شده است.</p>
|
||||
|
||||
<dl class="mks__facts">
|
||||
<div><dt>رنگ محصول</dt><dd>{{ item.color || '—' }}</dd></div>
|
||||
<div><dt>سایز محصول</dt><dd>{{ item.size || '—' }}</dd></div>
|
||||
<div><dt>رنگ مینا</dt><dd>{{ item.color_mina || '—' }}</dd></div>
|
||||
<div><dt>رنگ سنگ</dt><dd>{{ item.color_stone || '—' }}</dd></div>
|
||||
<div><dt>تعداد</dt><dd>{{ item.sum }}</dd></div>
|
||||
<div><dt>وضعیت</dt><dd>{{ item.sts_str_fa }}</dd></div>
|
||||
<div><dt>تاریخ ثبت</dt><dd dir="ltr">{{ jdate(item.createdAt) }}</dd></div>
|
||||
<div><dt>ساعت ثبت</dt><dd dir="ltr">{{ timeOf(item.createdAt) }}</dd></div>
|
||||
</dl>
|
||||
<p v-if="item.description" class="mks__note">{{ item.description }}</p>
|
||||
<img v-if="item.image" class="mks__photo" :src="item.image" alt="" />
|
||||
</article>
|
||||
|
||||
<section v-if="!rows.length && !loading && !failed" class="mks__empty">
|
||||
<Icon icon="vuesax-linear:box" size="26" />
|
||||
<p>هنوز سفارش ساختی ثبت نکردهاید.</p>
|
||||
<button type="button" class="mks__cta" @click="router.push({ name: 'makeOrderList' })">ثبت سفارش</button>
|
||||
</section>
|
||||
|
||||
<section v-if="failed" class="mks__empty">
|
||||
<Icon icon="vuesax-linear:danger" size="26" />
|
||||
<p>دریافت اطلاعات با خطا روبهرو شد.</p>
|
||||
<button type="button" class="mks__cta" @click="load">تلاش دوباره</button>
|
||||
</section>
|
||||
</container>
|
||||
</AppPullRefresh>
|
||||
</Spinner>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import AppPullRefresh from '../../components/ui/AppPullRefresh.vue'
|
||||
import Icon from '../../components/icon/Icon.vue'
|
||||
import PageBar from '../../components/ui/PageBar.vue'
|
||||
import Spinner from '../../components/Spinner.vue'
|
||||
import { jdate } from '../../utils/filters'
|
||||
import { api, type PreOrderRow } from '../../api/client'
|
||||
|
||||
const router = useRouter()
|
||||
const STEPS = ['ثبت سفارش', 'تایید ادمین', 'تایید کارگاه', 'ارسال', 'تحویل شده']
|
||||
|
||||
const rows = ref<PreOrderRow[]>([])
|
||||
const loading = ref(false)
|
||||
const refreshing = ref(false)
|
||||
const failed = ref(false)
|
||||
|
||||
/** HH:mm in Tehran time, as the reference showed the hour of registration. */
|
||||
function timeOf(iso: string): string {
|
||||
return new Date(iso).toLocaleTimeString('en-GB', { hour: '2-digit', minute: '2-digit', timeZone: 'Asia/Tehran' })
|
||||
}
|
||||
|
||||
async function load() {
|
||||
loading.value = true
|
||||
failed.value = false
|
||||
try {
|
||||
rows.value = (await api.getMyPreOrders()).rows
|
||||
} catch {
|
||||
failed.value = true
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function onRefresh() {
|
||||
try {
|
||||
await load()
|
||||
} finally {
|
||||
refreshing.value = false
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(load)
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.mks__body {
|
||||
padding-top: 84px;
|
||||
padding-bottom: 90px;
|
||||
}
|
||||
|
||||
.mks__card {
|
||||
padding: 18px 2px;
|
||||
border-bottom: 1px solid @hairline;
|
||||
}
|
||||
|
||||
.mks__track {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 4px;
|
||||
margin: 0 0 16px;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.mks__track li {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
text-align: center;
|
||||
font-size: 10.5px;
|
||||
color: @inkFaint;
|
||||
}
|
||||
|
||||
.mks__track i {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 3px;
|
||||
border-radius: 999px;
|
||||
background: @hairline;
|
||||
}
|
||||
|
||||
.mks__track li.is-done {
|
||||
color: @inkSoft;
|
||||
}
|
||||
.mks__track li.is-done i {
|
||||
background: @wine;
|
||||
}
|
||||
.mks__track li.is-now {
|
||||
color: @wine;
|
||||
font-weight: 800;
|
||||
}
|
||||
.mks__track li.is-now i {
|
||||
background: @wine;
|
||||
opacity: 0.55;
|
||||
}
|
||||
|
||||
.mks__cancelled {
|
||||
margin: 0 0 12px;
|
||||
font-size: 12.5px;
|
||||
font-weight: 700;
|
||||
color: @red;
|
||||
}
|
||||
|
||||
.mks__facts {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 8px 14px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.mks__facts div {
|
||||
display: flex;
|
||||
gap: 6px;
|
||||
font-size: 12.5px;
|
||||
}
|
||||
|
||||
.mks__facts dt {
|
||||
color: @inkFaint;
|
||||
}
|
||||
|
||||
.mks__facts dd {
|
||||
margin: 0;
|
||||
font-weight: 700;
|
||||
color: @ink;
|
||||
}
|
||||
|
||||
.mks__note {
|
||||
margin: 12px 0 0;
|
||||
font-size: 12.5px;
|
||||
color: @inkSoft;
|
||||
}
|
||||
|
||||
.mks__photo {
|
||||
display: block;
|
||||
width: 100%;
|
||||
max-height: 260px;
|
||||
margin-top: 12px;
|
||||
border-radius: 14px;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.mks__empty {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
padding: 48px 0;
|
||||
color: @inkFaint;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.mks__cta {
|
||||
padding: 11px 22px;
|
||||
border: none;
|
||||
border-radius: 999px;
|
||||
background: @wine;
|
||||
color: #fff;
|
||||
font-family: inherit;
|
||||
font-size: 13.5px;
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,197 @@
|
||||
<!--
|
||||
"سفارش ساخت" — ask for a piece to be made.
|
||||
|
||||
Ported from henza_pwa/src/views/user/src/components/makeOrder.vue (route
|
||||
/makeOrder, name makeOrderList), restyled into this app's design language.
|
||||
|
||||
Kept from the reference:
|
||||
- the header title "سفارش ساخت"
|
||||
- the photo of the piece first, then the questions: رنگ محصول، سایز محصول،
|
||||
رنگ مینا، رنگ سنگ، تعداد، توضیحات (the last one optional)
|
||||
- every field but the description required, with the reference's own messages
|
||||
- POST create-custom-order -> customer/me/pre-orders here; the customer is the
|
||||
token's, nothing about WHO is sent
|
||||
The reference then sent the customer home; this goes to «وضعیت سفارش» so the
|
||||
request just placed is the first thing seen.
|
||||
-->
|
||||
<template>
|
||||
<div class="mko">
|
||||
<PageBar title="سفارش ساخت" back-to="userPage::hasSubRoute" />
|
||||
|
||||
<Spinner :spinning="submitting" tip="در حال ثبت اطلاعات">
|
||||
<container class="mko__body">
|
||||
<form class="mko__form" novalidate @submit.prevent="submit">
|
||||
<SingleImageUploader
|
||||
upload-text="بارگذاری عکس سفارش"
|
||||
purpose="preorder-design"
|
||||
@done="(id: string) => (form.file_id = id)"
|
||||
/>
|
||||
|
||||
<p class="mko__lead">لطفا به سوالات زیر پاسخ دهید</p>
|
||||
|
||||
<label class="mko__field">
|
||||
<span>رنگ محصول</span>
|
||||
<input v-model.trim="form.color" type="text" maxlength="100" />
|
||||
</label>
|
||||
<label class="mko__field">
|
||||
<span>سایز محصول</span>
|
||||
<input v-model.trim="form.size" type="text" maxlength="100" />
|
||||
</label>
|
||||
<label class="mko__field">
|
||||
<span>رنگ مینا</span>
|
||||
<input v-model.trim="form.color_mina" type="text" maxlength="100" />
|
||||
</label>
|
||||
<label class="mko__field">
|
||||
<span>رنگ سنگ</span>
|
||||
<input v-model.trim="form.color_stone" type="text" maxlength="100" />
|
||||
</label>
|
||||
<label class="mko__field">
|
||||
<span>تعداد</span>
|
||||
<input v-model.number="form.sum" type="number" inputmode="numeric" min="1" step="1" />
|
||||
</label>
|
||||
<label class="mko__field">
|
||||
<span>توضیحات</span>
|
||||
<textarea v-model.trim="form.description" rows="3" maxlength="1000" />
|
||||
</label>
|
||||
|
||||
<p v-if="error" class="mko__error">{{ error }}</p>
|
||||
|
||||
<button type="submit" class="mko__submit" :disabled="submitting">ارسال اطلاعات</button>
|
||||
</form>
|
||||
</container>
|
||||
</Spinner>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { reactive, ref, watch } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { toast } from '../../composables/useToast'
|
||||
import PageBar from '../../components/ui/PageBar.vue'
|
||||
import Spinner from '../../components/Spinner.vue'
|
||||
import SingleImageUploader from '../../components/upload/SingleImageUploader.vue'
|
||||
import { api } from '../../api/client'
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
const form = reactive({
|
||||
file_id: null as string | null,
|
||||
color: '',
|
||||
size: '',
|
||||
color_mina: '',
|
||||
color_stone: '',
|
||||
sum: 1,
|
||||
description: '',
|
||||
})
|
||||
|
||||
const submitting = ref(false)
|
||||
const error = ref<string | null>(null)
|
||||
/** A message about a missing field must not outlive the fix (e.g. the photo being uploaded). */
|
||||
watch(form, () => (error.value = null))
|
||||
|
||||
/** The reference's required-field messages, in the order it asked. */
|
||||
function firstMissing(): string | null {
|
||||
if (!form.file_id) return 'لطفا تصویر سفارش را آپلود کنید'
|
||||
if (!form.color) return 'لطفا رنگ محصول را وارد کنید'
|
||||
if (!form.size) return 'لطفا سایز محصول را وارد کنید'
|
||||
if (!form.color_mina) return 'لطفا رنگ مینا را وارد کنید'
|
||||
if (!form.color_stone) return 'لطفا رنگ سنگ را وارد کنید'
|
||||
if (!Number.isInteger(form.sum) || form.sum < 1) return 'لطفا تعداد را وارد کنید'
|
||||
return null
|
||||
}
|
||||
|
||||
async function submit() {
|
||||
error.value = firstMissing()
|
||||
if (error.value) return
|
||||
|
||||
submitting.value = true
|
||||
try {
|
||||
await api.createPreOrder({
|
||||
color: form.color,
|
||||
size: form.size,
|
||||
color_mina: form.color_mina,
|
||||
color_stone: form.color_stone,
|
||||
sum: form.sum,
|
||||
file_id: form.file_id,
|
||||
description: form.description || undefined,
|
||||
})
|
||||
toast.success('سفارش با موفقیت ثبت شد')
|
||||
router.replace({ name: 'makeOrderStatus' })
|
||||
} catch {
|
||||
error.value = 'خطا در ثبت سفارش'
|
||||
} finally {
|
||||
submitting.value = false
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.mko__body {
|
||||
padding-top: 84px;
|
||||
padding-bottom: 110px;
|
||||
}
|
||||
|
||||
.mko__form {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.mko__lead {
|
||||
margin: 18px 2px 4px;
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
color: @inkMuted;
|
||||
}
|
||||
|
||||
.mko__field {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
padding: 12px 0;
|
||||
border-bottom: 1px solid @hairline;
|
||||
font-size: 12.5px;
|
||||
color: @inkSoft;
|
||||
}
|
||||
|
||||
.mko__field input,
|
||||
.mko__field textarea {
|
||||
width: 100%;
|
||||
padding: 11px 12px;
|
||||
border: 1px solid @hairline;
|
||||
border-radius: 12px;
|
||||
background: transparent;
|
||||
color: @ink;
|
||||
font-family: inherit;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.mko__error {
|
||||
margin: 12px 2px 0;
|
||||
font-size: 12.5px;
|
||||
color: @red;
|
||||
}
|
||||
|
||||
.mko__submit {
|
||||
position: fixed;
|
||||
left: 16px;
|
||||
right: 16px;
|
||||
bottom: 20px;
|
||||
z-index: 20;
|
||||
max-width: 736px;
|
||||
margin: 0 auto;
|
||||
padding: 15px;
|
||||
border: none;
|
||||
border-radius: 999px;
|
||||
background: @wine;
|
||||
color: #fff;
|
||||
font-family: inherit;
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.mko__submit:disabled {
|
||||
opacity: 0.6;
|
||||
cursor: progress;
|
||||
}
|
||||
</style>
|
||||
@@ -122,6 +122,10 @@
|
||||
<dt>وزن سفارش</dt>
|
||||
<dd>{{ parseFloat(viewData.item.totalGoldWeightGrams).toFixed(2) }} گرم</dd>
|
||||
</div>
|
||||
<div v-if="parseFloat(viewData.item.flatRialCharge) > 0" class="detail__spec">
|
||||
<dt>اجرت ریالی</dt>
|
||||
<dd>{{ price(Math.round(parseFloat(viewData.item.flatRialCharge))) }} ریال</dd>
|
||||
</div>
|
||||
<div class="detail__spec">
|
||||
<dt>تاریخ سفارش</dt>
|
||||
<dd>{{ jdate(viewData.item.createdAt) }}</dd>
|
||||
@@ -229,7 +233,7 @@ import {
|
||||
orderStatusIcon,
|
||||
orderStatusLabel,
|
||||
} from '../../utils/orderStatus'
|
||||
import { jdate, jtimelineWhen } from '../../utils/filters'
|
||||
import { jdate, jtimelineWhen, price } from '../../utils/filters'
|
||||
import { useSessionStore } from '../../stores/session'
|
||||
import { api, type OrderDetail } from '../../api/client'
|
||||
import { useQueryCache, KEYS } from '../../stores/queryCache'
|
||||
|
||||
Reference in New Issue
Block a user