feat(apps): sales-expert screens in both apps + v2 admin home slider (D21, APP-02)

Both expert screens are built in user-app and user-app-v2, with byte-identical
template and script and a per-app style block only — verified by diffing
everything above <style>:

  ChildOrdersView  "سفارش مشتریان"  — legacy ChildOrders.vue. Keeps the
    reference's title, search, infinite paging, and per-card item count, total
    weight, customer name and the fixed «تحویل مسئول فروش» chip (the endpoint
    only returns that status, ApiMobileController:766).
  CustomerChoiceView "لیست مشتریان" — legacy customerChoice.vue. Keeps its
    title, per-search re-query and the reference's choice to LIST inactive
    customers (its active() scope is commented out at :187).

Reachable from inside the app, not just by URL: routes carry the reference's own
paths and names, the dashboard grows the two entries only for an expert (v1 as
tiles, v2 as its own rows), and a router guard sends an ordinary customer back
to their dashboard. None of that is relied on for safety — the server scopes
both endpoints on the AdminUser id in the token and answers 403 otherwise.

Not ported, both recorded in D21: the act-as api_token minting (:197-201) and
the child-order edit drawer, which recomputed an order's money from client-sent
values. The card opens a read-only summary instead.

APP-02 fixed: user-app-v2 gained getHomeSlider and now prefers admin-configured
slides, keeping its category-derived hero as the fallback and its own design.

Session stores stay byte-identical across the apps.
build 5/5, jest 45/45, expert login 36/36, apps smoke 43/43, typecheck clean.

[ref: henza_pwa/src/views/user/src/components/ChildOrders.vue, customerChoice.vue]
[ref: henza_pwa/src/router/index.ts:171-188]

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
s.esmaeili
2026-09-23 01:12:53 +03:30
co-authored by Claude Opus 5
parent 69f4ba2b29
commit f71fd5bfe1
99 changed files with 1991 additions and 99 deletions
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
.cho__barExtra[data-v-844d21d4]{padding:0 16px 12px}.cho__body[data-v-844d21d4]{padding-top:132px;padding-bottom:90px}.cho__list[data-v-844d21d4]{display:flex;flex-direction:column;padding-top:16px;gap:11px}.cho__card[data-v-844d21d4]{padding:16px;background:#fff;border:1px solid #ECEDEF;border-radius:18px;cursor:pointer;transition:transform .2s ease}.cho__card[data-v-844d21d4]:active{transform:scale(.99)}.cho__top[data-v-844d21d4]{display:flex;justify-content:space-between;gap:12px}.cho__right[data-v-844d21d4]{display:flex;flex-direction:column;align-items:flex-end;gap:8px}.cho__num[data-v-844d21d4]{font-size:15px;font-weight:700;margin-bottom:10px}.cho__muted[data-v-844d21d4]{color:#5b616e;font-weight:500;margin-left:4px}.cho__meta[data-v-844d21d4]{display:flex;align-items:baseline;gap:4px}.cho__strong[data-v-844d21d4]{font-size:15px;font-weight:700}.cho__unit[data-v-844d21d4]{font-size:12px;color:#5b616e}.cho__status[data-v-844d21d4]{padding:5px 14px;border-radius:8px;font-size:12px;font-weight:600;color:#06b6d4;background:#ecfeff;white-space:nowrap}.cho__divider[data-v-844d21d4]{height:1px;background:#ecedef;margin:12px 0}.cho__bottom[data-v-844d21d4]{display:flex;justify-content:space-between;align-items:center}.cho__customer[data-v-844d21d4]{font-size:14px;font-weight:600;color:#5b616e}.cho__more[data-v-844d21d4],.cho__sentinel[data-v-844d21d4]{padding:12px 0;text-align:center;font-size:12px;color:#5b616e}.cho__empty[data-v-844d21d4]{margin-top:8px;padding:34px 20px;border:1px dashed #ECEDEF;border-radius:18px;display:flex;flex-direction:column;align-items:center;gap:10px;color:#5b616e;font-size:13px}.cho__retry[data-v-844d21d4]{padding:8px 18px;border-radius:999px;border:1px solid #ECEDEF;background:#fff;font-family:inherit;font-size:12px;font-weight:600;cursor:pointer}.cho__detail[data-v-844d21d4]{padding:20px 16px 24px}.cho__detailTitle[data-v-844d21d4]{margin:0 0 16px;font-size:17px;font-weight:700}.cho__rows[data-v-844d21d4]{margin:0;display:flex;flex-direction:column;gap:2px}.cho__row[data-v-844d21d4]{display:flex;justify-content:space-between;align-items:center;padding:11px 14px;background:#fafafa;border-radius:10px}.cho__row dt[data-v-844d21d4]{font-size:13px;color:#5b616e}.cho__row dd[data-v-844d21d4]{margin:0;font-size:14px;font-weight:600}.cho__close[data-v-844d21d4]{margin-top:18px;width:100%;padding:13px;border:none;border-radius:14px;background:#14161a;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 @@
import{d as f,o as v,q as g,c as s,k as e,s as u,g as p,h as d,i as t,F as y,r as k,I as P,b as x,f as C,v as b,K as h,x as B,_ as V}from"./index-gDBsh1na.js";import{P as w}from"./PageBar-lc_J1EFz.js";import{a as I}from"./Spinner.vue_vue_type_style_index_0_lang-iladsJNR.js";import{S as N}from"./SectionHead-D1crGF_Y.js";import{P as q}from"./ProductCard-BSvFgf0Q.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./SingleProduct-DoCRibqt.js";import"./NotifyVant.vue_vue_type_script_setup_true_lang-04nlwBMZ.js";import"./DialogVant.vue_vue_type_style_index_0_lang-CjJCtcu_.js";import"./cartStore-CnHZpE-f.js";import"./dialogEmpty1-Caw7F5KL.js";import"./index-DHV2EObP.js";import"./classCallCheck-Cn_U7yJ4.js";const F={class:"coll"},S={key:0,class:"coll__grid"},z={key:1,class:"coll__empty"},E=f({__name:"CollectionView",setup(H){const l=h(),o=p(!1),n=p([]),m=d(()=>l.query.page||"مجموعه"),i=d(()=>n.value.filter(r=>r.collections.some(a=>a.collectionId===l.params.id)));return v(async()=>{o.value=!0;try{n.value=await g.listProducts()}finally{o.value=!1}}),(r,a)=>{const _=b("container");return t(),s("div",F,[e(w,{title:m.value,"back-to":"search"},null,8,["title"]),e(I,{spinning:o.value,tip:"درحال دریافت اطلاعات"},{default:u(()=>[e(_,{class:"coll__body"},{default:u(()=>[e(N,{title:"محصولات این مجموعه",subtitle:"برای دیدن جزئیات، روی محصول ضربه بزنید"}),i.value.length?(t(),s("div",S,[(t(!0),s(y,null,k(i.value,c=>(t(),B(q,{key:c.id,value:c},null,8,["value"]))),128))])):o.value?C("",!0):(t(),s("section",z,[e(P,{icon:"vuesax-linear:box",size:"26"}),a[0]||(a[0]=x("p",null,"در این مجموعه محصولی ثبت نشده است.",-1))]))]),_:1})]),_:1},8,["spinning"])])}}}),U=V(E,[["__scopeId","data-v-4e05d52b"]]);export{U as default};
import{d as f,o as v,q as g,c as s,k as e,s as u,g as p,h as d,i as t,F as y,r as k,I as P,b as x,f as C,v as b,K as h,x as B,_ as V}from"./index-zU76P609.js";import{P as w}from"./PageBar-BNTdgQIH.js";import{a as I}from"./Spinner.vue_vue_type_style_index_0_lang-8IfA4lPE.js";import{S as N}from"./SectionHead-DiMH7kD3.js";import{P as q}from"./ProductCard-DnjzY-Hn.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./SingleProduct-Bo-ynxSe.js";import"./NotifyVant.vue_vue_type_script_setup_true_lang-BFiftwB2.js";import"./DialogVant.vue_vue_type_style_index_0_lang-j8dd-xd3.js";import"./cartStore-BxC8w6kf.js";import"./dialogEmpty1-Caw7F5KL.js";import"./index-BL4GBXwx.js";import"./classCallCheck-BeQXLUEU.js";const F={class:"coll"},S={key:0,class:"coll__grid"},z={key:1,class:"coll__empty"},E=f({__name:"CollectionView",setup(H){const l=h(),o=p(!1),n=p([]),m=d(()=>l.query.page||"مجموعه"),i=d(()=>n.value.filter(r=>r.collections.some(a=>a.collectionId===l.params.id)));return v(async()=>{o.value=!0;try{n.value=await g.listProducts()}finally{o.value=!1}}),(r,a)=>{const _=b("container");return t(),s("div",F,[e(w,{title:m.value,"back-to":"search"},null,8,["title"]),e(I,{spinning:o.value,tip:"درحال دریافت اطلاعات"},{default:u(()=>[e(_,{class:"coll__body"},{default:u(()=>[e(N,{title:"محصولات این مجموعه",subtitle:"برای دیدن جزئیات، روی محصول ضربه بزنید"}),i.value.length?(t(),s("div",S,[(t(!0),s(y,null,k(i.value,c=>(t(),B(q,{key:c.id,value:c},null,8,["value"]))),128))])):o.value?C("",!0):(t(),s("section",z,[e(P,{icon:"vuesax-linear:box",size:"26"}),a[0]||(a[0]=x("p",null,"در این مجموعه محصولی ثبت نشده است.",-1))]))]),_:1})]),_:1},8,["spinning"])])}}}),U=V(E,[["__scopeId","data-v-4e05d52b"]]);export{U as default};
@@ -0,0 +1 @@
import{d as z,o as S,c,k as a,s as d,u as w,g as r,q as N,i,b as s,F as P,r as B,I as u,t as o,f as m,v as D,e as F,_ as I}from"./index-zU76P609.js";import{P as E}from"./PageBar-BNTdgQIH.js";import{a as R}from"./Spinner.vue_vue_type_style_index_0_lang-8IfA4lPE.js";import{S as $}from"./SearchInput-DKDqPKX6.js";import{D as U}from"./index-BL4GBXwx.js";import{P as q}from"./index-CJgwp52_.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./classCallCheck-BeQXLUEU.js";const L={class:"cch"},M={class:"cch__barExtra"},O={key:0,class:"cch__list"},T=["onClick"],j={class:"cch__head"},A={class:"cch__name"},G={class:"cch__facts"},H={class:"cch__fact"},J={dir:"ltr"},K={class:"cch__fact"},Q={dir:"ltr"},W={key:0,class:"cch__fact"},X={key:1,class:"cch__empty"},Y={key:2,class:"cch__empty"},Z={key:0,class:"cch__detail"},ss={class:"cch__detailTitle"},es={class:"cch__rows"},ts={class:"cch__row"},os={dir:"ltr"},as={class:"cch__row"},ls={dir:"ltr"},ns={class:"cch__row"},cs={class:"cch__row"},is={class:"cch__row"},rs={dir:"ltr"},_s={class:"cch__row"},ds={dir:"ltr"},us={class:"cch__row"},vs=z({__name:"CustomerChoiceView",setup(hs){const _=r([]),v=r(!1),y=r(!1),h=r(!1),b=r(null),p=r(!1),l=r(null);function g(n){const e=Number(n??0);return Number.isFinite(e)?e.toFixed(3):"0.000"}async function f(){v.value=!0,h.value=!1;try{_.value=await N.getExpertCustomers(b.value)}catch{h.value=!0,_.value=[]}finally{v.value=!1}}async function k(n){b.value=n!=null&&n.trim()?n.trim():null,await f()}async function C(){await f(),y.value=!1}function x(n){l.value=n,p.value=!0}return S(f),(n,e)=>{const V=D("container");return i(),c("div",L,[a(E,{title:"لیست مشتریان","back-to":"userPage::hasSubRoute"},{below:d(()=>[s("div",M,[a($,{onSearch:k,"place-holder":"جستجو"})])]),_:1}),a(R,{spinning:v.value&&!_.value.length,tip:"درحال دریافت اطلاعات"},{default:d(()=>[a(w(q),{modelValue:y.value,"onUpdate:modelValue":e[0]||(e[0]=t=>y.value=t),onRefresh:C},{default:d(()=>[a(V,{class:"cch__body"},{default:d(()=>[_.value.length?(i(),c("div",O,[(i(!0),c(P,null,B(_.value,t=>(i(),c("article",{key:t.id,class:"cch__card",onClick:ps=>x(t)},[s("div",j,[s("h3",A,o(t.name),1),s("span",{class:F(["cch__state",t.active===1?"is-on":"is-off"])},o(t.active===1?"فعال":"غیرفعال"),3)]),s("div",G,[s("div",H,[a(u,{icon:"vuesax-linear:mobile",size:"15"}),s("span",J,o(t.mobile||"—"),1)]),s("div",K,[a(u,{icon:"vuesax-linear:call",size:"15"}),s("span",Q,o(t.phone||"—"),1)]),t.store_name?(i(),c("div",W,[a(u,{icon:"vuesax-linear:shop",size:"15"}),s("span",null,o(t.store_name),1)])):m("",!0)])],8,T))),128))])):!v.value&&!h.value?(i(),c("section",X,[a(u,{icon:"vuesax-linear:profile-2user",size:"26"}),s("p",null,o(b.value?"مشتری با این مشخصات پیدا نشد.":"هنوز مشتری‌ای به شما معرفی نشده است."),1)])):m("",!0),h.value?(i(),c("section",Y,[a(u,{icon:"vuesax-linear:danger",size:"26"}),e[3]||(e[3]=s("p",null,"دریافت اطلاعات با خطا روبه‌رو شد.",-1)),s("button",{type:"button",class:"cch__retry",onClick:f},"تلاش دوباره")])):m("",!0)]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["spinning"]),a(w(U),{open:p.value,"onUpdate:open":e[2]||(e[2]=t=>p.value=t),placement:"bottom",height:"auto",closable:!1,"body-style":{padding:"0"}},{default:d(()=>[l.value?(i(),c("div",Z,[s("h2",ss,o(l.value.name),1),s("dl",es,[s("div",ts,[e[4]||(e[4]=s("dt",null,"موبایل",-1)),s("dd",os,o(l.value.mobile||"—"),1)]),s("div",as,[e[5]||(e[5]=s("dt",null,"تلفن",-1)),s("dd",ls,o(l.value.phone||"—"),1)]),s("div",ns,[e[6]||(e[6]=s("dt",null,"نام مغازه",-1)),s("dd",null,o(l.value.store_name||"—"),1)]),s("div",cs,[e[7]||(e[7]=s("dt",null,"نام پاساژ",-1)),s("dd",null,o(l.value.pasazh_name||"—"),1)]),s("div",is,[e[8]||(e[8]=s("dt",null,"سقف اعتبار",-1)),s("dd",rs,o(g(l.value.gram_level))+" گرم",1)]),s("div",_s,[e[9]||(e[9]=s("dt",null,"بدهی گرمی",-1)),s("dd",ds,o(g(l.value.remain))+" گرم",1)]),s("div",us,[e[10]||(e[10]=s("dt",null,"وضعیت",-1)),s("dd",null,o(l.value.active===1?"فعال":"غیرفعال"),1)])]),s("button",{type:"button",class:"cch__close",onClick:e[1]||(e[1]=t=>p.value=!1)},"بستن")])):m("",!0)]),_:1},8,["open"])])}}}),xs=I(vs,[["__scopeId","data-v-0f43a8be"]]);export{xs as default};
@@ -0,0 +1 @@
.cch__barExtra[data-v-0f43a8be]{padding:0 16px 12px}.cch__body[data-v-0f43a8be]{padding-top:132px;padding-bottom:90px}.cch__list[data-v-0f43a8be]{display:flex;flex-direction:column;padding-top:16px;gap:11px}.cch__card[data-v-0f43a8be]{padding:16px;background:#fff;border:1px solid #ECEDEF;border-radius:18px;cursor:pointer;transition:transform .2s ease}.cch__card[data-v-0f43a8be]:active{transform:scale(.99)}.cch__head[data-v-0f43a8be]{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:12px}.cch__name[data-v-0f43a8be]{margin:0;font-size:15.5px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cch__state[data-v-0f43a8be]{flex:0 0 auto;padding:4px 12px;border-radius:999px;font-size:11.5px;font-weight:600}.cch__state.is-on[data-v-0f43a8be]{color:#16a34a;background:#dcfce7}.cch__state.is-off[data-v-0f43a8be]{color:#dc2626;background:#fee2e2}.cch__facts[data-v-0f43a8be]{display:flex;flex-direction:column;gap:7px}.cch__fact[data-v-0f43a8be]{display:flex;align-items:center;gap:7px;font-size:13px;font-weight:600;color:#5b616e}.cch__empty[data-v-0f43a8be]{margin-top:8px;padding:34px 20px;border:1px dashed #ECEDEF;border-radius:18px;display:flex;flex-direction:column;align-items:center;gap:10px;color:#5b616e;font-size:13px}.cch__retry[data-v-0f43a8be]{padding:8px 18px;border-radius:999px;border:1px solid #ECEDEF;background:#fff;font-family:inherit;font-size:12px;font-weight:600;cursor:pointer}.cch__detail[data-v-0f43a8be]{padding:20px 16px 24px}.cch__detailTitle[data-v-0f43a8be]{margin:0 0 16px;font-size:17px;font-weight:700}.cch__rows[data-v-0f43a8be]{margin:0;display:flex;flex-direction:column;gap:2px}.cch__row[data-v-0f43a8be]{display:flex;justify-content:space-between;align-items:center;padding:11px 14px;background:#fafafa;border-radius:10px}.cch__row dt[data-v-0f43a8be]{font-size:13px;color:#5b616e}.cch__row dd[data-v-0f43a8be]{margin:0;font-size:14px;font-weight:600}.cch__close[data-v-0f43a8be]{margin-top:18px;width:100%;padding:13px;border:none;border-radius:14px;background:#14161a;color:#fff;font-family:inherit;font-size:14px;font-weight:700;cursor:pointer}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-1
View File
@@ -1 +0,0 @@
.dash[data-v-072e5edf]{background:#fff;min-height:100vh}.dash__bar[data-v-072e5edf]{position:fixed;top:0;left:0;right:0;z-index:20;background:#ffffffe0;-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);border-bottom:1px solid #ECEDEF}.dash__barInner[data-v-072e5edf]{max-width:768px;margin:0 auto;padding:11px 16px;display:flex;align-items:center;justify-content:space-between;gap:12px}.dash__barTitle[data-v-072e5edf]{margin:0;font-size:14.5px;font-weight:800;color:#14161a}.dash__barBtn[data-v-072e5edf]{flex:0 0 auto;width:38px;height:38px;border:0;cursor:pointer;border-radius:12px;display:grid;place-items:center;color:#7a1b33;background:#fbf2f4}.dash__barBtn[data-v-072e5edf]:active{transform:scale(.94)}.dash__barSpacer[data-v-072e5edf]{display:block;width:38px;height:38px}.dash__body[data-v-072e5edf]{padding-top:76px;padding-bottom:90px}.dash__balance[data-v-072e5edf]{padding:16px;border-radius:20px;background:#14161a;color:#fff;box-shadow:0 14px 30px -22px #14161af2}.dash__balanceHead[data-v-072e5edf]{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.dash__eyebrow[data-v-072e5edf]{font-size:11.5px;color:#ffffff9e}.dash__figure[data-v-072e5edf]{padding-top:5px;font-size:25px;font-weight:800;letter-spacing:-.3px}.dash__unit[data-v-072e5edf]{font-size:11.5px;font-weight:600;color:#ffffff9e;padding-inline-start:4px}.dash__seal[data-v-072e5edf]{flex:0 0 auto;padding:5px 12px;border-radius:999px;font-size:10.5px;font-weight:700}.dash__seal.is-debtor[data-v-072e5edf]{color:#fff;background:#a33c55}.dash__seal.is-creditor[data-v-072e5edf]{color:#14161a;background:#ffffffe6}.dash__balanceRow[data-v-072e5edf]{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:16px;padding-top:13px;border-top:1px solid rgba(255,255,255,.13)}.dash__rowLabel[data-v-072e5edf]{font-size:11.5px;color:#ffffff9e}.dash__rowValue[data-v-072e5edf]{font-size:13.5px;font-weight:700}.dash__rowValue i[data-v-072e5edf]{font-style:normal;font-size:10.5px;font-weight:600;color:#ffffff9e;padding-inline-start:3px}.dash__identity[data-v-072e5edf]{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:13px;padding-top:13px;border-top:1px solid rgba(255,255,255,.13)}.dash__name[data-v-072e5edf]{font-size:12.5px;font-weight:700}.dash__mobile[data-v-072e5edf]{font-size:11.5px;color:#ffffff9e;direction:ltr}.dash__invite[data-v-072e5edf]{display:flex;align-items:center;gap:12px;padding:16px;border:1px solid #ECEDEF;border-radius:20px;background:#fafafa}.dash__inviteIcon[data-v-072e5edf]{flex:0 0 42px;width:42px;height:42px;border-radius:50%;display:grid;place-items:center;color:#7a1b33;background:#fbf2f4}.dash__inviteCopy[data-v-072e5edf]{flex:1;min-width:0}.dash__inviteCopy h3[data-v-072e5edf]{margin:0;font-size:13px;font-weight:800;color:#14161a}.dash__inviteCopy p[data-v-072e5edf]{margin:4px 0 0;font-size:11.5px;color:#8a909c}.dash__inviteCta[data-v-072e5edf]{flex:0 0 auto;padding:9px 14px;border:0;cursor:pointer;border-radius:999px;font-family:inherit;font-size:11.5px;font-weight:700;color:#fff;background:#14161a}.dash__section[data-v-072e5edf]{margin-top:26px}.dash__grid[data-v-072e5edf]{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px}.dash__tile[data-v-072e5edf]{display:flex;flex-direction:column;align-items:center;gap:8px;padding:14px 6px;border:1px solid #ECEDEF;border-radius:16px;cursor:pointer;background:#fff;font-family:inherit;transition:transform .18s ease}.dash__tile[data-v-072e5edf]:active{transform:scale(.97)}.dash__tile.is-disabled[data-v-072e5edf]{opacity:.4}.dash__tileIcon[data-v-072e5edf]{width:38px;height:38px;border-radius:12px;display:grid;place-items:center;color:#22262e;background:#f4f5f6}.dash__tileTitle[data-v-072e5edf]{font-size:11px;font-weight:700;color:#22262e}
+1
View File
@@ -0,0 +1 @@
.dash[data-v-25cce518]{background:#fff;min-height:100vh}.dash__bar[data-v-25cce518]{position:fixed;top:0;left:0;right:0;z-index:20;background:#ffffffe0;-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);border-bottom:1px solid #ECEDEF}.dash__barInner[data-v-25cce518]{max-width:768px;margin:0 auto;padding:11px 16px;display:flex;align-items:center;justify-content:space-between;gap:12px}.dash__barTitle[data-v-25cce518]{margin:0;font-size:14.5px;font-weight:800;color:#14161a}.dash__barBtn[data-v-25cce518]{flex:0 0 auto;width:38px;height:38px;border:0;cursor:pointer;border-radius:12px;display:grid;place-items:center;color:#7a1b33;background:#fbf2f4}.dash__barBtn[data-v-25cce518]:active{transform:scale(.94)}.dash__barSpacer[data-v-25cce518]{display:block;width:38px;height:38px}.dash__body[data-v-25cce518]{padding-top:76px;padding-bottom:90px}.dash__balance[data-v-25cce518]{padding:16px;border-radius:20px;background:#14161a;color:#fff;box-shadow:0 14px 30px -22px #14161af2}.dash__balanceHead[data-v-25cce518]{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.dash__eyebrow[data-v-25cce518]{font-size:11.5px;color:#ffffff9e}.dash__figure[data-v-25cce518]{padding-top:5px;font-size:25px;font-weight:800;letter-spacing:-.3px}.dash__unit[data-v-25cce518]{font-size:11.5px;font-weight:600;color:#ffffff9e;padding-inline-start:4px}.dash__seal[data-v-25cce518]{flex:0 0 auto;padding:5px 12px;border-radius:999px;font-size:10.5px;font-weight:700}.dash__seal.is-debtor[data-v-25cce518]{color:#fff;background:#a33c55}.dash__seal.is-creditor[data-v-25cce518]{color:#14161a;background:#ffffffe6}.dash__balanceRow[data-v-25cce518]{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:16px;padding-top:13px;border-top:1px solid rgba(255,255,255,.13)}.dash__rowLabel[data-v-25cce518]{font-size:11.5px;color:#ffffff9e}.dash__rowValue[data-v-25cce518]{font-size:13.5px;font-weight:700}.dash__rowValue i[data-v-25cce518]{font-style:normal;font-size:10.5px;font-weight:600;color:#ffffff9e;padding-inline-start:3px}.dash__identity[data-v-25cce518]{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:13px;padding-top:13px;border-top:1px solid rgba(255,255,255,.13)}.dash__name[data-v-25cce518]{font-size:12.5px;font-weight:700}.dash__mobile[data-v-25cce518]{font-size:11.5px;color:#ffffff9e;direction:ltr}.dash__invite[data-v-25cce518]{display:flex;align-items:center;gap:12px;padding:16px;border:1px solid #ECEDEF;border-radius:20px;background:#fafafa}.dash__inviteIcon[data-v-25cce518]{flex:0 0 42px;width:42px;height:42px;border-radius:50%;display:grid;place-items:center;color:#7a1b33;background:#fbf2f4}.dash__inviteCopy[data-v-25cce518]{flex:1;min-width:0}.dash__inviteCopy h3[data-v-25cce518]{margin:0;font-size:13px;font-weight:800;color:#14161a}.dash__inviteCopy p[data-v-25cce518]{margin:4px 0 0;font-size:11.5px;color:#8a909c}.dash__inviteCta[data-v-25cce518]{flex:0 0 auto;padding:9px 14px;border:0;cursor:pointer;border-radius:999px;font-family:inherit;font-size:11.5px;font-weight:700;color:#fff;background:#14161a}.dash__section[data-v-25cce518]{margin-top:26px}.dash__grid[data-v-25cce518]{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px}.dash__tile[data-v-25cce518]{display:flex;flex-direction:column;align-items:center;gap:8px;padding:14px 6px;border:1px solid #ECEDEF;border-radius:16px;cursor:pointer;background:#fff;font-family:inherit;transition:transform .18s ease}.dash__tile[data-v-25cce518]:active{transform:scale(.97)}.dash__tile.is-disabled[data-v-25cce518]{opacity:.4}.dash__tileIcon[data-v-25cce518]{width:38px;height:38px;border-radius:12px;display:grid;place-items:center;color:#22262e;background:#f4f5f6}.dash__tileTitle[data-v-25cce518]{font-size:11px;font-weight:700;color:#22262e}
@@ -1 +1 @@
import{d as l,x as n,s as r,u as d,ap as c,i as x,b as t,B as o,E as a,t as i}from"./index-gDBsh1na.js";const f={class:"my-4"},u={class:"w-full flex justify-center"},m={class:"w-full flex justify-center text-[18px] font-semibold"},_={class:"grid grid-cols-2 border-t border-solid border-[#E5E7EB] pt-4 mx-2 mt-6 font-semibold text-[15px]"},g=l({__name:"DialogVant",props:{timeOut:{},text1:{},text2:{},text3:{}},setup(e){return(s,p)=>(x(),n(d(c),null,{default:r(()=>[t("div",f,[t("div",u,[o(s.$slots,"img",{},()=>[a(i(e.text2),1)])]),t("div",m,[o(s.$slots,"title",{},()=>[a(i(e.text1),1)])]),t("div",_,[o(s.$slots,"button",{},()=>[a(i(e.text3),1)])])])]),_:3}))}});export{g as _};
import{d as l,x as n,s as r,u as d,ap as c,i as x,b as t,B as o,E as a,t as i}from"./index-zU76P609.js";const f={class:"my-4"},u={class:"w-full flex justify-center"},m={class:"w-full flex justify-center text-[18px] font-semibold"},_={class:"grid grid-cols-2 border-t border-solid border-[#E5E7EB] pt-4 mx-2 mt-6 font-semibold text-[15px]"},g=l({__name:"DialogVant",props:{timeOut:{},text1:{},text2:{},text3:{}},setup(e){return(s,p)=>(x(),n(d(c),null,{default:r(()=>[t("div",f,[t("div",u,[o(s.$slots,"img",{},()=>[a(i(e.text2),1)])]),t("div",m,[o(s.$slots,"title",{},()=>[a(i(e.text1),1)])]),t("div",_,[o(s.$slots,"button",{},()=>[a(i(e.text3),1)])])])]),_:3}))}});export{g as _};
@@ -1 +1 @@
import{d as f,o as y,q as b,c as o,k as e,s as c,g as m,i as t,F as p,b as i,r as g,I as k,u as h,f as P,y as C,h as x,v as F,x as B,_ as V}from"./index-gDBsh1na.js";import{P as w}from"./PageBar-lc_J1EFz.js";import{a as S}from"./Spinner.vue_vue_type_style_index_0_lang-iladsJNR.js";import{S as I}from"./SectionHead-D1crGF_Y.js";import{P as N}from"./ProductCard-BSvFgf0Q.js";import{u as $}from"./SingleProduct-DoCRibqt.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./cartStore-CnHZpE-f.js";import"./index-DHV2EObP.js";import"./classCallCheck-Cn_U7yJ4.js";import"./NotifyVant.vue_vue_type_script_setup_true_lang-04nlwBMZ.js";import"./DialogVant.vue_vue_type_style_index_0_lang-CjJCtcu_.js";import"./dialogEmpty1-Caw7F5KL.js";const R={class:"favs"},q={class:"favs__grid"},z={key:1,class:"favs__empty"},E=f({__name:"FavoritesView",setup(H){const d=C(),v=$(),a=m(!1),l=m([]),r=x(()=>l.value.filter(u=>v.isFavorite(u.id)));return y(async()=>{a.value=!0;try{l.value=await b.listProducts()}finally{a.value=!1}}),(u,s)=>{const _=F("container");return t(),o("div",R,[e(w,{title:"علاقه‌مندی","back-to":"userPage::hasSubRoute"}),e(S,{spinning:a.value,tip:"در حال دریافت اطلاعات"},{default:c(()=>[e(_,{class:"favs__body"},{default:c(()=>[r.value.length?(t(),o(p,{key:0},[e(I,{title:"ذخیره‌شده‌ها",subtitle:`${r.value.length} محصول`},null,8,["subtitle"]),i("div",q,[(t(!0),o(p,null,g(r.value,n=>(t(),B(N,{key:n.id,value:n},null,8,["value"]))),128))])],64)):a.value?P("",!0):(t(),o("section",z,[e(k,{icon:"vuesax-linear:heart",size:"26"}),s[1]||(s[1]=i("p",null,"هنوز محصولی را به علاقه‌مندی‌ها اضافه نکرده‌اید.",-1)),i("button",{type:"button",class:"favs__emptyCta",onClick:s[0]||(s[0]=n=>h(d).push({name:"home"}))}," دیدن محصولات ")]))]),_:1})]),_:1},8,["spinning"])])}}}),X=V(E,[["__scopeId","data-v-93bb7c6a"]]);export{X as default};
import{d as f,o as y,q as b,c as o,k as e,s as c,g as m,i as t,F as p,b as i,r as g,I as k,u as h,f as P,y as C,h as x,v as F,x as B,_ as V}from"./index-zU76P609.js";import{P as w}from"./PageBar-BNTdgQIH.js";import{a as S}from"./Spinner.vue_vue_type_style_index_0_lang-8IfA4lPE.js";import{S as I}from"./SectionHead-DiMH7kD3.js";import{P as N}from"./ProductCard-DnjzY-Hn.js";import{u as $}from"./SingleProduct-Bo-ynxSe.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./cartStore-BxC8w6kf.js";import"./index-BL4GBXwx.js";import"./classCallCheck-BeQXLUEU.js";import"./NotifyVant.vue_vue_type_script_setup_true_lang-BFiftwB2.js";import"./DialogVant.vue_vue_type_style_index_0_lang-j8dd-xd3.js";import"./dialogEmpty1-Caw7F5KL.js";const R={class:"favs"},q={class:"favs__grid"},z={key:1,class:"favs__empty"},E=f({__name:"FavoritesView",setup(H){const d=C(),v=$(),a=m(!1),l=m([]),r=x(()=>l.value.filter(u=>v.isFavorite(u.id)));return y(async()=>{a.value=!0;try{l.value=await b.listProducts()}finally{a.value=!1}}),(u,s)=>{const _=F("container");return t(),o("div",R,[e(w,{title:"علاقه‌مندی","back-to":"userPage::hasSubRoute"}),e(S,{spinning:a.value,tip:"در حال دریافت اطلاعات"},{default:c(()=>[e(_,{class:"favs__body"},{default:c(()=>[r.value.length?(t(),o(p,{key:0},[e(I,{title:"ذخیره‌شده‌ها",subtitle:`${r.value.length} محصول`},null,8,["subtitle"]),i("div",q,[(t(!0),o(p,null,g(r.value,n=>(t(),B(N,{key:n.id,value:n},null,8,["value"]))),128))])],64)):a.value?P("",!0):(t(),o("section",z,[e(k,{icon:"vuesax-linear:heart",size:"26"}),s[1]||(s[1]=i("p",null,"هنوز محصولی را به علاقه‌مندی‌ها اضافه نکرده‌اید.",-1)),i("button",{type:"button",class:"favs__emptyCta",onClick:s[0]||(s[0]=n=>h(d).push({name:"home"}))}," دیدن محصولات ")]))]),_:1})]),_:1},8,["spinning"])])}}}),X=V(E,[["__scopeId","data-v-93bb7c6a"]]);export{X as default};
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
.otp-single-input{display:flex;align-items:center}.auth[data-v-c130183b]{background:#fff;min-height:100vh}.auth__body[data-v-c130183b]{padding-top:86px;padding-bottom:90px}.auth__intro[data-v-c130183b]{display:flex;flex-direction:column;align-items:center;text-align:center;padding-bottom:24px}.auth__mark[data-v-c130183b]{width:64px;height:64px;border-radius:50%;display:grid;place-items:center;color:#7a1b33;background:#fbf2f4}.auth__title[data-v-c130183b]{margin:14px 0 0;font-size:16px;font-weight:800;color:#14161a}.auth__sub[data-v-c130183b]{margin:6px 0 0;font-size:12.5px;color:#8a909c}.auth__card[data-v-c130183b]{padding:18px 16px;border:1px solid #ECEDEF;border-radius:20px;background:#fafafa}.auth__otp[data-v-c130183b]{display:flex;justify-content:center;gap:10px;direction:ltr;padding-bottom:6px}.auth__timer[data-v-c130183b]{margin:12px 0 16px;text-align:center;font-size:11.5px;color:#5b616e}.auth__form[data-v-c130183b] .ant-form-item-label>label{font-size:12px;color:#5b616e}.auth__cta[data-v-c130183b]{width:100%;padding:13px 18px;border:0;cursor:pointer;border-radius:14px;font-family:inherit;font-size:13px;font-weight:700;color:#fff;background:#14161a;transition:transform .15s ease,opacity .15s ease}.auth__cta[data-v-c130183b]:active{transform:scale(.99)}.auth__cta[data-v-c130183b]:disabled{opacity:.45;cursor:default}.auth__switch[data-v-c130183b]{margin:20px 0 0;text-align:center;font-size:12px;color:#5b616e}.auth__switch button[data-v-c130183b]{border:0;background:none;cursor:pointer;padding:0 3px;font-family:inherit;font-size:12px;font-weight:700;color:#7a1b33}.otp-input{width:48px;height:52px;padding:5px;margin:0;font-size:19px;font-weight:700;color:#14161a;background:#fff;border:1px solid #ECEDEF;border-radius:13px;text-align:center;transition:border-color .18s ease}.otp-input:focus{outline:none;border-color:#14161a}.otp-input.error{border-color:#e31a1a!important}.otp-input::-webkit-inner-spin-button,.otp-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.auth[data-v-23baea3e]{background:#fff;min-height:100vh}.auth__body[data-v-23baea3e]{padding-top:86px;padding-bottom:90px}.auth__intro[data-v-23baea3e]{display:flex;flex-direction:column;align-items:center;text-align:center;padding-bottom:24px}.auth__mark[data-v-23baea3e]{width:64px;height:64px;border-radius:50%;display:grid;place-items:center;color:#7a1b33;background:#fbf2f4}.auth__title[data-v-23baea3e]{margin:14px 0 0;font-size:16px;font-weight:800;color:#14161a}.auth__sub[data-v-23baea3e]{margin:6px 0 0;font-size:12.5px;color:#8a909c}.auth__card[data-v-23baea3e]{padding:18px 16px 20px;border:1px solid #ECEDEF;border-radius:20px;background:#fafafa}.auth__form[data-v-23baea3e] .ant-form-item-label>label{font-size:12px;color:#5b616e}.auth__cta[data-v-23baea3e]{width:100%;margin-top:4px;padding:13px 18px;border:0;cursor:pointer;border-radius:14px;font-family:inherit;font-size:13px;font-weight:700;color:#fff;background:#14161a;transition:transform .15s ease}.auth__cta[data-v-23baea3e]:active{transform:scale(.99)}.auth__switch[data-v-23baea3e]{margin:20px 0 0;text-align:center;font-size:12px;color:#5b616e}.auth__switch button[data-v-23baea3e]{border:0;background:none;cursor:pointer;padding:0 3px;font-family:inherit;font-size:12px;font-weight:700;color:#7a1b33}
.otp-single-input{display:flex;align-items:center}.auth[data-v-5c10e11c]{background:#fff;min-height:100vh}.auth__body[data-v-5c10e11c]{padding-top:86px;padding-bottom:90px}.auth__intro[data-v-5c10e11c]{display:flex;flex-direction:column;align-items:center;text-align:center;padding-bottom:24px}.auth__mark[data-v-5c10e11c]{width:64px;height:64px;border-radius:50%;display:grid;place-items:center;color:#7a1b33;background:#fbf2f4}.auth__title[data-v-5c10e11c]{margin:14px 0 0;font-size:16px;font-weight:800;color:#14161a}.auth__sub[data-v-5c10e11c]{margin:6px 0 0;font-size:12.5px;color:#8a909c}.auth__card[data-v-5c10e11c]{padding:18px 16px;border:1px solid #ECEDEF;border-radius:20px;background:#fafafa}.auth__otp[data-v-5c10e11c]{display:flex;justify-content:center;gap:10px;direction:ltr;padding-bottom:6px}.auth__timer[data-v-5c10e11c]{margin:12px 0 16px;text-align:center;font-size:11.5px;color:#5b616e}.auth__form[data-v-5c10e11c] .ant-form-item-label>label{font-size:12px;color:#5b616e}.auth__cta[data-v-5c10e11c]{width:100%;padding:13px 18px;border:0;cursor:pointer;border-radius:14px;font-family:inherit;font-size:13px;font-weight:700;color:#fff;background:#14161a;transition:transform .15s ease,opacity .15s ease}.auth__cta[data-v-5c10e11c]:active{transform:scale(.99)}.auth__cta[data-v-5c10e11c]:disabled{opacity:.45;cursor:default}.auth__switch[data-v-5c10e11c]{margin:20px 0 0;text-align:center;font-size:12px;color:#5b616e}.auth__switch button[data-v-5c10e11c]{border:0;background:none;cursor:pointer;padding:0 3px;font-family:inherit;font-size:12px;font-weight:700;color:#7a1b33}.otp-input{width:48px;height:52px;padding:5px;margin:0;font-size:19px;font-weight:700;color:#14161a;background:#fff;border:1px solid #ECEDEF;border-radius:13px;text-align:center;transition:border-color .18s ease}.otp-input:focus{outline:none;border-color:#14161a}.otp-input.error{border-color:#e31a1a!important}.otp-input::-webkit-inner-spin-button,.otp-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.auth[data-v-23baea3e]{background:#fff;min-height:100vh}.auth__body[data-v-23baea3e]{padding-top:86px;padding-bottom:90px}.auth__intro[data-v-23baea3e]{display:flex;flex-direction:column;align-items:center;text-align:center;padding-bottom:24px}.auth__mark[data-v-23baea3e]{width:64px;height:64px;border-radius:50%;display:grid;place-items:center;color:#7a1b33;background:#fbf2f4}.auth__title[data-v-23baea3e]{margin:14px 0 0;font-size:16px;font-weight:800;color:#14161a}.auth__sub[data-v-23baea3e]{margin:6px 0 0;font-size:12.5px;color:#8a909c}.auth__card[data-v-23baea3e]{padding:18px 16px 20px;border:1px solid #ECEDEF;border-radius:20px;background:#fafafa}.auth__form[data-v-23baea3e] .ant-form-item-label>label{font-size:12px;color:#5b616e}.auth__cta[data-v-23baea3e]{width:100%;margin-top:4px;padding:13px 18px;border:0;cursor:pointer;border-radius:14px;font-family:inherit;font-size:13px;font-weight:700;color:#fff;background:#14161a;transition:transform .15s ease}.auth__cta[data-v-23baea3e]:active{transform:scale(.99)}.auth__switch[data-v-23baea3e]{margin:20px 0 0;text-align:center;font-size:12px;color:#5b616e}.auth__switch button[data-v-23baea3e]{border:0;background:none;cursor:pointer;padding:0 3px;font-family:inherit;font-size:12px;font-weight:700;color:#7a1b33}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
import{P as x}from"./PageBar-lc_J1EFz.js";import{E as P,a as _}from"./Spinner.vue_vue_type_style_index_0_lang-iladsJNR.js";import{S}from"./SectionHead-D1crGF_Y.js";import{P as k}from"./ProductCard-BSvFgf0Q.js";import{d,i as n,c,k as o,u as l,z as B,A as C,n as E,B as b,x as v,f as y,g as u,q as L,C as $,D as A,s as p,F,r as I,h as N,v as V,_ as D}from"./index-gDBsh1na.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./SingleProduct-DoCRibqt.js";import"./NotifyVant.vue_vue_type_script_setup_true_lang-04nlwBMZ.js";import"./DialogVant.vue_vue_type_style_index_0_lang-CjJCtcu_.js";import"./cartStore-CnHZpE-f.js";import"./dialogEmpty1-Caw7F5KL.js";import"./index-DHV2EObP.js";import"./classCallCheck-Cn_U7yJ4.js";const q={class:"flex justify-center items-center empty"},z=d({__name:"EmptyState",props:{description:{},image:{}},setup(t){return(e,a)=>(n(),c("div",q,[o(l(P),{description:"موردی یافت نشد",image:t.image,class:"h-[200px] w-[200px] opacity-70"},null,8,["image"])]))}}),H="/assets/favoritEmpty-CIK7qR49.svg",T=d({__name:"ScrollFetchSearch",props:{loading:{type:Boolean},flag:{type:Boolean},padding:{}},emits:["fetch"],setup(t,{emit:e}){const a=e,r=B(),s=u(null);return C(s,()=>{a("fetch")},{distance:50}),(i,m)=>(n(),c("main",{class:"flex flex-col flex-1 overflow-auto no-scrollbar w-[100vw] max-w-screen-md m-auto",style:E({paddingTop:t.padding||l(r).headerHeight+"px"}),ref_key:"scrollArea",ref:s},[b(i.$slots,"default"),o(_,{cls:"my-[10px]",spinning:t.loading,indicator:!0,tip:"درحال دریافت اطلاعات"},null,8,["spinning"]),t.flag?(n(),v(z,{key:0,image:l(H)},null,8,["image"])):y("",!0)],4))}});function j(){const t=$({totalPages:0,productList:[],flag:!1});return{productsData:t,getProducts:async(a,r=!1)=>{if(!r){a.value=!0;try{t.productList=await L.listProducts(),t.flag=t.productList.length<1}catch(s){console.log(s)}finally{a.value=!1}}}}}const G={class:"newest"},K={key:0,class:"newest__grid"},g=20,M=d({__name:"NewestView",setup(t){const{productsData:e,getProducts:a}=j(),r=u(!1),s=u(!1),i=u(g),m=N(()=>e.productList.slice(0,i.value));A(async()=>{await a(r,!1)});const h=async()=>{if(i.value<e.productList.length){i.value+=g;return}await a(s,!0)};return(R,Z)=>{const w=V("container");return n(),c("div",G,[o(x,{title:"جدیدترین محصولات","back-to":"home"}),o(_,{spinning:r.value,tip:"درحال دریافت اطلاعات"},{default:p(()=>[o(T,{class:"newest__scroll",loading:s.value,flag:l(e).flag,padding:"0px",onFetch:h},{default:p(()=>[o(w,{class:"newest__body"},{default:p(()=>[o(S,{title:"تازه‌ها",subtitle:"آخرین افزوده‌های مجموعه"}),l(e).productList.length?(n(),c("div",K,[(n(!0),c(F,null,I(m.value,f=>(n(),v(k,{key:f.id,value:f},null,8,["value"]))),128))])):y("",!0)]),_:1})]),_:1},8,["loading","flag"])]),_:1},8,["spinning"])])}}}),rt=D(M,[["__scopeId","data-v-62cb523e"]]);export{rt as default};
import{P as x}from"./PageBar-BNTdgQIH.js";import{E as P,a as _}from"./Spinner.vue_vue_type_style_index_0_lang-8IfA4lPE.js";import{S}from"./SectionHead-DiMH7kD3.js";import{P as k}from"./ProductCard-DnjzY-Hn.js";import{d,i as n,c,k as o,u as l,z as B,A as C,n as E,B as b,x as v,f as y,g as u,q as L,C as $,D as A,s as p,F,r as I,h as N,v as V,_ as D}from"./index-zU76P609.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./SingleProduct-Bo-ynxSe.js";import"./NotifyVant.vue_vue_type_script_setup_true_lang-BFiftwB2.js";import"./DialogVant.vue_vue_type_style_index_0_lang-j8dd-xd3.js";import"./cartStore-BxC8w6kf.js";import"./dialogEmpty1-Caw7F5KL.js";import"./index-BL4GBXwx.js";import"./classCallCheck-BeQXLUEU.js";const q={class:"flex justify-center items-center empty"},z=d({__name:"EmptyState",props:{description:{},image:{}},setup(t){return(e,a)=>(n(),c("div",q,[o(l(P),{description:"موردی یافت نشد",image:t.image,class:"h-[200px] w-[200px] opacity-70"},null,8,["image"])]))}}),H="/assets/favoritEmpty-CIK7qR49.svg",T=d({__name:"ScrollFetchSearch",props:{loading:{type:Boolean},flag:{type:Boolean},padding:{}},emits:["fetch"],setup(t,{emit:e}){const a=e,r=B(),s=u(null);return C(s,()=>{a("fetch")},{distance:50}),(i,m)=>(n(),c("main",{class:"flex flex-col flex-1 overflow-auto no-scrollbar w-[100vw] max-w-screen-md m-auto",style:E({paddingTop:t.padding||l(r).headerHeight+"px"}),ref_key:"scrollArea",ref:s},[b(i.$slots,"default"),o(_,{cls:"my-[10px]",spinning:t.loading,indicator:!0,tip:"درحال دریافت اطلاعات"},null,8,["spinning"]),t.flag?(n(),v(z,{key:0,image:l(H)},null,8,["image"])):y("",!0)],4))}});function j(){const t=$({totalPages:0,productList:[],flag:!1});return{productsData:t,getProducts:async(a,r=!1)=>{if(!r){a.value=!0;try{t.productList=await L.listProducts(),t.flag=t.productList.length<1}catch(s){console.log(s)}finally{a.value=!1}}}}}const G={class:"newest"},K={key:0,class:"newest__grid"},g=20,M=d({__name:"NewestView",setup(t){const{productsData:e,getProducts:a}=j(),r=u(!1),s=u(!1),i=u(g),m=N(()=>e.productList.slice(0,i.value));A(async()=>{await a(r,!1)});const h=async()=>{if(i.value<e.productList.length){i.value+=g;return}await a(s,!0)};return(R,Z)=>{const w=V("container");return n(),c("div",G,[o(x,{title:"جدیدترین محصولات","back-to":"home"}),o(_,{spinning:r.value,tip:"درحال دریافت اطلاعات"},{default:p(()=>[o(T,{class:"newest__scroll",loading:s.value,flag:l(e).flag,padding:"0px",onFetch:h},{default:p(()=>[o(w,{class:"newest__body"},{default:p(()=>[o(S,{title:"تازه‌ها",subtitle:"آخرین افزوده‌های مجموعه"}),l(e).productList.length?(n(),c("div",K,[(n(!0),c(F,null,I(m.value,f=>(n(),v(k,{key:f.id,value:f},null,8,["value"]))),128))])):y("",!0)]),_:1})]),_:1},8,["loading","flag"])]),_:1},8,["spinning"])])}}}),rt=D(M,[["__scopeId","data-v-62cb523e"]]);export{rt as default};
@@ -1 +1 @@
import{d as a,c as n,k as o,s as i,v as c,i as _,b as e,I as r,_ as p}from"./index-gDBsh1na.js";import{P as d}from"./PageBar-lc_J1EFz.js";const f={class:"notif"},l={class:"notif__empty"},m=a({__name:"NotificationsView",setup(u){return(v,t)=>{const s=c("container");return _(),n("div",f,[o(d,{title:"اعلان‌ها","back-to":"home"}),o(s,{class:"notif__body"},{default:i(()=>[e("section",l,[o(r,{icon:"vuesax-linear:notification",size:"26"}),t[0]||(t[0]=e("p",null,"اعلانی برای نمایش وجود ندارد.",-1))])]),_:1})])}}}),B=p(m,[["__scopeId","data-v-44d0c9a5"]]);export{B as default};
import{d as a,c as n,k as o,s as i,v as c,i as _,b as e,I as r,_ as p}from"./index-zU76P609.js";import{P as d}from"./PageBar-BNTdgQIH.js";const f={class:"notif"},l={class:"notif__empty"},m=a({__name:"NotificationsView",setup(u){return(v,t)=>{const s=c("container");return _(),n("div",f,[o(d,{title:"اعلان‌ها","back-to":"home"}),o(s,{class:"notif__body"},{default:i(()=>[e("section",l,[o(r,{icon:"vuesax-linear:notification",size:"26"}),t[0]||(t[0]=e("p",null,"اعلانی برای نمایش وجود ندارد.",-1))])]),_:1})])}}}),B=p(m,[["__scopeId","data-v-44d0c9a5"]]);export{B as default};
@@ -1 +1 @@
import{d as r,k as n,ai as p,aj as f,ak as h,al as w,am as y,an as k,a7 as x,ao as c,a6 as g,ae as N,H as S,i as V,c as v,u as P,n as B,s as _,b as l,I as b,B as I,E as z,t as C,f as O,g as E}from"./index-gDBsh1na.js";const[T,U]=g("notify"),j=["lockScroll","position","show","teleport","zIndex"],D=w({},y,{type:c("danger"),color:String,message:x,position:c("top"),className:k,background:String,lockScroll:Boolean});var H=r({name:T,props:D,emits:["update:show"],setup(e,{emit:o,slots:t}){const a=s=>o("update:show",s);return()=>n(h,p({class:[U([e.type]),e.className],style:{color:e.color,background:e.background},overlay:!1,duration:.2,"onUpdate:show":a},f(e,j)),{default:()=>[t.default?t.default():e.message]})}});const $=N(H),q={key:0,class:"flex"},A={class:"w-full text-white my-2"},F={class:"w-full flex content-end"},J=r({__name:"NotifyVant",props:{modelValue:{type:Boolean},timeOut:{},text:{},color:{}},emits:["update:modelValue"],setup(e,{emit:o}){const t=E(!0),a=e,s=o;S(()=>a.modelValue,()=>{a.timeOut!==-1&&u()});const u=()=>{setTimeout(()=>{s("update:modelValue",!1)},a.timeOut)};return(d,i)=>e.modelValue?(V(),v("div",q,[n(P($),{show:t.value,"onUpdate:show":i[0]||(i[0]=m=>t.value=m),style:B(e.color)},{default:_(()=>[l("div",A,[l("div",F,[n(b,{icon:"vuesax-linear:info-circle",class:"ml-[20px] text-white",size:"25"}),l("div",null,[I(d.$slots,"default",{},()=>[z(C(e.text),1)])])])])]),_:3},8,["show","style"])])):O("",!0)}});export{J as _};
import{d as r,k as n,ai as p,aj as f,ak as h,al as w,am as y,an as k,a7 as x,ao as c,a6 as g,ae as N,H as S,i as V,c as v,u as P,n as B,s as _,b as l,I as b,B as I,E as z,t as C,f as O,g as E}from"./index-zU76P609.js";const[T,U]=g("notify"),j=["lockScroll","position","show","teleport","zIndex"],D=w({},y,{type:c("danger"),color:String,message:x,position:c("top"),className:k,background:String,lockScroll:Boolean});var H=r({name:T,props:D,emits:["update:show"],setup(e,{emit:o,slots:t}){const a=s=>o("update:show",s);return()=>n(h,p({class:[U([e.type]),e.className],style:{color:e.color,background:e.background},overlay:!1,duration:.2,"onUpdate:show":a},f(e,j)),{default:()=>[t.default?t.default():e.message]})}});const $=N(H),q={key:0,class:"flex"},A={class:"w-full text-white my-2"},F={class:"w-full flex content-end"},J=r({__name:"NotifyVant",props:{modelValue:{type:Boolean},timeOut:{},text:{},color:{}},emits:["update:modelValue"],setup(e,{emit:o}){const t=E(!0),a=e,s=o;S(()=>a.modelValue,()=>{a.timeOut!==-1&&u()});const u=()=>{setTimeout(()=>{s("update:modelValue",!1)},a.timeOut)};return(d,i)=>e.modelValue?(V(),v("div",q,[n(P($),{show:t.value,"onUpdate:show":i[0]||(i[0]=m=>t.value=m),style:B(e.color)},{default:_(()=>[l("div",A,[l("div",F,[n(b,{icon:"vuesax-linear:info-circle",class:"ml-[20px] text-white",size:"25"}),l("div",null,[I(d.$slots,"default",{},()=>[z(C(e.text),1)])])])])]),_:3},8,["show","style"])])):O("",!0)}});export{J as _};
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
import{d as _,c as s,b as a,k as d,I as b,t as u,B as i,i as t,y as p,_ as k}from"./index-gDBsh1na.js";const h={class:"bar"},f={class:"bar__inner"},B={key:1,class:"bar__spacer","aria-hidden":"true"},m={class:"bar__title"},g={class:"bar__trailing"},y=_({__name:"PageBar",props:{title:{},back:{type:Boolean,default:!0},backTo:{}},setup(e){const o=e,r=p();function l(){o.backTo?r.push({name:o.backTo}):r.back()}return(n,c)=>(t(),s("header",h,[a("div",f,[e.back?(t(),s("button",{key:0,type:"button",class:"bar__btn","aria-label":"بازگشت",onClick:l},[d(b,{icon:"vuesax-linear:arrow-right-1",size:"20"})])):(t(),s("span",B)),a("h1",m,u(e.title),1),a("div",g,[i(n.$slots,"trailing",{},()=>[c[0]||(c[0]=a("span",{class:"bar__spacer","aria-hidden":"true"},null,-1))],!0)])]),i(n.$slots,"below",{},void 0,!0)]))}}),I=k(y,[["__scopeId","data-v-d2d3dfeb"]]);export{I as P};
import{d as _,c as s,b as a,k as d,I as b,t as u,B as i,i as t,y as p,_ as k}from"./index-zU76P609.js";const h={class:"bar"},f={class:"bar__inner"},B={key:1,class:"bar__spacer","aria-hidden":"true"},m={class:"bar__title"},g={class:"bar__trailing"},y=_({__name:"PageBar",props:{title:{},back:{type:Boolean,default:!0},backTo:{}},setup(e){const o=e,r=p();function l(){o.backTo?r.push({name:o.backTo}):r.back()}return(n,c)=>(t(),s("header",h,[a("div",f,[e.back?(t(),s("button",{key:0,type:"button",class:"bar__btn","aria-label":"بازگشت",onClick:l},[d(b,{icon:"vuesax-linear:arrow-right-1",size:"20"})])):(t(),s("span",B)),a("h1",m,u(e.title),1),a("div",g,[i(n.$slots,"trailing",{},()=>[c[0]||(c[0]=a("span",{class:"bar__spacer","aria-hidden":"true"},null,-1))],!0)])]),i(n.$slots,"below",{},void 0,!0)]))}}),I=k(y,[["__scopeId","data-v-d2d3dfeb"]]);export{I as P};
@@ -1 +1 @@
import{d as D,l as P,i as s,c as i,F as S,b as t,u as e,w as z,k as _,I as f,j as B,e as I,f as d,t as u,s as N,x as V,g as E,h as $,_ as j}from"./index-gDBsh1na.js";import{u as q,S as L}from"./SingleProduct-DoCRibqt.js";import{u as M}from"./cartStore-CnHZpE-f.js";import{D as O}from"./index-DHV2EObP.js";const U={class:"pc__art"},A=["alt"],G={key:1,class:"pc__artEmpty","aria-hidden":"true"},H=["aria-label"],J={key:2,class:"pc__flag"},K={key:3,class:"pc__flag pc__flag--soft"},Q={class:"pc__body"},R={class:"pc__title"},T={class:"pc__meta"},W={class:"pc__weight"},X={key:0,class:"pc__wage"},Y=D({__name:"ProductCard",props:{value:{}},setup(g){const h=g,n=q(),{image:p,id:a,title:v,min_gram:y,wage:m,is_exist:b,qty:k,isPreOrder:w}=M(h.value),l=E(!1);function x(){l.value=!0}const C=$(()=>{const r=m.value;return r==null?"":r%1===0?String(r):r.toFixed(2)});return(r,o)=>{const F=P("lazy");return s(),i(S,null,[t("article",{class:"pc",onClick:x},[t("div",U,[e(p)?z((s(),i("img",{key:0,alt:e(v)},null,8,A)),[[F,e(p)]]):(s(),i("div",G,[_(f,{icon:"vuesax-linear:diamonds",size:"26"})])),t("button",{type:"button",class:I(["pc__fav",{"is-on":e(n).isFavorite(e(a))}]),"aria-label":e(n).isFavorite(e(a))?"حذف از علاقه‌مندی":"افزودن به علاقه‌مندی",onClick:o[0]||(o[0]=B(c=>e(n).toggle(e(a)),["stop"]))},[_(f,{icon:e(n).isFavorite(e(a))?"vuesax-linear:heart-fill":"vuesax-linear:heart",size:"16"},null,8,["icon"])],10,H),e(b)?e(w)&&e(k)===0?(s(),i("span",K,"پیش‌سفارش")):d("",!0):(s(),i("span",J,"ناموجود"))]),t("div",Q,[t("h3",R,u(e(v)),1),t("div",T,[t("span",W,u(e(y))+" گرم",1),e(m)!=null?(s(),i("span",X,"اجرت "+u(C.value)+"٪",1)):d("",!0)])])]),_(e(O),{visible:l.value,"onUpdate:visible":o[2]||(o[2]=c=>l.value=c),placement:"bottom",closable:!1,class:"rtl",height:"100vh",bodyStyle:{padding:0,position:"relative"}},{default:N(()=>[l.value?(s(),V(L,{id:e(a),key:e(a),onCloseDrawer:o[1]||(o[1]=c=>l.value=!1)},null,8,["id"])):d("",!0)]),_:1},8,["visible"])],64)}}}),ae=j(Y,[["__scopeId","data-v-5658bc04"]]);export{ae as P};
import{d as D,l as P,i as s,c as i,F as S,b as t,u as e,w as z,k as _,I as f,j as B,e as I,f as d,t as u,s as N,x as V,g as E,h as $,_ as j}from"./index-zU76P609.js";import{u as q,S as L}from"./SingleProduct-Bo-ynxSe.js";import{u as M}from"./cartStore-BxC8w6kf.js";import{D as O}from"./index-BL4GBXwx.js";const U={class:"pc__art"},A=["alt"],G={key:1,class:"pc__artEmpty","aria-hidden":"true"},H=["aria-label"],J={key:2,class:"pc__flag"},K={key:3,class:"pc__flag pc__flag--soft"},Q={class:"pc__body"},R={class:"pc__title"},T={class:"pc__meta"},W={class:"pc__weight"},X={key:0,class:"pc__wage"},Y=D({__name:"ProductCard",props:{value:{}},setup(g){const h=g,n=q(),{image:p,id:a,title:v,min_gram:y,wage:m,is_exist:b,qty:k,isPreOrder:w}=M(h.value),l=E(!1);function x(){l.value=!0}const C=$(()=>{const r=m.value;return r==null?"":r%1===0?String(r):r.toFixed(2)});return(r,o)=>{const F=P("lazy");return s(),i(S,null,[t("article",{class:"pc",onClick:x},[t("div",U,[e(p)?z((s(),i("img",{key:0,alt:e(v)},null,8,A)),[[F,e(p)]]):(s(),i("div",G,[_(f,{icon:"vuesax-linear:diamonds",size:"26"})])),t("button",{type:"button",class:I(["pc__fav",{"is-on":e(n).isFavorite(e(a))}]),"aria-label":e(n).isFavorite(e(a))?"حذف از علاقه‌مندی":"افزودن به علاقه‌مندی",onClick:o[0]||(o[0]=B(c=>e(n).toggle(e(a)),["stop"]))},[_(f,{icon:e(n).isFavorite(e(a))?"vuesax-linear:heart-fill":"vuesax-linear:heart",size:"16"},null,8,["icon"])],10,H),e(b)?e(w)&&e(k)===0?(s(),i("span",K,"پیش‌سفارش")):d("",!0):(s(),i("span",J,"ناموجود"))]),t("div",Q,[t("h3",R,u(e(v)),1),t("div",T,[t("span",W,u(e(y))+" گرم",1),e(m)!=null?(s(),i("span",X,"اجرت "+u(C.value)+"٪",1)):d("",!0)])])]),_(e(O),{visible:l.value,"onUpdate:visible":o[2]||(o[2]=c=>l.value=c),placement:"bottom",closable:!1,class:"rtl",height:"100vh",bodyStyle:{padding:0,position:"relative"}},{default:N(()=>[l.value?(s(),V(L,{id:e(a),key:e(a),onCloseDrawer:o[1]||(o[1]=c=>l.value=!1)},null,8,["id"])):d("",!0)]),_:1},8,["visible"])],64)}}}),ae=j(Y,[["__scopeId","data-v-5658bc04"]]);export{ae as P};
@@ -1 +1 @@
import{d as S,G as I,o as E,q as y,c as a,k as i,s as b,g as c,v as k,i as l,b as e,I as p,t,f as _,e as V,h as g,_ as h}from"./index-gDBsh1na.js";import{P as N}from"./PageBar-lc_J1EFz.js";import{S as T}from"./SectionHead-D1crGF_Y.js";const B={class:"prof"},C={class:"prof__identity"},P={class:"prof__avatar","aria-hidden":"true"},x={class:"prof__name"},D={key:0,class:"prof__mobile"},R={key:0,class:"prof__block"},w={class:"prof__specs"},F={class:"prof__spec"},M={class:"prof__spec"},z={class:"prof__spec"},L={class:"prof__spec"},O={key:1,class:"prof__empty"},U=S({__name:"ProfileView",setup(A){const d={UNVERIFIED:"احراز نشده",STEP_ONE_SUBMITTED:"مرحله اول ثبت شده",STEP_TWO_SUBMITTED:"مرحله دوم ثبت شده",VERIFIED:"تایید شده"},f=I(),s=c(null),n=c(!1),v=g(()=>{var r;return((r=s.value)==null?void 0:r.verificationStep)==="VERIFIED"});return E(async()=>{if(f.isLoggedIn){n.value=!0;try{s.value=await y.getMe()}finally{n.value=!1}}}),(r,o)=>{const m=k("container");return l(),a("div",B,[i(N,{title:"اطلاعات کاربری","back-to":"userPage::hasSubRoute"}),i(m,{class:"prof__body"},{default:b(()=>{var u;return[e("section",C,[e("div",P,[i(p,{icon:"vuesax-linear:user",size:"30"})]),e("h2",x,t(((u=s.value)==null?void 0:u.fullName)??"—"),1),s.value?(l(),a("p",D,t(s.value.mobile),1)):_("",!0),s.value?(l(),a("span",{key:1,class:V(["prof__seal",v.value?"is-ok":"is-pending"])},t(d[s.value.verificationStep]??s.value.verificationStep),3)):_("",!0)]),s.value?(l(),a("section",R,[i(T,{title:"مشخصات",subtitle:"اطلاعات ثبت‌شده حساب شما"}),e("dl",w,[e("div",F,[o[0]||(o[0]=e("dt",null,"نام و نام خانوادگی",-1)),e("dd",null,t(s.value.fullName),1)]),e("div",M,[o[1]||(o[1]=e("dt",null,"تلفن همراه",-1)),e("dd",null,t(s.value.mobile),1)]),e("div",z,[o[2]||(o[2]=e("dt",null,"کد ملی",-1)),e("dd",null,t(s.value.nationalCode),1)]),e("div",L,[o[3]||(o[3]=e("dt",null,"وضعیت احراز هویت",-1)),e("dd",null,t(d[s.value.verificationStep]??s.value.verificationStep),1)])])])):n.value?_("",!0):(l(),a("section",O,[i(p,{icon:"vuesax-linear:user",size:"26"}),o[4]||(o[4]=e("p",null,"اطلاعات حساب در دسترس نیست.",-1))]))]}),_:1})])}}}),W=h(U,[["__scopeId","data-v-adfdabd9"]]);export{W as default};
import{d as S,G as I,o as E,q as y,c as a,k as i,s as b,g as c,v as k,i as l,b as e,I as p,t,f as _,e as V,h as g,_ as h}from"./index-zU76P609.js";import{P as N}from"./PageBar-BNTdgQIH.js";import{S as T}from"./SectionHead-DiMH7kD3.js";const B={class:"prof"},C={class:"prof__identity"},P={class:"prof__avatar","aria-hidden":"true"},x={class:"prof__name"},D={key:0,class:"prof__mobile"},R={key:0,class:"prof__block"},w={class:"prof__specs"},F={class:"prof__spec"},M={class:"prof__spec"},z={class:"prof__spec"},L={class:"prof__spec"},O={key:1,class:"prof__empty"},U=S({__name:"ProfileView",setup(A){const d={UNVERIFIED:"احراز نشده",STEP_ONE_SUBMITTED:"مرحله اول ثبت شده",STEP_TWO_SUBMITTED:"مرحله دوم ثبت شده",VERIFIED:"تایید شده"},f=I(),s=c(null),n=c(!1),v=g(()=>{var r;return((r=s.value)==null?void 0:r.verificationStep)==="VERIFIED"});return E(async()=>{if(f.isLoggedIn){n.value=!0;try{s.value=await y.getMe()}finally{n.value=!1}}}),(r,o)=>{const m=k("container");return l(),a("div",B,[i(N,{title:"اطلاعات کاربری","back-to":"userPage::hasSubRoute"}),i(m,{class:"prof__body"},{default:b(()=>{var u;return[e("section",C,[e("div",P,[i(p,{icon:"vuesax-linear:user",size:"30"})]),e("h2",x,t(((u=s.value)==null?void 0:u.fullName)??"—"),1),s.value?(l(),a("p",D,t(s.value.mobile),1)):_("",!0),s.value?(l(),a("span",{key:1,class:V(["prof__seal",v.value?"is-ok":"is-pending"])},t(d[s.value.verificationStep]??s.value.verificationStep),3)):_("",!0)]),s.value?(l(),a("section",R,[i(T,{title:"مشخصات",subtitle:"اطلاعات ثبت‌شده حساب شما"}),e("dl",w,[e("div",F,[o[0]||(o[0]=e("dt",null,"نام و نام خانوادگی",-1)),e("dd",null,t(s.value.fullName),1)]),e("div",M,[o[1]||(o[1]=e("dt",null,"تلفن همراه",-1)),e("dd",null,t(s.value.mobile),1)]),e("div",z,[o[2]||(o[2]=e("dt",null,"کد ملی",-1)),e("dd",null,t(s.value.nationalCode),1)]),e("div",L,[o[3]||(o[3]=e("dt",null,"وضعیت احراز هویت",-1)),e("dd",null,t(d[s.value.verificationStep]??s.value.verificationStep),1)])])])):n.value?_("",!0):(l(),a("section",O,[i(p,{icon:"vuesax-linear:user",size:"26"}),o[4]||(o[4]=e("p",null,"اطلاعات حساب در دسترس نیست.",-1))]))]}),_:1})])}}}),W=h(U,[["__scopeId","data-v-adfdabd9"]]);export{W as default};
@@ -1 +1 @@
import{p as c,j as d}from"./filters-CLL9nGZ2.js";import{d as u,c as s,e as _,b as a,E as l,t as i,u as n,f as m,h as v,i as r,_ as q}from"./index-gDBsh1na.js";const f={key:0,class:"rate-strip__value"},k={class:"rate-strip__num"},y={key:1,class:"rate-strip__value rate-strip__value--muted"},x={key:2,class:"rate-strip__time"},R=u({__name:"RateStrip",props:{quote:{}},setup(t){const o=t,p=v(()=>o.quote?o.quote.pricePerGramRial.split(".")[0]:"");return(b,e)=>(r(),s("div",{class:_(["rate-strip",{"is-empty":!t.quote}])},[e[1]||(e[1]=a("div",{class:"rate-strip__label"},[a("span",{class:"rate-strip__dot","aria-hidden":"true"}),l(" نرخ طلای ۱۸ عیار ")],-1)),t.quote?(r(),s("div",f,[a("span",k,i(n(c)(p.value)),1),e[0]||(e[0]=a("span",{class:"rate-strip__unit"},"ریال / گرم",-1))])):(r(),s("div",y,"در انتظار اعلام نرخ")),t.quote?(r(),s("div",x,i(n(d)(t.quote.quotedAt)),1)):m("",!0)],2))}}),C=q(R,[["__scopeId","data-v-16b4c8d5"]]);export{C as R};
import{p as c,j as d}from"./filters-CLL9nGZ2.js";import{d as u,c as s,e as _,b as a,E as l,t as i,u as n,f as m,h as v,i as r,_ as q}from"./index-zU76P609.js";const f={key:0,class:"rate-strip__value"},k={class:"rate-strip__num"},y={key:1,class:"rate-strip__value rate-strip__value--muted"},x={key:2,class:"rate-strip__time"},R=u({__name:"RateStrip",props:{quote:{}},setup(t){const o=t,p=v(()=>o.quote?o.quote.pricePerGramRial.split(".")[0]:"");return(b,e)=>(r(),s("div",{class:_(["rate-strip",{"is-empty":!t.quote}])},[e[1]||(e[1]=a("div",{class:"rate-strip__label"},[a("span",{class:"rate-strip__dot","aria-hidden":"true"}),l(" نرخ طلای ۱۸ عیار ")],-1)),t.quote?(r(),s("div",f,[a("span",k,i(n(c)(p.value)),1),e[0]||(e[0]=a("span",{class:"rate-strip__unit"},"ریال / گرم",-1))])):(r(),s("div",y,"در انتظار اعلام نرخ")),t.quote?(r(),s("div",x,i(n(d)(t.quote.quotedAt)),1)):m("",!0)],2))}}),C=q(R,[["__scopeId","data-v-16b4c8d5"]]);export{C as R};
@@ -1 +1 @@
import{d as v,a3 as h,H as m,i as t,c as l,k as n,I as r,w as f,a4 as b,b as k,a5 as x,f as C,C as I,g as w,_ as y}from"./index-gDBsh1na.js";const S={class:"si"},V=["placeholder"],B=v({__name:"SearchInput",props:{placeHolder:{}},emits:["search"],setup(i,{emit:d}){const c=d,a=I({clear:!1}),e=w(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()}),(H,o)=>(t(),l("div",S,[n(r,{icon:"vuesax-linear:search-normal-1",class:"si__icon",size:"18",onClick:s}),f(k("input",{"onUpdate:modelValue":o[0]||(o[0]=_=>e.value=_),class:"si__input",placeholder:i.placeHolder,onKeyup:x(s,["enter"])},null,40,V),[[b,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"})])):C("",!0)]))}}),z=y(B,[["__scopeId","data-v-4c50067a"]]);export{z as S};
import{d as v,a3 as h,H as m,i as t,c as l,k as n,I as r,w as f,a4 as b,b as k,a5 as x,f as C,C as I,g as w,_ as y}from"./index-zU76P609.js";const S={class:"si"},V=["placeholder"],B=v({__name:"SearchInput",props:{placeHolder:{}},emits:["search"],setup(i,{emit:d}){const c=d,a=I({clear:!1}),e=w(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()}),(H,o)=>(t(),l("div",S,[n(r,{icon:"vuesax-linear:search-normal-1",class:"si__icon",size:"18",onClick:s}),f(k("input",{"onUpdate:modelValue":o[0]||(o[0]=_=>e.value=_),class:"si__input",placeholder:i.placeHolder,onKeyup:x(s,["enter"])},null,40,V),[[b,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"})])):C("",!0)]))}}),z=y(B,[["__scopeId","data-v-4c50067a"]]);export{z as S};
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
import{d as r,c as t,b as o,t as s,f as n,E as _,k as d,I as u,i as a,_ as b}from"./index-gDBsh1na.js";const m={class:"sec"},f={class:"sec__text"},k={class:"sec__title"},x={key:0,class:"sec__sub"},h=r({__name:"SectionHead",props:{title:{},subtitle:{},actionLabel:{}},emits:["action"],setup(e,{emit:i}){const l=i;return(p,c)=>(a(),t("header",m,[o("div",f,[o("h2",k,s(e.title),1),e.subtitle?(a(),t("p",x,s(e.subtitle),1)):n("",!0)]),e.actionLabel?(a(),t("button",{key:0,type:"button",class:"sec__action",onClick:c[0]||(c[0]=v=>l("action"))},[_(s(e.actionLabel)+" ",1),d(u,{icon:"vuesax-linear:arrow-left-2",size:"15"})])):n("",!0)]))}}),N=b(h,[["__scopeId","data-v-e5c65b7c"]]);export{N as S};
import{d as r,c as t,b as o,t as s,f as n,E as _,k as d,I as u,i as a,_ as b}from"./index-zU76P609.js";const m={class:"sec"},f={class:"sec__text"},k={class:"sec__title"},x={key:0,class:"sec__sub"},h=r({__name:"SectionHead",props:{title:{},subtitle:{},actionLabel:{}},emits:["action"],setup(e,{emit:i}){const l=i;return(p,c)=>(a(),t("header",m,[o("div",f,[o("h2",k,s(e.title),1),e.subtitle?(a(),t("p",x,s(e.subtitle),1)):n("",!0)]),e.actionLabel?(a(),t("button",{key:0,type:"button",class:"sec__action",onClick:c[0]||(c[0]=v=>l("action"))},[_(s(e.actionLabel)+" ",1),d(u,{icon:"vuesax-linear:arrow-left-2",size:"15"})])):n("",!0)]))}}),N=b(h,[["__scopeId","data-v-e5c65b7c"]]);export{N as S};
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
import{d as b,G as A,o as C,q as D,c as i,k as r,s as f,x as w,u as E,f as m,g as u,i as l,F as y,b as s,r as L,I as g,t as o,e as p,v as N,_ as M}from"./index-gDBsh1na.js";import{P}from"./PageBar-lc_J1EFz.js";import{a as O}from"./Spinner.vue_vue_type_style_index_0_lang-iladsJNR.js";import{S as B}from"./SectionHead-D1crGF_Y.js";import{j as R,p as U}from"./filters-CLL9nGZ2.js";import{D as I}from"./index-DHV2EObP.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./classCallCheck-Cn_U7yJ4.js";const V={class:"tx"},$={class:"tx__list"},G=["onClick"],Y={class:"tx__main"},z={class:"tx__head"},F={class:"tx__kind"},H={key:0,class:"tx__note"},j={class:"tx__foot"},q={class:"tx__date"},J={key:1,class:"tx__empty"},K={class:"sheet"},Q={class:"sheet__specs"},W={class:"sheet__spec"},X={class:"sheet__spec"},Z={class:"sheet__spec"},ss={class:"sheet__spec"},es={class:"sheet__spec"},ts=b({__name:"TransactionsView",setup(os){const x={ORDER_STOCK:"سفارش",ORDER_PRE_ORDER:"سفارش ساخت",REPAYMENT_MELTED_GOLD:"طلای آب‌شده",REPAYMENT_TRANSFER:"حواله",REPAYMENT_CHEQUE:"چک",REPAYMENT_CASH:"پولی",WALLET_BONUS:"پاداش",ADJUSTMENT:"اصلاحیه"},T=A(),_=u(!1),d=u([]),v=u(!1),n=u(null),c=a=>a.direction==="CREDIT",h=a=>a.currency==="GOLD_GRAM"?`${a.amount} گرم`:`${U(a.amount)} ریال`,k=a=>{n.value=a,v.value=!0};return C(async()=>{if(T.isLoggedIn){_.value=!0;try{d.value=await D.getMyLedgerEntries()}finally{_.value=!1}}}),(a,e)=>{const S=N("container");return l(),i("div",V,[r(P,{title:"اسناد","back-to":"userPage::hasSubRoute"}),r(O,{spinning:_.value,tip:"درحال دریافت اطلاعات"},{default:f(()=>[r(S,{class:"tx__body"},{default:f(()=>[d.value.length?(l(),i(y,{key:0},[r(B,{title:"گردش حساب",subtitle:`${d.value.length} سند`},null,8,["subtitle"]),s("div",$,[(l(!0),i(y,null,L(d.value,t=>(l(),i("article",{key:t.id,class:"tx__row",onClick:ns=>k(t)},[s("span",{class:p(["tx__mark",c(t)?"is-in":"is-out"]),"aria-hidden":"true"},[r(g,{icon:c(t)?"vuesax-linear:arrow-down":"vuesax-linear:arrow-up",size:"16"},null,8,["icon"])],2),s("div",Y,[s("div",z,[s("h3",F,o(x[t.sourceType]??t.sourceType),1),s("span",{class:p(["tx__amount",c(t)?"is-in":"is-out"])},o(h(t)),3)]),t.note?(l(),i("p",H,o(t.note),1)):m("",!0),s("div",j,[s("span",q,o(E(R)(t.createdAt)),1),s("span",{class:p(["tx__state",{"is-pending":!t.confirmed}])},o(t.confirmed?"تایید شده":"در انتظار تایید"),3)])])],8,G))),128))])],64)):_.value?m("",!0):(l(),i("section",J,[r(g,{icon:"vuesax-linear:receipt-text",size:"26"}),e[1]||(e[1]=s("p",null,"سندی برای حساب شما ثبت نشده است.",-1))]))]),_:1})]),_:1},8,["spinning"]),n.value?(l(),w(E(I),{key:0,visible:v.value,"onUpdate:visible":e[0]||(e[0]=t=>v.value=t),placement:"bottom",closable:!1,height:"420px",class:"rtl",bodyStyle:{padding:0}},{default:f(()=>[s("div",K,[e[7]||(e[7]=s("h3",{class:"sheet__title"},"جزئیات سند",-1)),s("dl",Q,[s("div",W,[e[2]||(e[2]=s("dt",null,"نوع سند",-1)),s("dd",null,o(x[n.value.sourceType]??n.value.sourceType),1)]),s("div",X,[e[3]||(e[3]=s("dt",null,"مبلغ",-1)),s("dd",{class:p(c(n.value)?"is-in":"is-out")},o(h(n.value)),3)]),s("div",Z,[e[4]||(e[4]=s("dt",null,"وضعیت",-1)),s("dd",null,o(n.value.confirmed?"تایید شده":"در انتظار تایید"),1)]),s("div",ss,[e[5]||(e[5]=s("dt",null,"تاریخ",-1)),s("dd",null,o(E(R)(n.value.createdAt)),1)]),s("div",es,[e[6]||(e[6]=s("dt",null,"توضیحات",-1)),s("dd",null,o(n.value.note||"—"),1)])])])]),_:1},8,["visible"])):m("",!0)])}}}),ps=M(ts,[["__scopeId","data-v-d21f0dcb"]]);export{ps as default};
import{d as b,G as A,o as C,q as D,c as i,k as r,s as f,x as w,u as E,f as m,g as u,i as l,F as y,b as s,r as L,I as g,t as o,e as p,v as N,_ as M}from"./index-zU76P609.js";import{P}from"./PageBar-BNTdgQIH.js";import{a as O}from"./Spinner.vue_vue_type_style_index_0_lang-8IfA4lPE.js";import{S as B}from"./SectionHead-DiMH7kD3.js";import{j as R,p as U}from"./filters-CLL9nGZ2.js";import{D as I}from"./index-BL4GBXwx.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./classCallCheck-BeQXLUEU.js";const V={class:"tx"},$={class:"tx__list"},G=["onClick"],Y={class:"tx__main"},z={class:"tx__head"},F={class:"tx__kind"},H={key:0,class:"tx__note"},j={class:"tx__foot"},q={class:"tx__date"},J={key:1,class:"tx__empty"},K={class:"sheet"},Q={class:"sheet__specs"},W={class:"sheet__spec"},X={class:"sheet__spec"},Z={class:"sheet__spec"},ss={class:"sheet__spec"},es={class:"sheet__spec"},ts=b({__name:"TransactionsView",setup(os){const x={ORDER_STOCK:"سفارش",ORDER_PRE_ORDER:"سفارش ساخت",REPAYMENT_MELTED_GOLD:"طلای آب‌شده",REPAYMENT_TRANSFER:"حواله",REPAYMENT_CHEQUE:"چک",REPAYMENT_CASH:"پولی",WALLET_BONUS:"پاداش",ADJUSTMENT:"اصلاحیه"},T=A(),_=u(!1),d=u([]),v=u(!1),n=u(null),c=a=>a.direction==="CREDIT",h=a=>a.currency==="GOLD_GRAM"?`${a.amount} گرم`:`${U(a.amount)} ریال`,k=a=>{n.value=a,v.value=!0};return C(async()=>{if(T.isLoggedIn){_.value=!0;try{d.value=await D.getMyLedgerEntries()}finally{_.value=!1}}}),(a,e)=>{const S=N("container");return l(),i("div",V,[r(P,{title:"اسناد","back-to":"userPage::hasSubRoute"}),r(O,{spinning:_.value,tip:"درحال دریافت اطلاعات"},{default:f(()=>[r(S,{class:"tx__body"},{default:f(()=>[d.value.length?(l(),i(y,{key:0},[r(B,{title:"گردش حساب",subtitle:`${d.value.length} سند`},null,8,["subtitle"]),s("div",$,[(l(!0),i(y,null,L(d.value,t=>(l(),i("article",{key:t.id,class:"tx__row",onClick:ns=>k(t)},[s("span",{class:p(["tx__mark",c(t)?"is-in":"is-out"]),"aria-hidden":"true"},[r(g,{icon:c(t)?"vuesax-linear:arrow-down":"vuesax-linear:arrow-up",size:"16"},null,8,["icon"])],2),s("div",Y,[s("div",z,[s("h3",F,o(x[t.sourceType]??t.sourceType),1),s("span",{class:p(["tx__amount",c(t)?"is-in":"is-out"])},o(h(t)),3)]),t.note?(l(),i("p",H,o(t.note),1)):m("",!0),s("div",j,[s("span",q,o(E(R)(t.createdAt)),1),s("span",{class:p(["tx__state",{"is-pending":!t.confirmed}])},o(t.confirmed?"تایید شده":"در انتظار تایید"),3)])])],8,G))),128))])],64)):_.value?m("",!0):(l(),i("section",J,[r(g,{icon:"vuesax-linear:receipt-text",size:"26"}),e[1]||(e[1]=s("p",null,"سندی برای حساب شما ثبت نشده است.",-1))]))]),_:1})]),_:1},8,["spinning"]),n.value?(l(),w(E(I),{key:0,visible:v.value,"onUpdate:visible":e[0]||(e[0]=t=>v.value=t),placement:"bottom",closable:!1,height:"420px",class:"rtl",bodyStyle:{padding:0}},{default:f(()=>[s("div",K,[e[7]||(e[7]=s("h3",{class:"sheet__title"},"جزئیات سند",-1)),s("dl",Q,[s("div",W,[e[2]||(e[2]=s("dt",null,"نوع سند",-1)),s("dd",null,o(x[n.value.sourceType]??n.value.sourceType),1)]),s("div",X,[e[3]||(e[3]=s("dt",null,"مبلغ",-1)),s("dd",{class:p(c(n.value)?"is-in":"is-out")},o(h(n.value)),3)]),s("div",Z,[e[4]||(e[4]=s("dt",null,"وضعیت",-1)),s("dd",null,o(n.value.confirmed?"تایید شده":"در انتظار تایید"),1)]),s("div",ss,[e[5]||(e[5]=s("dt",null,"تاریخ",-1)),s("dd",null,o(E(R)(n.value.createdAt)),1)]),s("div",es,[e[6]||(e[6]=s("dt",null,"توضیحات",-1)),s("dd",null,o(n.value.note||"—"),1)])])])]),_:1},8,["visible"])):m("",!0)])}}}),ps=M(ts,[["__scopeId","data-v-d21f0dcb"]]);export{ps as default};
@@ -1 +1 @@
import{g as d,u as C,h as a,m as F,q as S}from"./index-gDBsh1na.js";function W(t){return(t.qty??0)>0||!!t.isPreOrder}function Q(t){if(!t||t.length===0)return null;const e=t.filter(W);return(e.length?e:t).reduce((s,r)=>parseFloat(r.defaultWagePercent)<parseFloat(s.defaultWagePercent)?r:s)}function M(t,e){const i=d(t),s=a(()=>i.value.id),r=a(()=>i.value.title),n=a(()=>i.value.variants),o=d(e??Q(C(n))),y=a(()=>{var u,f,m,p;return((f=(u=o.value)==null?void 0:u.image)==null?void 0:f.url)??((p=(m=i.value.images)==null?void 0:m[0])==null?void 0:p.url)}),g=a(()=>o.value?parseFloat(o.value.rashWeightGrams):0),x=a(()=>o.value?parseFloat(o.value.defaultWagePercent):null),q=d(null),l=a(()=>{var u;return((u=o.value)==null?void 0:u.qty)??0}),h=a(()=>{var u;return((u=o.value)==null?void 0:u.isPreOrder)??!1}),P=a(()=>l.value>0||h.value),O=a(()=>i.value.productCode??null),_=d(!1);return{product:i,image:y,id:s,title:r,productCode:O,variants:n,selectedVariant:o,min_gram:g,wage:x,hasDiscountWage:q,qty:l,isPreOrder:h,is_exist:P,has_warranty:_}}const v="appCart";function w(){try{const t=localStorage.getItem(v);return t?JSON.parse(t):[]}catch{return[]}}function c(t){localStorage.setItem(v,JSON.stringify(t))}const N=F("cart",{state:()=>({items:w()}),actions:{async init(){try{const t=await S.listProducts(),e=[];for(const i of this.items){const s=t.find(n=>n.id===i.pid),r=s==null?void 0:s.variants.find(n=>n.id===i.vid);s&&r&&e.push({...i,product:s})}this.items=e,c(this.items)}catch(t){console.log(t)}},addToCart(t){var s,r;const e=(r=(s=t.product)==null?void 0:s.variants)==null?void 0:r.find(n=>n.id===t.vid);if(!e||!((e.qty??0)>0||e.isPreOrder))return!1;const i=this.find_index(t);return i===-1?this.items.push({...t,qty:this.capQty(t.qty,e)}):(this.items[i].product=t.product,this.items[i].qty=this.capQty(t.qty,e)),c(this.items),!0},capQty(t,e){const i=Math.max(1,Math.floor(t)||1);if(e.isPreOrder)return i;const s=e.qty??0;return s>0?Math.min(i,s):i},maxQty(t){const e=this.find_index(t);if(e===-1)return null;const i=this.variant(this.items[e]);return!i||i.isPreOrder?null:(i.qty??0)>0?i.qty:null},remove(t){const e=this.find_index(t);e>-1&&this.items.splice(e,1),c(this.items)},updateFeild(t,e,i,s){if(!this.isInCart(i))return!1;const r=e??this.find_index(i);if(s==="qty"){const n=this.variant(this.items[r]);t=n?this.capQty(Number(t),n):Math.max(1,Number(t)||1)}return this.items[r][s]=t,c(this.items),!0},find_index(t){return this.items.findIndex(e=>e.pid===t.pid&&e.vid===t.vid)},isInCart(t){return this.find_index(t)>-1},variant(t){return t.product.variants.find(e=>e.id===t.vid)},total(){return this.items.reduce((t,e)=>{const i=this.variant(e);return t+(i?parseFloat(i.rashWeightGrams)*e.qty:0)},0).toFixed(2)},clear(){this.items=[],c(this.items)}}});export{N as a,W as i,M as u};
import{g as d,u as C,h as a,m as F,q as S}from"./index-zU76P609.js";function W(t){return(t.qty??0)>0||!!t.isPreOrder}function Q(t){if(!t||t.length===0)return null;const e=t.filter(W);return(e.length?e:t).reduce((s,r)=>parseFloat(r.defaultWagePercent)<parseFloat(s.defaultWagePercent)?r:s)}function M(t,e){const i=d(t),s=a(()=>i.value.id),r=a(()=>i.value.title),n=a(()=>i.value.variants),o=d(e??Q(C(n))),y=a(()=>{var u,f,m,p;return((f=(u=o.value)==null?void 0:u.image)==null?void 0:f.url)??((p=(m=i.value.images)==null?void 0:m[0])==null?void 0:p.url)}),g=a(()=>o.value?parseFloat(o.value.rashWeightGrams):0),x=a(()=>o.value?parseFloat(o.value.defaultWagePercent):null),q=d(null),l=a(()=>{var u;return((u=o.value)==null?void 0:u.qty)??0}),h=a(()=>{var u;return((u=o.value)==null?void 0:u.isPreOrder)??!1}),P=a(()=>l.value>0||h.value),O=a(()=>i.value.productCode??null),_=d(!1);return{product:i,image:y,id:s,title:r,productCode:O,variants:n,selectedVariant:o,min_gram:g,wage:x,hasDiscountWage:q,qty:l,isPreOrder:h,is_exist:P,has_warranty:_}}const v="appCart";function w(){try{const t=localStorage.getItem(v);return t?JSON.parse(t):[]}catch{return[]}}function c(t){localStorage.setItem(v,JSON.stringify(t))}const N=F("cart",{state:()=>({items:w()}),actions:{async init(){try{const t=await S.listProducts(),e=[];for(const i of this.items){const s=t.find(n=>n.id===i.pid),r=s==null?void 0:s.variants.find(n=>n.id===i.vid);s&&r&&e.push({...i,product:s})}this.items=e,c(this.items)}catch(t){console.log(t)}},addToCart(t){var s,r;const e=(r=(s=t.product)==null?void 0:s.variants)==null?void 0:r.find(n=>n.id===t.vid);if(!e||!((e.qty??0)>0||e.isPreOrder))return!1;const i=this.find_index(t);return i===-1?this.items.push({...t,qty:this.capQty(t.qty,e)}):(this.items[i].product=t.product,this.items[i].qty=this.capQty(t.qty,e)),c(this.items),!0},capQty(t,e){const i=Math.max(1,Math.floor(t)||1);if(e.isPreOrder)return i;const s=e.qty??0;return s>0?Math.min(i,s):i},maxQty(t){const e=this.find_index(t);if(e===-1)return null;const i=this.variant(this.items[e]);return!i||i.isPreOrder?null:(i.qty??0)>0?i.qty:null},remove(t){const e=this.find_index(t);e>-1&&this.items.splice(e,1),c(this.items)},updateFeild(t,e,i,s){if(!this.isInCart(i))return!1;const r=e??this.find_index(i);if(s==="qty"){const n=this.variant(this.items[r]);t=n?this.capQty(Number(t),n):Math.max(1,Number(t)||1)}return this.items[r][s]=t,c(this.items),!0},find_index(t){return this.items.findIndex(e=>e.pid===t.pid&&e.vid===t.vid)},isInCart(t){return this.find_index(t)>-1},variant(t){return t.product.variants.find(e=>e.id===t.vid)},total(){return this.items.reduce((t,e)=>{const i=this.variant(e);return t+(i?parseFloat(i.rashWeightGrams)*e.qty:0)},0).toFixed(2)},clear(){this.items=[],c(this.items)}}});export{N as a,W as i,M as u};
@@ -1 +1 @@
import{c as l}from"./Spinner.vue_vue_type_style_index_0_lang-iladsJNR.js";var f=function(n){return setTimeout(n,16)},c=function(n){return clearTimeout(n)};typeof window<"u"&&"requestAnimationFrame"in window&&(f=function(n){return window.requestAnimationFrame(n)},c=function(n){return window.cancelAnimationFrame(n)});var i=0,o=new Map;function u(e){o.delete(e)}function w(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;i+=1;var r=i;function a(t){if(t===0)u(r),e();else{var s=f(function(){a(t-1)});o.set(r,s)}}return a(n),r}w.cancel=function(e){var n=o.get(e);return u(n),c(n)};function m(e,n){for(var r=l({},e),a=0;a<n.length;a+=1){var t=n[a];delete r[t]}return r}function p(e,n,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}function v(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}export{p as _,v as a,m as o,w};
import{c as l}from"./Spinner.vue_vue_type_style_index_0_lang-8IfA4lPE.js";var f=function(n){return setTimeout(n,16)},c=function(n){return clearTimeout(n)};typeof window<"u"&&"requestAnimationFrame"in window&&(f=function(n){return window.requestAnimationFrame(n)},c=function(n){return window.cancelAnimationFrame(n)});var i=0,o=new Map;function u(e){o.delete(e)}function w(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;i+=1;var r=i;function a(t){if(t===0)u(r),e();else{var s=f(function(){a(t-1)});o.set(r,s)}}return a(n),r}w.cancel=function(e){var n=o.get(e);return u(n),c(n)};function m(e,n){for(var r=l({},e),a=0;a<n.length;a+=1){var t=n[a];delete r[t]}return r}function p(e,n,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}function v(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}export{p as _,v as a,m as o,w};
@@ -1 +1 @@
import{m as e}from"./index-gDBsh1na.js";const t={colors:[],brands:[],ciny_id:[],limit_percent:[],limit_gram:[],has_discount:!1,text:void 0,cats:void 0,page:0},i=e("filters",{state:()=>({query:{...t}}),actions:{reset(){this.query={...t}}}});export{i as u};
import{m as e}from"./index-zU76P609.js";const t={colors:[],brands:[],ciny_id:[],limit_percent:[],limit_gram:[],has_discount:!1,text:void 0,cats:void 0,page:0},i=e("filters",{state:()=>({query:{...t}}),actions:{reset(){this.query={...t}}}});export{i as u};
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
import{a6 as y,d as L,a7 as N,a8 as $,H as w,a9 as A,k as l,g as D,C as p,L as B,aa as C,N as I,ab as f,ac as M,ad as R,ae as U}from"./index-gDBsh1na.js";const[Y,r,F]=y("pull-refresh"),x=50,G=["pulling","loosing","success"],X={disabled:Boolean,modelValue:Boolean,headHeight:f(x),successText:String,pullingText:String,loosingText:String,loadingText:String,pullDistance:N,successDuration:f(500),animationDuration:f(300)};var j=L({name:Y,props:X,emits:["change","refresh","update:modelValue"],setup(s,{emit:d,slots:o}){let u;const g=D(),T=D(),H=$(g),e=p({status:"normal",distance:0,duration:0}),i=R(),P=()=>{if(s.headHeight!==x)return{height:`${s.headHeight}px`}},h=()=>e.status!=="loading"&&e.status!=="success"&&!s.disabled,k=t=>{const a=+(s.pullDistance||s.headHeight);return t>a&&(t<a*2?t=a+(t-a)/2:t=a*1.5+(t-a*2)/4),Math.round(t)},n=(t,a)=>{const c=+(s.pullDistance||s.headHeight);e.distance=t,a?e.status="loading":t===0?e.status="normal":t<c?e.status="pulling":e.status="loosing",d("change",{status:e.status,distance:t})},m=()=>{const{status:t}=e;return t==="normal"?"":s[`${t}Text`]||F(t)},E=()=>{const{status:t,distance:a}=e;if(o[t])return o[t]({distance:a});const c=[];return G.includes(t)&&c.push(l("div",{class:r("text")},[m()])),t==="loading"&&c.push(l(B,{class:r("loading")},{default:m})),c},V=()=>{e.status="success",setTimeout(()=>{n(0)},+s.successDuration)},v=t=>{u=M(H.value)===0,u&&(e.duration=0,i.start(t))},b=t=>{h()&&v(t)},_=t=>{if(h()){u||v(t);const{deltaY:a}=i;i.move(t),u&&a.value>=0&&i.isVertical()&&(C(t),n(k(a.value)))}},S=()=>{u&&i.deltaY.value&&h()&&(e.duration=+s.animationDuration,e.status==="loosing"?(n(+s.headHeight,!0),d("update:modelValue",!0),I(()=>d("refresh"))):n(0))};return w(()=>s.modelValue,t=>{e.duration=+s.animationDuration,t?n(+s.headHeight,!0):o.success||s.successText?V():n(0,!1)}),A("touchmove",_,{target:T}),()=>{var t;const a={transitionDuration:`${e.duration}ms`,transform:e.distance?`translate3d(0,${e.distance}px, 0)`:""};return l("div",{ref:g,class:r()},[l("div",{ref:T,class:r("track"),style:a,onTouchstartPassive:b,onTouchend:S,onTouchcancel:S},[l("div",{class:r("head"),style:P()},[E()]),(t=o.default)==null?void 0:t.call(o)])])}}});const z=U(j);export{z as P};
import{a6 as y,d as L,a7 as N,a8 as $,H as w,a9 as A,k as l,g as D,C as p,L as B,aa as C,N as I,ab as f,ac as M,ad as R,ae as U}from"./index-zU76P609.js";const[Y,r,F]=y("pull-refresh"),x=50,G=["pulling","loosing","success"],X={disabled:Boolean,modelValue:Boolean,headHeight:f(x),successText:String,pullingText:String,loosingText:String,loadingText:String,pullDistance:N,successDuration:f(500),animationDuration:f(300)};var j=L({name:Y,props:X,emits:["change","refresh","update:modelValue"],setup(s,{emit:d,slots:o}){let u;const g=D(),T=D(),H=$(g),e=p({status:"normal",distance:0,duration:0}),i=R(),P=()=>{if(s.headHeight!==x)return{height:`${s.headHeight}px`}},h=()=>e.status!=="loading"&&e.status!=="success"&&!s.disabled,k=t=>{const a=+(s.pullDistance||s.headHeight);return t>a&&(t<a*2?t=a+(t-a)/2:t=a*1.5+(t-a*2)/4),Math.round(t)},n=(t,a)=>{const c=+(s.pullDistance||s.headHeight);e.distance=t,a?e.status="loading":t===0?e.status="normal":t<c?e.status="pulling":e.status="loosing",d("change",{status:e.status,distance:t})},m=()=>{const{status:t}=e;return t==="normal"?"":s[`${t}Text`]||F(t)},E=()=>{const{status:t,distance:a}=e;if(o[t])return o[t]({distance:a});const c=[];return G.includes(t)&&c.push(l("div",{class:r("text")},[m()])),t==="loading"&&c.push(l(B,{class:r("loading")},{default:m})),c},V=()=>{e.status="success",setTimeout(()=>{n(0)},+s.successDuration)},v=t=>{u=M(H.value)===0,u&&(e.duration=0,i.start(t))},b=t=>{h()&&v(t)},_=t=>{if(h()){u||v(t);const{deltaY:a}=i;i.move(t),u&&a.value>=0&&i.isVertical()&&(C(t),n(k(a.value)))}},S=()=>{u&&i.deltaY.value&&h()&&(e.duration=+s.animationDuration,e.status==="loosing"?(n(+s.headHeight,!0),d("update:modelValue",!0),I(()=>d("refresh"))):n(0))};return w(()=>s.modelValue,t=>{e.duration=+s.animationDuration,t?n(+s.headHeight,!0):o.success||s.successText?V():n(0,!1)}),A("touchmove",_,{target:T}),()=>{var t;const a={transitionDuration:`${e.duration}ms`,transform:e.distance?`translate3d(0,${e.distance}px, 0)`:""};return l("div",{ref:g,class:r()},[l("div",{ref:T,class:r("track"),style:a,onTouchstartPassive:b,onTouchend:S,onTouchcancel:S},[l("div",{class:r("head"),style:P()},[E()]),(t=o.default)==null?void 0:t.call(o)])])}}});const z=U(j);export{z as P};
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -9,7 +9,7 @@
<meta name="background-color" content="#1C2D56" />
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport" />
<title>طلای منتزر</title>
<script type="module" crossorigin src="/assets/index-gDBsh1na.js"></script>
<script type="module" crossorigin src="/assets/index-zU76P609.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-CpQh57KC.css">
<link rel="manifest" href="/manifest.webmanifest"></head>
<body style="background-color: #fff">
+1 -1
View File
File diff suppressed because one or more lines are too long
+55
View File
@@ -189,6 +189,45 @@ export interface AdminSlide {
link: string;
}
/**
* D21 — a sales expert signed into the app. Ordinary customers get
* `isSalesExpert: false` and neither expert screen is shown to them.
*/
export interface ExpertIdentity {
isSalesExpert: boolean;
type: 'customer' | 'sales-expert';
}
/** One of the expert's referred customers ("انتخاب مشتری"). */
export interface ExpertCustomer {
id: string;
/** Legacy key the reference's card bound to. */
name: string;
fullName: string;
mobile: string;
phone: string | null;
store_name: string | null;
pasazh_name: string | null;
gram_level: string;
remain: string;
rial_remain: string;
active: number;
createdAt: string;
}
/** One row of "سفارش مشتریان". */
export interface ExpertChildOrder {
id: string;
orderNumber: string;
status: string;
/** Total order weight — the reference's `item.w` (ChildOrders.vue:55). */
w: string;
totalGoldWeightGrams: string;
createdAt: string;
items: OrderItemDetail[];
customer: { id: string; name: string; mobile: string } | null;
}
export const api = {
listProducts: () => request<ProductSummary[]>('/catalog/products'),
@@ -226,4 +265,20 @@ export const api = {
/** GET /home/slider — public, no auth. Empty array when the admin hasn't
* configured any slides (the caller falls back to a derived hero). */
getHomeSlider: () => request<AdminSlide[]>('/home/slider'),
// ── D21: sales-expert screens ────────────────────────────────────────
// All three scope themselves on the AdminUser id inside the token; no id
// ever travels from the client. An ordinary customer gets 403 on the first
// two, and `isSalesExpert: false` from whoami so the menu entries stay hidden.
getExpertIdentity: () => request<ExpertIdentity>('/expert/whoami'),
getExpertCustomers: (search?: string | null) =>
request<ExpertCustomer[]>('/expert/my-customers', {
method: 'POST',
body: JSON.stringify({ search: search ?? null }),
}),
getExpertChildOrders: (page = 1, search?: string | null) =>
request<{ rows: ExpertChildOrder[]; total: number; page: number; limit: number }>(
'/expert/child-orders',
{ method: 'POST', body: JSON.stringify({ page, search: search ?? null }) },
),
};
+23
View File
@@ -36,6 +36,22 @@ 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 } },
// D21 — the sales expert's two screens. Reference paths and names kept
// (henza_pwa router/index.ts:171-188). requiresExpert is enforced by the
// guard below AND by the server, which scopes both endpoints on the
// AdminUser id in the token and answers 403 for anyone else.
{
path: '/ChildOrder',
name: 'ChildOrder',
component: () => import('../views/expert/ChildOrdersView.vue'),
meta: { title: 'سفارش مشتریان', layout: 'FullPage', requiresAuth: true, requiresExpert: true },
},
{
path: '/customerChoice',
name: 'customerChoice',
component: () => import('../views/expert/CustomerChoiceView.vue'),
meta: { title: 'انتخاب مشتری', layout: 'FullPage', requiresAuth: true, requiresExpert: true },
},
{ path: '/notifications', name: 'notifications', component: () => import('../views/user/NotificationsView.vue') },
{ path: '/search', name: 'search', component: () => import('../views/search/SearchView.vue') },
{ path: '/collection/:id?', name: 'collection', component: () => import('../views/search/CollectionView.vue') },
@@ -60,6 +76,13 @@ router.beforeEach((to) => {
return { name: 'login', query: { redirect: to.fullPath } };
}
// D21 — an ordinary customer typing the URL is sent back to their
// dashboard. This is convenience, not security: the server refuses both
// expert endpoints for a non-expert token regardless of what the app does.
if (to.meta.requiresExpert && !session.isSalesExpert) {
return { name: 'userPage::hasSubRoute' };
}
// legacy router/index.ts:268-270 — the product page slides down into view.
if (to.name === 'singleProduct') nav.setPgaTransition('slideDown');
else nav.setPgaTransition(undefined);
+20
View File
@@ -5,6 +5,8 @@ const CUSTOMER_ID_KEY = 'gold-bank:customerId';
const MOBILE_KEY = 'gold-bank:mobile';
/** Legacy's isUserLoggedIn() (Mixins/checkAccess.ts) reads this key. */
const LEGACY_FLAG_KEY = 'appToken';
/** D21 — cached so the expert menu entries render before whoami resolves. */
const EXPERT_KEY = 'gold-bank:isSalesExpert';
/**
* The logged-in customer's session.
@@ -25,6 +27,15 @@ export const useSessionStore = defineStore('session', {
token: localStorage.getItem(TOKEN_KEY) as string | null,
customerId: localStorage.getItem(CUSTOMER_ID_KEY) as string | null,
mobile: localStorage.getItem(MOBILE_KEY) as string | null,
/**
* D21 — whether this session belongs to a sales expert.
*
* A CONVENIENCE ONLY: it decides whether the two expert entries are
* rendered. It is never an authorisation claim — the server scopes both
* expert routes on the AdminUser id inside the token and answers 403 for
* an ordinary customer, so flipping this in devtools reveals nothing.
*/
isSalesExpert: localStorage.getItem(EXPERT_KEY) === '1',
}),
getters: {
/** Authenticated means holding a token, not merely knowing an id. */
@@ -40,6 +51,13 @@ export const useSessionStore = defineStore('session', {
localStorage.setItem(MOBILE_KEY, mobile);
localStorage.setItem(LEGACY_FLAG_KEY, token);
},
/** Set from GET /expert/whoami right after login. */
setSalesExpert(value: boolean) {
this.isSalesExpert = value;
if (value) localStorage.setItem(EXPERT_KEY, '1');
else localStorage.removeItem(EXPERT_KEY);
},
/**
* Clears everything. Called on explicit logout and by the API client when a
* request comes back 401 — an expired or revoked token must not leave stale
@@ -49,6 +67,8 @@ export const useSessionStore = defineStore('session', {
this.token = null;
this.customerId = null;
this.mobile = null;
this.isSalesExpert = false;
localStorage.removeItem(EXPERT_KEY);
localStorage.removeItem(TOKEN_KEY);
localStorage.removeItem(CUSTOMER_ID_KEY);
localStorage.removeItem(MOBILE_KEY);
@@ -0,0 +1,415 @@
<!--
"سفارش مشتریان" — the sales expert's referred customers' orders.
Ported from legacy henza_pwa/src/views/user/src/components/ChildOrders.vue,
restyled into this app's design language (PageBar + SearchInput + cards, as
OrdersView uses). The LOGIC is the reference's and is identical in
user-app-v2; only the styling differs between the two apps.
Kept from the reference:
- the title "سفارشات مشتریان" (ChildOrders.vue:18)
- the search box over the list (:26)
- infinite paging: one page per scroll to the bottom (:327-338)
- per card: "سفارش : ORD-{id}", the item count, the total weight in grams,
the customer name, and the fixed status chip «تحویل مسئول فروش» — the
reference hardcodes that label (:48) because the endpoint only ever
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.
Scope is the server's: every row belongs to a customer this expert referred.
No id travels from the client.
-->
<template>
<div class="cho">
<PageBar title="سفارشات مشتریان" back-to="userPage::hasSubRoute">
<template #below>
<div class="cho__barExtra">
<SearchInput @search="readSearch" place-holder="جستجو" />
</div>
</template>
</PageBar>
<Spinner :spinning="loading && !rows.length" tip="درحال دریافت اطلاعات">
<PullRefresh v-model="refreshing" @refresh="onRefresh">
<container class="cho__body">
<template v-if="rows.length">
<div class="cho__list">
<article
v-for="item in rows"
:key="item.id"
class="cho__card"
@click="openDetail(item)"
>
<div class="cho__top">
<div class="cho__left">
<div class="cho__num">
<span class="cho__muted">سفارش :</span>
{{ item.orderNumber }}
</div>
<div class="cho__meta">
<span class="cho__strong">{{ item.items?.length ?? 0 }}</span>
<span class="cho__unit">آیتم</span>
</div>
</div>
<div class="cho__right">
<span class="cho__status">تحویل مسئول فروش</span>
<div class="cho__meta">
<span class="cho__strong">{{ grams(item.w) }}</span>
<span class="cho__unit">گرم</span>
</div>
</div>
</div>
<div class="cho__divider" />
<div class="cho__bottom">
<div class="cho__customer">
نام مشتری : {{ item.customer?.name ?? '—' }}
</div>
<Icon icon="vuesax-linear:arrow-left-1" size="20" />
</div>
</article>
</div>
<div v-if="loading" class="cho__more">در حال دریافت…</div>
</template>
<section v-else-if="!loading" class="cho__empty">
<Icon icon="vuesax-linear:box" size="26" />
<p>{{ search ? 'سفارشی با این مشخصات پیدا نشد.' : 'هنوز سفارشی ثبت نشده است.' }}</p>
</section>
<section v-if="failed" class="cho__empty">
<Icon icon="vuesax-linear:danger" size="26" />
<p>دریافت اطلاعات با خطا روبه‌رو شد.</p>
<button type="button" class="cho__retry" @click="reload">تلاش دوباره</button>
</section>
<!-- Sentinel for the infinite scroll, as the reference used (:216). -->
<div ref="sentinel" class="cho__sentinel" />
</container>
</PullRefresh>
</Spinner>
<Drawer
v-model:open="detailOpen"
placement="bottom"
height="auto"
:closable="false"
:body-style="{ padding: '0' }"
>
<div v-if="active" class="cho__detail">
<h2 class="cho__detailTitle">{{ active.orderNumber }}</h2>
<dl class="cho__rows">
<div class="cho__row">
<dt>نام مشتری</dt>
<dd>{{ active.customer?.name ?? '—' }}</dd>
</div>
<div class="cho__row">
<dt>شماره تماس</dt>
<dd dir="ltr">{{ active.customer?.mobile ?? '—' }}</dd>
</div>
<div class="cho__row">
<dt>وزن کل</dt>
<dd dir="ltr">{{ grams(active.w) }} گرم</dd>
</div>
<div class="cho__row">
<dt>تعداد آیتم‌ها</dt>
<dd>{{ active.items?.length ?? 0 }}</dd>
</div>
<div class="cho__row">
<dt>تاریخ ثبت</dt>
<dd>{{ jdate(active.createdAt) }}</dd>
</div>
<div class="cho__row">
<dt>وضعیت</dt>
<dd>تحویل مسئول فروش</dd>
</div>
</dl>
<button type="button" class="cho__close" @click="detailOpen = false">بستن</button>
</div>
</Drawer>
</div>
</template>
<script setup lang="ts">
import { onBeforeUnmount, onMounted, ref } from 'vue'
import { Drawer } from 'ant-design-vue'
import { PullRefresh } from 'vant'
import Icon from '../../components/icon/Icon.vue'
import PageBar from '../../components/ui/PageBar.vue'
import Spinner from '../../components/Spinner.vue'
import SearchInput from '../../components/search/SearchInput.vue'
import { jdate } from '../../utils/filters'
import { api, type ExpertChildOrder } from '../../api/client'
const rows = ref<ExpertChildOrder[]>([])
const loading = ref(false)
const refreshing = ref(false)
const failed = ref(false)
const search = ref<string | null>(null)
const page = ref(1)
/** Cleared when a page comes back short, so scrolling stops asking. */
const hasMore = ref(true)
const detailOpen = ref(false)
const active = ref<ExpertChildOrder | null>(null)
/** Weights arrive as decimal strings; shown to 3 places, as the reference did. */
function grams(value: string | number | null | undefined): string {
const n = Number(value ?? 0)
return Number.isFinite(n) ? n.toFixed(3) : '0.000'
}
async function fetchPage() {
if (loading.value || !hasMore.value) return
loading.value = true
failed.value = false
try {
const data = await api.getExpertChildOrders(page.value, search.value)
const incoming = data.rows ?? []
rows.value = [...rows.value, ...incoming]
if (incoming.length < (data.limit ?? 20)) hasMore.value = false
else page.value += 1
} catch {
failed.value = true
hasMore.value = false
} finally {
loading.value = false
}
}
function reset() {
rows.value = []
page.value = 1
hasMore.value = true
failed.value = false
}
async function reload() {
reset()
await fetchPage()
}
/** The reference re-ran the query on every search (ChildOrders.vue:327). */
async function readSearch(value: string | undefined) {
search.value = value?.trim() ? value.trim() : null
await reload()
}
async function onRefresh() {
await reload()
refreshing.value = false
}
function openDetail(item: ExpertChildOrder) {
active.value = item
detailOpen.value = true
}
// Infinite scroll, the reference's behaviour (useInfiniteScroll at :216/:330).
const sentinel = ref<HTMLElement | null>(null)
let observer: IntersectionObserver | null = null
onMounted(async () => {
await fetchPage()
if (typeof IntersectionObserver !== 'undefined') {
observer = new IntersectionObserver((entries) => {
if (entries.some((e) => e.isIntersecting)) void fetchPage()
})
if (sentinel.value) observer.observe(sentinel.value)
}
})
onBeforeUnmount(() => observer?.disconnect())
</script>
<style scoped lang="less">
.cho__barExtra {
padding: 0 16px 12px;
}
.cho__body {
padding-top: 132px;
padding-bottom: 90px;
}
.cho__list {
display: flex;
flex-direction: column;
padding-top: 16px;
gap: 11px;
}
.cho__card {
padding: 16px;
background: @canvas;
border: 1px solid @hairline;
border-radius: 18px;
cursor: pointer;
transition: transform 0.2s ease;
}
.cho__card:active {
transform: scale(0.99);
}
.cho__top {
display: flex;
justify-content: space-between;
gap: 12px;
}
.cho__right {
display: flex;
flex-direction: column;
align-items: flex-end;
gap: 8px;
}
.cho__num {
font-size: 15px;
font-weight: 700;
margin-bottom: 10px;
}
.cho__muted {
color: @inkMuted;
font-weight: 500;
margin-left: 4px;
}
.cho__meta {
display: flex;
align-items: baseline;
gap: 4px;
}
.cho__strong {
font-size: 15px;
font-weight: 700;
}
.cho__unit {
font-size: 12px;
color: @inkMuted;
}
.cho__status {
padding: 5px 14px;
border-radius: 8px;
font-size: 12px;
font-weight: 600;
color: #06b6d4;
background: #ecfeff;
white-space: nowrap;
}
.cho__divider {
height: 1px;
background: @hairline;
margin: 12px 0;
}
.cho__bottom {
display: flex;
justify-content: space-between;
align-items: center;
}
.cho__customer {
font-size: 14px;
font-weight: 600;
color: @inkMuted;
}
.cho__more,
.cho__sentinel {
padding: 12px 0;
text-align: center;
font-size: 12px;
color: @inkMuted;
}
.cho__empty {
margin-top: 8px;
padding: 34px 20px;
border: 1px dashed @hairline;
border-radius: 18px;
display: flex;
flex-direction: column;
align-items: center;
gap: 10px;
color: @inkMuted;
font-size: 13px;
}
.cho__retry {
padding: 8px 18px;
border-radius: 999px;
border: 1px solid @hairline;
background: @canvas;
font-family: inherit;
font-size: 12px;
font-weight: 600;
cursor: pointer;
}
.cho__detail {
padding: 20px 16px 24px;
}
.cho__detailTitle {
margin: 0 0 16px;
font-size: 17px;
font-weight: 700;
}
.cho__rows {
margin: 0;
display: flex;
flex-direction: column;
gap: 2px;
}
.cho__row {
display: flex;
justify-content: space-between;
align-items: center;
padding: 11px 14px;
background: @canvasSoft;
border-radius: 10px;
}
.cho__row dt {
font-size: 13px;
color: @inkMuted;
}
.cho__row dd {
margin: 0;
font-size: 14px;
font-weight: 600;
}
.cho__close {
margin-top: 18px;
width: 100%;
padding: 13px;
border: none;
border-radius: 14px;
background: @ink;
color: #fff;
font-family: inherit;
font-size: 14px;
font-weight: 700;
cursor: pointer;
}
</style>
@@ -0,0 +1,346 @@
<!--
"لیست مشتریان" — the sales expert's own referred customers.
Ported from legacy henza_pwa/src/views/user/src/components/customerChoice.vue
(route name customerChoice, title "انتخاب مشتری"), restyled into this app's
design language. The LOGIC is the reference's and is identical in
user-app-v2; only the styling differs.
Kept from the reference:
- the header title "لیست مشتریان" (customerChoice.vue:8)
- the search box, re-querying on each search (:11, :184)
- per card: name, mobile, phone, address and the active/inactive state
- inactive customers are LISTED, not hidden — the reference's `active()`
scope is commented out at ApiMobileController.php:187, so every referred
customer appears whatever their state (D4: replicate, don't "fix")
Deliberately NOT ported — two things, both recorded in D21:
1. `changeUser` / act-as. The reference minted an api_token for each listed
customer (ApiMobileController.php:197-201) so the agent could act AS them.
That is a session-hijack primitive; every session here derives from the
caller's own token, so tapping a card opens their details instead.
2. The activate/deactivate toggle and the edit button, which posted to
`/customer/toggle-active` and the customer form. Those are admin-panel
operations here, and adding a write path to the app during a delivery is
not worth the risk. The state is shown, read-only.
Scope is the server's: `referredByAgentId` = this expert, from the token.
-->
<template>
<div class="cch">
<PageBar title="لیست مشتریان" back-to="userPage::hasSubRoute">
<template #below>
<div class="cch__barExtra">
<SearchInput @search="readSearch" place-holder="جستجو" />
</div>
</template>
</PageBar>
<Spinner :spinning="loading && !rows.length" tip="درحال دریافت اطلاعات">
<PullRefresh v-model="refreshing" @refresh="onRefresh">
<container class="cch__body">
<div v-if="rows.length" class="cch__list">
<article
v-for="item in rows"
:key="item.id"
class="cch__card"
@click="openDetail(item)"
>
<div class="cch__head">
<h3 class="cch__name">{{ item.name }}</h3>
<span class="cch__state" :class="item.active === 1 ? 'is-on' : 'is-off'">
{{ item.active === 1 ? 'فعال' : 'غیرفعال' }}
</span>
</div>
<div class="cch__facts">
<div class="cch__fact">
<Icon icon="vuesax-linear:mobile" size="15" />
<span dir="ltr">{{ item.mobile || '—' }}</span>
</div>
<div class="cch__fact">
<Icon icon="vuesax-linear:call" size="15" />
<span dir="ltr">{{ item.phone || '—' }}</span>
</div>
<div v-if="item.store_name" class="cch__fact">
<Icon icon="vuesax-linear:shop" size="15" />
<span>{{ item.store_name }}</span>
</div>
</div>
</article>
</div>
<section v-else-if="!loading && !failed" class="cch__empty">
<Icon icon="vuesax-linear:profile-2user" size="26" />
<p>{{ search ? 'مشتری با این مشخصات پیدا نشد.' : 'هنوز مشتری‌ای به شما معرفی نشده است.' }}</p>
</section>
<section v-if="failed" class="cch__empty">
<Icon icon="vuesax-linear:danger" size="26" />
<p>دریافت اطلاعات با خطا روبه‌رو شد.</p>
<button type="button" class="cch__retry" @click="load">تلاش دوباره</button>
</section>
</container>
</PullRefresh>
</Spinner>
<Drawer
v-model:open="detailOpen"
placement="bottom"
height="auto"
:closable="false"
:body-style="{ padding: '0' }"
>
<div v-if="active" class="cch__detail">
<h2 class="cch__detailTitle">{{ active.name }}</h2>
<dl class="cch__rows">
<div class="cch__row">
<dt>موبایل</dt>
<dd dir="ltr">{{ active.mobile || '—' }}</dd>
</div>
<div class="cch__row">
<dt>تلفن</dt>
<dd dir="ltr">{{ active.phone || '—' }}</dd>
</div>
<div class="cch__row">
<dt>نام مغازه</dt>
<dd>{{ active.store_name || '—' }}</dd>
</div>
<div class="cch__row">
<dt>نام پاساژ</dt>
<dd>{{ active.pasazh_name || '—' }}</dd>
</div>
<div class="cch__row">
<dt>سقف اعتبار</dt>
<dd dir="ltr">{{ grams(active.gram_level) }} گرم</dd>
</div>
<div class="cch__row">
<dt>بدهی گرمی</dt>
<dd dir="ltr">{{ grams(active.remain) }} گرم</dd>
</div>
<div class="cch__row">
<dt>وضعیت</dt>
<dd>{{ active.active === 1 ? 'فعال' : 'غیرفعال' }}</dd>
</div>
</dl>
<button type="button" class="cch__close" @click="detailOpen = false">بستن</button>
</div>
</Drawer>
</div>
</template>
<script setup lang="ts">
import { onMounted, ref } from 'vue'
import { Drawer } from 'ant-design-vue'
import { PullRefresh } from 'vant'
import Icon from '../../components/icon/Icon.vue'
import PageBar from '../../components/ui/PageBar.vue'
import Spinner from '../../components/Spinner.vue'
import SearchInput from '../../components/search/SearchInput.vue'
import { api, type ExpertCustomer } from '../../api/client'
const rows = ref<ExpertCustomer[]>([])
const loading = ref(false)
const refreshing = ref(false)
const failed = ref(false)
const search = ref<string | null>(null)
const detailOpen = ref(false)
const active = ref<ExpertCustomer | null>(null)
function grams(value: string | number | null | undefined): string {
const n = Number(value ?? 0)
return Number.isFinite(n) ? n.toFixed(3) : '0.000'
}
/**
* The reference returned the whole list in one call (no paging on /my-child,
* ApiMobileController.php:195 ends in `->get()`), so this does the same.
*/
async function load() {
loading.value = true
failed.value = false
try {
rows.value = await api.getExpertCustomers(search.value)
} catch {
failed.value = true
rows.value = []
} finally {
loading.value = false
}
}
/** The reference re-queried the server on each search (customerChoice.vue:184). */
async function readSearch(value: string | undefined) {
search.value = value?.trim() ? value.trim() : null
await load()
}
async function onRefresh() {
await load()
refreshing.value = false
}
function openDetail(item: ExpertCustomer) {
active.value = item
detailOpen.value = true
}
onMounted(load)
</script>
<style scoped lang="less">
.cch__barExtra {
padding: 0 16px 12px;
}
.cch__body {
padding-top: 132px;
padding-bottom: 90px;
}
.cch__list {
display: flex;
flex-direction: column;
padding-top: 16px;
gap: 11px;
}
.cch__card {
padding: 16px;
background: @canvas;
border: 1px solid @hairline;
border-radius: 18px;
cursor: pointer;
transition: transform 0.2s ease;
}
.cch__card:active {
transform: scale(0.99);
}
.cch__head {
display: flex;
justify-content: space-between;
align-items: center;
gap: 10px;
margin-bottom: 12px;
}
.cch__name {
margin: 0;
font-size: 15.5px;
font-weight: 700;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.cch__state {
flex: 0 0 auto;
padding: 4px 12px;
border-radius: 999px;
font-size: 11.5px;
font-weight: 600;
}
.cch__state.is-on {
color: #16a34a;
background: #dcfce7;
}
.cch__state.is-off {
color: #dc2626;
background: #fee2e2;
}
.cch__facts {
display: flex;
flex-direction: column;
gap: 7px;
}
.cch__fact {
display: flex;
align-items: center;
gap: 7px;
font-size: 13px;
font-weight: 600;
color: @inkMuted;
}
.cch__empty {
margin-top: 8px;
padding: 34px 20px;
border: 1px dashed @hairline;
border-radius: 18px;
display: flex;
flex-direction: column;
align-items: center;
gap: 10px;
color: @inkMuted;
font-size: 13px;
}
.cch__retry {
padding: 8px 18px;
border-radius: 999px;
border: 1px solid @hairline;
background: @canvas;
font-family: inherit;
font-size: 12px;
font-weight: 600;
cursor: pointer;
}
.cch__detail {
padding: 20px 16px 24px;
}
.cch__detailTitle {
margin: 0 0 16px;
font-size: 17px;
font-weight: 700;
}
.cch__rows {
margin: 0;
display: flex;
flex-direction: column;
gap: 2px;
}
.cch__row {
display: flex;
justify-content: space-between;
align-items: center;
padding: 11px 14px;
background: @canvasSoft;
border-radius: 10px;
}
.cch__row dt {
font-size: 13px;
color: @inkMuted;
}
.cch__row dd {
margin: 0;
font-size: 14px;
font-weight: 600;
}
.cch__close {
margin-top: 18px;
width: 100%;
padding: 13px;
border: none;
border-radius: 14px;
background: @ink;
color: #fff;
font-family: inherit;
font-size: 14px;
font-weight: 700;
cursor: pointer;
}
</style>
+18 -1
View File
@@ -181,13 +181,28 @@ const grams = computed(() =>
const data = reactive({ notify: false, loginNotify: false })
const list = [
const BASE_TILES = [
{ id: 0, icon: 'vuesax-linear:box', title: 'سفارشات', disabled: false },
{ id: 1, icon: 'vuesax-linear:receipt-text', title: 'اسناد', disabled: false },
{ id: 2, icon: 'vuesax-linear:user', title: 'پروفایل', disabled: false },
{ id: 3, icon: 'vuesax-linear:heart', title: 'علاقمندی', disabled: false },
]
/**
* D21 — the two sales-expert entries, appended only for an expert. The
* reference showed them the same way, gated on the agent's own account
* (Dashboard.vue:117-125). An ordinary customer never sees them, and the
* server refuses both routes for a non-expert token regardless.
*/
const EXPERT_TILES = [
{ id: 4, icon: 'vuesax-linear:box-tick', title: 'سفارش مشتریان', disabled: false },
{ id: 5, icon: 'vuesax-linear:profile-2user', title: 'مشتریان من', disabled: false },
]
const list = computed(() =>
session.isSalesExpert ? [...BASE_TILES, ...EXPERT_TILES] : BASE_TILES,
)
function goToDetails(id: number) {
if (!session.isLoggedIn) {
data.loginNotify = true
@@ -197,6 +212,8 @@ function goToDetails(id: number) {
if (id === 1) router.push({ name: 'transactionsList' })
if (id === 2) router.push({ name: 'profileData' })
if (id === 3) router.push({ name: 'favoritesList' })
if (id === 4) router.push({ name: 'ChildOrder' })
if (id === 5) router.push({ name: 'customerChoice' })
}
function logOut() {
@@ -165,6 +165,16 @@ const sendToken = async (otpCode: string) => {
body.loading = true
const { token, customer } = await api.verifyOtp(String(formModel.username ?? ''), otpCode)
session.login(token, customer.id, customer.mobile)
// D21 — ask the server which kind of principal this token is, so the
// expert-only entries appear for a sales expert. Failure is non-fatal:
// the entries simply stay hidden, and the server refuses those routes
// for anyone who is not an expert anyway.
try {
const who = await api.getExpertIdentity()
session.setSalesExpert(who.isSalesExpert)
} catch {
session.setSalesExpert(false)
}
const redirect = typeof route.query.redirect === 'string' ? route.query.redirect : undefined
await router.push(redirect ?? { name: 'home' })
notify.text = 'با موفقیت وارد شدید'
+1 -1
View File
@@ -1 +1 @@
{"root":["./src/app.vue","./src/env.d.ts","./src/main.ts","./src/sw.ts","./src/api/client.ts","./src/components/dialogvant.vue","./src/components/dialogvantonebutton.vue","./src/components/emptystate.vue","./src/components/notifyvant.vue","./src/components/spinner.vue","./src/components/viewall.vue","./src/components/home/accountstrip.vue","./src/components/home/categoryrail.vue","./src/components/home/ratestrip.vue","./src/components/home/sectionhead.vue","./src/components/home/showcasecard.vue","./src/components/home/showcaseslider.vue","./src/components/icon/icon.vue","./src/components/input/otpinput.vue","./src/components/input/singleotpinput.vue","./src/components/product/cartitem.vue","./src/components/product/category.vue","./src/components/product/galleryslider.vue","./src/components/product/ordercard.vue","./src/components/product/orderitemcard.vue","./src/components/product/productcard.vue","./src/components/product/singleproduct.vue","./src/components/search/filters.vue","./src/components/search/searchinput.vue","./src/components/slider/homeslider.vue","./src/components/slider/slider.vue","./src/components/ui/container.vue","./src/components/ui/contentwrapper.vue","./src/components/ui/dropdown.vue","./src/components/ui/navigation.vue","./src/components/ui/pagebar.vue","./src/components/ui/scrollfetch.vue","./src/components/ui/scrollfetchaftersearch.vue","./src/components/ui/scrollfetchsearch.vue","./src/composables/useorderitemproduct.ts","./src/composables/useproduct.ts","./src/composables/useproductdetail.ts","./src/composables/useproducts.ts","./src/composables/userefresh.ts","./src/layout/fullpagelayout.vue","./src/layout/masterlayout.vue","./src/router/index.ts","./src/stores/cartstore.ts","./src/stores/configstore.ts","./src/stores/favoritesstore.ts","./src/stores/filtersstore.ts","./src/stores/loadingstore.ts","./src/stores/navstore.ts","./src/stores/session.ts","./src/stores/transitionstore.ts","./src/stores/windowdatastore.ts","./src/types/moment-jalaali-shim.d.ts","./src/types/swiper-shim.d.ts","./src/utils/checkaccess.ts","./src/utils/filters.ts","./src/utils/orderstatus.ts","./src/utils/validator.ts","./src/views/cartview.vue","./src/views/homeview.vue","./src/views/newestview.vue","./src/views/search/collectionview.vue","./src/views/search/searchview.vue","./src/views/user/dashboardview.vue","./src/views/user/favoritesview.vue","./src/views/user/loginregisterview.vue","./src/views/user/loginview.vue","./src/views/user/notificationsview.vue","./src/views/user/ordersview.vue","./src/views/user/profileview.vue","./src/views/user/registerview.vue","./src/views/user/transactionsview.vue"],"version":"5.9.3"}
{"root":["./src/app.vue","./src/env.d.ts","./src/main.ts","./src/sw.ts","./src/api/client.ts","./src/components/dialogvant.vue","./src/components/dialogvantonebutton.vue","./src/components/emptystate.vue","./src/components/notifyvant.vue","./src/components/spinner.vue","./src/components/viewall.vue","./src/components/home/accountstrip.vue","./src/components/home/categoryrail.vue","./src/components/home/ratestrip.vue","./src/components/home/sectionhead.vue","./src/components/home/showcasecard.vue","./src/components/home/showcaseslider.vue","./src/components/icon/icon.vue","./src/components/input/otpinput.vue","./src/components/input/singleotpinput.vue","./src/components/product/cartitem.vue","./src/components/product/category.vue","./src/components/product/galleryslider.vue","./src/components/product/ordercard.vue","./src/components/product/orderitemcard.vue","./src/components/product/productcard.vue","./src/components/product/singleproduct.vue","./src/components/search/filters.vue","./src/components/search/searchinput.vue","./src/components/slider/homeslider.vue","./src/components/slider/slider.vue","./src/components/ui/container.vue","./src/components/ui/contentwrapper.vue","./src/components/ui/dropdown.vue","./src/components/ui/navigation.vue","./src/components/ui/pagebar.vue","./src/components/ui/scrollfetch.vue","./src/components/ui/scrollfetchaftersearch.vue","./src/components/ui/scrollfetchsearch.vue","./src/composables/useorderitemproduct.ts","./src/composables/useproduct.ts","./src/composables/useproductdetail.ts","./src/composables/useproducts.ts","./src/composables/userefresh.ts","./src/layout/fullpagelayout.vue","./src/layout/masterlayout.vue","./src/router/index.ts","./src/stores/cartstore.ts","./src/stores/configstore.ts","./src/stores/favoritesstore.ts","./src/stores/filtersstore.ts","./src/stores/loadingstore.ts","./src/stores/navstore.ts","./src/stores/session.ts","./src/stores/transitionstore.ts","./src/stores/windowdatastore.ts","./src/types/moment-jalaali-shim.d.ts","./src/types/swiper-shim.d.ts","./src/utils/checkaccess.ts","./src/utils/filters.ts","./src/utils/orderstatus.ts","./src/utils/validator.ts","./src/views/cartview.vue","./src/views/homeview.vue","./src/views/newestview.vue","./src/views/expert/childordersview.vue","./src/views/expert/customerchoiceview.vue","./src/views/search/collectionview.vue","./src/views/search/searchview.vue","./src/views/user/dashboardview.vue","./src/views/user/favoritesview.vue","./src/views/user/loginregisterview.vue","./src/views/user/loginview.vue","./src/views/user/notificationsview.vue","./src/views/user/ordersview.vue","./src/views/user/profileview.vue","./src/views/user/registerview.vue","./src/views/user/transactionsview.vue"],"version":"5.9.3"}