Files
nademitex_user/dist/assets/ProfileView-BnfYcxhD.js
T

1 line
9.5 KiB
JavaScript
Raw Normal View History

import{A as e,Ct as t,E as n,Et as r,I as ee,L as i,M as a,N as o,O as s,P as c,R as l,St as u,Tt as d,Y as f,Z as p,_ as m,j as h,mt as g,n as te,q as ne,t as _,z as v}from"./BasicIcon-C6boaehV.js";import{o as y,r as re}from"./format-BHJptHdF.js";import{C as ie,c as ae,d as oe,o as se,r as ce,s as le,u as ue}from"./index-fdhs4HNc.js";import{r as b,t as x}from"./constants-DXXK14Zz.js";import{t as S}from"./PageSkeleton-sKuEY4NI.js";import{n as C,t as w}from"./crm-DmqasSZ_.js";var T=v({__name:`IconSettings`,props:{size:{default:24},strokeWidth:{default:1.5},color:{default:null}},setup(e){return(t,n)=>(f(),a(_,{icon:`vuesax-linear:setting-2`,size:e.size,"stroke-width":e.strokeWidth,color:e.color},null,8,[`size`,`stroke-width`,`color`]))}}),E={class:`page profile-page`},D={class:`page__scroll page__scroll--with-nav profile-scroll`},O={class:`hero`},k={class:`hero__pin`},A={class:`hero__top mobile-only`},j=[`aria-label`],M={class:`hero__meta`},N={class:`level-pill`},P={class:`hero__desk-actions desktop-only-flex`},F={class:`profile-sheet`},I={class:`panel`},L={class:`panel__head`},R={class:`panel__period`},z={class:`stats`},B={class:`stat-card`},V={class:`stat-card__text`},H={class:`stat-card__value`},U={class:`stat-card__icon stat-card__icon--orders`},de={class:`stat-card`},fe={class:`stat-card__text`},pe={class:`stat-card__value`},me={class:`stat-card__icon stat-card__icon--customers`},he={class:`stat-card`},ge={class:`stat-card__text`},_e={class:`stat-card__value`},ve={class:`stat-card__icon stat-card__icon--profit`},ye={class:`stat-card`},be={class:`stat-card__text`},xe={class:`stat-card__value`},Se={class:`stat-card__icon stat-card__icon--sales`},Ce={class:`loyalty`},we={class:`loyalty__row`},Te={class:`loyalty__text`},Ee={class:`loyalty__text-next`},De={class:`loyalty__bar`},Oe={class:`quick-section`},ke={class:`quick-grid`},Ae=[`onClick`],je={class:`quick-item__icon`},Me={class:`orders-box`},Ne={class:`section-head`},Pe=[`onClick`,`onKeydown`],Fe={class:`order-row__meta`},Ie={class:`order-row__date`},Le={class:`order-row__title`},Re={key:0,class:`order-row__customer`},ze={class:`price-section`},Be={class:`price-card`},Ve={class:`price-card__body`},He={class:`price-card__info`},W=te(v({__name:`MobileProfilePage`,setup(te){let v={id:`sample-base-price`,name:`پارچه فاستونی ایتالیایی`,code:`DF-1204`,categoryId:``,season:`all_season`,widthCm:160,composition:``,colors:[`1`,`2`,`3`,`4`,`5`,`6`],tags:[],isNew:!1,rollMeters:0,basePrice:38e4},W=m(),G=ae(),K=oe(),Ue=w(),q=ue(),J=g(null),Y=g(v),X=g(!1),We=[{label:`ثبت مشتری جدید`,to:`/customers`,icon:`vuesax-linear:add`},{label:`سفارش‌ها`,to:`/orders`,icon:`vuesax-linear:document-text`},{label:`مشتریان من`,to:`/customers`,icon:`vuesax-linear:people`},{label:`گزارش‌ها`,to:`/reminders`,icon:`vuesax-linear:chart-2`},{label:`درخواست کالیته`,to:`/catalog-request`,icon:`vuesax-linear:category`},{label:`قیمت‌گذاری`,to:`/categories`,icon:`vuesax-linear:money-4`}],Ge=e(()=>[...K.orders].sort((e,t)=>String(t.createdAt).localeCompare(String(e.createdAt))).slice(0,3).map(e=>{let t=b[e.status]??`info`,n=t===`danger`||t===`neutral`?`danger`:t===`success`?`success`:t===`warning`?`warning`:`info`;return{id:e.id,title:`سفارش #${e.orderNumber}`,date:e.createdAt?re(e.createdAt):``,customer:e.companyName||``,statusLabel:x[e.status]||e.status,statusTone:n}})),Z=e(()=>G.fullName||`کاربر`),Q=e(()=>J.value?.code||G.user?.agentCode||`—`),$=e(()=>J.value?.levelLabel||G.user?.levelLabel||`برنزی`),Ke=e(()=>J.value?.nextLevelLabel||G.user?.nextLevelLabel||`نقره‌ای`),qe=e(()=>J.value?.pointsToNext??G.user?.pointsToNext??0),Je=e(()=>J.value?.periodLabel||`۳۰ روز اخیر`),Ye=e(()=>J.value?.customersCount??0),Xe=e(()=>J.value?.ordersCount??K.orders.length),Ze=e(()=>J.value?.salesVolumeToman??0),Qe=e(()=>J.value?.profitToman??0),$e=e(()=>J.value?.levelProgress??G.user?.levelProgress??0),et=e(()=>q.unreadCount>9?`9+`:String(q.unreadCount)),tt=e(()=>Y.value.basePrice??v.basePrice??0);return ne(async()