Files
tehran_tala/apps/user-app/dist/assets/DashboardView-9KmxS4Gj.js
T
s.esmaeiliandClaude Opus 5 f71fd5bfe1 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>
2026-09-23 01:12:53 +03:30

2 lines
5.7 KiB
JavaScript

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