更新骑手端 (2026-04-01)
This commit is contained in:
parent
98f8d4669d
commit
a3d0650b46
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1 @@
|
|||
.login-page[data-v-9b312d7e]{min-height:100vh;background:#f7f7f7;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:20px}.login-header[data-v-9b312d7e]{text-align:center;color:#1a1a1a;margin-bottom:40px}.logo[data-v-9b312d7e]{font-size:64px;margin-bottom:10px}.login-header h1[data-v-9b312d7e]{font-size:28px;margin-bottom:8px;font-weight:600;color:#1a1a1a}.login-header p[data-v-9b312d7e]{font-size:13px;color:#b2b2b2}.login-form[data-v-9b312d7e]{width:100%;max-width:360px;background:#fff;border-radius:16px;padding:30px;box-shadow:0 2px 12px #0000000f}.login-form[data-v-9b312d7e] .el-input__wrapper{border-radius:12px}.login-btn[data-v-9b312d7e]{width:100%;background:#ff6b00;border-color:#ff6b00;font-size:18px;border-radius:12px;margin-top:20px;height:48px}.demo-hint[data-v-9b312d7e]{text-align:center;color:#b2b2b2;font-size:12px;margin-top:20px}
|
||||
|
|
@ -1 +0,0 @@
|
|||
.login-page[data-v-73cdf8aa]{min-height:100vh;background:#f7f7f7;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:20px}.login-header[data-v-73cdf8aa]{text-align:center;color:#1a1a1a;margin-bottom:40px}.logo[data-v-73cdf8aa]{font-size:64px;margin-bottom:10px}.login-header h1[data-v-73cdf8aa]{font-size:28px;margin-bottom:8px;font-weight:600;color:#1a1a1a}.login-header p[data-v-73cdf8aa]{font-size:13px;color:#b2b2b2}.login-form[data-v-73cdf8aa]{width:100%;max-width:360px;background:#fff;border-radius:16px;padding:30px;box-shadow:0 2px 12px #0000000f}.login-form[data-v-73cdf8aa] .el-input__wrapper{border-radius:12px}.login-btn[data-v-73cdf8aa]{width:100%;background:#ff6b00;border-color:#ff6b00;font-size:18px;border-radius:12px;margin-top:20px;height:48px}.demo-hint[data-v-73cdf8aa]{text-align:center;color:#b2b2b2;font-size:12px;margin-top:20px}
|
||||
|
|
@ -0,0 +1 @@
|
|||
import{H as V,L as k,P as s,M as a,O as r,e as u,ag as l,az as y,u as f,Y as b}from"./vendor-DeEI1rpK.js";import{u as h,l as I,a as d}from"./element-plus-pbz_d-qS.js";import{r as L}from"./request-BEmSsgoM.js";import{_ as N}from"./index-CxJCpQ-E.js";const q={class:"login-page"},z={class:"login-form"},B={__name:"Login",setup(C){const c=y(),t=u(!1),i=u(null),o=u({username:"",password:""}),g={username:[{required:!0,message:"请输入账号",trigger:"blur"}],password:[{required:!0,message:"请输入密码",trigger:"blur"}]},_=async()=>{if(await i.value.validate().catch(()=>!1)){t.value=!0;try{const e=await L.post("/auth/login",{username:o.value.username.trim(),password:o.value.password.trim()});e.success&&e.data&&e.data.token?(localStorage.setItem("token",e.data.token),localStorage.setItem("riderInfo",JSON.stringify(e.data)),d.success("登录成功"),c.push("/")):d.error(e.message||"登录失败")}catch(e){d.error(e.response?.data?.message||"登录失败,请检查账号密码")}finally{t.value=!1}}};return(v,e)=>{const m=l("el-input"),p=l("el-form-item"),w=l("el-form"),x=l("el-button");return V(),k("div",q,[e[4]||(e[4]=s("div",{class:"login-header"},[s("div",{class:"logo"},"🛵"),s("h1",null,"电动车租赁"),s("p",null,"骑手端")],-1)),s("div",z,[a(w,{ref_key:"formRef",ref:i,model:o.value,rules:g,size:"large"},{default:r(()=>[a(p,{prop:"username"},{default:r(()=>[a(m,{modelValue:o.value.username,"onUpdate:modelValue":e[0]||(e[0]=n=>o.value.username=n),placeholder:"请输入账号","prefix-icon":f(h)},null,8,["modelValue","prefix-icon"])]),_:1}),a(p,{prop:"password"},{default:r(()=>[a(m,{modelValue:o.value.password,"onUpdate:modelValue":e[1]||(e[1]=n=>o.value.password=n),type:"password",placeholder:"请输入密码","prefix-icon":f(I),"show-password":""},null,8,["modelValue","prefix-icon"])]),_:1})]),_:1},8,["model"]),a(x,{type:"primary",size:"large",loading:t.value,class:"login-btn",onClick:_},{default:r(()=>[...e[2]||(e[2]=[b(" 登录 ",-1)])]),_:1},8,["loading"]),e[3]||(e[3]=s("div",{class:"demo-hint"},[s("p",null,"演示账号:rider_demo / demo123")],-1))])])}}},O=N(B,[["__scopeId","data-v-9b312d7e"]]);export{O as default};
|
||||
|
|
@ -1 +0,0 @@
|
|||
import{_ as V,o as k,c as y,a as s,b as a,w as l,r as u,d as r,u as b,e as c,f as h,l as I,g as N,E as d}from"./index-CZe38Ow-.js";import{r as q}from"./request-DftRczcY.js";const B={class:"login-page"},C={class:"login-form"},E={__name:"Login",setup(L){const f=b(),t=u(!1),i=u(null),o=u({username:"",password:""}),g={username:[{required:!0,message:"请输入账号",trigger:"blur"}],password:[{required:!0,message:"请输入密码",trigger:"blur"}]},_=async()=>{if(await i.value.validate().catch(()=>!1)){t.value=!0;try{const e=await q.post("/auth/login",{username:o.value.username,password:o.value.password});e.success&&e.data&&e.data.token?(localStorage.setItem("token",e.data.token),localStorage.setItem("riderInfo",JSON.stringify(e.data)),d.success("登录成功"),f.push("/")):d.error(e.message||"登录失败")}catch(e){d.error(e.response?.data?.message||"登录失败,请检查账号密码")}finally{t.value=!1}}};return(v,e)=>{const m=r("el-input"),p=r("el-form-item"),w=r("el-form"),x=r("el-button");return k(),y("div",B,[e[4]||(e[4]=s("div",{class:"login-header"},[s("div",{class:"logo"},"🛵"),s("h1",null,"电动车租赁"),s("p",null,"骑手端")],-1)),s("div",C,[a(w,{ref_key:"formRef",ref:i,model:o.value,rules:g,size:"large"},{default:l(()=>[a(p,{prop:"username"},{default:l(()=>[a(m,{modelValue:o.value.username,"onUpdate:modelValue":e[0]||(e[0]=n=>o.value.username=n),placeholder:"请输入账号","prefix-icon":c(h)},null,8,["modelValue","prefix-icon"])]),_:1}),a(p,{prop:"password"},{default:l(()=>[a(m,{modelValue:o.value.password,"onUpdate:modelValue":e[1]||(e[1]=n=>o.value.password=n),type:"password",placeholder:"请输入密码","prefix-icon":c(I),"show-password":""},null,8,["modelValue","prefix-icon"])]),_:1})]),_:1},8,["model"]),a(x,{type:"primary",size:"large",loading:t.value,class:"login-btn",onClick:_},{default:l(()=>[...e[2]||(e[2]=[N(" 登录 ",-1)])]),_:1},8,["loading"]),e[3]||(e[3]=s("div",{class:"demo-hint"},[s("p",null,"演示账号:rider_demo / demo123")],-1))])])}}},z=V(E,[["__scopeId","data-v-73cdf8aa"]]);export{z as default};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1 @@
|
|||
.profile-page[data-v-e9c0f515]{min-height:100vh;background:#f7f7f7;padding-bottom:20px}.profile-header[data-v-e9c0f515]{background:#fff;padding:20px 16px;display:flex;align-items:center;gap:14px;position:relative;border-bottom:.5px solid rgba(0,0,0,.06)}.avatar[data-v-e9c0f515]{flex-shrink:0}.user-info[data-v-e9c0f515]{flex:1}.user-info h3[data-v-e9c0f515]{margin:0 0 4px;font-size:18px;font-weight:600;color:#1a1a1a}.user-info p[data-v-e9c0f515]{margin:0 0 6px;font-size:13px;color:#b2b2b2}.credit[data-v-e9c0f515]{display:flex;align-items:center;gap:8px;font-size:12px}.settings-btn[data-v-e9c0f515]{position:absolute;top:16px;right:16px;color:#b2b2b2!important}.wallet-card[data-v-e9c0f515]{background:#fff;margin:12px;border-radius:16px;padding:16px}.wallet-main[data-v-e9c0f515]{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:12px}.wallet-main .label[data-v-e9c0f515]{color:#b2b2b2;font-size:13px}.wallet-main .balance[data-v-e9c0f515]{color:#ff6b00;font-size:28px;font-weight:700}.wallet-actions[data-v-e9c0f515]{display:flex;gap:12px}.wallet-actions .el-button[data-v-e9c0f515]:first-child{flex:1;background:#ff6b00;border-color:#ff6b00;border-radius:12px}.wallet-actions .el-button[data-v-e9c0f515]:last-child{border-radius:12px}.stats-card[data-v-e9c0f515]{background:#fff;margin:0 12px;border-radius:16px;padding:16px;display:flex;justify-content:space-around;align-items:center}.stat-item[data-v-e9c0f515]{text-align:center}.stat-item .value[data-v-e9c0f515]{display:block;font-size:20px;font-weight:700;color:#1a1a1a}.stat-item .label[data-v-e9c0f515]{font-size:10px;color:#b2b2b2;margin-top:4px}.stat-divider[data-v-e9c0f515]{width:.5px;height:40px;background:#f0f0f0}.menu-list[data-v-e9c0f515]{background:#fff;margin:12px;border-radius:16px;overflow:hidden}.menu-item[data-v-e9c0f515]{display:flex;align-items:center;padding:14px 16px;cursor:pointer;transition:background .2s}.menu-item[data-v-e9c0f515]:active{background:#f7f7f7}.menu-item span[data-v-e9c0f515]{flex:1;margin-left:12px;font-size:15px;color:#1a1a1a}.menu-item .el-icon[data-v-e9c0f515]:last-child{color:#b2b2b2}.recharge-dialog[data-v-e9c0f515]{padding:10px 0}.amount-input[data-v-e9c0f515]{display:flex;align-items:center;gap:8px;margin-bottom:16px}.amount-input .yuan[data-v-e9c0f515]{font-size:24px;color:#1a1a1a}.quick-amounts[data-v-e9c0f515]{display:flex;gap:10px;justify-content:center}.amount-tag[data-v-e9c0f515]{cursor:pointer;padding:8px 16px}.withdraw-dialog[data-v-e9c0f515]{padding:10px 0}.withdraw-dialog .hint[data-v-e9c0f515]{text-align:center;color:#b2b2b2;margin-bottom:16px}.transaction-list[data-v-e9c0f515]{max-height:400px;overflow-y:auto}.transaction-item[data-v-e9c0f515]{display:flex;justify-content:space-between;align-items:center;padding:12px 0;border-bottom:.5px solid #F0F0F0}.tx-type[data-v-e9c0f515]{display:block;font-size:14px;color:#1a1a1a}.tx-date[data-v-e9c0f515]{font-size:11px;color:#b2b2b2}.tx-amount[data-v-e9c0f515]{font-size:16px;font-weight:600}.tx-amount.expense[data-v-e9c0f515]{color:#1a1a1a}.tx-amount.income[data-v-e9c0f515]{color:#ff6b00}.settings-list[data-v-e9c0f515]{padding:10px 0}.settings-item[data-v-e9c0f515]{display:flex;justify-content:space-between;align-items:center;padding:12px 0;border-bottom:.5px solid #F0F0F0}.about-content[data-v-e9c0f515]{text-align:center;padding:20px 0}.app-logo[data-v-e9c0f515]{font-size:64px;margin-bottom:12px}.about-content h3[data-v-e9c0f515]{margin:0 0 8px;color:#1a1a1a}.about-content p[data-v-e9c0f515]{margin:0 0 4px;color:#b2b2b2}.about-content .desc[data-v-e9c0f515]{margin-top:12px;font-size:13px}
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1 +0,0 @@
|
|||
.profile-page[data-v-599b9681]{min-height:100vh;background:#f7f7f7;padding-bottom:20px}.profile-header[data-v-599b9681]{background:#fff;padding:20px 16px;display:flex;align-items:center;gap:14px;position:relative;border-bottom:.5px solid rgba(0,0,0,.06)}.avatar[data-v-599b9681]{flex-shrink:0}.user-info[data-v-599b9681]{flex:1}.user-info h3[data-v-599b9681]{margin:0 0 4px;font-size:18px;font-weight:600;color:#1a1a1a}.user-info p[data-v-599b9681]{margin:0 0 6px;font-size:13px;color:#b2b2b2}.credit[data-v-599b9681]{display:flex;align-items:center;gap:8px;font-size:12px}.settings-btn[data-v-599b9681]{position:absolute;top:16px;right:16px;color:#b2b2b2!important}.wallet-card[data-v-599b9681]{background:#fff;margin:12px;border-radius:16px;padding:16px}.wallet-main[data-v-599b9681]{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:12px}.wallet-main .label[data-v-599b9681]{color:#b2b2b2;font-size:13px}.wallet-main .balance[data-v-599b9681]{color:#ff6b00;font-size:28px;font-weight:700}.wallet-actions[data-v-599b9681]{display:flex;gap:12px}.wallet-actions .el-button[data-v-599b9681]:first-child{flex:1;background:#ff6b00;border-color:#ff6b00;border-radius:12px}.wallet-actions .el-button[data-v-599b9681]:last-child{border-radius:12px}.stats-card[data-v-599b9681]{background:#fff;margin:0 12px;border-radius:16px;padding:16px;display:flex;justify-content:space-around;align-items:center}.stat-item[data-v-599b9681]{text-align:center}.stat-item .value[data-v-599b9681]{display:block;font-size:20px;font-weight:700;color:#1a1a1a}.stat-item .label[data-v-599b9681]{font-size:10px;color:#b2b2b2;margin-top:4px}.stat-divider[data-v-599b9681]{width:.5px;height:40px;background:#f0f0f0}.menu-list[data-v-599b9681]{background:#fff;margin:12px;border-radius:16px;overflow:hidden}.menu-item[data-v-599b9681]{display:flex;align-items:center;padding:14px 16px;cursor:pointer;transition:background .2s}.menu-item[data-v-599b9681]:active{background:#f7f7f7}.menu-item span[data-v-599b9681]{flex:1;margin-left:12px;font-size:15px;color:#1a1a1a}.menu-item .el-icon[data-v-599b9681]:last-child{color:#b2b2b2}.recharge-dialog[data-v-599b9681]{padding:10px 0}.amount-input[data-v-599b9681]{display:flex;align-items:center;gap:8px;margin-bottom:16px}.amount-input .yuan[data-v-599b9681]{font-size:24px;color:#1a1a1a}.quick-amounts[data-v-599b9681]{display:flex;gap:10px;justify-content:center}.amount-tag[data-v-599b9681]{cursor:pointer;padding:8px 16px}.withdraw-dialog[data-v-599b9681]{padding:10px 0}.withdraw-dialog .hint[data-v-599b9681]{text-align:center;color:#b2b2b2;margin-bottom:16px}.transaction-list[data-v-599b9681]{max-height:400px;overflow-y:auto}.transaction-item[data-v-599b9681]{display:flex;justify-content:space-between;align-items:center;padding:12px 0;border-bottom:.5px solid #F0F0F0}.tx-type[data-v-599b9681]{display:block;font-size:14px;color:#1a1a1a}.tx-date[data-v-599b9681]{font-size:11px;color:#b2b2b2}.tx-amount[data-v-599b9681]{font-size:16px;font-weight:600}.tx-amount.expense[data-v-599b9681]{color:#1a1a1a}.tx-amount.income[data-v-599b9681]{color:#ff6b00}.settings-list[data-v-599b9681]{padding:10px 0}.settings-item[data-v-599b9681]{display:flex;justify-content:space-between;align-items:center;padding:12px 0;border-bottom:.5px solid #F0F0F0}.about-content[data-v-599b9681]{text-align:center;padding:20px 0}.app-logo[data-v-599b9681]{font-size:64px;margin-bottom:12px}.about-content h3[data-v-599b9681]{margin:0 0 8px;color:#1a1a1a}.about-content p[data-v-599b9681]{margin:0 0 4px;color:#b2b2b2}.about-content .desc[data-v-599b9681]{margin-top:12px;font-size:13px}
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1 +0,0 @@
|
|||
import{o as d,c as v,a as t,b as e,w as i,n as l,e as r,h,d as n}from"./index-CZe38Ow-.js";const p={class:"tab-layout"},b={class:"tab-content"},u={class:"tab-bar"},y={__name:"TabLayout",setup(w){const o=h();return(x,s)=>{const c=n("router-view"),a=n("router-link");return d(),v("div",p,[t("div",b,[e(c)]),t("div",u,[e(a,{to:"/",class:l(["tab-item",{active:r(o).path==="/"}])},{default:i(()=>[...s[0]||(s[0]=[t("div",{class:"tab-icon"},[t("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8"},[t("path",{d:"M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2z"}),t("polyline",{points:"9,22 9,12 15,12 15,22"})])],-1),t("div",{class:"tab-label"},"首页",-1)])]),_:1},8,["class"]),e(a,{to:"/vehicles",class:l(["tab-item",{active:r(o).path.startsWith("/vehicles")}])},{default:i(()=>[...s[1]||(s[1]=[t("div",{class:"tab-icon"},[t("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8"},[t("rect",{x:"1",y:"3",width:"15",height:"13",rx:"2",ry:"2"}),t("polygon",{points:"16,8 20,8 23,11 23,16 16,16 16,8"}),t("circle",{cx:"5.5",cy:"18.5",r:"2.5"}),t("circle",{cx:"18.5",cy:"18.5",r:"2.5"})])],-1),t("div",{class:"tab-label"},"租车",-1)])]),_:1},8,["class"]),e(a,{to:"/orders",class:l(["tab-item",{active:r(o).path.startsWith("/orders")}])},{default:i(()=>[...s[2]||(s[2]=[t("div",{class:"tab-icon"},[t("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8"},[t("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"}),t("polyline",{points:"14,2 14,8 20,8"}),t("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),t("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),t("polyline",{points:"10,9 9,9 8,9"})])],-1),t("div",{class:"tab-label"},"订单",-1)])]),_:1},8,["class"]),e(a,{to:"/profile",class:l(["tab-item",{active:r(o).path.startsWith("/profile")}])},{default:i(()=>[...s[3]||(s[3]=[t("div",{class:"tab-icon"},[t("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8"},[t("path",{d:"M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2"}),t("circle",{cx:"12",cy:"7",r:"4"})])],-1),t("div",{class:"tab-label"},"我的",-1)])]),_:1},8,["class"])])])}}};export{y as default};
|
||||
|
|
@ -0,0 +1 @@
|
|||
import{H as d,L as v,P as t,M as e,O as i,R as l,u as r,aA as h,ag as n}from"./vendor-DeEI1rpK.js";const p={class:"tab-layout"},u={class:"tab-content"},b={class:"tab-bar"},y={__name:"TabLayout",setup(w){const a=h();return(x,s)=>{const c=n("router-view"),o=n("router-link");return d(),v("div",p,[t("div",u,[e(c)]),t("div",b,[e(o,{to:"/",class:l(["tab-item",{active:r(a).path==="/"}])},{default:i(()=>[...s[0]||(s[0]=[t("div",{class:"tab-icon"},[t("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8"},[t("path",{d:"M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2z"}),t("polyline",{points:"9,22 9,12 15,12 15,22"})])],-1),t("div",{class:"tab-label"},"首页",-1)])]),_:1},8,["class"]),e(o,{to:"/vehicles",class:l(["tab-item",{active:r(a).path.startsWith("/vehicles")}])},{default:i(()=>[...s[1]||(s[1]=[t("div",{class:"tab-icon"},[t("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8"},[t("rect",{x:"1",y:"3",width:"15",height:"13",rx:"2",ry:"2"}),t("polygon",{points:"16,8 20,8 23,11 23,16 16,16 16,8"}),t("circle",{cx:"5.5",cy:"18.5",r:"2.5"}),t("circle",{cx:"18.5",cy:"18.5",r:"2.5"})])],-1),t("div",{class:"tab-label"},"租车",-1)])]),_:1},8,["class"]),e(o,{to:"/orders",class:l(["tab-item",{active:r(a).path.startsWith("/orders")}])},{default:i(()=>[...s[2]||(s[2]=[t("div",{class:"tab-icon"},[t("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8"},[t("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"}),t("polyline",{points:"14,2 14,8 20,8"}),t("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),t("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),t("polyline",{points:"10,9 9,9 8,9"})])],-1),t("div",{class:"tab-label"},"订单",-1)])]),_:1},8,["class"]),e(o,{to:"/profile",class:l(["tab-item",{active:r(a).path.startsWith("/profile")}])},{default:i(()=>[...s[3]||(s[3]=[t("div",{class:"tab-icon"},[t("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8"},[t("path",{d:"M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2"}),t("circle",{cx:"12",cy:"7",r:"4"})])],-1),t("div",{class:"tab-label"},"我的",-1)])]),_:1},8,["class"])])])}}};export{y as default};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1 @@
|
|||
import{k as z,H as i,L as _,P as t,M as s,O as c,V as M,F as C,ab as D,I as B,X as N,e as m,ag as n,ah as F,c as I,az as L,Y as y,Z as r,u as R}from"./vendor-DeEI1rpK.js";import{b as S}from"./element-plus-pbz_d-qS.js";import{r as U}from"./request-BEmSsgoM.js";import{_ as $}from"./index-CxJCpQ-E.js";const j={class:"vehicles-page"},q={class:"filter-bar"},E={class:"vehicle-list"},H=["onClick"],O={class:"vehicle-img"},X={class:"vehicle-info"},Y={class:"tags"},Z={class:"price-row"},A={class:"price"},G={class:"deposit"},J={class:"vehicle-arrow"},K={__name:"Vehicles",setup(Q){const b=L(),u=m(!1),v=m([]),d=m(""),p=m(""),V=l=>{const a=l.purchasePrice||3e3;return Math.round(a/100)},f=I(()=>v.value.filter(l=>{const a=!d.value||l.batteryType===d.value,o=!p.value||l.status===p.value;return a&&o})),P=async()=>{u.value=!0;try{const l=await U.get("/vehicles");l.success&&(v.value=l.data)}catch{v.value=[{_id:"1",model:"黑骑士",color:"黑色",batteryType:"锂电池",purchasePrice:3500,status:"空闲"},{_id:"2",model:"黑骑士",color:"白色",batteryType:"锂电池",purchasePrice:3500,status:"空闲"},{_id:"3",model:"电动车",color:"蓝色",batteryType:"铅酸电池",purchasePrice:2800,status:"空闲"},{_id:"4",model:"高端豪车",color:"红色",batteryType:"锂电池",purchasePrice:8e3,status:"空闲"},{_id:"5",model:"普通标准套餐",color:"绿色",batteryType:"铅酸电池",purchasePrice:2500,status:"在租"}]}finally{u.value=!1}},w=l=>{b.push(`/vehicle/${l}`)};return z(()=>{P()}),(l,a)=>{const o=n("el-option"),g=n("el-select"),h=n("el-tag"),T=n("el-icon"),k=n("el-empty"),x=F("loading");return i(),_("div",j,[a[3]||(a[3]=t("div",{class:"page-header"},[t("h2",null,"选择车型"),t("p",null,"浏览全部可用车辆")],-1)),t("div",q,[s(g,{modelValue:d.value,"onUpdate:modelValue":a[0]||(a[0]=e=>d.value=e),placeholder:"电池类型",size:"small",style:{width:"100px"}},{default:c(()=>[s(o,{label:"全部",value:""}),s(o,{label:"锂电池",value:"锂电池"}),s(o,{label:"铅酸电池",value:"铅酸电池"})]),_:1},8,["modelValue"]),s(g,{modelValue:p.value,"onUpdate:modelValue":a[1]||(a[1]=e=>p.value=e),placeholder:"状态",size:"small",style:{width:"100px"}},{default:c(()=>[s(o,{label:"全部",value:""}),s(o,{label:"空闲",value:"空闲"}),s(o,{label:"在租",value:"在租"})]),_:1},8,["modelValue"])]),M((i(),_("div",E,[(i(!0),_(C,null,D(f.value,e=>(i(),_("div",{key:e._id,class:"vehicle-card",onClick:W=>w(e._id)},[t("div",O,[a[2]||(a[2]=t("span",{class:"emoji"},"🛵",-1)),s(h,{type:e.status==="空闲"?"success":"warning",class:"status-tag",size:"small"},{default:c(()=>[y(r(e.status),1)]),_:2},1032,["type"])]),t("div",X,[t("h4",null,r(e.model),1),t("div",Y,[s(h,{size:"small",type:"info"},{default:c(()=>[y(r(e.color),1)]),_:2},1024),s(h,{size:"small",type:"info"},{default:c(()=>[y(r(e.batteryType),1)]),_:2},1024)]),t("div",Z,[t("span",A,"¥"+r(V(e))+"/天",1),t("span",G,"押金: ¥"+r(e.purchasePrice?Math.round(e.purchasePrice*.1):200),1)])]),t("div",J,[s(T,null,{default:c(()=>[s(R(S))]),_:1})])],8,H))),128)),!u.value&&f.value.length===0?(i(),B(k,{key:0,description:"暂无车辆"})):N("",!0)])),[[x,u.value]])])}}},le=$(K,[["__scopeId","data-v-5ef92e98"]]);export{le as default};
|
||||
|
|
@ -1 +0,0 @@
|
|||
import{_ as z,i as C,o as i,c as _,a as t,b as s,w as c,q as D,F as M,j as B,s as N,p as j,r as v,d as n,v as q,x as F,u as R,g as y,t as r,e as S,y as U}from"./index-CZe38Ow-.js";import{r as $}from"./request-DftRczcY.js";const E={class:"vehicles-page"},I={class:"filter-bar"},L={class:"vehicle-list"},A=["onClick"],G={class:"vehicle-img"},H={class:"vehicle-info"},J={class:"tags"},K={class:"price-row"},O={class:"price"},Q={class:"deposit"},W={class:"vehicle-arrow"},X={__name:"Vehicles",setup(Y){const b=R(),u=v(!1),m=v([]),d=v(""),p=v(""),V=l=>{const a=l.purchasePrice||3e3;return Math.round(a/100)},f=F(()=>m.value.filter(l=>{const a=!d.value||l.batteryType===d.value,o=!p.value||l.status===p.value;return a&&o})),w=async()=>{u.value=!0;try{const l=await $.get("/vehicles");l.success&&(m.value=l.data)}catch{m.value=[{_id:"1",model:"黑骑士",color:"黑色",batteryType:"锂电池",purchasePrice:3500,status:"空闲"},{_id:"2",model:"黑骑士",color:"白色",batteryType:"锂电池",purchasePrice:3500,status:"空闲"},{_id:"3",model:"电动车",color:"蓝色",batteryType:"铅酸电池",purchasePrice:2800,status:"空闲"},{_id:"4",model:"高端豪车",color:"红色",batteryType:"锂电池",purchasePrice:8e3,status:"空闲"},{_id:"5",model:"普通标准套餐",color:"绿色",batteryType:"铅酸电池",purchasePrice:2500,status:"在租"}]}finally{u.value=!1}},P=l=>{b.push(`/vehicle/${l}`)};return C(()=>{w()}),(l,a)=>{const o=n("el-option"),g=n("el-select"),h=n("el-tag"),T=n("el-icon"),x=n("el-empty"),k=q("loading");return i(),_("div",E,[a[3]||(a[3]=t("div",{class:"page-header"},[t("h2",null,"选择车型"),t("p",null,"浏览全部可用车辆")],-1)),t("div",I,[s(g,{modelValue:d.value,"onUpdate:modelValue":a[0]||(a[0]=e=>d.value=e),placeholder:"电池类型",size:"small",style:{width:"100px"}},{default:c(()=>[s(o,{label:"全部",value:""}),s(o,{label:"锂电池",value:"锂电池"}),s(o,{label:"铅酸电池",value:"铅酸电池"})]),_:1},8,["modelValue"]),s(g,{modelValue:p.value,"onUpdate:modelValue":a[1]||(a[1]=e=>p.value=e),placeholder:"状态",size:"small",style:{width:"100px"}},{default:c(()=>[s(o,{label:"全部",value:""}),s(o,{label:"空闲",value:"空闲"}),s(o,{label:"在租",value:"在租"})]),_:1},8,["modelValue"])]),D((i(),_("div",L,[(i(!0),_(M,null,B(f.value,e=>(i(),_("div",{key:e._id,class:"vehicle-card",onClick:Z=>P(e._id)},[t("div",G,[a[2]||(a[2]=t("span",{class:"emoji"},"🛵",-1)),s(h,{type:e.status==="空闲"?"success":"warning",class:"status-tag",size:"small"},{default:c(()=>[y(r(e.status),1)]),_:2},1032,["type"])]),t("div",H,[t("h4",null,r(e.model),1),t("div",J,[s(h,{size:"small",type:"info"},{default:c(()=>[y(r(e.color),1)]),_:2},1024),s(h,{size:"small",type:"info"},{default:c(()=>[y(r(e.batteryType),1)]),_:2},1024)]),t("div",K,[t("span",O,"¥"+r(V(e))+"/天",1),t("span",Q,"押金: ¥"+r(e.purchasePrice?Math.round(e.purchasePrice*.1):200),1)])]),t("div",W,[s(T,null,{default:c(()=>[s(S(U))]),_:1})])],8,A))),128)),!u.value&&f.value.length===0?(i(),N(x,{key:0,description:"暂无车辆"})):j("",!0)])),[[k,u.value]])])}}},se=z(X,[["__scopeId","data-v-5ef92e98"]]);export{se as default};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,2 @@
|
|||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Login-CWH3x7xe.js","assets/vendor-DeEI1rpK.js","assets/element-plus-pbz_d-qS.js","assets/request-BEmSsgoM.js","assets/Login-9F0WSW0H.css","assets/TabLayout-DqSV0rLh.js","assets/TabLayout-h1nUEoAe.css","assets/Home-DBpKmnUx.js","assets/Home-CzqWt0ff.css","assets/Vehicles-JVkPd0AQ.js","assets/Vehicles-COnsGIPa.css","assets/VehicleDetail-o5dn_MeU.js","assets/VehicleDetail-Dy9bWpCb.css","assets/Orders-Bbqviy3-.js","assets/Orders-BnVqLHyb.css","assets/Profile-Dim3OacT.js","assets/Profile-B0c1N5EH.css"])))=>i.map(i=>d[i]);
|
||||
import{H as g,I as y,ag as P,ax as O,ay as L,au as A}from"./vendor-DeEI1rpK.js";import{E as I,e as b}from"./element-plus-pbz_d-qS.js";(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))a(e);new MutationObserver(e=>{for(const o of e)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&a(s)}).observe(document,{childList:!0,subtree:!0});function t(e){const o={};return e.integrity&&(o.integrity=e.integrity),e.referrerPolicy&&(o.referrerPolicy=e.referrerPolicy),e.crossOrigin==="use-credentials"?o.credentials="include":e.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function a(e){if(e.ep)return;e.ep=!0;const o=t(e);fetch(e.href,o)}})();const R=(r,n)=>{const t=r.__vccOpts||r;for(const[a,e]of n)t[a]=e;return t},V={};function w(r,n){const t=P("router-view");return g(),y(t)}const D=R(V,[["render",w]]),S="modulepreload",T=function(r){return"/"+r},d={},u=function(n,t,a){let e=Promise.resolve();if(t&&t.length>0){let h=function(c){return Promise.all(c.map(p=>Promise.resolve(p).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),i=s?.nonce||s?.getAttribute("nonce");e=h(t.map(c=>{if(c=T(c),c in d)return;d[c]=!0;const p=c.endsWith(".css"),m=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${m}`))return;const l=document.createElement("link");if(l.rel=p?"stylesheet":S,p||(l.as="script"),l.crossOrigin="",l.href=c,i&&l.setAttribute("nonce",i),document.head.appendChild(l),p)return new Promise((E,v)=>{l.addEventListener("load",E),l.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${c}`)))})}))}function o(s){const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=s,window.dispatchEvent(i),!i.defaultPrevented)throw s}return e.then(s=>{for(const i of s||[])i.status==="rejected"&&o(i.reason);return n().catch(o)})},N=[{path:"/login",name:"Login",component:()=>u(()=>import("./Login-CWH3x7xe.js"),__vite__mapDeps([0,1,2,3,4]))},{path:"/",component:()=>u(()=>import("./TabLayout-DqSV0rLh.js"),__vite__mapDeps([5,1,6])),children:[{path:"",name:"Home",component:()=>u(()=>import("./Home-DBpKmnUx.js"),__vite__mapDeps([7,1,2,3,8]))},{path:"vehicles",name:"Vehicles",component:()=>u(()=>import("./Vehicles-JVkPd0AQ.js"),__vite__mapDeps([9,1,2,3,10]))},{path:"vehicle/:id",name:"VehicleDetail",component:()=>u(()=>import("./VehicleDetail-o5dn_MeU.js"),__vite__mapDeps([11,1,2,3,12]))},{path:"orders",name:"Orders",component:()=>u(()=>import("./Orders-Bbqviy3-.js"),__vite__mapDeps([13,2,1,3,14]))},{path:"profile",name:"Profile",component:()=>u(()=>import("./Profile-Dim3OacT.js"),__vite__mapDeps([15,1,2,16]))}]}],_=O({history:L("/rider/"),routes:N});_.beforeEach((r,n,t)=>{const a=localStorage.getItem("token");r.path!=="/login"&&!a?t("/login"):r.path==="/login"&&a?t("/"):t()});const f=A(D);for(const[r,n]of Object.entries(I))f.component(r,n);f.use(b);f.use(_);f.mount("#app");export{R as _,_ as r};
|
||||
|
|
@ -0,0 +1 @@
|
|||
import{aC as o}from"./vendor-DeEI1rpK.js";import{r as s}from"./index-CxJCpQ-E.js";const t=o.create({baseURL:"/api",timeout:1e4});t.interceptors.request.use(e=>{const r=localStorage.getItem("token");return r&&(e.headers.Authorization=`Bearer ${r}`),e},e=>Promise.reject(e));t.interceptors.response.use(e=>e.data,e=>(e.response?.status===401&&(localStorage.removeItem("token"),localStorage.removeItem("riderInfo"),s.push("/login")),Promise.reject(e)));export{t as r};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -10,7 +10,9 @@
|
|||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
|
||||
</style>
|
||||
<script type="module" crossorigin src="/assets/index-CZe38Ow-.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-CxJCpQ-E.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/assets/vendor-DeEI1rpK.js">
|
||||
<link rel="modulepreload" crossorigin href="/assets/element-plus-pbz_d-qS.js">
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-B3zBkNS6.css">
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
|||
|
|
@ -65,8 +65,8 @@ const handleLogin = async () => {
|
|||
loading.value = true
|
||||
try {
|
||||
const res = await request.post('/auth/login', {
|
||||
username: loginForm.value.username,
|
||||
password: loginForm.value.password
|
||||
username: loginForm.value.username.trim(),
|
||||
password: loginForm.value.password.trim()
|
||||
})
|
||||
|
||||
if (res.success && res.data && res.data.token) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue