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

2 lines
7.4 KiB
JavaScript
Raw Normal View History

import{d as E,E as F,o as M,q as P,c,b as s,u as n,l as t,e as I,s as l,g as h,B as U,p as $,f,i as N,n as b,t as p,D as T,I as o,F as q,L as C,x as B,h as k,v as G,_ as j}from"./index-l-_Vq2SS.js";import{R as W}from"./RateStrip-C8jZXpHf.js";import{_ as L}from"./DialogVant.vue_vue_type_style_index_0_lang-BjHJx5gQ.js";import{l as H}from"./dialogEmpty1-Caw7F5KL.js";import{p as J}from"./filters-CLL9nGZ2.js";import{P as K}from"./index-CY8Sc0iT.js";import"./_commonjsHelpers-Cpj98o6Y.js";const Q="/assets/dialogEmpty5-DWebUDaI.svg",X={class:"dash"},Y={class:"dash__bar"},Z={class:"dash__barInner"},ss={class:"dash__heroTop"},es={class:"dash__heroIdentity"},ts={class:"dash__heroName"},as={class:"dash__heroMobile"},os={class:"dash__heroFigure"},ns={class:"dash__heroNum"},ls={class:"dash__heroUnit"},is={class:"dash__heroDebt"},rs={class:"dash__inviteIcon","aria-hidden":"true"},us={class:"dash__rowIcon","aria-hidden":"true"},ds={class:"dash__rowIcon","aria-hidden":"true"},_s={class:"dash__rowIcon","aria-hidden":"true"},vs={class:"dash__rowIcon","aria-hidden":"true"},ps={class:"dash__rowIcon","aria-hidden":"true"},cs={class:"dash__rowIcon","aria-hidden":"true"},fs=["src"],ms=["src"],hs=70,bs=E({__name:"DashboardView",setup(ys){const i=B(),_=F(),d=h(null),y=h(null),g=h(!1),x=k(()=>d.value?parseFloat(d.value.goldDebtGrams)>0:!1),V=k(()=>x.value?"بدهکار":"بستانکار"),S=k(()=>d.value?Math.abs(parseFloat(d.value.goldDebtGrams)):0),r=U({notify:!1,loginNotify:!1});function v(u){if(!_.isLoggedIn){r.loginNotify=!0;return}u===0&&i.push({name:"ordersList"}),u===1&&i.push({name:"transactionsList"}),u===2&&i.push({name:"profileData"}),u===3&&i.push({name:"favoritesList"}),u===4&&i.push({name:"ChildOrder"}),u===5&&i.push({name:"customerChoice"})}function A(){_.logout(),r.notify=!1,i.push({name:"home"})}async function z(){_.isLoggedIn&&(d.value=await $.getMe());try{y.value=await $.getLatestGoldPrice()}catch{y.value=null}}async function O(){await z(),g.value=!1}let D=!1;const w=h(D);function m(u){return{"--reveal-delay":`${u*hs}ms`}}return M(async()=>{await z(),!w.value&&(await P(),requestAnimationFrame(()=>{w.value=!0,D=!0}))}),(u,e)=>{const R=G("container");return f(),c("div",X,[s("header",Y,[s("div",Z,[e[14]||(e[14]=s("span",{class:"dash__brand"},"میز کار",-1)),n(_).isLoggedIn?(f(),c("button",{key:0,type:"button",class:"dash__exit","aria-label":"خروج",onClick:e[0]||(e[0]=a=>r.notify=!0)},[t(o,{icon:"vuesax-linear:logout",size:"18"})])):I("",!0)])]),t(n(K),{modelValue:g.value,"onUpdate:modelValue":e[8]||(e[8]=a=>g.value=a),onRefresh:O},{pulling:l(()=>[t(n(C),{size:"18"})]),loosing:l(()=>[t(n(C),{size:"18"})]),loading:l(()=>[t(n(C),{size:"18"})]),success:l(()=>[...e[15]||(e[15]=[s("span",null,null,-1)])]),default:l(()=>[t(R,{class:N(["dash__body",{"is-revealed":w.value}])},{default:l(()=>[d.value?(f(),c("section",{key:0,class:"dash__hero dash__reveal",style:b(m(0))},[s("div",ss,[s("div",es,[s("span",ts,p(d.value.fullName),1),s("span",as,p(n(_).mobile),1)]),s("span",{class:N(["dash__heroSeal",x.value?"is-debtor":"is-creditor"])},p(x.value?"بدهکار":"بستانکار"),3)]),s("div",os,[s("span",ns,p(S.value),1),s("span",ls,"گرم "+p(V.value),1)]),s("div",is,[e[17]||(e[17]=s("span",null,"بدهی ریالی",-1)),s("b",null,[T(p(n(J)(d.value.fiatDebtRial))+" ",1),e[16]||(e[16]=s("i",null,"ریال",-1))])])],4)):(f(),c("section",{key:1,class:"dash__invite dash__reveal",style:b(m(0))},[s("div",rs,[t(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__inviteCta",onClick:e[1]||(e[1]=a=>n(i).push({name:"login"}))}," ورود / ثبت‌نام ")],4)),s("section",{class:"dash__rows dash__reveal",style:b(m(1))},[s("button",{type:"button",class:"dash__row",onClick:e[2]||(e[2]=a=>v(0))},[s("span",us,[t(o,{icon:"vuesax-linear:box",size:"18"})]),e[20]||(e[20]=s("span",{class:"dash__rowText"},[s("b",null