var e=Object.defineProperty,t=Object.defineProperties,o=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,n=(t,o,r)=>o in t?e(t,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[o]=r,l=(e,t)=>{for(var o in t||(t={}))a.call(t,o)&&n(e,o,t[o]);if(r)for(var o of r(t))s.call(t,o)&&n(e,o,t[o]);return e},i=(e,t,o)=>new Promise((r,a)=>{var s=e=>{try{l(o.next(e))}catch(t){a(t)}},n=e=>{try{l(o.throw(e))}catch(t){a(t)}},l=e=>e.done?r(e.value):Promise.resolve(e.value).then(s,n);l((o=o.apply(e,t)).next())});import{q as d,by as u,bD as m,r as c,c as _,R as b,D as p,v as y}from"./vendor-core-DQkwEQyE.js";import f from"./mobile-CKlCc0VO.js";import{a as v,u as g,a3 as h,a2 as N}from"./index-DITu3gCO.js";import"./vendor-element-CbJWrKZ5.js";import"./shopQualification-ojUd51Fq.js";import"./format-BSrYeaol.js";const j=d({__name:"index",setup(e){const r=u(),{t:a}=m(),s=v(),n=g(),d=c(!1),j=c({balance:0,total_sales:0,total_orders:0,today_sales:0,today_profit:0,today_orders:0,today_total_orders:0,today_complaints:0,sold_cards:0,stock_cards:0,stock_warning:0,complaints:0,to_ship:0,frozen_balance:0,frozen_amount:0,settlement_total:0,settled_amount:0,today_visitors:0,visitors:0,announcements:[],update_time:""}),w=_(()=>{const e=s.getUserInfo||{},t=e.userName||e.nickName||e.username||a("user.dashboard.user"),o=(new Date).getHours();return o<6?`${a("user.dashboard.goodNight")}，${t}！`:o<12?`${a("user.dashboard.goodMorning")}，${t}！`:o<18?`${a("user.dashboard.goodAfternoon")}，${t}！`:o<22?`${a("user.dashboard.goodEvening")}，${t}！`:`${a("user.dashboard.goodNight")}，${t}！`}),$=()=>i(null,null,function*(){try{const e=yield N();if(null==e?void 0:e.slug){const t=n.siteConfig.shop_link_prefix||"s",{href:o}=r.resolve({path:`/${t}/${e.slug}`});return void window.open(o,"_blank")}}catch(e){}r.push("/user/shop/setting")});return b(()=>i(null,null,function*(){d.value=!0;try{const a=yield h();a&&(j.value=(e=l(l({},j.value),a),r={balance:Number(a.balance||0),total_sales:Number(a.total_sales||0),total_orders:Number(a.total_orders||0),today_sales:Number(a.today_sales||0),today_profit:Number(a.today_profit||0),today_orders:Number(a.today_orders||0),today_total_orders:Number(a.today_total_orders||a.today_orders||0),today_complaints:Number(a.today_complaints||0),sold_cards:Number(a.sold_cards||0),stock_cards:Number(a.stock_cards||0),stock_warning:Number(a.stock_warning||0),complaints:Number(a.complaints||0),to_ship:Number(a.to_ship||0),frozen_balance:Number(a.frozen_balance||0),frozen_amount:Number(a.frozen_amount||0),settlement_total:Number(a.settlement_total||0),settled_amount:Number(a.settled_amount||0),today_visitors:Number(a.today_visitors||0),visitors:Number(a.visitors||0),announcements:Array.isArray(a.announcements)?a.announcements:[]},t(e,o(r))))}catch(a){}finally{d.value=!1}var e,r})),(e,t)=>(y(),p(f,{stats:j.value,greeting:w.value,"open-shop":$,loading:d.value},null,8,["stats","greeting","loading"]))}});export{j as default};
