Files
tehran_taj/apps/user-app/dist/assets/DashboardView-ClnjzM0I.js
T
s.esmaeiliandClaude Opus 5 460cf276b6 parity(api,apps): delivery-mode gaps — master OTP, non-blocking SMS, faToEn, v2 cart cap
D20: OTP_MASTER_CODE login bypass read only from the environment, disabled when
unset, audited on every use, with a boot banner while armed. SMS no longer
aborts the boot in production — it warns and declines silently, so no message
can stop an operation.

D19: port Utility::faTOen onto admin-entered mobiles (before the uniqueness
lookup, which could previously be bypassed with Persian digits), and the
create-only welcome SMS, byte-identical to the reference and fire-and-forget.

user-app-v2 was missing the cart stock ceiling entirely: capQty/maxQty, the
un-orderable guard and the qty clamp are ported, leaving v2's own design intact.
The two cart stores are now byte-identical. isVariantOrderable and the
orderable-first default selection ported too.

jest 45/45; typecheck clean on api, admin-panel, user-app, user-app-v2.

[ref: henza_server/app/Http/Controllers/Adm/AdminController.php:333,348,364,378-387]
[ref: henza_server/app/Models/Utility.php:26]

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 18:35:33 +03:30

2 lines
5.4 KiB
JavaScript

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