e-scooter-rider-web/dist/assets/Profile-B4gpPCGr.js

2 lines
11 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{_ as T,r as i,i as H,o as k,c as _,a as t,t as a,b as s,w as o,e as J,B as O,k as m,d,C as D,E as b,u as L,g as r,F as E,j as z,n as P}from"./index-CZe38Ow-.js";const W={class:"profile-page"},q={class:"profile-header"},G={class:"avatar"},K={style:{width:"60px",height:"60px",background:"#E8F8EE","border-radius":"30px",display:"flex","align-items":"center","justify-content":"center","font-size":"26px"}},Q={class:"user-info"},X={class:"credit"},Y={style:{color:"#FF6B00","font-weight":"500"}},Z={class:"wallet-card"},ee={class:"wallet-main"},te={class:"balance"},le={class:"wallet-actions"},se={class:"stats-card"},ae={class:"stat-item"},oe={class:"value"},ne={class:"stat-item"},ie={class:"value"},de={class:"stat-item"},ue={class:"value"},re={class:"menu-list"},ve={class:"recharge-dialog"},pe={class:"amount-input"},me={class:"quick-amounts"},ge={class:"withdraw-dialog"},ce={class:"hint"},be={class:"transaction-list"},fe={class:"tx-info"},ye={class:"tx-type"},xe={class:"tx-date"},he={class:"settings-list"},we={class:"settings-item"},ke={class:"settings-item"},_e={class:"settings-item"},Be={__name:"Profile",setup(Ve){const S=L(),n=i(JSON.parse(localStorage.getItem("customer_info")||"{}")),g=i(!1),f=i(!1),x=i(!1),h=i(!1),$=i(!1),w=i(!1),v=i(100),u=i({amount:"",alipay:""}),y=i({notifications:!0,sound:!0}),U=()=>{b.success(`充值 ¥${v.value} 成功(演示)`),n.value.balance=(n.value.balance||0)+v.value,localStorage.setItem("customer_info",JSON.stringify(n.value)),g.value=!1},j=()=>{if(!u.value.amount||!u.value.alipay){b.warning("请填写完整信息");return}b.success("提现申请已提交(演示)"),f.value=!1},I=()=>{b.success("缓存已清除")},M=()=>{D.confirm("确定要退出登录吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{localStorage.removeItem("customer_token"),localStorage.removeItem("customer_info"),localStorage.removeItem("customer_id"),S.push("/login"),b.success("已退出登录")}).catch(()=>{})};return H(()=>{n.value=JSON.parse(localStorage.getItem("customer_info")||"{}")}),(N,e)=>{const B=d("el-tag"),p=d("el-button"),R=d("el-input-number"),c=d("el-dialog"),V=d("el-input"),F=d("el-form-item"),A=d("el-form"),C=d("el-switch");return k(),_("div",W,[t("div",q,[t("div",G,[t("div",K,a(n.value.name?.charAt(0)||"租"),1)]),t("div",Q,[t("h3",null,a(n.value.name||"加载中..."),1),t("p",null,"手机号:"+a(n.value.phone||"-"),1),t("div",X,[t("span",Y,"信用分:"+a(n.value.creditScore||100),1),s(B,{size:"small",type:"success",style:{"border-radius":"10px"}},{default:o(()=>[r(a(n.value.creditLevel||"优秀"),1)]),_:1})])]),s(p,{icon:J(O),text:"",onClick:e[0]||(e[0]=l=>h.value=!0),class:"settings-btn"},null,8,["icon"])]),t("div",Z,[t("div",ee,[e[18]||(e[18]=t("span",{class:"label"},"账户余额",-1)),t("span",te,"¥"+a(n.value.balance||0),1)]),t("div",le,[s(p,{type:"primary",size:"small",onClick:e[1]||(e[1]=l=>g.value=!0)},{default:o(()=>[...e[19]||(e[19]=[r("充值",-1)])]),_:1}),s(p,{size:"small",onClick:e[2]||(e[2]=l=>f.value=!0)},{default:o(()=>[...e[20]||(e[20]=[r("提现",-1)])]),_:1})])]),t("div",se,[t("div",ae,[t("span",oe,a(n.value.totalRentals||0),1),e[21]||(e[21]=t("span",{class:"label"},"租车次数",-1))]),e[24]||(e[24]=t("div",{class:"stat-divider"},null,-1)),t("div",ne,[t("span",ie,a(n.value.currentRentals||0),1),e[22]||(e[22]=t("span",{class:"label"},"当前在租",-1))]),e[25]||(e[25]=t("div",{class:"stat-divider"},null,-1)),t("div",de,[t("span",ue,"¥"+a(n.value.totalSpent||0),1),e[23]||(e[23]=t("span",{class:"label"},"累计消费",-1))])]),t("div",re,[t("div",{class:"menu-item",onClick:e[3]||(e[3]=l=>g.value=!0)},[...e[26]||(e[26]=[m('<div style="width:32px;height:32px;background:#E8F8EE;border-radius:8px;display:flex;align-items:center;justify-content:center;" data-v-599b9681><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#FF6B00" stroke-width="1.8" data-v-599b9681><rect x="1" y="4" width="22" height="16" rx="2" ry="2" data-v-599b9681></rect><line x1="1" y1="10" x2="23" y2="10" data-v-599b9681></line></svg></div><span data-v-599b9681>充值余额</span><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#B2B2B2" stroke-width="1.8" data-v-599b9681><polyline points="9 18 15 12 9 6" data-v-599b9681></polyline></svg>',3)])]),t("div",{class:"menu-item",onClick:e[4]||(e[4]=l=>x.value=!0)},[...e[27]||(e[27]=[m('<div style="width:32px;height:32px;background:#E8F0FF;border-radius:8px;display:flex;align-items:center;justify-content:center;" data-v-599b9681><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#576BFF" stroke-width="1.8" data-v-599b9681><path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z" data-v-599b9681></path><polyline points="14,2 14,8 20,8" data-v-599b9681></polyline><line x1="16" y1="13" x2="8" y2="13" data-v-599b9681></line><line x1="16" y1="17" x2="8" y2="17" data-v-599b9681></line></svg></div><span data-v-599b9681>交易记录</span><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#B2B2B2" stroke-width="1.8" data-v-599b9681><polyline points="9 18 15 12 9 6" data-v-599b9681></polyline></svg>',3)])]),t("div",{class:"menu-item",onClick:e[5]||(e[5]=l=>N.$router.push("/orders"))},[...e[28]||(e[28]=[m('<div style="width:32px;height:32px;background:#FFF4E0;border-radius:8px;display:flex;align-items:center;justify-content:center;" data-v-599b9681><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#FF8C00" stroke-width="1.8" data-v-599b9681><path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z" data-v-599b9681></path><polyline points="14,2 14,8 20,8" data-v-599b9681></polyline><line x1="16" y1="13" x2="8" y2="13" data-v-599b9681></line><line x1="16" y1="17" x2="8" y2="17" data-v-599b9681></line></svg></div><span data-v-599b9681>我的订单</span><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#B2B2B2" stroke-width="1.8" data-v-599b9681><polyline points="9 18 15 12 9 6" data-v-599b9681></polyline></svg>',3)])]),t("div",{class:"menu-item",onClick:e[6]||(e[6]=l=>$.value=!0)},[...e[29]||(e[29]=[m('<div style="width:32px;height:32px;background:#F0E8FF;border-radius:8px;display:flex;align-items:center;justify-content:center;" data-v-599b9681><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#722ed1" stroke-width="1.8" data-v-599b9681><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0118 0z" data-v-599b9681></path><circle cx="12" cy="10" r="3" data-v-599b9681></circle></svg></div><span data-v-599b9681>还车点</span><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#B2B2B2" stroke-width="1.8" data-v-599b9681><polyline points="9 18 15 12 9 6" data-v-599b9681></polyline></svg>',3)])]),t("div",{class:"menu-item",onClick:e[7]||(e[7]=l=>w.value=!0)},[...e[30]||(e[30]=[m('<div style="width:32px;height:32px;background:#F0F0F0;border-radius:8px;display:flex;align-items:center;justify-content:center;" data-v-599b9681><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#999" stroke-width="1.8" data-v-599b9681><circle cx="12" cy="12" r="10" data-v-599b9681></circle><line x1="12" y1="8" x2="12" y2="12" data-v-599b9681></line><line x1="12" y1="16" x2="12.01" y2="16" data-v-599b9681></line></svg></div><span data-v-599b9681>关于我们</span><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#B2B2B2" stroke-width="1.8" data-v-599b9681><polyline points="9 18 15 12 9 6" data-v-599b9681></polyline></svg>',3)])]),t("div",{class:"menu-item",onClick:M},[...e[31]||(e[31]=[m('<div style="width:32px;height:32px;background:#FFE8E8;border-radius:8px;display:flex;align-items:center;justify-content:center;" data-v-599b9681><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#FF4D4F" stroke-width="1.8" data-v-599b9681><path d="M9 21H5a2 2 0 01-2-2V5a2 2 0 012-2h4" data-v-599b9681></path><polyline points="16 17 21 12 16 7" data-v-599b9681></polyline><line x1="21" y1="12" x2="9" y2="12" data-v-599b9681></line></svg></div><span data-v-599b9681>退出登录</span><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#B2B2B2" stroke-width="1.8" data-v-599b9681><polyline points="9 18 15 12 9 6" data-v-599b9681></polyline></svg>',3)])])]),s(c,{modelValue:g.value,"onUpdate:modelValue":e[9]||(e[9]=l=>g.value=l),title:"充值余额",width:"85%",center:""},{default:o(()=>[t("div",ve,[t("div",pe,[e[32]||(e[32]=t("span",{class:"yuan"},"¥",-1)),s(R,{modelValue:v.value,"onUpdate:modelValue":e[8]||(e[8]=l=>v.value=l),min:10,max:1e4,step:10,size:"large"},null,8,["modelValue"])]),t("div",me,[(k(),_(E,null,z([50,100,200,500],l=>s(B,{key:l,effect:v.value===l?"dark":"plain",class:"amount-tag",onClick:Fe=>v.value=l},{default:o(()=>[r(" ¥"+a(l),1)]),_:2},1032,["effect","onClick"])),64))]),s(p,{type:"primary",size:"large",style:{width:"100%","margin-top":"16px"},onClick:U},{default:o(()=>[...e[33]||(e[33]=[r(" 确认充值 ",-1)])]),_:1})])]),_:1},8,["modelValue"]),s(c,{modelValue:f.value,"onUpdate:modelValue":e[12]||(e[12]=l=>f.value=l),title:"提现",width:"85%",center:""},{default:o(()=>[t("div",ge,[t("p",ce,"可提现金额:¥"+a(n.value.balance||0),1),s(A,{model:u.value,"label-position":"top"},{default:o(()=>[s(F,{label:"提现金额"},{default:o(()=>[s(V,{modelValue:u.value.amount,"onUpdate:modelValue":e[10]||(e[10]=l=>u.value.amount=l),placeholder:"请输入提现金额",size:"large"},null,8,["modelValue"])]),_:1}),s(F,{label:"支付宝账号"},{default:o(()=>[s(V,{modelValue:u.value.alipay,"onUpdate:modelValue":e[11]||(e[11]=l=>u.value.alipay=l),placeholder:"请输入支付宝账号",size:"large"},null,8,["modelValue"])]),_:1})]),_:1},8,["model"]),s(p,{type:"primary",size:"large",style:{width:"100%"},onClick:j},{default:o(()=>[...e[34]||(e[34]=[r(" 确认提现 ",-1)])]),_:1})])]),_:1},8,["modelValue"]),s(c,{modelValue:x.value,"onUpdate:modelValue":e[13]||(e[13]=l=>x.value=l),title:"交易记录",width:"90%"},{default:o(()=>[t("div",be,[(k(),_(E,null,z(5,l=>t("div",{class:"transaction-item",key:l},[t("div",fe,[t("span",ye,a(l%2===0?"消费":"充值"),1),t("span",xe,"2026-03-"+a(20-l),1)]),t("span",{class:P(["tx-amount",l%2===0?"expense":"income"])},a(l%2===0?"-":"+")+"¥"+a((Math.random()*100).toFixed(2)),3)])),64))])]),_:1},8,["modelValue"]),s(c,{modelValue:h.value,"onUpdate:modelValue":e[16]||(e[16]=l=>h.value=l),title:"设置",width:"90%"},{default:o(()=>[t("div",he,[t("div",we,[e[35]||(e[35]=t("span",null,"消息通知",-1)),s(C,{modelValue:y.value.notifications,"onUpdate:modelValue":e[14]||(e[14]=l=>y.value.notifications=l)},null,8,["modelValue"])]),t("div",ke,[e[36]||(e[36]=t("span",null,"声音提示",-1)),s(C,{modelValue:y.value.sound,"onUpdate:modelValue":e[15]||(e[15]=l=>y.value.sound=l)},null,8,["modelValue"])]),t("div",_e,[e[38]||(e[38]=t("span",null,"清除缓存",-1)),s(p,{size:"small",onClick:I},{default:o(()=>[...e[37]||(e[37]=[r("清除",-1)])]),_:1})])])]),_:1},8,["modelValue"]),s(c,{modelValue:w.value,"onUpdate:modelValue":e[17]||(e[17]=l=>w.value=l),title:"关于我们",width:"85%",center:""},{default:o(()=>[...e[39]||(e[39]=[t("div",{class:"about-content"},[t("div",{class:"app-logo"},"🛵"),t("h3",null,"电动车租赁平台"),t("p",null,"版本1.0.0"),t("p",{class:"desc"},"专业的电动车租赁服务,为您提供便捷的租车体验。")],-1)])]),_:1},8,["modelValue"])])}}},Ee=T(Be,[["__scopeId","data-v-599b9681"]]);export{Ee as default};