import{C as e,E as t,M as n,O as r,T as i,_ as a,a as o,g as s,h as c,k as l,l as u,m as d,s as f,v as p,x as m,y as h}from"./index-vhvNh9F8.js";var g={class:`page`},_={class:`user-header`},v={key:0,class:`user-avatar-wrap`},y={key:1,class:`user-name`},b={class:`order-grid`},x={class:`menu-card`},S={style:{padding:`20px 12px`}},C=f({__name:`User`,setup(f){let C=u(),w=r(localStorage.getItem(`token`)||``),T=r({});async function E(){if(w.value)try{let e=await o.get(`/user/info`,{headers:{Authorization:`Bearer `+w.value}});e.code===0&&(T.value=e.data||{})}catch{}}function D(){w.value=``,localStorage.removeItem(`token`),T.value={},C.push(`/`)}return m(()=>{E()}),(r,o)=>{let u=i(`van-button`);return e(),a(`div`,g,[d(`div`,_,[T.value.phone?(e(),a(`div`,v,[...o[11]||=[d(`svg`,{width:`32`,height:`32`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[d(`path`,{d:`M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2`}),d(`circle`,{cx:`12`,cy:`7`,r:`4`})],-1)]])):s(``,!0),T.value.phone?(e(),a(`div`,y,n(T.value.nickname||T.value.phone),1)):(e(),a(`div`,{key:2,class:`user-login-btn`,onClick:o[0]||=e=>l(C).push(`/login`)},[...o[12]||=[d(`svg`,{width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[d(`path`,{d:`M15 3h4a2 2 0 012 2v14a2 2 0 01-2 2h-4`}),d(`polyline`,{points:`10 17 15 12 10 7`}),d(`line`,{x1:`15`,y1:`12`,x2:`3`,y2:`12`})],-1),h(` 去登录 `,-1)]]))]),d(`div`,b,[d(`div`,{class:`order-item`,onClick:o[1]||=e=>l(C).push(`/orders`)},[...o[13]||=[d(`div`,{class:`order-icon`},`📄`,-1),d(`div`,{class:`order-label`},`待付款`,-1)]]),d(`div`,{class:`order-item`,onClick:o[2]||=e=>l(C).push(`/orders`)},[...o[14]||=[d(`div`,{class:`order-icon`},`📦`,-1),d(`div`,{class:`order-label`},`待发货`,-1)]]),d(`div`,{class:`order-item`,onClick:o[3]||=e=>l(C).push(`/orders`)},[...o[15]||=[d(`div`,{class:`order-icon`},`🚚`,-1),d(`div`,{class:`order-label`},`待收货`,-1)]]),d(`div`,{class:`order-item`,onClick:o[4]||=e=>l(C).push(`/orders`)},[...o[16]||=[d(`div`,{class:`order-icon`},`⭐`,-1),d(`div`,{class:`order-label`},`已完成`,-1)]])]),d(`div`,x,[d(`div`,{class:`menu-item`,onClick:o[5]||=e=>l(C).push(`/orders`)},[...o[17]||=[d(`span`,{class:`menu-text`},`我的订单`,-1),d(`span`,{class:`menu-arrow`},`›`,-1)]]),d(`div`,{class:`menu-item`,onClick:o[6]||=e=>l(C).push(`/recharge`)},[...o[18]||=[d(`span`,{class:`menu-text`},`💰 账户余额`,-1),d(`span`,{class:`menu-arrow`},`›`,-1)]]),o[23]||=p(`<div class="menu-item" data-v-2264621a><span class="menu-text" data-v-2264621a>我的地址</span><span class="menu-arrow" data-v-2264621a>›</span></div><div class="menu-item" data-v-2264621a><span class="menu-text" data-v-2264621a>我的收藏</span><span class="menu-arrow" data-v-2264621a>›</span></div>`,2),d(`div`,{class:`menu-item`,onClick:o[7]||=e=>l(C).push(`/my-bulk-group`)},[...o[19]||=[d(`span`,{class:`menu-text`},`🏷️ 我的团购`,-1),d(`span`,{class:`menu-arrow`},`›`,-1)]]),d(`div`,{class:`menu-item`,onClick:o[8]||=e=>l(C).push(`/my-presale`)},[...o[20]||=[d(`span`,{class:`menu-text`},`🕐 我的预售`,-1),d(`span`,{class:`menu-arrow`},`›`,-1)]]),d(`div`,{class:`menu-item`,onClick:o[9]||=e=>l(C).push(`/exchange`)},[...o[21]||=[d(`span`,{class:`menu-text`},`🎁 积分商城`,-1),d(`span`,{class:`menu-arrow`},`›`,-1)]]),d(`div`,{class:`menu-item`,onClick:o[10]||=e=>l(C).push(`/chat`),style:{"border-bottom":`none`}},[...o[22]||=[d(`span`,{class:`menu-text`},`在线客服`,-1),d(`span`,{class:`menu-arrow`},`›`,-1)]])]),d(`div`,S,[T.value.phone?(e(),c(u,{key:0,round:``,block:``,plain:``,onClick:D,style:{color:`var(--danger)`,"border-color":`var(--danger)`}},{default:t(()=>[...o[24]||=[h(`退出登录`,-1)]]),_:1})):s(``,!0)])])}}},[[`__scopeId`,`data-v-2264621a`]]);export{C as default};