Files
tehran_tala/apps/user-app-v2/dist/assets/DashboardView-yeOzdGHn.js
T

2 lines
8.2 KiB
JavaScript
Raw Normal View History

2026-10-11 16:01:15 +03:30
import{d as U,R as A,x as B,h as w,K as $,aQ as q,o as O,y as G,c as p,e as s,m as i,p as a,g as D,A as c,S as N,B as K,M as Q,b as f,f as L,n as x,t as v,Q as Y,I as o,F as j,i as C,C as H,T as R,_ as J}from"./index-DhakXDGI.js";import{R as W}from"./RateStrip-Y5oNDHlM.js";import{p as X}from"./filters-Vgn3Zr0m.js";import{P as Z,L as I}from"./index-CKJ4yKZL.js";const ss={class:"dash"},es={class:"dash__bar"},as={class:"dash__barInner"},os={class:"dash__heroTop"},ts={class:"dash__heroIdentity"},ns={class:"dash__heroName"},ls={class:"dash__heroMobile"},is={class:"dash__heroFigure"},rs={class:"dash__heroNum"},us={class:"dash__heroUnit"},ds={class:"dash__heroDebt"},_s={class:"dash__inviteIcon","aria-hidden":"true"},cs={class:"dash__rowIcon","aria-hidden":"true"},vs={class:"dash__rowIcon","aria-hidden":"true"},ps={class:"dash__rowIcon","aria-hidden":"true"},fs={class:"dash__rowIcon","aria-hidden":"true"},hs={class:"dash__rowIcon","aria-hidden":"true"},ms={class:"dash__rowIcon","aria-hidden":"true"},bs={class:"dash__rowIcon","aria-hidden":"true"},ws={class:"dash__rowIcon","aria-hidden":"true"},xs=70,ys=U({__name:"DashboardView",setup(gs){const l=K(),_=A(),h=B(),r=w(h.peek($.profile)??null),S=w(h.peek($.goldPrice)??null),y=w(!1),g=C(()=>r.value?parseFloat(r.value.goldDebtGrams)>0:!1),V=C(()=>g.value?"بدهکار":"بستانکار"),P=C(()=>r.value?Math.abs(parseFloat(r.value.goldDebtGrams)):0),u=Q({notify:!1,loginNotify:!1});function d(t){if(!_.isLoggedIn){u.loginNotify=!0;return}t===0&&l.push({name:"ordersList"}),t===1&&l.push({name:"transactionsList"}),t===2&&l.push({name:"profileData"}),t===3&&l.push({name:"favoritesList"}),t===4&&l.push({name:"ChildOrder"}),t===5&&l.push({name:"customerChoice"}),t===6&&l.push({name:"report"})}async function E(){u.notify=!1;try{await R.endSharedSession()}catch{}let t=null;try{t=(await R.ssoLogoutUrl()).logout_url}catch{t=null}if(_.logout(),sessionStorage.removeItem("gb_iam_sso_checked"),t){window.location.assign(t);return}l.push({name:"home"})}async function k(t=!1){const[e,b]=await Promise.allSettled([_.isLoggedIn?h.me({force:!0}):Promise.resolve(null),h.goldPrice({force:t})]);e.status==="fulfilled"?r.value=e.value:console.log(e.reason),S.value=b.status==="fulfilled"?b.value:null}async function M(){await k(!0),y.value=!1}let T=!1;q(()=>{T&&k(),T=!0});let F=!1;const z=w(F);function m(t){return{"--reveal-delay":`${t*xs}ms`}}return O(async()=>{await k(),!z.value&&(await G(),requestAnimationFrame(()=>{z.value=!0,F=!0}))}),(t,e)=>{const b=H("container");return f(),p("div",ss,[s("header",es,[s("div",as,[e[14]||(e[14]=s("span",{class:"dash__brand"},"میز کار",-1)),i(_).isLoggedIn?(f(),p("button",{key:0,type:"button",class:"dash__exit","aria-label":"خروج",onClick:e[0]||(e[0]=n=>u.notify=!0)},[a(o,{icon:"vuesax-linear:logout",size:"18"})])):D("",!0)])]),a(i(Z),{modelValue:y.value,"onUpdate:modelValue":e[10]||(e[10]=n=>y.value=n),onRefresh:M},{pulling:c(()=>[a(i(I),{size:"18"})]),loosing:c(()=>[a(i(I),{size:"18"})]),loading:c(()=>[a(i(I),{size:"18"})]),success:c(()=>[...e[15]||(e[15]=[s("span",null,null,-1)])]),default:c(()=>[a(b,{class:L(["dash__body",{"is-revealed":z.value}])},{default:c(()=>[r.value?(f(),p("section",{key:0,class:"dash__hero dash__reveal",style:x(m(0))},[s("div",os,[s("div",ts,[s("span",ns,v(r.value.fullName),1),s("span",ls,v(i(_).mobile),1)]),s("span",{class:L(["dash__heroSeal",g.value?"is-debtor":"is-creditor"])},v(g.value?"بدهکار":"بستانکار"),3)]),s("div",is,[s("span",rs,v(P.value),1),s("span",us,"گرم "+v(V.value),1)]),s("div",ds,[e[17]||(e[17]=s("span",null,"بدهی ریالی",-1)),s("b",null,[Y(v(i(X)(r.value.fiatDebtRial))+" ",1),e[16]||(e[16]=s("i",null,"ریال",-1))])])],4)):(f(),p("section",{key:1,class:"dash__invite dash__reveal",style:x(m(0))},[s("div",_s,[a(o,{icon:"vuesax-linear:security-user",size:"22",color:"#fff"})]),e[18]||(e[18]=s("h3",null,"حساب گرمی شما",-1)),e[19]||(e[19]=s("p",null,"برای دیدن موجودی، سفارش‌ها و اسناد خود وارد شوید.",-1)),s("button",{type:"button",class:"dash__in