Express(new)
gct 7 days ago
parent b2a5c65d8a
commit 4760bf3fd9

@ -1,2 +1,5 @@
# uml
# Vue 3 + Vite
This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
Learn more about IDE Support for Vue in the [Vue Docs Scaling up Guide](https://vuejs.org/guide/scaling-up/tooling.html#ide-support).

@ -1,24 +0,0 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

@ -1,13 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + Vue</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>

@ -13,7 +13,7 @@
"axios": "1.2.1",
"element-plus": "2.2.19",
"pinia": "2.0.27",
"pinia-plugin-persist": "1.0.0",
"pinia-plugin-persist": "^1.0.0",
"vant": "4.0.0",
"vue": "^3.4.37",
"vue-router": "4"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

@ -1,43 +0,0 @@
<script setup>
import { ref } from 'vue'
defineProps({
msg: String,
})
const count = ref(0)
</script>
<template>
<h1>{{ msg }}</h1>
<div class="card">
<button type="button" @click="count++">count is {{ count }}</button>
<p>
Edit
<code>components/HelloWorld.vue</code> to test HMR
</p>
</div>
<p>
Check out
<a href="https://vuejs.org/guide/quick-start.html#local" target="_blank"
>create-vue</a
>, the official Vue + Vite starter
</p>
<p>
Learn more about IDE Support for Vue in the
<a
href="https://vuejs.org/guide/scaling-up/tooling.html#ide-support"
target="_blank"
>Vue Docs Scaling up Guide</a
>.
</p>
<p class="read-the-docs">Click on the Vite and Vue logos to learn more</p>
</template>
<style scoped>
.read-the-docs {
color: #888;
}
</style>

@ -2,13 +2,15 @@ import { createApp } from 'vue'
import './style.css'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
//import App from './view/Regiter.vue'
//import App from './components/App.vue'
import App from './App.vue'
import router from './router'
import { PiniaVuePlugin, createPinia } from 'pinia'
import { PiniaVuePlugin,createPinia } from 'pinia'
import piniaPluginPersist from 'pinia-plugin-persist'
const app=createApp(App)
app.use(ElementPlus)
app.use(router)
const pinia=createPinia()
pinia.use(piniaPluginPersist)
app.use(pinia)
app.mount('#app')

@ -1,54 +1,133 @@
import { createRouter,createWebHashHistory } from "vue-router";
import { createRouter, createWebHashHistory } from "vue-router";
import { userStore } from "./store";
import { storeToRefs } from "pinia";
const router = createRouter({
history:createWebHashHistory(),
routes:[{
path:'/',
redirect:'login'
},
history: createWebHashHistory(),
routes: [
{
path: '/',
redirect: 'login'
},
{
path: '/login',
name: 'Login',
component: () => import('./view/Login.vue'),
meta: { requiresAuth: false } // 不需要登录
},
{
path: '/register',
name: 'Register',
component: () => import('./view/Register.vue'),
meta: { requiresAuth: false } // 不需要登录
},
{
path: '/User',
name: 'User',
component: () => import("./view/user/Index.vue"),
redirect: "/User/Head",
children: [
{
path: 'Head',
name: 'Head',
component: () => import("./view/user/Home.vue"),
meta: { requiresAuth: true }
},
{
path: 'userProfile',
name: 'userProfile',
component: () => import("./view/user/userProfile.vue"),
meta: { requiresAuth: true }
},
{
path: 'OrderManagement',
name: 'OrderManagement',
component: () => import("./view/user/OrderManagement.vue"),
meta: { requiresAuth: true }
},
{
path: 'ExpressForm',
name: 'ExpressForm',
component: () => import("./view/user/ExpressForm.vue"),
meta: { requiresAuth: true }
},
{
path: 'Address',
name: 'Address',
component: () => import("./view/user/Address.vue"),
meta: { requiresAuth: true }
},
{
path: 'ShipmentQuery',
name: 'ShipmentQuery',
component: () => import("./view/user/ShipmentQuery.vue"),
meta: { requiresAuth: true }
},
{
path: 'CourierComplaint',
name: 'CourierComplaint',
component: () => import("./view/user/CourierComplaint.vue"),
meta: { requiresAuth: true }
},
]
},
{
path:'/login',
name:'Login',
component:()=>import('./view/Login.vue')
},
{
path:'/User',
name:'User',
component:()=>import("./view/user/index.vue"),
redirect:"/User/myInfo",
children:[
path: '/Courier',
name: 'Courier',
component: () => import("./view/courier/index.vue"),
redirect: "/Courier/Home",
children: [
{
path: 'Home',
name: 'Home',
component: () => import("./view/courier/Home.vue"),
meta: { requiresAuth: true },
},
{
path: 'orderProcessing',
name: 'orderProcessing',
component: () => import("./view/courier/OrderProcessing.vue"),
meta: { requiresAuth: true },
},
{
path:'myInfo',
component:()=>import('./view/user/MyInfo.vue')
path: 'deliveryTracking',
name: 'deliveryTracking',
component: () => import("./view/courier/DeliveryTracking.vue"),
meta: { requiresAuth: true },
},
{
path:"expressList",
component:()=>import('./view/user/ExpressList.vue')
path: 'orderHistory',
name: 'orderHistory',
component: () => import("./view/courier/OrderHistory.vue"),
meta: { requiresAuth: true },
},
{
path:"expressForm",
component:()=>import('./view/user/ExpressForm.vue')
path: 'feedback',
name: 'feedback',
component: () => import("./view/courier/Feedback.vue"),
meta: { requiresAuth: true },
}
]
}
]
})
router.beforeEach((to,from,next)=>{
const store=userStore()
const {loginState}=storeToRefs(store)
console.log("路由守卫:",loginState.value)
if(to.name=="Login"){
next()
}else{
if(loginState.value){
next()
}else{
next({
name:"Login"
})
}
}
})
export default router
]
});
router.beforeEach((to, from, next) => {
const store = userStore();
const { loginState } = storeToRefs(store);
console.log("路由守卫:", loginState.value);
// 如果路由的 meta.requiresAuth 为 false直接允许访问
if (to.meta.requiresAuth === false) {
next();
} else {
// 否则检查登录状态
if (loginState.value) {
next();
} else {
next({ name: "Login" });
}
}
});
export default router;

@ -1,15 +1,26 @@
import { defineStore } from "pinia";
import {
defineStore
} from "pinia";
export const userStore = defineStore('storeId',{
state:()=>{
return{
loginState:false
export const userStore = defineStore('storeId', {
state: () => {
return {
loginState: false
}
},
getters:{},
actions:{
setLoginState(state){
this.loginState=state
getters: {},
actions: {
setLoginState(state) {
this.loginState = state
}
},
persist: {
enabled: true, // 开启数据缓存
strategies: [{
key: 'storeId', // 当前store的id
storage: localStorage, // 存储方式
paths: ['loginState'] // 指定要持久化的字段
}]
}
})

@ -0,0 +1,26 @@
import { defineStore } from 'pinia';
export const useUserStore = defineStore('user', {
state: () => ({
username: '用户',
email: 'user@example.com',
gender: '',
birthdate: new Date(),
phone: '',
selectedRegion: [],
}),
actions: {
updateProfile(profile) {
this.username = profile.username;
this.email = profile.email;
this.gender = profile.gender;
this.birthdate = profile.birthdate;
this.phone = profile.phone;
this.selectedRegion = profile.selectedRegion;
},
},
persist: {
key: 'user-profile', // 存储的键名
storage: localStorage, // 使用 localStorage 持久化
},
});

@ -1,19 +0,0 @@
// stores/ageStore.js
import { defineStore } from 'pinia'
export const useAgeStore = defineStore('ageStore', {
state: () => ({
age: 20 // 设置初始年龄为20
}),
actions: {
incrementAge() {
this.age++
}
},
persist: {
enabled: true,
strategies: [
{ storage: localStorage, paths: ['age'] } // 将age字段持久化到localStorage
]
}
})

@ -1,102 +1,191 @@
<template>
<div class="body-view">
<el-text class="mx-1">卓越快递</el-text>
<el-text>登录状态{{loginState}}</el-text>
<el-form class="form-view">
<el-form-item label="账号:">
<el-input class="ipt" v-model="form.account"></el-input>
</el-form-item>
<el-form-item label="密码:" style="margin-bottom: 40px;">
<el-input class="ipt" v-model="form.password"></el-input>
</el-form-item>
<el-form-item class="btn-view">
<el-button class="btn" type="primary" @click="login"></el-button>
<el-button class="btn cancel-btn" type="primary" >取消</el-button>
</el-form-item>
</el-form>
<div class="login-container">
<div class="login-box">
<div class="logo-container">
<img src="../assets/logo.png" alt="Logo" class="logo">
<h2 class="login-title">旭日快递</h2>
</div>
<el-form :model="loginForm" :rules="loginRules" ref="loginFormRef" label-width="80px" class="login-form">
<el-form-item label="用户名" prop="username">
<el-input v-model="loginForm.username" placeholder="请输入用户名" clearable></el-input>
</el-form-item>
<el-form-item label="密码" prop="password">
<el-input v-model="loginForm.password" type="password" placeholder="请输入密码" clearable></el-input>
</el-form-item>
<el-form-item label="登录身份" prop="role" >
<el-select v-model="loginForm.role" placeholder="请选择登录身份" clearable>
<el-option label="普通用户" value="user"></el-option>
<el-option label="管理员" value="admin"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit" class="login-button">登录</el-button>
</el-form-item>
</el-form>
<router-link to="/register">没有账号去注册</router-link>
</div>
</div>
</template>
<script setup>
import request from '../request';
import { reactive,ref } from 'vue';
import { ElMessage } from 'element-plus';
import { useRouter } from 'vue-router';
import { storeToRefs } from 'pinia';
import { userStore } from '../store';
const store=userStore()
const {loginState}=storeToRefs(store)
// //
// const userStore = ref([
// { username: 'test', password: '123' },
// { username: 'gct', password: '123' },
// { username: 'admin', password: 'admin' },
// ]);
//
const form = reactive({
account: "",
password: ""
});
const router=useRouter()
const login=()=>{
console.log(form.account,form.password)
request({
url:"http://www.fj84.site/login",
method:"get",
params:{
account:form.account,
password:form.password
}
}).then(res=>{
let myType="error"
if(res.data.code==1){
myType="success"
store.setLoginState(true)
router.push({
name:"User"
})
}else{
myType="error"
}
ElMessage({
message:res.data.message,
type:myType
})
}).catch(error=>{
console.log(error)
})
}
import {
ref
} from 'vue';
import {
ElMessage
} from 'element-plus';
import {
useRouter
} from 'vue-router';
import {
storeToRefs
} from 'pinia';
import {
userStore
} from '../store';
//
const userData = ref([
{ username: 'test', password: '123', role: 'user' },
{ username: 'admin', password: 'admin', role: 'admin' }
]);
//
const loginForm = ref({
username: '',
password: '',
role: ''
});
//
const loginRules = ref({
username: [
{ required: true, message: '请输入用户名', trigger: 'blur' }
],
password: [
{ required: true, message: '请输入密码', trigger: 'blur' }
],
role: [
{ required: true, message: '请选择登录身份', trigger: 'change' }
]
});
//
const loginFormRef = ref(null);
const router = useRouter();
const store = userStore()
const {
loginState
} = storeToRefs(store)
//
const onSubmit = () => {
if (loginFormRef.value) {
loginFormRef.value.validate((valid) => {
if (valid) {
const user = userData.value.find(u =>
u.username === loginForm.value.username &&
u.password === loginForm.value.password &&
u.role === loginForm.value.role
);
if (user) {
ElMessage({
message: '登录成功!',
type: 'success',
duration: 3000
});
store.setLoginState(true);
if (loginForm.value.role === 'admin') {
router.push('/Courier'); //
} else {
router.push('/User'); //
}
} else {
ElMessage.error('用户名、密码或登录身份错误');
}
} else {
ElMessage.error('请检查输入信息是否正确');
}
});
}
};
</script>
<style scoped>
.body-view{
border:1px solid black;
width:500px;
height: 435px;
/* 整体容器,居中显示,背景渐变 */
.login-container {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
background: linear-gradient(135deg, #6ab7ff, #ece9e6);
font-family: 'Arial', sans-serif;
}
/* 登录框样式 */
.login-box {
width: 400px;
padding: 40px;
background-color: white;
border-radius: 10px;
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
text-align: center;
}
.mx-1{
font-size: 25px;
/* Logo 区域 */
.logo-container {
display: flex;
flex-direction: column;
align-items: center;
margin-bottom: 20px;
}
.ipt{
border: 1.5px solid black;
height: 50px;
.logo {
width: 100px;
margin-bottom: 10px;
}
.btn-view{
margin-left: 10px;
.login-title {
font-size: 24px;
color: #333;
font-weight: 600;
margin: 0;
}
.btn{
background-color: #0f63fe;
width: 90px;
height: 40px;
/* 输入框和表单样式 */
.el-input {
border-radius: 8px;
border: 1px solid #dcdfe6;
}
.el-input:focus-within {
border-color: #409eff;
}
.cancel-btn{
margin-left: 70px !important;
/* 按钮美化 */
.login-button {
width: 100%;
height: 45px;
font-size: 16px;
border-radius: 25px;
background-color: #409eff;
border-color: #409eff;
color: white;
box-shadow: 0 4px 10px rgba(64, 158, 255, 0.2);
transition: all 0.3s ease;
}
.login-button:hover {
background-color: #66b1ff;
border-color: #66b1ff;
box-shadow: 0 4px 12px rgba(64, 158, 255, 0.3);
}
/* 输入框外间距 */
.el-form-item {
margin-bottom: 20px;
}
</style>

@ -0,0 +1,178 @@
<template>
<div class="register-container">
<div class="register-box">
<!-- Logo 区域 -->
<div class="logo-container">
<img src="../assets/logo.png" alt="Logo" class="logo">
<h2 class="register-title">用户注册</h2>
</div>
<!-- 注册表单 -->
<el-form :model="registerForm" :rules="registerRules" ref="registerFormRef" label-width="100px" class="register-form">
<!-- 用户名 -->
<el-form-item label="用户名" prop="username">
<el-input v-model="registerForm.username" placeholder="请输入用户名" clearable></el-input>
</el-form-item>
<!-- 账号 -->
<el-form-item label="账号" prop="account">
<el-input v-model="registerForm.account" placeholder="请输入账号" clearable></el-input>
</el-form-item>
<!-- 密码 -->
<el-form-item label="密码" prop="password">
<el-input v-model="registerForm.password" type="password" placeholder="请输入密码" clearable></el-input>
</el-form-item>
<!-- 确认密码 -->
<el-form-item label="确认密码" prop="confirmPassword">
<el-input v-model="registerForm.confirmPassword" type="password" placeholder="请再次输入密码" clearable></el-input>
</el-form-item>
<!-- 注册按钮 -->
<el-form-item>
<el-button type="primary" @click="onSubmit" class="register-button">注册</el-button>
</el-form-item>
<router-link to="/Login">已有账号去登录</router-link>
</el-form>
</div>
</div>
</template>
<script setup>
import { ref } from 'vue';
import { ElMessage } from 'element-plus';
//
const registerForm = ref({
username: '',
password: '',
confirmPassword: '',
account: ''
});
//
const validateAccount = (rule, value, callback) => {
const regex = /^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{8,}$/;
if (!value) {
callback(new Error('请输入账号'));
} else if (!regex.test(value)) {
callback(new Error('账号必须包含字母和数字并且不少于8个字符'));
} else {
callback();
}
};
//
const validateConfirmPassword = (rule, value, callback) => {
if (value !== registerForm.value.password) {
callback(new Error('两次输入的密码不一致'));
} else {
callback();
}
};
//
const registerRules = ref({
username: [
{ required: true, message: '请输入用户名', trigger: 'blur' }
],
password: [
{ required: true, message: '请输入密码', trigger: 'blur' }
],
confirmPassword: [
{ required: true, message: '请确认密码', trigger: 'blur' },
{ validator: validateConfirmPassword, trigger: 'blur' }
],
account: [
{ required: true, message: '请输入账号', trigger: 'blur' },
{ validator: validateAccount, trigger: 'blur' }
]
});
const registerFormRef = ref(null);
//
const onSubmit = () => {
registerFormRef.value.validate((valid) => {
if (valid) {
ElMessage.success('注册成功!');
} else {
ElMessage.error('请检查输入信息是否正确');
return false;
}
});
};
</script>
<style scoped>
/* 整体容器,居中显示,背景渐变 */
.register-container {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background: linear-gradient(135deg, #6ab7ff, #ece9e6);
font-family: 'Arial', sans-serif;
}
/* 注册框样式 */
.register-box {
width: 400px;
padding: 40px;
background-color: white;
border-radius: 10px;
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
text-align: center;
}
/* Logo 区域 */
.logo-container {
display: flex;
flex-direction: column;
align-items: center;
margin-bottom: 20px;
}
.logo {
width: 100px;
margin-bottom: 10px;
}
.register-title {
font-size: 24px;
color: #333;
font-weight: 600;
margin: 0;
}
/* 输入框和表单样式 */
.el-input {
border-radius: 8px;
border: 1px solid #dcdfe6;
}
.el-input:focus-within {
border-color: #409eff;
}
/* 按钮美化 */
.register-button {
width: 100%;
height: 45px;
font-size: 16px;
border-radius: 25px;
background-color: #409eff;
border-color: #409eff;
color: white;
box-shadow: 0 4px 10px rgba(64, 158, 255, 0.2);
transition: all 0.3s ease;
}
.register-button:hover {
background-color: #66b1ff;
border-color: #66b1ff;
box-shadow: 0 4px 12px rgba(64, 158, 255, 0.3);
}
/* 输入框外间距 */
.el-form-item {
margin-bottom: 20px;
}
</style>

@ -1,88 +0,0 @@
<template>
<el-form ref="ruleFormRef" style="max-width: 600px" :model="ruleForm" status-icon :rules="rules" label-width="auto"
class="demo-ruleForm">
<el-form-item label="账号" prop="account">
<el-input v-model.number="ruleForm.account" />
</el-form-item>
<el-form-item label="密码" prop="pass">
<el-input v-model="ruleForm.pass" type="password" autocomplete="off" />
</el-form-item>
<el-form-item label="确认密码" prop="checkPass">
<el-input v-model="ruleForm.checkPass" type="password" autocomplete="off" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitForm(ruleFormRef)">
Submit
</el-button>
<el-button @click="resetForm(ruleFormRef)">Reset</el-button>
</el-form-item>
</el-form>
</template>
<script lang="ts" setup>
import { reactive, ref } from 'vue'
import type { FormInstance, FormRules } from 'element-plus'
const ruleFormRef = ref<FormInstance>()
const checkAccount = (rule : any, value : any, callback : any) => {
if (!value) {
return callback(new Error('请输入账号'))
}else{
let value1=value+""
if(value1.length<8){
return callback(new Error('账号长度不能小于8'))
}
callback()
}
}
const validatePass = (rule : any, value : any, callback : any) => {
if (value === '') {
callback(new Error('请输入密码'))
} else {
if (ruleForm.checkPass !== '') {
if (!ruleFormRef.value) return
ruleFormRef.value.validateField('checkPass')
}
callback()
}
}
const validatePass2 = (rule : any, value : any, callback : any) => {
if (value === '') {
callback(new Error('请再次输入密码'))
} else if (value !== ruleForm.pass) {
callback(new Error("两次密码不一致"))
} else {
callback()
}
}
const ruleForm = reactive({
pass: '',
checkPass: '',
account: '',
})
const rules = reactive<FormRules<typeof ruleForm>>({
pass: [{ validator: validatePass, trigger: 'blur' }],
checkPass: [{ validator: validatePass2, trigger: 'blur' }],
account: [{ validator: checkAccount, trigger: 'blur' }],
})
const submitForm = (formEl : FormInstance | undefined) => {
if (!formEl) return
formEl.validate((valid) => {
if (valid) {
console.log('submit!')
} else {
console.log('error submit!')
}
})
}
const resetForm = (formEl : FormInstance | undefined) => {
if (!formEl) return
formEl.resetFields()
}
</script>

@ -0,0 +1,162 @@
<template>
<div class="container">
<!-- 页面标题 -->
<el-row class="title-row">
<el-col :span="24">
<h2 class="title">配送状态查询</h2>
</el-col>
</el-row>
<!-- 查询条件 -->
<el-row :gutter="20" class="query-row">
<el-col :span="8">
<el-input
v-model="searchText"
placeholder="请输入订单编号或客户姓名"
@input="filterOrders"
clearable
class="custom-input"
>
<template #prepend>
<el-icon><search /></el-icon>
</template>
</el-input>
</el-col>
<el-col :span="8">
<el-select
v-model="selectedStatus"
placeholder="选择订单状态"
@change="filterOrders"
clearable
class="custom-select"
>
<el-option label="待接收" value="待接收" />
<el-option label="待配送" value="待配送" />
<el-option label="配送中" value="配送中" />
<el-option label="已完成" value="已完成" />
</el-select>
</el-col>
</el-row>
<!-- 订单列表 -->
<el-table :data="filteredOrders" class="custom-table" stripe>
<el-table-column prop="orderId" label="订单编号" width="150" />
<el-table-column prop="customerName" label="客户姓名" width="150" />
<el-table-column prop="pickupAddress" label="取件地址" width="250" />
<el-table-column prop="deliveryAddress" label="送达地址" width="250" />
<el-table-column prop="status" label="订单状态" width="150" />
</el-table>
</div>
</template>
<script setup>
import { ref } from "vue";
import { Search } from "@element-plus/icons-vue";
//
const orders = ref([
{
orderId: "123456",
customerName: "张三",
pickupAddress: "北京市朝阳区",
deliveryAddress: "北京市海淀区",
status: "待接收",
},
{
orderId: "123457",
customerName: "李四",
pickupAddress: "上海市浦东新区",
deliveryAddress: "上海市静安区",
status: "待配送",
},
{
orderId: "123458",
customerName: "王五",
pickupAddress: "广州市天河区",
deliveryAddress: "广州市越秀区",
status: "配送中",
},
{
orderId: "123459",
customerName: "赵六",
pickupAddress: "深圳市南山区",
deliveryAddress: "深圳市福田区",
status: "已完成",
},
]);
//
const searchText = ref("");
//
const selectedStatus = ref(null);
//
const filteredOrders = ref([...orders.value]);
//
const filterOrders = () => {
filteredOrders.value = orders.value.filter((order) => {
const matchesText =
!searchText.value ||
order.orderId.includes(searchText.value) ||
order.customerName.includes(searchText.value);
const matchesStatus =
!selectedStatus.value || order.status === selectedStatus.value;
return matchesText && matchesStatus;
});
};
</script>
<style scoped>
/* 容器样式 */
.container {
background-color: #f9f9f9;
padding: 20px;
border-radius: 10px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
/* 标题样式 */
.title-row {
margin-bottom: 20px;
text-align: center;
}
.title {
font-size: 24px;
font-weight: bold;
color: #333;
margin: 0;
}
/* 查询行样式 */
.query-row {
margin-bottom: 20px;
}
.custom-input {
border-radius: 5px;
}
.custom-select {
border-radius: 5px;
}
/* 表格样式 */
.custom-table {
background: white;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 1px 6px rgba(0, 0, 0, 0.1);
}
.custom-table .el-table__header {
background-color: #f5f5f5;
font-weight: bold;
}
.custom-table .el-table__row:hover {
background-color: #f0f9ff;
transition: background-color 0.3s;
}
</style>

@ -0,0 +1,78 @@
<template>
<el-container>
<el-header>
<h2 class="title">客户反馈</h2>
</el-header>
<el-main>
<el-row class="feedback-list">
<el-col :span="24">
<h2>客户反馈列表</h2>
<el-table :data="feedbacks" style="width: 100%">
<el-table-column label="主题" prop="subject" width="150"></el-table-column>
<el-table-column label="反馈内容" prop="content" width="300" :show-overflow-tooltip="true"></el-table-column>
<el-table-column label="提交日期" prop="date" width="180"></el-table-column>
<el-table-column label="联系方式" prop="contact" width="150"></el-table-column>
</el-table>
</el-col>
</el-row>
</el-main>
</el-container>
</template>
<script setup>
import { ref } from 'vue';
const feedbacks = ref([
{
subject: '物流问题',
content: '我的包裹在运输过程中丢失了,请尽快处理。',
date: '2024-11-01',
contact: '12345678901'
},
{
subject: '服务建议',
content: '希望能增加实时物流跟踪功能。',
date: '2024-11-05',
contact: ''
}
]);
</script>
<style scoped>
/* 顶部标题样式 */
.title {
font-size: 28px;
font-weight: bold;
color: #2c3e50;
text-align: center;
padding: 15px 0;
background-color: #f5f7fa;
margin: 0;
}
/* 客户反馈列表容器 */
.feedback-list {
padding: 20px;
background: #f9f9f9;
}
/* 分区标题样式 */
.section-title {
font-size: 20px;
font-weight: bold;
color: #333;
margin-bottom: 20px;
text-align: left;
}
/* 表格样式 */
.el-table {
margin-top: 20px;
border-radius: 8px;
}
/* 表格行的 hover 效果 */
.el-table .el-table__row:hover {
background-color: #e8f0fe;
}
</style>

@ -0,0 +1,111 @@
<template>
<div class="home-page">
<!-- 欢迎横幅 -->
<section class="welcome-banner">
<h1>欢迎使用旭日快递管理系统</h1>
<p>在这里您可以管理快递用户和系统设置</p>
</section>
<!-- 统计信息卡片 -->
<section class="statistics">
<el-row :gutter="20">
<el-col :span="8">
<el-card class="stat-card">
<div class="stat-title">用户总数</div>
<div class="stat-value">{{ userCount }}</div>
</el-card>
</el-col>
<el-col :span="8">
<el-card class="stat-card">
<div class="stat-title">快递总数</div>
<div class="stat-value">{{ expressCount }}</div>
</el-card>
</el-col>
<el-col :span="8">
<el-card class="stat-card">
<div class="stat-title">进行中的订单</div>
<div class="stat-value">{{ ongoingOrders }}</div>
</el-card>
</el-col>
</el-row>
</section>
</div>
</template>
<script setup>
import { ref, onMounted } from 'vue';
import { useRouter } from 'vue-router';
//
const userCount = ref(1024);
const expressCount = ref(5678);
const ongoingOrders = ref(321);
//
const router = useRouter();
const goToPage = (path) => {
router.push(path);
};
//
onMounted(() => {
// API
});
</script>
<style scoped>
.home-page {
padding: 20px;
background-color: #f9f9f9;
}
.welcome-banner {
text-align: center;
padding: 20px;
background-color: #409EFF;
color: white;
border-radius: 8px;
margin-bottom: 30px;
}
.welcome-banner h1 {
font-size: 24px;
margin: 0;
}
.welcome-banner p {
font-size: 16px;
margin: 5px 0 0;
}
.statistics {
margin-bottom: 30px;
}
.stat-card {
text-align: center;
padding: 20px;
}
.stat-title {
font-size: 18px;
color: #606266;
margin-bottom: 10px;
}
.stat-value {
font-size: 24px;
font-weight: bold;
color: #409EFF;
}
.quick-actions {
margin-top: 30px;
text-align: center;
}
.el-button {
width: 100%;
padding: 15px 0;
}
</style>

@ -0,0 +1,183 @@
<template>
<div id="app">
<!-- Top Navigation Bar -->
<el-header class="top-nav">
<div class="logo">
<img src="../../assets/logo.png" alt="Logo" class="logo-image" />
<span class="title">旭日快递管理系统</span>
</div>
<div class="user-controls">
<span class="welcome-message">欢迎您管理员</span>
<el-button type="text" class="logout-button" @click="logout">退</el-button>
</div>
</el-header>
<!-- Main Container -->
<el-container>
<!-- Sidebar -->
<el-aside width="220px" class="sidebar">
<el-menu
:default-active="activeSidebarMenu"
class="side-menu"
@select="handleSidebarMenuSelect"
router
>
<el-menu-item index="Home">
<el-icon><HomeFilled /></el-icon>
<span>首页</span>
</el-menu-item>
<el-submenu index="1">
<template #title>
<el-icon><Document /></el-icon>
<span>订单管理</span>
</template>
<el-menu-item index="orderProcessing">订单处理</el-menu-item>
<el-menu-item index="deliveryTracking">配送状态查询</el-menu-item>
<el-menu-item index="orderHistory">历史订单</el-menu-item>
</el-submenu>
<el-menu-item index="feedback">
<el-icon><message /></el-icon>
<span>客户反馈</span>
</el-menu-item>
</el-menu>
</el-aside>
<!-- Content Area -->
<el-main class="content-area">
<router-view></router-view>
</el-main>
</el-container>
</div>
</template>
<script setup>
import { ref } from 'vue';
import { useRouter } from 'vue-router';
import { HomeFilled, Document, Message } from '@element-plus/icons-vue';
// Define active sidebar menu
const activeSidebarMenu = ref('Home');
const router = useRouter();
// Handle sidebar menu item selectionH
const handleSidebarMenuSelect = (index) => {
activeSidebarMenu.value = index;
router.push(index); // Navigate to selected route
};
// Logout function
const logout = () => {
// Clear user session or token (if any)
localStorage.removeItem('userToken'); // Example: Remove stored token
// Redirect to login page
router.push('/login');
};
</script>
<style scoped>
#app {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
font-family: 'Arial', sans-serif;
}
.top-nav {
display: flex;
justify-content: space-between;
padding: 0 30px;
background-color: #3b82f6;
color: white;
align-items: center;
height: 80px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.logo {
display: flex;
align-items: center;
}
.logo-image {
width: 50px;
margin-right: 15px;
}
.title {
font-size: 1.8em;
font-weight: bold;
}
.logout-button {
color: white;
font-size: 1em;
margin-left: 20px;
}
.sidebar {
background: linear-gradient(180deg, #e0f7fa, #ffffff);
padding-top: 20px;
border-right: 1px solid #ddd;
}
.side-menu {
height: 100%;
border-right: none;
}
.side-menu .el-menu-item,
.side-menu .el-submenu__title {
font-size: 16px;
padding: 15px 20px;
}
.side-menu .el-menu-item:hover,
.side-menu .el-submenu__title:hover {
background-color: #f0f9ff;
color: #3b82f6;
}
.content-area {
padding: 25px 35px;
background-color: #ffffff;
box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.05);
border-radius: 8px;
margin: 20px;
overflow-y: auto;
}
.el-menu-item.is-active {
color: #3b82f6 !important;
background-color: #f0f9ff;
}
.user-controls {
display: flex;
align-items: center;
}
.welcome-message {
margin-right: 15px;
font-size: 1.1em;
}
@media (max-width: 768px) {
.top-nav {
flex-direction: column;
height: auto;
text-align: center;
}
.sidebar {
display: none;
}
.content-area {
margin: 10px;
padding: 15px;
}
}
</style>

@ -0,0 +1,283 @@
<template>
<el-container>
<el-header>
<h1 class="title">历史订单管理</h1>
</el-header>
<el-main>
<el-row class="history-orders">
<!-- 标题 -->
<el-col :span="24">
<el-row class="title">
<span class="history-label">历史订单</span>
</el-row>
</el-col>
<!-- 搜索和筛选 -->
<el-col :span="24">
<el-row :gutter="10" class="search-filter-row">
<el-col :span="10">
<el-input v-model="searchQuery" placeholder="搜索订单编号或收件人" @keyup.enter="searchOrders"></el-input>
</el-col>
<el-col :span="2">
<el-button type="primary" @click="searchOrders"></el-button>
</el-col>
<el-col :span="10">
<el-select v-model="statusFilter" placeholder="选择订单状态" @change="filterOrders">
<el-option label="全部" value=""></el-option>
<el-option label="已完成" value="已完成"></el-option>
<el-option label="运输中" value="运输中"></el-option>
<el-option label="已取消" value="已取消"></el-option>
</el-select>
</el-col>
</el-row>
</el-col>
<!-- 订单列表 -->
<el-col :span="24">
<el-table :data="filteredOrders" style="width: 100%">
<el-table-column label="订单编号" prop="orderId" width="150"></el-table-column>
<el-table-column label="寄件人" prop="sender" width="200"></el-table-column>
<el-table-column label="收件人" prop="receiver" width="200"></el-table-column>
<el-table-column label="下单日期" prop="orderDate" width="180"></el-table-column>
<el-table-column label="订单状态" prop="status" width="120">
<template #default="scope">
<el-tag :type="getStatusType(scope.row.status)" disable-transitions>
{{ scope.row.status }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" width="150">
<template #default="scope">
<el-button size="mini" @click="viewOrder(scope.row)"></el-button>
</template>
</el-table-column>
</el-table>
</el-col>
<!-- 订单详情弹框 -->
<el-dialog v-model="dialogVisible" title="订单详情" width="40%">
<el-form :model="selectedOrder" label-width="100px">
<el-form-item label="订单编号">
<el-input v-model="selectedOrder.orderId" disabled></el-input>
</el-form-item>
<el-form-item label="寄件人">
<el-input v-model="selectedOrder.sender" disabled></el-input>
</el-form-item>
<el-form-item label="收件人">
<el-input v-model="selectedOrder.receiver" disabled></el-input>
</el-form-item>
<el-form-item label="下单日期">
<el-input v-model="selectedOrder.orderDate" disabled></el-input>
</el-form-item>
<el-form-item label="订单状态">
<el-input v-model="selectedOrder.status" disabled></el-input>
</el-form-item>
<el-form-item label="寄件地址">
<el-input v-model="selectedOrder.senderAddress" disabled></el-input>
</el-form-item>
<el-form-item label="收件地址">
<el-input v-model="selectedOrder.receiverAddress" disabled></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">关闭</el-button>
</span>
</el-dialog>
</el-row>
</el-main>
</el-container>
</template>
<script setup>
import { ref, computed } from 'vue';
const dialogVisible = ref(false);
const selectedOrder = ref(null);
const searchQuery = ref('');
const statusFilter = ref('');
//
const orders = ref([
{
orderId: 'ORD001',
sender: '张三',
receiver: '李四',
orderDate: '2024-11-01',
status: '已完成',
senderAddress: '北京朝阳区',
receiverAddress: '上海浦东新区'
},
{
orderId: 'ORD002',
sender: '王五',
receiver: '赵六',
orderDate: '2024-11-05',
status: '运输中',
senderAddress: '广州天河区',
receiverAddress: '深圳南山区'
},
{
orderId: 'ORD003',
sender: '周七',
receiver: '孙八',
orderDate: '2024-10-28',
status: '已取消',
senderAddress: '成都武侯区',
receiverAddress: '杭州西湖区'
},
]);
//
const filteredOrders = computed(() => {
let result = orders.value;
if (searchQuery.value) {
result = result.filter(order =>
order.orderId.includes(searchQuery.value) ||
order.receiver.includes(searchQuery.value)
);
}
if (statusFilter.value) {
result = result.filter(order => order.status === statusFilter.value);
}
return result;
});
//
const getStatusType = (status) => {
switch (status) {
case '已完成':
return 'success';
case '运输中':
return 'info';
case '已取消':
return 'danger';
default:
return 'default';
}
};
//
const searchOrders = () => {
//
};
//
const filterOrders = () => {
//
};
//
const viewOrder = (order) => {
selectedOrder.value = { ...order }; //
dialogVisible.value = true;
};
</script>
<style scoped>
/* 页面整体布局调整 */
.history-orders {
padding: 20px;
background-color: #f9f9f9; /* 设置页面背景颜色 */
border-radius: 8px; /* 圆角效果 */
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1); /* 添加阴影 */
}
/* 标题样式 */
.title {
font-size: 28px;
font-weight: bold;
color: #3a3a3a;
text-align: center; /* 居中标题 */
margin: 20px 0;
}
/* 历史订单标题 */
.history-label {
font-size: 20px;
font-weight: bold;
color: #333;
}
/* 表格样式 */
.el-table {
margin-top: 20px;
background-color: #ffffff; /* 表格背景颜色 */
border-radius: 8px;
overflow: hidden; /* 隐藏多余部分 */
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
/* 表头样式 */
.el-table th {
background-color: #f5f7fa;
color: #606266;
font-size: 14px;
font-weight: bold;
}
/* 表格行样式 */
.el-table .el-table__body tr:hover {
background-color: #eef5ff; /* 鼠标悬停效果 */
}
/* 标签样式 */
.el-tag {
font-size: 14px;
border-radius: 4px;
padding: 5px 10px;
}
/* 按钮样式 */
.el-button {
margin-left: 10px;
border-radius: 20px; /* 圆角按钮 */
}
/* 搜索框容器 */
.search-container {
margin-bottom: 20px;
}
/* 搜索和筛选区域样式 */
.search-filter-row {
margin-top: 20px;
}
.el-input, .el-button, .el-select {
margin-right: 10px;
border-radius: 4px; /* 统一圆角 */
}
/* 弹窗样式 */
.el-dialog {
border-radius: 10px;
}
.dialog-footer {
text-align: right;
}
.dialog-footer .el-button {
border-radius: 20px; /* 圆角关闭按钮 */
}
/* 响应式布局 */
@media (max-width: 768px) {
.search-filter-row {
flex-direction: column;
}
.el-col {
margin-bottom: 10px;
}
.title {
font-size: 22px;
}
.history-label {
font-size: 16px;
}
}
</style>

@ -0,0 +1,192 @@
<template>
<div class="container">
<!-- 页面标题 -->
<el-row class="title-row">
<el-col :span="24">
<h2 class="title">订单处理</h2>
</el-col>
</el-row>
<!-- 订单列表 -->
<el-table :data="orders" class="custom-table" stripe>
<el-table-column prop="orderId" label="订单编号" width="150" />
<el-table-column prop="customerName" label="客户姓名" width="150" />
<el-table-column prop="pickupAddress" label="取件地址" width="250" />
<el-table-column prop="deliveryAddress" label="送达地址" width="250" />
<el-table-column prop="status" label="订单状态" width="150">
<template #default="{ row }">
<el-select v-model="row.status" @change="handleStatusChange(row)" placeholder="请选择状态">
<el-option label="待接收" value="待接收" />
<el-option label="待配送" value="待配送" />
<el-option label="配送中" value="配送中" />
<el-option label="已完成" value="已完成" />
</el-select>
</template>
</el-table-column>
<el-table-column label="操作" width="200">
<template #default="{ row }">
<el-button type="link" @click="handleEditCustomer(row)">
修改顾客信息
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 修改顾客信息对话框 -->
<el-dialog v-model="dialogVisible" width="50%" title="修改顾客信息" class="custom-dialog">
<el-form :model="orderDetail" label-width="120px">
<el-form-item label="订单编号">
<el-input v-model="orderDetail.orderId" disabled />
</el-form-item>
<el-form-item label="客户姓名">
<el-input v-model="orderDetail.customerName" placeholder="请输入客户姓名" />
</el-form-item>
<el-form-item label="取件地址">
<el-input v-model="orderDetail.pickupAddress" placeholder="请输入取件地址" />
</el-form-item>
<el-form-item label="送达地址">
<el-input v-model="orderDetail.deliveryAddress" placeholder="请输入送达地址" />
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="saveCustomerInfo"></el-button>
</span>
</el-dialog>
</div>
</template>
<script setup>
import { ref } from "vue";
//
const orders = ref([
{
orderId: "123456",
customerName: "张三",
pickupAddress: "北京市朝阳区",
deliveryAddress: "北京市海淀区",
status: "待接收",
},
{
orderId: "123457",
customerName: "李四",
pickupAddress: "上海市浦东新区",
deliveryAddress: "上海市静安区",
status: "待配送",
},
{
orderId: "123458",
customerName: "王五",
pickupAddress: "广州市天河区",
deliveryAddress: "广州市越秀区",
status: "配送中",
},
]);
//
const orderDetail = ref({
orderId: "",
customerName: "",
pickupAddress: "",
deliveryAddress: "",
status: "",
});
//
const dialogVisible = ref(false);
//
const handleEditCustomer = (row) => {
orderDetail.value = { ...row }; // orderDetail
dialogVisible.value = true; //
};
//
const saveCustomerInfo = () => {
const index = orders.value.findIndex((order) => order.orderId === orderDetail.value.orderId);
if (index !== -1) {
orders.value[index] = { ...orderDetail.value }; //
alert("顾客信息已更新!");
dialogVisible.value = false; //
}
};
//
const handleStatusChange = (order) => {
alert(`订单 ${order.orderId} 状态已更改为:${order.status}`);
};
</script>
<style scoped>
/* 页面整体样式 */
.container {
background-color: #f9f9f9;
padding: 20px;
border-radius: 10px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
/* 标题样式 */
.title-row {
margin-bottom: 20px;
}
.title {
font-size: 24px;
font-weight: bold;
color: #333;
text-align: center;
}
/* 表格样式 */
.custom-table {
background: white;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 1px 6px rgba(0, 0, 0, 0.1);
}
.custom-table .el-table__header {
background-color: #f5f5f5;
font-weight: bold;
}
.custom-table .el-table__row {
transition: background-color 0.3s;
}
.custom-table .el-table__row:hover {
background-color: #f0f9ff;
}
/* 对话框样式 */
.custom-dialog {
border-radius: 10px;
}
.dialog-footer {
text-align: right;
border-top: 1px solid #f0f0f0;
padding-top: 10px;
}
/* 按钮样式 */
.el-button {
border-radius: 5px;
}
.el-button--primary {
background-color: #409eff;
border-color: #409eff;
}
.el-button--primary:hover {
background-color: #66b1ff;
}
/* 表单输入框样式 */
.el-form-item {
margin-bottom: 20px;
}
</style>

@ -0,0 +1,193 @@
<template>
<el-row class="page">
<el-row class="header">
<h2>地址簿</h2>
<el-button type="primary" @click="openAddDialog"></el-button>
</el-row>
<!-- 遍历显示 contactList 中的每个联系人信息 -->
<el-row class="block-view" v-for="(item, index) in contactList" :key="index">
<!-- 联系人信息 -->
<el-row class="contact-view">
<el-row>
<span class="name">{{ item.name }}</span>
<span class="phone">{{ item.phone }}</span>
</el-row>
<el-row class="address">{{ item.address }}</el-row>
<!-- 操作图标删除和编辑 -->
<el-row class="contact-icon-view">
<el-icon @click="deleteByIndex(index)">
<Delete />
</el-icon>
<el-icon @click="modify(item, index)">
<Edit />
</el-icon>
</el-row>
</el-row>
<!-- 分割线 -->
<el-row class="line-view"></el-row>
</el-row>
<!-- 删除确认对话框 -->
<el-dialog v-model="dialogVisible" title="警告" width="500">
<span>确定要删除此联系人吗</span>
<template #footer>
<div class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="deleteByIndexConfirm()">
确定
</el-button>
</div>
</template>
</el-dialog>
<!-- 添加或编辑联系人对话框 -->
<el-dialog v-model="dialogFormVisible" :title="dialogTitle" width="500">
<el-form :model="form">
<el-form-item label="姓名" :label-width="formLabelWidth">
<el-input v-model="form.name" autocomplete="off" />
</el-form-item>
<el-form-item label="电话号码" :label-width="formLabelWidth">
<el-input v-model="form.phone" autocomplete="off" />
</el-form-item>
<el-form-item label="地址" :label-width="formLabelWidth">
<el-input v-model="form.address" autocomplete="off" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button @click="dialogFormVisible = false">取消</el-button>
<el-button type="primary" @click="confirmDialog">
确认
</el-button>
</div>
</template>
</el-dialog>
</el-row>
</template>
<script setup>
import { Delete, Edit } from '@element-plus/icons-vue';
import { reactive, ref } from 'vue';
//
const contactList = reactive([
{ name: "张三", phone: "12345678901", address: "福建省福州市鼓楼区洪山镇杨桥西路50号" },
{ name: "李四", phone: "23456789012", address: "海南省海口市龙华区金垦路世代雅居二期清泉居A5028" },
]);
const dialogVisible = ref(false);
const dialogFormVisible = ref(false);
const dialogTitle = ref("新增联系人");
let formIndex = -1;
//
const form = reactive({
name: "",
phone: "",
email: "",
address: "",
});
const formLabelWidth = '100px';
//
const openAddDialog = () => {
dialogTitle.value = "新增联系人";
dialogFormVisible.value = true;
Object.assign(form, { name: "", phone: "", email: "", address: "" });
formIndex = -1;
};
//
const modify = (item, index) => {
dialogTitle.value = "编辑联系人";
dialogFormVisible.value = true;
Object.assign(form, item);
formIndex = index;
};
//
const confirmDialog = () => {
if (formIndex === -1) {
contactList.push({ ...form });
} else {
contactList[formIndex] = { ...form };
}
dialogFormVisible.value = false;
};
//
const deleteByIndex = (index) => {
dialogVisible.value = true;
formIndex = index;
};
const deleteByIndexConfirm = () => {
contactList.splice(formIndex, 1);
dialogVisible.value = false;
};
</script>
<style scoped>
.page {
display: flex;
flex-direction: column;
width: 100%;
background-color: white;
padding: 20px;
}
.header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
}
.block-view {
display: flex;
flex-direction: column;
margin-bottom: 20px;
border-bottom: 1px solid #ebebeb;
}
.contact-view {
display: flex;
flex-direction: column;
padding: 10px 0;
}
.name {
font-size: large;
font-weight: 500;
}
.phone {
color: gray;
margin-left: 10px;
}
.email {
color: gray;
font-size: small;
margin-top: 5px;
}
.address {
color: darkgray;
font-size: small;
margin-top: 5px;
}
.contact-icon-view {
margin-top: 10px;
display: flex;
justify-content: space-around;
}
.line-view {
height: 0.5px;
width: 95%;
background-color: lightgray;
margin-top: 10px;
}
</style>

@ -0,0 +1,105 @@
<template>
<div class="complaint-form">
<h2>快递投诉</h2>
<el-form :model="form" :rules="formRules" label-width="120px" class="form-container">
<!-- 运单号输入框 -->
<el-form-item label="运单号" prop="trackingNumber">
<el-input v-model="form.trackingNumber" placeholder="请输入运单号" clearable></el-input>
</el-form-item>
<!-- 投诉内容输入框 -->
<el-form-item label="投诉内容" prop="complaintContent">
<el-input v-model="form.complaintContent" type="textarea" placeholder="请输入投诉内容" rows="4"></el-input>
</el-form-item>
<!-- 联系方式输入框 -->
<el-form-item label="联系方式" prop="contact">
<el-input v-model="form.contact" placeholder="请输入联系方式" clearable></el-input>
</el-form-item>
<!-- 提交按钮 -->
<el-form-item>
<el-button type="primary" @click="handleSubmit"></el-button>
</el-form-item>
</el-form>
<!-- 提交成功提示 -->
<el-alert v-if="submitSuccess" type="success" title="投诉提交成功!" show-icon></el-alert>
<!-- 错误提示 -->
<el-alert v-if="error" type="error" :title="error" show-icon></el-alert>
</div>
</template>
<script setup>
import { ref } from 'vue';
import { ElForm, ElFormItem, ElInput, ElButton, ElAlert } from 'element-plus';
//
const form = ref({
trackingNumber: '',
complaintContent: '',
contact: ''
});
//
const submitSuccess = ref(false);
const error = ref(null);
//
const formRules = {
trackingNumber: [{ required: true, message: '请输入运单号', trigger: 'blur' }],
complaintContent: [{ required: true, message: '请输入投诉内容', trigger: 'blur' }],
contact: [
{ required: true, message: '请输入联系方式', trigger: 'blur' },
{ pattern: /^[0-9]{11}$/, message: '请输入有效的电话号码', trigger: 'blur' }
]
};
//
const handleSubmit = () => {
error.value = null; //
//
const formRef = ref(null);
formRef.value.validate((valid) => {
if (valid) {
//
// axios.post('/api/complaint', form.value)
//
submitSuccess.value = true;
setTimeout(() => {
submitSuccess.value = false; // 3
form.value = { trackingNumber: '', complaintContent: '', contact: '' }; //
}, 3000);
} else {
error.value = '请填写所有必填项';
}
});
};
</script>
<style scoped>
.complaint-form {
max-width: 600px;
margin: 50px auto;
padding: 20px;
background: #fff;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
border-radius: 8px;
text-align: center;
}
.form-container {
margin-bottom: 20px;
}
.el-alert {
margin-top: 20px;
}
h2 {
margin-bottom: 20px;
}
</style>

@ -1,203 +1,241 @@
<template>
<el-row class="main">
<!-- 寄件人面板 -->
<el-row class="panel send-panel send-panel1">
<el-row class="send-container">
<el-button class="send-btn"></el-button>
<el-row>
<el-button class="btn" @click="openAddressBook('sender')">簿</el-button>
<el-button class="btn" @click="autoFill('sender')"></el-button>
</el-row>
</el-row>
<el-form ref="formSender" label-width="auto" class="form" :model="sender" :rules="senderRules">
<el-form-item label="姓名" prop="name">
<el-input v-model="sender.name" placeholder="请填写发件人姓名"></el-input>
</el-form-item>
<el-form-item label="联系电话" prop="phone">
<el-input v-model="sender.phone" placeholder="请填写发件人联系电话"></el-input>
</el-form-item>
<el-form-item label="省市区" prop="region">
<el-input v-model="sender.address.region" placeholder="请填写发件人省市区"></el-input>
</el-form-item>
<el-form-item label="详细地址" prop="detail">
<el-input v-model="sender.address.detail" placeholder="请填写发件人详细地址"></el-input>
</el-form-item>
<el-form-item label="公司名称">
<el-input v-model="sender.company" placeholder="请填写发件人公司名称"></el-input>
</el-form-item>
</el-form>
</el-row>
<!-- 箭头图标 -->
<el-image class="arrow" src="/arrow.png"></el-image>
<!-- 收件人面板 -->
<el-row class="panel send-panel send-panel1">
<el-row class="send-container">
<el-button class="send-btn receive-btn"></el-button>
<el-row>
<el-button class="btn" @click="openAddressBook('receiver')">簿</el-button>
<el-button class="btn" @click="autoFill('receiver')"></el-button>
</el-row>
</el-row>
<el-form ref="formReceiver" label-width="auto" class="form" :model="receiver" :rules="receiverRules">
<el-form-item label="姓名" prop="name">
<el-input v-model="receiver.name" placeholder="请填写收件人姓名"></el-input>
</el-form-item>
<el-form-item label="联系电话" prop="phone">
<el-input v-model="receiver.phone" placeholder="请填写收件人联系电话"></el-input>
</el-form-item>
<el-form-item label="省市区" prop="region">
<el-input v-model="receiver.address.region" placeholder="请填写收件人省市区"></el-input>
</el-form-item>
<el-form-item label="详细地址" prop="detail">
<el-input v-model="receiver.address.detail" placeholder="请填写收件人详细地址"></el-input>
</el-form-item>
<el-form-item label="公司名称">
<el-input v-model="receiver.company" placeholder="请填写收件人公司名称"></el-input>
</el-form-item>
</el-form>
</el-row>
<!-- 寄件方式 -->
<el-row class="panel send-panel">
<el-text class="send-label">寄件方式</el-text>
<el-row>
<el-radio-group v-model="shippingMethod">
<el-radio :label="1">预约上门取件</el-radio>
<el-radio :label="0">自行联系快递员</el-radio>
</el-radio-group>
</el-row>
</el-row>
<!-- 下单按钮 -->
<el-row class="panel send-panel">
<el-button class="confirm-btn" @click="submitOrder"></el-button>
</el-row>
</el-row>
<el-row class="main">
<!-- 发件人面板 -->
<el-row class="send-container">
<el-row class="panel send-panel send-panel1">
<el-row class="send-container">
<el-button class="send-btn"></el-button>
<el-row>
<el-button class="btn" @click="openAddressBook('sender')">簿</el-button>
<el-button class="btn" @click="autoFill('sender')"></el-button>
</el-row>
</el-row>
<el-form ref="formSender" label-width="auto" class="form" :model="sender" :rules="senderRules">
<el-form-item label="姓名" prop="name">
<el-input v-model="sender.name" placeholder="请填写发件人姓名"></el-input>
</el-form-item>
<el-form-item label="联系电话" prop="phone">
<el-input v-model="sender.phone" placeholder="请填写发件人联系电话"></el-input>
</el-form-item>
<el-form-item label="省市区" prop="region">
<el-input v-model="sender.region" placeholder="请填写发件人省市区"></el-input>
</el-form-item>
<el-form-item label="详细地址" prop="detail">
<el-input v-model="sender.detail" placeholder="请填写发件人详细地址"></el-input>
</el-form-item>
<el-form-item label="公司名称">
<el-input v-model="sender.company" placeholder="请填写发件人公司名称"></el-input>
</el-form-item>
</el-form>
</el-row>
<!-- 箭头图标 -->
<el-image class="arrow" src="/arrow.png"></el-image>
<!-- 收件人面板 -->
<el-row class="panel send-panel send-panel1">
<el-row class="send-container">
<el-button class="send-btn receive-btn"></el-button>
<el-row>
<el-button class="btn" @click="openAddressBook('receiver')">簿</el-button>
<el-button class="btn" @click="autoFill('receiver')"></el-button>
</el-row>
</el-row>
<el-form ref="formReceiver" label-width="auto" class="form" :model="receiver" :rules="receiverRules">
<el-form-item label="姓名" prop="name">
<el-input v-model="receiver.name" placeholder="请填写收件人姓名"></el-input>
</el-form-item>
<el-form-item label="联系电话" prop="phone">
<el-input v-model="receiver.phone" placeholder="请填写收件人联系电话"></el-input>
</el-form-item>
<el-form-item label="省市区" prop="region">
<el-input v-model="receiver.region" placeholder="请填写收件人省市区"></el-input>
</el-form-item>
<el-form-item label="详细地址" prop="detail">
<el-input v-model="receiver.detail" placeholder="请填写收件人详细地址"></el-input>
</el-form-item>
<el-form-item label="公司名称">
<el-input v-model="receiver.company" placeholder="请填写收件人公司名称"></el-input>
</el-form-item>
</el-form>
</el-row>
</el-row>
<!-- 寄件方式 -->
<el-row class="panel send-panel">
<el-text class="send-label">寄件方式</el-text>
<el-row>
<el-radio-group v-model="shippingMethod">
<el-radio :label="1">预约上门取件</el-radio>
<el-radio :label="0">自行联系快递员</el-radio>
</el-radio-group>
</el-row>
</el-row>
<!-- 下单按钮 -->
<el-row class="panel send-panel">
<el-button class="confirm-btn" @click="submitOrder"></el-button>
</el-row>
</el-row>
</template>
<script setup>
import { ref } from 'vue';
import { ElMessage } from 'element-plus'; //
const formSender = ref(null);
const formReceiver = ref(null);
//
const sender = ref({
name: '',
phone: '',
address: {
region: '',
detail: ''
},
company: ''
name: '',
phone: '',
region: '',
detail: '',
company: ''
});
const receiver = ref({
name: '',
phone: '',
address: {
region: '',
detail: ''
},
company: ''
name: '',
phone: '',
region: '',
detail: '',
company: ''
});
const shippingMethod = ref(1); //
//
const senderRules = {
name: [{ required: true, message: '请输入发件人姓名', trigger: 'blur' }],
phone: [{ required: true, message: '请输入发件人联系电话', trigger: 'blur' }],
region: [{ required: true, message: '请输入发件人省市区', trigger: 'blur' }],
detail: [{ required: true, message: '请输入发件人详细地址', trigger: 'blur' }]
name: [{ required: true, message: '请输入发件人姓名', trigger: 'blur' }],
phone: [{ required: true, message: '请输入发件人联系电话', trigger: 'blur' }],
region: [{ required: true, message: '请输入发件人省市区', trigger: 'blur' }],
detail: [{ required: true, message: '请输入发件人详细地址', trigger: 'blur' }]
};
const receiverRules = {
name: [{ required: true, message: '请输入收件人姓名', trigger: 'blur' }],
phone: [{ required: true, message: '请输入收件人联系电话', trigger: 'blur' }],
region: [{ required: true, message: '请输入收件人省市区', trigger: 'blur' }],
detail: [{ required: true, message: '请输入收件人详细地址', trigger: 'blur' }]
name: [{ required: true, message: '请输入收件人姓名', trigger: 'blur' }],
phone: [{ required: true, message: '请输入收件人联系电话', trigger: 'blur' }],
region: [{ required: true, message: '请输入收件人省市区', trigger: 'blur' }],
detail: [{ required: true, message: '请输入收件人详细地址', trigger: 'blur' }]
};
// 簿
const openAddressBook = (type) => {
console.log(`${type} 地址簿点击`);
console.log(`${type} 地址簿点击`);
};
const autoFill = (type) => {
console.log(`${type} 智能填写点击`);
console.log(`${type} 智能填写点击`);
};
//
const submitOrder = () => {
//
const formSender = document.querySelector('#formSender');
const formReceiver = document.querySelector('#formReceiver');
//
formSender.validate((valid) => {
if (!valid) return;
});
formReceiver.validate((valid) => {
if (!valid) return;
formSender.value.validate((senderValid) => {
if (!senderValid) {
ElMessage.error('请完整填写寄件人信息!');
return;
}
formReceiver.value.validate((receiverValid) => {
if (!receiverValid) {
ElMessage.error('请完整填写收件人信息!');
return;
}
ElMessage.success('下单成功!');
resetForm();
});
});
};
//
console.log('订单提交:', sender.value, receiver.value, shippingMethod.value);
//
const resetForm = () => {
sender.value = {
name: '',
phone: '',
address: {
region: '',
detail: ''
},
company: ''
};
receiver.value = {
name: '',
phone: '',
address: {
region: '',
detail: ''
},
company: ''
};
shippingMethod.value = 1;
};
</script>
<style scoped>
.send-btn {
border-radius: 100%;
padding: 10px;
background-color: black;
color: white;
}
.receive-btn {
background-color: red;
color: white;
}
.btn {
background-color: white;
}
.send-container {
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
.panel {
display: flex;
flex-direction: column;
background-color: white;
justify-content: center;
align-items: flex-start;
}
.send-panel {
margin-top: 10px;
padding: 10px;
width: 100%;
line-height: 40px;
}
.send-panel1 {
width: 40%;
align-items: center;
}
.form {
width: 80%;
margin-top: 10px;
}
.arrow {
width: 40px;
height: 10px;
}
.send-label {
font-weight: 600;
}
.confirm-btn {
background-color: royalblue;
color: white;
}
.send-btn {
border-radius: 100%;
padding: 10px;
background-color: black;
color: white;
}
.receive-btn {
background-color: red;
color: white;
}
.btn {
background-color: white;
}
.send-container {
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
.panel {
display: flex;
flex-direction: column;
background-color: white;
justify-content: center;
align-items: flex-start;
}
.send-panel {
margin-top: 10px;
padding: 10px;
width: 100%;
line-height: 40px;
}
.send-panel1 {
width: 40%;
align-items: center;
}
.form {
width: 80%;
margin-top: 10px;
}
.arrow {
width: 40px;
height: 10px;
}
.send-label {
font-weight: 600;
}
.confirm-btn {
background-color: royalblue;
color: white;
}
</style>

@ -1,153 +0,0 @@
<template>
<el-row class="page">
<el-row class="block-view" v-for="(item,index) in expressList">
<el-row class="top">
<el-row>运单号{{item.express_no}}</el-row>
<el-row class="top-time">签收时间{{item.s_datetime}}</el-row>
</el-row>
<el-row class="express-view">
<el-row class="express-no-view">
<el-text class="city">{{item.senderCity}}</el-text>
<el-text class="user">{{item.senderName}}</el-text>
</el-row>
<el-row class="express-no-view">
<el-image class="arrow" src="/arrow.png"></el-image>
<el-text class="sign">已签收</el-text>
</el-row>
<el-row class="express-no-view">
<el-text class="city">{{item.receiveCity}}</el-text>
<el-text class="user">{{item.receiveName}}</el-text>
</el-row>
<el-row class="express-icon-view">
<el-icon>
<Delete />
</el-icon>
<el-icon>
<Edit />
</el-icon>
</el-row>
<el-row class="Line-view"></el-row>
</el-row>
</el-row>
</el-row>
</template>
<script setup>
import {
Delete,
Edit
} from '@element-plus/icons-vue'
import {
reactive
} from 'vue';
const expressList = reactive([
{
"express_no":"SF12313123123",
"senderCity":"深圳市",
"senderName":"高先生1",
"receiveCity":"福州市",
"receiveName":"叶先生",
"s_datetime":"2024-11-11 11:11:11"
},
{
"express_no":"SF12313123123",
"senderCity":"深圳市",
"senderName":"高先生2",
"receiveCity":"福州市",
"receiveName":"叶先生",
"s_datetime":"2024-11-11 11:11:11"
},
{
"express_no":"SF12313123123",
"senderCity":"深圳市",
"senderName":"高先生3",
"receiveCity":"福州市",
"receiveName":"叶先生",
"s_datetime":"2024-11-11 11:11:11"
},
{
"express_no":"SF12313123123",
"senderCity":"深圳市",
"senderName":"高先生4",
"receiveCity":"福州市",
"receiveName":"叶先生",
"s_datetime":"2024-11-11 11:11:11"
}
])
</script>
<style>
.page {
display: flex;
flex-direction: column;
width: 100%;
background-color: white;
line-height: 20px;
}
.block-view {
width: 100%;
display: flex;
flex-direction: column;
}
.top {
display: flex;
flex-direction: row;
justify-content: flex-start;
padding: 20px;
color: gray;
}
.top-time {
margin-left: 180px;
}
.express-view {
display: flex;
width: 100%;
justify-content: space-around;
}
.express-no-view {
display: flex;
flex-direction: column;
}
.city {
font-size: large;
font-weight: 500;
}
.user {
margin-top: 10px;
font-size: small;
color: gray;
}
.arrow {
width: 40px;
height: 10px;
}
.sign {
font-size: small;
margin-top: 10px;
color: red;
font-weight: 100;
}
.express-icon-view {
width: 10%;
display: flex;
justify-content: space-around;
}
.Line-view {
height: 0.5px;
width: 95%;
background-color: lightgray;
margin-top: 20px;
margin-bottom: 20px;
}
</style>

@ -0,0 +1,142 @@
<template>
<div class="user-home-page">
<section class="welcome-banner">
<h1>欢迎使用旭日快递用户系统</h1>
<p>在这里您可以查看快递状况下单快递</p>
</section>
<!-- 用户信息部分 -->
<section class="user-info">
<el-row :gutter="20">
<el-col :span="8">
<el-card class="user-card">
<div class="user-title">用户名</div>
<div class="user-value">{{ username }}</div>
</el-card>
</el-col>
<el-col :span="8">
<el-card class="user-card">
<div class="user-title">账户余额</div>
<div class="user-value">{{ balance }} </div>
</el-card>
</el-col>
<el-col :span="8">
<el-card class="user-card">
<div class="user-title">最近登录</div>
<div class="user-value">{{ lastLogin }}</div>
</el-card>
</el-col>
</el-row>
</section>
<!-- 快递状态部分 -->
<section class="express-status">
<el-row :gutter="20">
<el-col :span="8">
<el-card class="status-card">
<div class="status-title">最新快递</div>
<div class="status-value">{{ latestExpress }}</div>
<el-button type="text" @click="goToPage('/express/detail')"></el-button>
</el-card>
</el-col>
<el-col :span="8">
<el-card class="status-card">
<div class="status-title">当前订单</div>
<div class="status-value">{{ currentOrderStatus }}</div>
<el-button type="text" @click="goToPage('/express/ongoing')"></el-button>
</el-card>
</el-col>
<el-col :span="8">
<el-card class="status-card">
<div class="status-title">已完成订单</div>
<div class="status-value">{{ completedOrders }}</div>
<el-button type="text" @click="goToPage('/express/completed')"></el-button>
</el-card>
</el-col>
</el-row>
</section>
<!-- 常用功能区 -->
</div>
</template>
<script setup>
import { ref } from 'vue';
import { useRouter } from 'vue-router';
//
const username = ref('张三');
const balance = ref(100.5); //
const lastLogin = ref('2024年11月19日 10:00');
//
const latestExpress = ref('快递001正在运输中');
const currentOrderStatus = ref('快递002待取件');
const completedOrders = ref(25);
//
const router = useRouter();
const goToPage = (path) => {
router.push(path);
};
</script>
<style scoped>
.user-home-page {
padding: 20px;
background-color: #f9f9f9;
}
.user-info,
.express-status {
margin-bottom: 30px;
}
.user-card,
.status-card {
text-align: center;
padding: 20px;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.user-title,
.status-title {
font-size: 18px;
color: #606266;
margin-bottom: 10px;
}
.user-value,
.status-value {
font-size: 24px;
font-weight: bold;
color: #409EFF;
}
.quick-actions {
margin-top: 30px;
text-align: center;
}
.el-button {
width: 100%;
padding: 15px 0;
}
.el-row {
margin-top: 10px;
}
.el-card {
cursor: pointer;
}
.el-card:hover {
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}
.welcome-banner h1 {
font-size: 24px;
margin: 0;
}
</style>

@ -1,82 +1,77 @@
<template>
<div class="common-layout">
<div id="app">
<!-- Top Navigation Bar -->
<el-header class="top-nav" mode="horizontal">
<div class="logo">
<img src="../../assets/logo.png" alt="Logo" class="logo-image">
<span class="title">旭日快递</span>
</div>
<div class="user-controls">
<span class="welcome-message">欢迎您158****1626</span>
<el-button type="text" class="logout-button" @click="logout">退</el-button>
</div>
</el-header>
<!-- Main Container -->
<el-container>
<el-header>
<el-menu class="el-menu-demo" mode="horizontal">
<el-menu-item index="1">
<el-image class="logo" src="/logo.png"></el-image>
</el-menu-item>
<el-menu-item index="2">
<el-text>首页</el-text>
</el-menu-item>
<el-menu-item index="3">
<el-sub-menu index="2">
<template #title>物流服务</template>
<el-menu-item index="2-1">即时服务</el-menu-item>
<el-menu-item index="2-2">快递服务</el-menu-item>
</el-sub-menu>
</el-menu-item>
<el-menu-item index="4">欢迎您158****1626 我的顺丰</el-menu-item>
<!-- Sidebar -->
<el-aside width="200px" class="sidebar">
<el-menu :default-active="activeSidebarMenu" class="side-menu" @select="handleSidebarMenuSelect" router>
<el-menu-item index="Head">首页</el-menu-item>
<el-submenu index="1">
<template #title>快递管理</template>
<el-menu-item index="ExpressForm">寄快递</el-menu-item>
<el-menu-item index="OrderManagement">快递列表</el-menu-item>
<el-menu-item index="ShipmentQuery">运单查询</el-menu-item>
</el-submenu>
<el-submenu index="2">
<template #title>用户管理</template>
<el-menu-item index="userProfile">用户资料</el-menu-item>
<el-menu-item index="Address">地址簿</el-menu-item>
</el-submenu>
<el-menu-item index="CourierComplaint">快递投诉</el-menu-item>
</el-menu>
</el-header>
<el-container>
<el-aside width="200px">
<el-row class="tac">
<el-col>
<el-menu default-active="2" class="el-menu-vertical-demo">
<el-sub-menu index="1">
<template #title>
<el-icon>
<location />
</el-icon>
<span>我要寄件</span>
</template>
<el-menu-item-group>
<router-link to="/user/expressForm">
<el-menu-item index="1-1">寄快递</el-menu-item>
</router-link>
<el-menu-item index="1-2">批量寄</el-menu-item>
</el-menu-item-group>
</el-sub-menu>
<el-menu-item index="2">
<router-link to="/user/expressList">
<el-icon><icon-menu /></el-icon>
<span>运单查询</span>
</router-link>
</el-menu-item>
<el-menu-item index="3">
<router-link to="/user/myInfo">
<el-icon>
<setting />
</el-icon>
<span>我的资料</span>
</router-link>
</el-menu-item>
</el-menu>
</el-col>
</el-row>
</el-aside>
<el-main>
<router-view></router-view>
</el-main>
</el-container>
</el-aside>
<!-- Content Area -->
<el-main class="content-area">
<router-view></router-view>
</el-main>
</el-container>
</div>
</template>
<script lang="ts" setup>
import { Document, Menu as IconMenu, Location, Setting } from '@element-plus/icons-vue'
const handleOpen = (key : string, keyPath : string[]) => {
console.log(key, keyPath)
}
const handleClose = (key : string, keyPath : string[]) => {
console.log(key, keyPath)
}
<script setup>
import { ref } from 'vue';
import { useRouter } from 'vue-router';
const activeTopMenu = ref('dashboard');
const activeSidebarMenu = ref('/home');
const router = useRouter();
// Top menu item selection handler
const handleTopMenuSelect = (index) => {
activeTopMenu.value = index;
};
// Sidebar menu item selection handler
const handleSidebarMenuSelect = (index) => {
activeSidebarMenu.value = index;
router.push(index); // Navigate to selected route
};
// Logout function
const logout = () => {
// Clear user session or token (if any)
localStorage.removeItem('userToken'); // Example: Remove stored token
// Redirect to login page
router.push('/login');
};
</script>
<style>
.common-layout {
<style scoped>
#app {
position: absolute;
top: 0;
right: 0;
@ -84,46 +79,84 @@
left: 0;
}
.el-header,
.el-footer {
background-color: white;
color: #333;
text-align: center;
line-height: 60px;
.top-nav {
display: flex;
justify-content: space-between;
padding: 0 30px;
background-color: #409EFF;
color: white;
align-items: center;
height: 80px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.logo {
display: flex;
align-items: center;
}
.el-aside {
background-color: #d9ecff;
color: #333;
text-align: center;
line-height: 200px;
.logo-image {
width: 40px;
margin-right: 10px;
}
.el-main {
background-color: #ecf5ff;
color: #333;
text-align: center;
line-height: 160px;
.title {
font-size: 1.5em;
font-weight: bold;
}
body>.el-container {
marigin-bottom: 40px;
.top-menu {
color: white;
}
.el-container:nth-child(5).elaside,
.el-container:nth-child(6).el-side {
line-height: 260px;
.el-menu-item {
padding: 0 20px;
}
.el-container:nth-child(7).el-side {
line-height: 320px;
.logout-button {
color: white;
font-size: 1em;
margin-left: 20px;
}
.el-menu--horizontal>.el-menu-item:nth-child(3) {
margin-right: auto;
.sidebar {
background-color: #f5f7fa;
padding: 20px 0;
box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}
.logo {
height: 55px
.side-menu {
height: 100%;
border-right: none;
}
.side-menu .el-menu-item,
.side-menu .el-submenu__title {
font-size: 16px;
padding: 15px 20px;
}
.side-menu .el-menu-item:hover,
.side-menu .el-submenu__title:hover {
background-color: #e5f1fb;
color: #409EFF;
}
.content-area {
padding: 20px 30px;
background-color: #ffffff;
box-shadow: inset 0px 0px 10px rgba(0, 0, 0, 0.05);
border-radius: 6px;
margin: 20px;
overflow-y: auto;
}
.el-menu-item.is-active {
color: #409EFF !important;
background-color: #e5f1fb;
}
.user-controls {
display: flex;
align-items: center;
}
</style>

@ -1,143 +0,0 @@
<template>
<el-row class="top">
<el-col :span="6" class="col">个人信息</el-col>
<el-col :span="6" class="col-exit">注销账号</el-col>
</el-row>
<el-row class="body">
<el-image class="user-img" src="/user.png"></el-image>
<e-text class="phone">158XXXXXXXX</e-text>
<el-form label-width="auto" style="max-width:600px">
<el-form-item label="性别">
<el-select placeholder="请选择性别" v-model="value">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="生日">
<el-date-picker
v-model="value1"
type="date"
placeholder="请选择一个日期"
:size="20"
/>
</el-form-item>
<el-form-item label="地区">
<el-cascader
v-model="selectedRegion"
:options="optionRegion"
placeholder="请选择地区"
></el-cascader>
</el-form-item>
<el-form-item label="绑定电话">
<el-input v-model="phone"/>
</el-form-item>
</el-form>
</el-row>
</template>
<script setup>
import { ref } from 'vue';
const value1=ref(new Date())
const value =ref('')
const phone=ref('')
const options = [
{
value: '男',
label: '男',
},
{
value: '女',
label: '女',
},
]
//
const selectedRegion = ref([]);
//
const optionRegion = ref([
{
value: 'beijing',
label: '北京',
children: [
{
value: 'chaoyang',
label: '朝阳区',
children: [
{ value: 'subdistrict1', label: '某街道1' },
{ value: 'subdistrict2', label: '某街道2' }
]
},
{
value: 'haidian',
label: '海淀区',
children: [
{ value: 'subdistrict3', label: '某街道3' },
{ value: 'subdistrict4', label: '某街道4' }
]
}
]
},
{
value: 'shanghai',
label: '上海',
children: [
{
value: 'pudong',
label: '浦东新区',
children: [
{ value: 'subdistrict5', label: '某街道5' },
{ value: 'subdistrict6', label: '某街道6' }
]
}
]
}
]);
</script>
<style>
.top{
background-color: white;
height: 50px;
flex-wrap: nowrap;
justify-content: space-between;
align-items:center;
border-radius: 10px;
}
.col{
font-size: 20px;
padding-left: 20px;
display: flex;
flex-direction: row;
justify-content: flex-start;
}
.col-exit{
font-size: 12px;
display: flex;
flex-direction: row;
justify-content: flex-end;
padding-right: 20px;
}
.body{
margin-top: 20px;
background-color: white;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
line-height: 0px;
height: 78vh;
}
.user-img{
width: 100px;
height: 100px;
}
.phone{
margin-top: 20px;
font-size: 14px;
margin-bottom: 20px;
}
</style>

@ -0,0 +1,240 @@
<template>
<el-row class="page">
<el-row class="header">
<h2>快递列表</h2>
</el-row>
<!-- 遍历显示 expressList 中的每个快递信息 -->
<el-row class="block-view" v-for="(item, index) in expressList" :key="index">
<!-- 顶部信息包括运单号和签收时间 -->
<el-row class="top">
<el-row>运单号{{ item.express_no }}</el-row>
<el-row class="top-time">签收时间{{ item.s_datetime }}</el-row>
</el-row>
<!-- 快递信息区域 -->
<el-row class="express-view">
<!-- 寄件人信息 -->
<el-row class="express-no-view">
<el-text class="city">{{ item.senderCity }}</el-text>
<el-text class="user">{{ item.senderName }}</el-text>
</el-row>
<!-- 箭头及签收状态 -->
<el-row class="express-no-view">
<el-image class="arrow" src="/arrow.png"></el-image>
<el-text class="sign">已签收</el-text>
</el-row>
<!-- 收件人信息 -->
<el-row class="express-no-view">
<el-text class="city">{{ item.receiveCity }}</el-text>
<el-text class="user">{{ item.receiveName }}</el-text>
</el-row>
<!-- 操作图标删除和编辑 -->
<el-row class="express-icon-view">
<el-icon @click="deleteByIndex(index)">
<Delete />
</el-icon>
<el-icon @click="modify(item,index)">
<Edit />
</el-icon>
</el-row>
</el-row>
<!-- 分割线 -->
<el-row class="line-view"></el-row>
</el-row>
<el-dialog v-model="dialogVisible" title="警告" width="500">
<span>确定要删除此条快递信息吗</span>
<template #footer>
<div class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="deleteByIndexConfirm()">
确定
</el-button>
</div>
</template>
</el-dialog>
<el-dialog v-model="dialogFormVisible" title="编辑快件表单" width="500">
<el-form :model="form">
<el-form-item label="寄件城市" :label-width="formLabelWidth">
<el-input v-model="form.senderCity" autocomplete="off" />
</el-form-item>
<el-form-item label="寄件人" :label-width="formLabelWidth">
<el-input v-model="form.senderName" autocomplete="off" />
</el-form-item>
<el-form-item label="收件城市" :label-width="formLabelWidth">
<el-input v-model="form.receiveCity" autocomplete="off" />
</el-form-item>
<el-form-item label="收件人" :label-width="formLabelWidth">
<el-input v-model="form.receiveName" autocomplete="off" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button @click="dialogFormVisible = false">取消</el-button>
<el-button type="primary" @click="modifyConfirm()">
确认
</el-button>
</div>
</template>
</el-dialog>
</el-row>
</template>
<script setup>
import {
Delete,
Edit
} from '@element-plus/icons-vue';
import {
reactive,ref
} from 'vue';
//
const expressList = reactive([{
express_no: "SF12313123123",
senderCity: "深圳市",
senderName: "高先生1",
receiveCity: "福州市",
receiveName: "叶先生",
s_datetime: "2024-11-11 11:11:11"
},
{
express_no: "SF22313123124",
senderCity: "广州市",
senderName: "王小姐",
receiveCity: "上海市",
receiveName: "张先生",
s_datetime: "2024-11-11 14:15:00"
},
{
express_no: "SF32313123125",
senderCity: "杭州市",
senderName: "李女士",
receiveCity: "北京市",
receiveName: "周女士",
s_datetime: "2024-11-12 09:30:00"
}
]);
const dialogVisible = ref(false)
let formIndex = -1
const deleteByIndex = index => {
dialogVisible.value = true
formIndex = index
}
const deleteByIndexConfirm = () => {
dialogVisible.value = false
expressList.splice(formIndex, 1)
}
const dialogFormVisible= ref(false)
const formLabelWidth = '140px'
const form = reactive({
"express_no": "",
"senderCity": "",
"senderName": "",
"receiveCity": "",
"receiveName": "",
"s_datetime": ""
})
const modify= (item,index)=>{
dialogFormVisible.value = true
form.senderCity = item.senderCity
form.senderName = item.senderName
form.receiveCity = item.receiveCity
form.receiveName = item.receiveName
formIndex = index
}
const modifyConfirm = ()=>{
dialogFormVisible.value = false
const item = expressList[formIndex]
item.senderCity = form.senderCity
item.senderName = form.senderName
item.receiveCity = form.receiveCity
item.receiveName = form.receiveName
}
</script>
<style scoped>
.page {
display: flex;
flex-direction: column;
width: 100%;
background-color: white;
padding: 20px;
line-height: 20px;
}
.header {
text-align: center;
margin-bottom: 20px;
}
.block-view {
width: 100%;
display: flex;
flex-direction: column;
margin-bottom: 20px;
border-bottom: 1px solid #ebebeb;
}
.top {
display: flex;
flex-direction: row;
justify-content: flex-start;
padding: 10px;
color: gray;
}
.top-time {
margin-left: 180px;
}
.express-view {
display: flex;
width: 100%;
justify-content: space-around;
padding: 10px 0;
}
.express-no-view {
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
}
.city {
font-size: large;
font-weight: 500;
}
.user {
margin-top: 5px;
font-size: small;
color: gray;
}
.arrow {
width: 40px;
height: 10px;
}
.sign {
font-size: small;
margin-top: 5px;
color: red;
font-weight: bold;
}
.express-icon-view {
width: 10%;
display: flex;
justify-content: space-around;
align-items: center;
}
.line-view {
height: 0.5px;
width: 95%;
background-color: lightgray;
margin-top: 10px;
}
</style>

@ -0,0 +1,100 @@
<template>
<div class="shipment-query">
<h2>运单查询</h2>
<el-form :model="form" label-width="120px" class="query-form">
<!-- 运单号输入框 -->
<el-form-item label="运单号" prop="trackingNumber">
<el-input v-model="form.trackingNumber" placeholder="请输入运单号" clearable></el-input>
</el-form-item>
<!-- 查询按钮 -->
<el-form-item>
<el-button type="primary" @click="handleQuery"></el-button>
</el-form-item>
</el-form>
<!-- 查询结果展示 -->
<el-card v-if="shipment" class="shipment-info">
<p><strong>运单号</strong>{{ shipment.trackingNumber }}</p>
<p><strong>发货人</strong>{{ shipment.sender }}</p>
<p><strong>收货人</strong>{{ shipment.receiver }}</p>
<p><strong>当前状态</strong>{{ shipment.status }}</p>
<p><strong>预计到达</strong>{{ shipment.estimatedArrival }}</p>
</el-card>
<!-- 错误提示 -->
<el-alert v-if="error" type="error" :title="error" show-icon></el-alert>
</div>
</template>
<script setup>
import { ref } from 'vue';
import { ElForm, ElFormItem, ElInput, ElButton, ElCard, ElAlert } from 'element-plus';
//
const form = ref({
trackingNumber: ''
});
const shipment = ref(null);
const error = ref(null);
//
const mockShipments = [
{
trackingNumber: 'SF12313123123',
sender: '高先生',
receiver: '叶先生',
status: '运输中',
estimatedArrival: '2024-11-18'
},
{
trackingNumber: 'SF45645645656',
sender: '陈先生',
receiver: '叶先生',
status: '运输中',
estimatedArrival: '2024-11-16'
}
];
//
const handleQuery = () => {
error.value = null; //
const trackingNumber = form.value.trackingNumber.trim();
if (!trackingNumber) {
error.value = '请输入有效的运单号';
shipment.value = null;
return;
}
//
const foundShipment = mockShipments.find(shipment => shipment.trackingNumber === trackingNumber);
if (foundShipment) {
shipment.value = foundShipment;
} else {
error.value = '未找到该运单号的信息';
shipment.value = null;
}
};
</script>
<style scoped>
.shipment-query {
max-width: 600px;
margin: 50px auto;
text-align: center;
}
.query-form {
margin-bottom: 20px;
}
.shipment-info {
margin-top: 20px;
text-align: left;
}
.el-alert {
margin-top: 20px;
}
</style>

@ -0,0 +1,176 @@
<template>
<el-row class="top">
<el-col :span="6" class="col">用户资料</el-col>
<el-col :span="6" class="col-exit">
<el-button type="text" @click="logout"></el-button>
</el-col>
</el-row>
<el-row class="body">
<el-image class="user-img" src="/user.png"></el-image>
<div class="user-info">
<e-text class="username">{{ username }}</e-text>
<e-text class="email">{{ email }}</e-text>
</div>
<el-form label-width="auto" style="max-width:600px">
<el-form-item label="性别">
<el-select placeholder="请选择性别" v-model="gender">
<el-option v-for="item in genderOptions" :key="item.value" :label="item.label"
:value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="生日">
<el-date-picker v-model="birthdate" type="date" placeholder="请选择生日" :size="20" />
</el-form-item>
<el-form-item label="地区">
<el-cascader v-model="selectedRegion" :options="optionRegion" placeholder="请选择地区"></el-cascader>
</el-form-item>
<el-form-item label="电话">
<el-input v-model="phone" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="updateProfile"></el-button>
</el-form-item>
</el-form>
</el-row>
</template>
<script setup>
import {
ref
} from 'vue';
import { useUserStore } from '../../store/user';
const userStore = useUserStore();
const username = userStore.username;
const email = userStore.email;
const gender = ref(userStore.gender);
const birthdate = ref(userStore.birthdate);
const phone = ref(userStore.phone);
const selectedRegion = ref(userStore.selectedRegion);
const genderOptions = [{
value: '男',
label: '男'
},
{
value: '女',
label: '女'
},
];
const optionRegion = ref([{
value: 'beijing',
label: '北京',
children: [{
value: 'chaoyang',
label: '朝阳区',
children: [{
value: 'subdistrict1',
label: '某街道1'
},
{
value: 'subdistrict2',
label: '某街道2'
},
],
},
{
value: 'haidian',
label: '海淀区',
children: [{
value: 'subdistrict3',
label: '某街道3'
},
{
value: 'subdistrict4',
label: '某街道4'
},
],
},
],
},
{
value: 'shanghai',
label: '上海',
children: [{
value: 'pudong',
label: '浦东新区',
children: [{
value: 'subdistrict5',
label: '某街道5'
},
{
value: 'subdistrict6',
label: '某街道6'
},
],
}, ],
},
]);
const logout = () => {
//
console.log("已注销");
};
const updateProfile = () => {
userStore.updateProfile({
username: userStore.username,
email: userStore.email,
gender: gender.value,
birthdate: birthdate.value,
phone: phone.value,
selectedRegion: selectedRegion.value,
});
console.log('用户资料已更新');
};
</script>
<style>
.top {
background-color: white;
height: 50px;
display: flex;
justify-content: space-between;
align-items: center;
border-radius: 10px;
}
.col {
font-size: 20px;
padding-left: 20px;
}
.col-exit {
font-size: 12px;
padding-right: 20px;
text-align: right;
}
.body {
margin-top: 20px;
background-color: white;
display: flex;
flex-direction: column;
align-items: center;
padding: 20px;
border-radius: 10px;
}
.user-img {
width: 100px;
height: 100px;
border-radius: 50%;
margin-bottom: 20px;
}
.user-info {
margin-bottom: 20px;
text-align: center;
}
.username,
.email {
display: block;
font-size: 16px;
margin: 5px 0;
}
</style>

@ -691,9 +691,9 @@ picocolors@^1.0.1:
resolved "https://registry.npmmirror.com/picocolors/-/picocolors-1.0.1.tgz#a8ad579b571952f0e5d25892de5445bcfe25aaa1"
integrity sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==
pinia-plugin-persist@1.0.0:
pinia-plugin-persist@^1.0.0:
version "1.0.0"
resolved "https://registry.npmmirror.com/pinia-plugin-persist/-/pinia-plugin-persist-1.0.0.tgz#fc696f225527f30bd5955109fafadd43c725e888"
resolved "https://registry.yarnpkg.com/pinia-plugin-persist/-/pinia-plugin-persist-1.0.0.tgz#fc696f225527f30bd5955109fafadd43c725e888"
integrity sha512-M4hBBd8fz/GgNmUPaaUsC29y1M09lqbXrMAHcusVoU8xlQi1TqgkWnnhvMikZwr7Le/hVyMx8KUcumGGrR6GVw==
dependencies:
vue-demi "^0.12.1"

Loading…
Cancel
Save