e-scooter-rider-web/dist/assets/Profile-Dim3OacT.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{e as i,k as H,H as _,L as B,P as t,Z as a,M as s,O as o,u as O,aB as c,ag as d,az as T,Y as r,F as z,ab as E,R as J}from"./vendor-DeEI1rpK.js";import{s as L,d as P,a as g}from"./element-plus-pbz_d-qS.js";import{_ as D}from"./index-CxJCpQ-E.js";const W={class:"profile-page"},q={class:"profile-header"},Y={class:"avatar"},Z={style:{width:"60px",height:"60px",background:"#E8F8EE","border-radius":"30px",display:"flex","align-items":"center","justify-content":"center","font-size":"26px"}},G={class:"user-info"},K={class:"credit"},Q={style:{color:"#FF6B00","font-weight":"500"}},X={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"},ce={class:"quick-amounts"},fe={class:"withdraw-dialog"},me={class:"hint"},ge={class:"transaction-list"},ye={class:"tx-info"},xe={class:"tx-type"},he={class:"tx-date"},we={class:"settings-list"},ke={class:"settings-item"},_e={class:"settings-item"},Be={class:"settings-item"},Ve={__name:"Profile",setup(be){const S=T(),n=i(JSON.parse(localStorage.getItem("customer_info")||"{}")),f=i(!1),y=i(!1),h=i(!1),w=i(!1),$=i(!1),k=i(!1),v=i(100),u=i({amount:"",alipay:""}),x=i({notifications:!0,sound:!0}),U=()=>{g.success(`充值 ¥${v.value} 成功(演示)`),n.value.balance=(n.value.balance||0)+v.value,localStorage.setItem("customer_info",JSON.stringify(n.value)),f.value=!1},M=()=>{if(!u.value.amount||!u.value.alipay){g.warning("请填写完整信息");return}g.success("提现申请已提交(演示)"),y.value=!1},I=()=>{g.success("缓存已清除")},j=()=>{P.confirm("确定要退出登录吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{localStorage.removeItem("token"),localStorage.removeItem("riderInfo"),S.push("/login"),g.success("已退出登录")}).catch(()=>{})};return H(()=>{n.value=JSON.parse(localStorage.getItem("customer_info")||"{}")}),(N,e)=>{const V=d("el-tag"),p=d("el-button"),R=d("el-input-number"),m=d("el-dialog"),b=d("el-input"),F=d("el-form-item"),A=d("el-form"),C=d("el-switch");return _(),B("div",W,[t("div",q,[t("div",Y,[t("div",Z,a(n.value.name?.charAt(0)||"租"),1)]),t("div",G,[t("h3",null,a(n.value.name||"加载中..."),1),t("p",null,"手机号:"+a(n.value.phone||"-"),1),t("div",K,[t("span",Q,"信用分:"+a(n.value.creditScore||100),1),s(V,{size:"small",type:"success",style:{"border-radius":"10px"}},{default:o(()=>[r(a(n.value.creditLevel||"优秀"),1)]),_:1})])]),s(p,{icon:O(L),text:"",onClick:e[0]||(e[0]=l=>w.value=!0),class:"settings-btn"},null,8,["icon"])]),t("div",X,[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=>f.value=!0)},{default:o(()=>[...e[19]||(e[19]=[r("充值",-1)])]),_:1}),s(p,{size:"small",onClick:e[2]||(e[2]=l=>y.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=>f.value=!0)},[...e[26]||(e[26]=[c('<div style="width:32px;height:32px;background:#E8F8EE;border-radius:8px;display:flex;align-items:center;justify-content:center;" data-v-e9c0f515><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#FF6B00" stroke-width="1.8" data-v-e9c0f515><rect x="1" y="4" width="22" height="16" rx="2" ry="2" data-v-e9c0f515></rect><line x1="1" y1="10" x2="23" y2="10" data-v-e9c0f515></line></svg></div><span data-v-e9c0f515>充值余额</span><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#B2B2B2" stroke-width="1.8" data-v-e9c0f515><polyline points="9 18 15 12 9 6" data-v-e9c0f515></polyline></svg>',3)])]),t("div",{class:"menu-item",onClick:e[4]||(e[4]=l=>h.value=!0)},[...e[27]||(e[27]=[c('<div style="width:32px;height:32px;background:#E8F0FF;border-radius:8px;display:flex;align-items:center;justify-content:center;" data-v-e9c0f515><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#576BFF" stroke-width="1.8" data-v-e9c0f515><path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z" data-v-e9c0f515></path><polyline points="14,2 14,8 20,8" data-v-e9c0f515></polyline><line x1="16" y1="13" x2="8" y2="13" data-v-e9c0f515></line><line x1="16" y1="17" x2="8" y2="17" data-v-e9c0f515></line></svg></div><span data-v-e9c0f515>交易记录</span><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#B2B2B2" stroke-width="1.8" data-v-e9c0f515><polyline points="9 18 15 12 9 6" data-v-e9c0f515></polyline></svg>',3)])]),t("div",{class:"menu-item",onClick:e[5]||(e[5]=l=>N.$router.push("/orders"))},[...e[28]||(e[28]=[c('<div style="width:32px;height:32px;background:#FFF4E0;border-radius:8px;display:flex;align-items:center;justify-content:center;" data-v-e9c0f515><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#FF8C00" stroke-width="1.8" data-v-e9c0f515><path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z" data-v-e9c0f515></path><polyline points="14,2 14,8 20,8" data-v-e9c0f515></polyline><line x1="16" y1="13" x2="8" y2="13" data-v-e9c0f515></line><line x1="16" y1="17" x2="8" y2="17" data-v-e9c0f515></line></svg></div><span data-v-e9c0f515>我的订单</span><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#B2B2B2" stroke-width="1.8" data-v-e9c0f515><polyline points="9 18 15 12 9 6" data-v-e9c0f515></polyline></svg>',3)])]),t("div",{class:"menu-item",onClick:e[6]||(e[6]=l=>$.value=!0)},[...e[29]||(e[29]=[c('<div style="width:32px;height:32px;background:#F0E8FF;border-radius:8px;display:flex;align-items:center;justify-content:center;" data-v-e9c0f515><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#722ed1" stroke-width="1.8" data-v-e9c0f515><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0118 0z" data-v-e9c0f515></path><circle cx="12" cy="10" r="3" data-v-e9c0f515></circle></svg></div><span data-v-e9c0f515>还车点</span><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#B2B2B2" stroke-width="1.8" data-v-e9c0f515><polyline points="9 18 15 12 9 6" data-v-e9c0f515></polyline></svg>',3)])]),t("div",{class:"menu-item",onClick:e[7]||(e[7]=l=>k.value=!0)},[...e[30]||(e[30]=[c('<div style="width:32px;height:32px;background:#F0F0F0;border-radius:8px;display:flex;align-items:center;justify-content:center;" data-v-e9c0f515><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#999" stroke-width="1.8" data-v-e9c0f515><circle cx="12" cy="12" r="10" data-v-e9c0f515></circle><line x1="12" y1="8" x2="12" y2="12" data-v-e9c0f515></line><line x1="12" y1="16" x2="12.01" y2="16" data-v-e9c0f515></line></svg></div><span data-v-e9c0f515>关于我们</span><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#B2B2B2" stroke-width="1.8" data-v-e9c0f515><polyline points="9 18 15 12 9 6" data-v-e9c0f515></polyline></svg>',3)])]),t("div",{class:"menu-item",onClick:j},[...e[31]||(e[31]=[c('<div style="width:32px;height:32px;background:#FFE8E8;border-radius:8px;display:flex;align-items:center;justify-content:center;" data-v-e9c0f515><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="#FF4D4F" stroke-width="1.8" data-v-e9c0f515><path d="M9 21H5a2 2 0 01-2-2V5a2 2 0 012-2h4" data-v-e9c0f515></path><polyline points="16 17 21 12 16 7" data-v-e9c0f515></polyline><line x1="21" y1="12" x2="9" y2="12" data-v-e9c0f515></line></svg></div><span data-v-e9c0f515>退出登录</span><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="#B2B2B2" stroke-width="1.8" data-v-e9c0f515><polyline points="9 18 15 12 9 6" data-v-e9c0f515></polyline></svg>',3)])])]),s(m,{modelValue:f.value,"onUpdate:modelValue":e[9]||(e[9]=l=>f.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",ce,[(_(),B(z,null,E([50,100,200,500],l=>s(V,{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(m,{modelValue:y.value,"onUpdate:modelValue":e[12]||(e[12]=l=>y.value=l),title:"提现",width:"85%",center:""},{default:o(()=>[t("div",fe,[t("p",me,"可提现金额:¥"+a(n.value.balance||0),1),s(A,{model:u.value,"label-position":"top"},{default:o(()=>[s(F,{label:"提现金额"},{default:o(()=>[s(b,{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(b,{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:M},{default:o(()=>[...e[34]||(e[34]=[r(" 确认提现 ",-1)])]),_:1})])]),_:1},8,["modelValue"]),s(m,{modelValue:h.value,"onUpdate:modelValue":e[13]||(e[13]=l=>h.value=l),title:"交易记录",width:"90%"},{default:o(()=>[t("div",ge,[(_(),B(z,null,E(5,l=>t("div",{class:"transaction-item",key:l},[t("div",ye,[t("span",xe,a(l%2===0?"消费":"充值"),1),t("span",he,"2026-03-"+a(20-l),1)]),t("span",{class:J(["tx-amount",l%2===0?"expense":"income"])},a(l%2===0?"-":"+")+"¥"+a((Math.random()*100).toFixed(2)),3)])),64))])]),_:1},8,["modelValue"]),s(m,{modelValue:w.value,"onUpdate:modelValue":e[16]||(e[16]=l=>w.value=l),title:"设置",width:"90%"},{default:o(()=>[t("div",we,[t("div",ke,[e[35]||(e[35]=t("span",null,"消息通知",-1)),s(C,{modelValue:x.value.notifications,"onUpdate:modelValue":e[14]||(e[14]=l=>x.value.notifications=l)},null,8,["modelValue"])]),t("div",_e,[e[36]||(e[36]=t("span",null,"声音提示",-1)),s(C,{modelValue:x.value.sound,"onUpdate:modelValue":e[15]||(e[15]=l=>x.value.sound=l)},null,8,["modelValue"])]),t("div",Be,[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(m,{modelValue:k.value,"onUpdate:modelValue":e[17]||(e[17]=l=>k.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"])])}}},Se=D(Ve,[["__scopeId","data-v-e9c0f515"]]);export{Se as default};