Compare commits
81 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
547b61315e | 2 years ago |
|
|
b6b7400b9b | 2 years ago |
|
|
91c51c5fbd | 2 years ago |
|
|
bbc5dc4227 | 2 years ago |
|
|
89c2fba28a | 2 years ago |
|
|
bfa49ec0eb | 2 years ago |
|
|
5fdb68fa9c | 2 years ago |
|
|
db3b54eac6 | 2 years ago |
|
|
bbba1c5420 | 2 years ago |
|
|
79b858112b | 2 years ago |
|
|
c5a815b054 | 2 years ago |
|
|
5a799f95c5 | 2 years ago |
|
|
bb9bad6335 | 2 years ago |
|
|
02d678f8d8 | 2 years ago |
|
|
92ff810b93 | 2 years ago |
|
|
52baa344c5 | 2 years ago |
|
|
1a0d65c725 | 2 years ago |
|
|
f72a51e34f | 2 years ago |
|
|
fbadcc2cae | 2 years ago |
|
|
2ee3d6f894 | 2 years ago |
|
|
7e6e07eb0e | 2 years ago |
|
|
4aebe6d916 | 2 years ago |
|
|
759274239b | 2 years ago |
|
|
2c6cf04da8 | 2 years ago |
|
|
5ebd78ff3c | 2 years ago |
|
|
642dceb244 | 2 years ago |
|
|
bf6cbe7dae | 2 years ago |
|
|
5ec51aafa9 | 2 years ago |
|
|
5ba00916b6 | 2 years ago |
|
|
e2014de19e | 2 years ago |
|
|
70ce44ad44 | 2 years ago |
|
|
04bdb19ec9 | 2 years ago |
|
|
da67fe8884 | 2 years ago |
|
|
991b3c3b61 | 2 years ago |
|
|
346e939e4f | 2 years ago |
|
|
8299139603 | 2 years ago |
|
|
8b7bee7c1d | 2 years ago |
|
|
510d8db779 | 2 years ago |
|
|
f800550ada | 2 years ago |
|
|
383a9111cd | 2 years ago |
|
|
a2373dffb3 | 2 years ago |
|
|
d5bdc148e5 | 2 years ago |
|
|
79475227ad | 2 years ago |
|
|
7e69ad3848 | 2 years ago |
|
|
8fb4fbcccc | 2 years ago |
|
|
8e77ed74cb | 2 years ago |
|
|
512de5ad7d | 2 years ago |
|
|
6d63961541 | 2 years ago |
|
|
9eb3a3a341 | 2 years ago |
|
|
0fa783bd1b | 2 years ago |
|
|
6c75e5562f | 2 years ago |
|
|
3cdd46dd80 | 2 years ago |
|
|
28a36bb26c | 2 years ago |
|
|
93177199db | 2 years ago |
|
|
28c47a51ca | 2 years ago |
|
|
7feccda1d0 | 2 years ago |
|
|
1d900ab370 | 2 years ago |
|
|
a6db9c05d6 | 2 years ago |
|
|
2d2aabcbc3 | 2 years ago |
|
|
3420b94b0c | 2 years ago |
|
|
3f53a7e490 | 2 years ago |
|
|
830dfe5e4a | 2 years ago |
|
|
bef6b8433e | 2 years ago |
|
|
a6cfa1b58f | 2 years ago |
|
|
11ca1b0560 | 2 years ago |
|
|
459b1e2d9d | 2 years ago |
|
|
b61e1370f7 | 2 years ago |
|
|
aa86338860 | 2 years ago |
|
|
78c8592922 | 2 years ago |
|
|
6cc844c2d6 | 2 years ago |
|
|
49bf7c57d7 | 2 years ago |
|
|
ad3e007dfa | 2 years ago |
|
|
98079dcf40 | 2 years ago |
|
|
80f92e6114 | 2 years ago |
|
|
9f984bcffb | 2 years ago |
|
|
191c450657 | 2 years ago |
|
|
fd52484673 | 2 years ago |
|
|
c3a76e62be | 2 years ago |
|
|
a35a1f82f7 | 2 years ago |
|
|
1d75cfe581 | 2 years ago |
|
|
f9889025cd | 2 years ago |
|
After Width: | Height: | Size: 3.2 MiB |
|
After Width: | Height: | Size: 475 KiB |
|
After Width: | Height: | Size: 270 KiB |
|
After Width: | Height: | Size: 945 KiB |
|
After Width: | Height: | Size: 210 KiB |
|
After Width: | Height: | Size: 574 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
After Width: | Height: | Size: 730 KiB |
|
Before Width: | Height: | Size: 74 KiB |
|
Before Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 543 KiB |
|
After Width: | Height: | Size: 632 KiB |
|
Before Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 745 KiB |
|
After Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 174 KiB |
|
After Width: | Height: | Size: 760 KiB |
|
After Width: | Height: | Size: 64 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 445 KiB |
|
After Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 217 KiB |
|
After Width: | Height: | Size: 41 KiB |
@ -0,0 +1,13 @@
|
|||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
end_of_line = crlf
|
||||||
|
indent_size = 4
|
||||||
|
indent_style = space
|
||||||
|
insert_final_newline = false
|
||||||
|
tab_width = 4
|
||||||
|
|
||||||
|
|
||||||
|
[*.vue]
|
||||||
|
indent_size = 2
|
||||||
|
tab_width = 2
|
||||||
|
ij_vue_indent_children_of_top_level = template, script, style
|
||||||
@ -0,0 +1,30 @@
|
|||||||
|
# Logs
|
||||||
|
logs
|
||||||
|
*.log
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
pnpm-debug.log*
|
||||||
|
lerna-debug.log*
|
||||||
|
|
||||||
|
node_modules
|
||||||
|
.DS_Store
|
||||||
|
dist
|
||||||
|
dist-ssr
|
||||||
|
coverage
|
||||||
|
*.local
|
||||||
|
|
||||||
|
/cypress/videos/
|
||||||
|
/cypress/screenshots/
|
||||||
|
|
||||||
|
# Editor directories and files
|
||||||
|
.vscode/*
|
||||||
|
!.vscode/extensions.json
|
||||||
|
.idea
|
||||||
|
*.suo
|
||||||
|
*.ntvs*
|
||||||
|
*.njsproj
|
||||||
|
*.sln
|
||||||
|
*.sw?
|
||||||
|
|
||||||
|
*.tsbuildinfo
|
||||||
@ -0,0 +1,29 @@
|
|||||||
|
# walktofree
|
||||||
|
|
||||||
|
This template should help get you started developing with Vue 3 in Vite.
|
||||||
|
|
||||||
|
## Recommended IDE Setup
|
||||||
|
|
||||||
|
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur).
|
||||||
|
|
||||||
|
## Customize configuration
|
||||||
|
|
||||||
|
See [Vite Configuration Reference](https://vitejs.dev/config/).
|
||||||
|
|
||||||
|
## Project Setup
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npm install
|
||||||
|
```
|
||||||
|
|
||||||
|
### Compile and Hot-Reload for Development
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npm run dev
|
||||||
|
```
|
||||||
|
|
||||||
|
### Compile and Minify for Production
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npm run build
|
||||||
|
```
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
module.exports = {
|
||||||
|
presets: [
|
||||||
|
'@vue/cli-plugin-babel/preset'
|
||||||
|
]
|
||||||
|
}
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<link rel="icon" href="/favicon.ico">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Vite App</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="app"></div>
|
||||||
|
<script type="module" src="/src/main.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"paths": {
|
||||||
|
"@/*": ["./src/*"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"exclude": ["node_modules", "dist"]
|
||||||
|
}
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
"name": "walktofree",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"private": true,
|
||||||
|
"type": "module",
|
||||||
|
"scripts": {
|
||||||
|
"dev": "vite",
|
||||||
|
"build": "vite build",
|
||||||
|
"preview": "vite preview"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@element-plus/icons-vue": "^2.3.1",
|
||||||
|
"@vuepic/vue-datepicker": "^8.6.0",
|
||||||
|
"axios": "^1.6.8",
|
||||||
|
"echarts": "^5.5.1",
|
||||||
|
"element-china-area-data": "^6.1.0",
|
||||||
|
"element-plus": "^2.7.3",
|
||||||
|
"sass": "^1.77.6",
|
||||||
|
"vue": "^3.4.27",
|
||||||
|
"vue-router": "^4.3.2"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@vitejs/plugin-vue": "^5.0.4",
|
||||||
|
"@vue/cli-service": "^5.0.8",
|
||||||
|
"vite": "^5.2.8"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 4.2 KiB |
@ -0,0 +1,17 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||||
|
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||||
|
<title><%= htmlWebpackPlugin.options.title %></title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<noscript>
|
||||||
|
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
||||||
|
</noscript>
|
||||||
|
<div id="app"></div>
|
||||||
|
<!-- built files will be auto injected -->
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
After Width: | Height: | Size: 208 KiB |
@ -1,6 +1,6 @@
|
|||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
|
||||||
const baseURL = 'https:106.52.218.118:12607'
|
const baseURL = 'http://192.168.243.35:9000'
|
||||||
|
|
||||||
export const login = (data) => {
|
export const login = (data) => {
|
||||||
return axios.post(`${baseURL}/Login/login`, data)
|
return axios.post(`${baseURL}/Login/login`, data)
|
||||||
|
Before Width: | Height: | Size: 276 B After Width: | Height: | Size: 276 B |
@ -0,0 +1,140 @@
|
|||||||
|
<template>
|
||||||
|
<div class="layout-container">
|
||||||
|
<div class="header" :style="{ backgroundColor: headerColor, height: headerHeight}">
|
||||||
|
<div class="header-content">
|
||||||
|
<div class="main-title">FreeToGo 自由同行-众包导游</div>
|
||||||
|
<h1 class="sub-title">{{ title }}</h1> <!-- 一级标题 -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- 导航栏使用 position: fixed 以确保它固定在页面的最左侧 -->
|
||||||
|
<nav class="navbar" :style="{ backgroundColor: headerColor, width: navWidth, position: 'fixed', top: '80px', height: 'calc(100vh - 80px)', left: '0' }">
|
||||||
|
<ul>
|
||||||
|
<li v-for="(link, index) in links" :key="index">
|
||||||
|
<router-link :to="link.path" class="nav-link">{{ link.name }}</router-link>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
<!-- 内容区域使用 margin-left 来保证不被导航栏覆盖 -->
|
||||||
|
<div class="content" :style="{ marginLeft: navWidth, paddingTop: headerHeight }">
|
||||||
|
<slot></slot> <!-- 插槽用于插入不同页面的主体内容 -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'Layout',
|
||||||
|
props: {
|
||||||
|
title: {
|
||||||
|
type: String,
|
||||||
|
default: '页面标题'
|
||||||
|
},
|
||||||
|
links: {
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
|
},
|
||||||
|
headerColor: {
|
||||||
|
type: String,
|
||||||
|
default: 'gray' // 你可以设置任何有效的CSS颜色值
|
||||||
|
},
|
||||||
|
navWidth: {
|
||||||
|
type: String,
|
||||||
|
default: '200px' // 导航栏的宽度
|
||||||
|
},
|
||||||
|
headerHeight: {
|
||||||
|
type: String,
|
||||||
|
default: '80px' // 标题栏的高度
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
:root {
|
||||||
|
--header-height: 80px;
|
||||||
|
--nav-width: 200px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.layout-container {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 100vh;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
z-index: 10;
|
||||||
|
background-image: url('../data/picture/loginBackground.jpg'); /* 替换为标题栏背景图片的URL */
|
||||||
|
background-size: cover;
|
||||||
|
background-position: center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
height: var(--header-height);
|
||||||
|
}
|
||||||
|
|
||||||
|
.main-title {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 24px;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sub-title {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 16px;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
.navbar {
|
||||||
|
position: fixed;
|
||||||
|
top: var(--header-height);
|
||||||
|
left: 0;
|
||||||
|
bottom: 0;
|
||||||
|
width: var(--nav-width);
|
||||||
|
z-index: 5;
|
||||||
|
padding: 10px 0;
|
||||||
|
list-style-type: none;
|
||||||
|
overflow-y: auto;
|
||||||
|
background-image: url('../data/picture/loginBackground.jpg'); /* 替换为导航栏背景图片的URL */
|
||||||
|
background-size: cover;
|
||||||
|
background-position: center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
}
|
||||||
|
|
||||||
|
.navbar li {
|
||||||
|
padding: 10px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-link {
|
||||||
|
color: white;
|
||||||
|
text-decoration: none;
|
||||||
|
display: block;
|
||||||
|
padding: 5px 15px;
|
||||||
|
transition: background-color 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-link:hover, .nav-link.router-link-active {
|
||||||
|
background-color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
flex-grow: 1;
|
||||||
|
padding: 20px;
|
||||||
|
overflow-y: auto;
|
||||||
|
margin-left: var(--nav-width);
|
||||||
|
padding-top: var(--header-height);
|
||||||
|
background-image: url('../data/picture/mainBackground.jpg'); /* 替换为内容区域背景图片的URL */
|
||||||
|
background-size: cover;
|
||||||
|
background-position: center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-carousel :interval="4000" arrow="always">
|
||||||
|
<el-carousel-item v-for="(item, index) in imagePaths" :key="index">
|
||||||
|
<img :src="item" alt = "描述图像的文本">
|
||||||
|
</el-carousel-item>
|
||||||
|
</el-carousel>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { ref } from 'vue';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
setup() {
|
||||||
|
const imagePaths = ref([
|
||||||
|
'https://dimg04.c-ctrip.com/images/0102p12000828jmogCF2E_C_1600_1200.jpg',
|
||||||
|
'https://pic.kuaizhan.com/g3/b7/18/7a16-bad5-4d28-b5aa-571710c674cb36',
|
||||||
|
'https://img.shetu66.com/2023/07/11/1689058469100908.png'
|
||||||
|
]);
|
||||||
|
|
||||||
|
return {
|
||||||
|
imagePaths
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@ -0,0 +1,76 @@
|
|||||||
|
<template>
|
||||||
|
<div style="height:100vh;width:100%;">
|
||||||
|
<!-- 标题栏 -->
|
||||||
|
<div class="header" style="height: 11.11%;">
|
||||||
|
<h1>FreeToGo 自由同行-众包导游</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 导航栏 -->
|
||||||
|
<aside class="sidebar" style="position: absolute; top: 11.11%; height: 88.89%;">
|
||||||
|
<!-- ...导航栏的其余部分... -->
|
||||||
|
</aside>
|
||||||
|
|
||||||
|
<!-- 主内容区域 -->
|
||||||
|
<div class="main-content" style="margin-left: 11.11%; height: 88.88%;">
|
||||||
|
<!-- 你的主要内容 -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { defineComponent, ref, onMounted, nextTick } from 'vue';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
|
|
||||||
|
// 导航栏的链接数据和逻辑
|
||||||
|
const links = ref([
|
||||||
|
{ to: '/home', text: '首页' },
|
||||||
|
{ to: '/mine', text: '个人信息' },
|
||||||
|
{ to: '/addDemand', text: '添加出行' },
|
||||||
|
{ to: '/order', text: '历史订单' },
|
||||||
|
]);
|
||||||
|
|
||||||
|
const route = useRoute();
|
||||||
|
const activeLink = ref(route.path);
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
nextTick(() => {
|
||||||
|
activeLink.value = route.path;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
function isActive(path) {
|
||||||
|
return path === activeLink.value;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.header {
|
||||||
|
background-color: #13202d;
|
||||||
|
color: white;
|
||||||
|
text-align: center;
|
||||||
|
padding: 1rem;
|
||||||
|
/* ...其余样式... */
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar {
|
||||||
|
background-color: #000000;
|
||||||
|
width: 11.11%; /* 根据页面布局调整 */
|
||||||
|
padding: 1rem;
|
||||||
|
overflow-y: auto;
|
||||||
|
/* ...其余样式... */
|
||||||
|
box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ...其余样式... */
|
||||||
|
|
||||||
|
.main-content {
|
||||||
|
padding: 1rem;
|
||||||
|
overflow-y: auto;
|
||||||
|
position: absolute;
|
||||||
|
left: 11.11%; /* 导航栏宽度 */
|
||||||
|
width: 88.89%; /* 减去导航栏宽度 */
|
||||||
|
/* ...其余样式... */
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
Before Width: | Height: | Size: 787 KiB After Width: | Height: | Size: 787 KiB |
|
After Width: | Height: | Size: 223 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 406 KiB |
|
After Width: | Height: | Size: 4.4 MiB |
|
After Width: | Height: | Size: 208 KiB |
|
After Width: | Height: | Size: 1.4 MiB |
|
After Width: | Height: | Size: 266 KiB |
|
After Width: | Height: | Size: 923 KiB |
|
After Width: | Height: | Size: 188 KiB |
@ -0,0 +1,167 @@
|
|||||||
|
<template>
|
||||||
|
<div style="height:100vh;width:100%;">
|
||||||
|
<el-container class="fullScreen">
|
||||||
|
<el-header class="header"><h1>FreeToGo 自由同行-众包导游</h1></el-header>
|
||||||
|
<el-container>
|
||||||
|
<el-aside width="200px" class="nav">
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<RouterLink to="/markdown" active-class="active">MD编辑器</RouterLink>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<RouterLink to="/tree" active-class="active">树状图</RouterLink>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<RouterLink to="/svg" active-class="active">SVG</RouterLink>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<RouterLink to="/todo" active-class="active">TodoMVC</RouterLink>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<RouterLink to="/list" active-class="active">动效列表</RouterLink>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<RouterLink to="/blur" active-class="active">模糊提示框</RouterLink>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</el-aside>
|
||||||
|
<el-main>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="16">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<!-- 左边2/3的上容器 -->
|
||||||
|
<div class="container-style">上容器1</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<!-- 左边2/3的下容器 -->
|
||||||
|
<div class="container-style">下容器2</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<!-- 右边1/3的容器 -->
|
||||||
|
<div class="container-style">右边容器3</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-main>
|
||||||
|
</el-container>
|
||||||
|
</el-container>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
*{
|
||||||
|
margin:0;
|
||||||
|
padding:0;
|
||||||
|
border:0
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
*, *:before, *:after {
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
html, body {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
body{
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
text-decoration: none;
|
||||||
|
color: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header {
|
||||||
|
background-color: #13202d;
|
||||||
|
color: white;
|
||||||
|
text-align: center;
|
||||||
|
padding: 1rem;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
font-size: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav {
|
||||||
|
background-color: #2b3642;
|
||||||
|
width: 100px;
|
||||||
|
height: 95vh;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav ul {
|
||||||
|
padding: 1rem;
|
||||||
|
list-style-type: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav li {
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav li a {
|
||||||
|
display: block;
|
||||||
|
color: white;
|
||||||
|
padding: 0.5rem 1rem;
|
||||||
|
transition: background-color 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav li a:hover, .active {
|
||||||
|
background-color: #8bb9ed;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-main {
|
||||||
|
padding: 1rem;
|
||||||
|
overflow-y: auto;
|
||||||
|
flex-grow: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.el-aside {
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav ul {
|
||||||
|
flex-direction: column;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-main {
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.fullScreen {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 100vh;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-container {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
overflow: hidden;
|
||||||
|
padding: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.el-header, .el-aside, .el-main {
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -0,0 +1,94 @@
|
|||||||
|
<template>
|
||||||
|
<div class="item-manager">
|
||||||
|
<el-button type="primary" @click="add">Add Item</el-button>
|
||||||
|
<el-button type="danger" @click="onDelete">Delete Item</el-button>
|
||||||
|
<el-scrollbar class="custom-scrollbar" max-height="800px">
|
||||||
|
<div v-for="(item, index) in count" :key="index" class="item-container">
|
||||||
|
<p class="scrollbar-demo-item">{{ item }}</p>
|
||||||
|
</div>
|
||||||
|
<div v-for="review in reviews" :key="review.id" class="review-container">
|
||||||
|
<p class="scrollbar-demo-item">{{ review.content }}</p>
|
||||||
|
</div>
|
||||||
|
</el-scrollbar>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.scrollbar-demo-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
height: 50px;
|
||||||
|
margin: 10px;
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 4px;
|
||||||
|
background: var(--el-color-primary-light-9);
|
||||||
|
color: var(--el-color-primary);
|
||||||
|
}
|
||||||
|
.item-manager {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-scrollbar {
|
||||||
|
width: 100%; /* 根据需要调整滚动条容器的宽度 */
|
||||||
|
border-radius: 8px; /* 添加圆角 */
|
||||||
|
overflow: auto; /* 确保滚动条出现 */
|
||||||
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* 添加阴影 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.scrollbar-demo-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
height: 50px;
|
||||||
|
margin: 10px;
|
||||||
|
padding: 0 15px; /* 添加内边距 */
|
||||||
|
border-radius: 4px;
|
||||||
|
background: var(--el-color-primary-light-9);
|
||||||
|
color: var(--el-color-primary);
|
||||||
|
transition: background-color 0.3s ease; /* 添加背景色过渡效果 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-container,
|
||||||
|
.review-container {
|
||||||
|
|
||||||
|
}
|
||||||
|
.custom-scrollbar::-webkit-scrollbar {
|
||||||
|
width: 10px;
|
||||||
|
}
|
||||||
|
.custom-scrollbar::-webkit-scrollbar-track {
|
||||||
|
background: #f1f1f1;
|
||||||
|
}
|
||||||
|
.custom-scrollbar::-webkit-scrollbar-thumb {
|
||||||
|
background: #888;
|
||||||
|
}
|
||||||
|
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
|
||||||
|
background: #555;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref } from 'vue'
|
||||||
|
|
||||||
|
|
||||||
|
const count = ref(3)
|
||||||
|
const reviews = ref([
|
||||||
|
{ id: 1, content: 'Great product!' },
|
||||||
|
{ id: 2, content: 'Fast shipping!' },
|
||||||
|
{ id: 3, content: 'Excellent customer service!' }
|
||||||
|
])
|
||||||
|
|
||||||
|
const add = () => {
|
||||||
|
count.value++
|
||||||
|
}
|
||||||
|
const onDelete = () => {
|
||||||
|
if (count.value > 0) {
|
||||||
|
count.value--
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@ -0,0 +1,191 @@
|
|||||||
|
<template>
|
||||||
|
<Layout :title="title" :links="computedLinks">
|
||||||
|
<!-- 将flex-direction改为row以实现水平排列 -->
|
||||||
|
<div class="main-content" :style="{ display: 'flex', flexDirection: 'row' }">
|
||||||
|
<div class="left-container" :style="{ flex: '3', height: 'calc(100vh - 20px)' }">
|
||||||
|
<h2>全国城市旅游热力图</h2>
|
||||||
|
<MapComponent></MapComponent>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="right-container" :style="{ flex: '1', height: '100vh', marginLeft: '20px' }">
|
||||||
|
<h1>排行榜</h1>
|
||||||
|
<div class="ranking-container">
|
||||||
|
<div v-for="(item, index) in rankingList" :key="index" class="ranking-item">
|
||||||
|
<span class="ranking-number">{{ index + 1 }}.</span>
|
||||||
|
<span class="city-name">{{ item.city }}</span>
|
||||||
|
<span class="visitors-count">{{ item.visitors }}人</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Layout>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import Layout from '../components/Layout.vue'; // 确保路径正确
|
||||||
|
import MapComponent from '../components/map.vue';
|
||||||
|
import axios from 'axios';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'HomePage',
|
||||||
|
components: {
|
||||||
|
Layout,
|
||||||
|
MapComponent
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
phone: sessionStorage.getItem('phone') || '',
|
||||||
|
title: '首页',
|
||||||
|
links: [{ name: '首页', path: '/home' }, { name: '个人信息', path: '/mine' }, { name: '添加出行', path: '/addDemandPage' },{ name: '历史出行', path: '/demandList' }],
|
||||||
|
user: {
|
||||||
|
},
|
||||||
|
rankingList: [
|
||||||
|
{ city: '广东', visitors: 3 },
|
||||||
|
{ city: '湖南', visitors: 2 },
|
||||||
|
// ...其他城市数据
|
||||||
|
],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
computedLinks() {
|
||||||
|
// 根据用户角色返回不同的链接数组
|
||||||
|
return this.user.membertype === true
|
||||||
|
? this.links.concat([{ name: '服务发布', path: '/addServe' },{ name: '导游记录', path: '/serverList' }])
|
||||||
|
: this.links.concat([{name:'注册导游',path:'/registerGuide'}]);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.fetchUser(this.phone);
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
fetchUser(phone) {
|
||||||
|
// 从后端 API 请求
|
||||||
|
axios.get(`/serve/users/getByPhone?phone=${phone}`)
|
||||||
|
.then(response => {
|
||||||
|
this.user = response.data
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error('Error fetching user:', error);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
/* 整体页面样式 */
|
||||||
|
.main-content {
|
||||||
|
height: calc(100vh - 80px);
|
||||||
|
padding: 20px;
|
||||||
|
transition: background-color 0.3s; /* 过渡效果 */
|
||||||
|
background-color: rgba(255, 255, 255, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 左侧容器样式 */
|
||||||
|
.left-container {
|
||||||
|
flex: 3;
|
||||||
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||||
|
border-radius: 5px;
|
||||||
|
padding: 20px;
|
||||||
|
transition: box-shadow 0.3s, transform 0.3s; /* 过渡效果 */
|
||||||
|
background-color: rgba(255, 255, 255, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 右侧容器样式 */
|
||||||
|
.right-container {
|
||||||
|
flex: 1;
|
||||||
|
margin-left: 20px;
|
||||||
|
background-color: rgba(255, 255, 255, 0.1);
|
||||||
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||||
|
border-radius: 5px;
|
||||||
|
padding: 20px;
|
||||||
|
transition: box-shadow 0.3s, transform 0.3s; /* 过渡效果 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 排行榜容器样式 */
|
||||||
|
.ranking-container {
|
||||||
|
width: 100%;
|
||||||
|
border: 1px solid #666c6e;
|
||||||
|
border-radius: 5px;
|
||||||
|
padding: 10px;
|
||||||
|
background-color: #abd4ee;
|
||||||
|
transition: background-color 0.3s; /* 过渡效果 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 排行榜项样式 */
|
||||||
|
.ranking-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
padding: 8px;
|
||||||
|
border-bottom: 1px solid #28a7a3;
|
||||||
|
transition: background-color 0.3s, transform 0.3s; /* 过渡效果 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.ranking-item:hover {
|
||||||
|
background-color: #e0e2e3;
|
||||||
|
transform: scale(1.02); /* 放大效果 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 排行榜序号样式 */
|
||||||
|
.ranking-number {
|
||||||
|
font-weight: bold;
|
||||||
|
margin-right: 5px;
|
||||||
|
color: #333;
|
||||||
|
transition: color 0.3s; /* 过渡效果 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 城市名称样式 */
|
||||||
|
.city-name {
|
||||||
|
flex: 1;
|
||||||
|
font-size: 16px;
|
||||||
|
color: #555;
|
||||||
|
transition: color 0.3s; /* 过渡效果 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 游客数量样式 */
|
||||||
|
.visitors-count {
|
||||||
|
margin-left: 5px;
|
||||||
|
color: #666;
|
||||||
|
transition: color 0.3s; /* 过渡效果 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 标题样式 */
|
||||||
|
h1, h2 {
|
||||||
|
color: #333;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
transition: color 0.3s; /* 过渡效果 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 链接样式 */
|
||||||
|
.links {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.link {
|
||||||
|
margin-left: 10px;
|
||||||
|
color: #007bff;
|
||||||
|
text-decoration: none;
|
||||||
|
transition: color 0.3s, transform 0.3s; /* 过渡效果 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.link:hover {
|
||||||
|
color: #0056b3;
|
||||||
|
transform: scale(1.1); /* 放大效果 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 页面滚动特效 */
|
||||||
|
.main-content.scrolled {
|
||||||
|
background-color: #e5e5e5; /* 滚动后的背景色 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.left-container.scrolled,
|
||||||
|
.right-container.scrolled {
|
||||||
|
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* 滚动后的阴影效果 */
|
||||||
|
transform: translateY(-10px); /* 滚动后的位移效果 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 使用JavaScript监听滚动事件来添加.scrolled类 */
|
||||||
|
</style>
|
||||||
@ -0,0 +1,264 @@
|
|||||||
|
<template>
|
||||||
|
<Layout :title="title" :links="computedLinks">
|
||||||
|
<div class="form-container">
|
||||||
|
<form class="order-form">
|
||||||
|
<div class="content-section">
|
||||||
|
<h1><i class="fas fa-map-marker-alt"></i> 订单详情</h1>
|
||||||
|
<p class="trip-info">目的地: {{ list.city }}</p>
|
||||||
|
<p class="trip-info">开始时间: {{ list.departureDate }}</p>
|
||||||
|
<p class="trip-info">结束时间: {{ list.endDate }}</p>
|
||||||
|
<p class="trip-info">创建时间: {{ list.createTime }}</p>
|
||||||
|
<p class="trip-info">订单号: {{ list.did }}</p>
|
||||||
|
<p class="trip-info">备注: {{ list.message }}</p>
|
||||||
|
<p class="status-info">
|
||||||
|
当前状态:
|
||||||
|
<span v-if="list.status === 0" class="matching">匹配中</span>
|
||||||
|
<span v-else-if="list.status === 1" class="processing">处理中</span> <!-- 修改了状态文本以区分状态1 -->
|
||||||
|
<span v-else-if="list.status === 2" class="success">匹配成功</span>
|
||||||
|
<span v-else-if="list.status === 3" class="completed">已完成</span>
|
||||||
|
<span v-else class="unknown">未知状态</span>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div v-if="list.status === 0 || list.status === 1">
|
||||||
|
<button class="action-button" @click="goToMatchDetail(orderId)">匹配导游</button>
|
||||||
|
<button class="action-button" @click="goToDemandMatched(orderId)">导游申请</button>
|
||||||
|
<button class="action-button cancel-button" @click="cancelTrip(orderId)">取消行程</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="list.status === 2">
|
||||||
|
<button class="action-button cancel-button" @click="cancel(orderId)">取消出行</button>
|
||||||
|
<button class="action-button complete-button" @click="over(orderId)">行程完成</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="list.status === 3">
|
||||||
|
<button class="action-button" @click="goToEvaluateTrip(orderId)">行程评价</button>
|
||||||
|
<button class="action-button cancel-button" @click="deleteOrder(orderId)">删除订单</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</Layout>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
/* 基本布局和间距 */
|
||||||
|
.content-section {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
border-radius: 8px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
min-height: 100vh;
|
||||||
|
line-height: 1.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.trip-info {
|
||||||
|
margin-bottom: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 标题和图标样式 */
|
||||||
|
h1 {
|
||||||
|
font-size: 36px; /* or any size you prefer */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 按钮样式 */
|
||||||
|
.action-button {
|
||||||
|
background-color: #007bff;
|
||||||
|
border: none;
|
||||||
|
color: white;
|
||||||
|
padding: 10px 20px;
|
||||||
|
text-align: center;
|
||||||
|
text-decoration: none;
|
||||||
|
display: inline-block;
|
||||||
|
font-size: 16px;
|
||||||
|
margin: 4px 2px;
|
||||||
|
cursor: pointer;
|
||||||
|
border-radius: 4px;
|
||||||
|
transition: background-color 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.action-button:hover {
|
||||||
|
background-color: #0056b3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cancel-button, .delete-button {
|
||||||
|
background-color: #dc3545;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cancel-button:hover, .delete-button:hover {
|
||||||
|
background-color: #c82333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.complete-button {
|
||||||
|
background-color: #28a745;
|
||||||
|
}
|
||||||
|
|
||||||
|
.complete-button:hover {
|
||||||
|
background-color: #218838;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 状态文本样式 */
|
||||||
|
.status-info span {
|
||||||
|
margin-right: 15px;
|
||||||
|
padding: 5px 10px;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.matching {
|
||||||
|
background-color: #ffc107;
|
||||||
|
color: #212529;
|
||||||
|
}
|
||||||
|
|
||||||
|
.processing {
|
||||||
|
background-color: #007bff;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.success {
|
||||||
|
background-color: #28a745;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.completed {
|
||||||
|
background-color: #17a2b8;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.unknown {
|
||||||
|
background-color: #6c757d;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 放大字体 */
|
||||||
|
.content-section, .trip-info, .status-info span, .action-button {
|
||||||
|
font-size: 18px;
|
||||||
|
}
|
||||||
|
.content-section {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: flex-start; /* align items at the start (top) */
|
||||||
|
align-items: center;
|
||||||
|
min-height: 100vh;
|
||||||
|
line-height: 1.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-container {
|
||||||
|
width: 50%;
|
||||||
|
margin: 0 auto; /* Center the container horizontally */
|
||||||
|
background-color: #fff; /* White background color */
|
||||||
|
padding: 20px; /* Add some padding around the form */
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-form {
|
||||||
|
width: 100%; /* Make the form occupy 100% of the container's width */
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import axios from 'axios';
|
||||||
|
import Layout from '../components/Layout.vue';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
props: ['orderId'],
|
||||||
|
components: {
|
||||||
|
Layout,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
phone: sessionStorage.getItem('phone') || '',
|
||||||
|
list: [],
|
||||||
|
title: '订单详情',
|
||||||
|
links: [{ name: '首页', path: '/home' }, { name: '个人信息', path: '/mine' }, { name: '添加出行', path: '/addDemandPage' },{ name: '历史出行', path: '/demandList' }],
|
||||||
|
user: {
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
computedLinks() {
|
||||||
|
// 根据用户角色返回不同的链接数组
|
||||||
|
return this.user.membertype === true
|
||||||
|
? this.links.concat([{ name: '服务发布', path: '/addServe' },{ name: '导游记录', path: '/serverList' }])
|
||||||
|
: this.links.concat([{name:'注册导游',path:'/registerGuide'}]);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async created() {
|
||||||
|
// 在组件创建后立即发送请求
|
||||||
|
axios.get(`/serve/SendDemand/demand?did=${this.orderId}`)
|
||||||
|
.then(response => {
|
||||||
|
this.list = response.data
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error('Error fetching user:', error);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
goToMatchDetail(orderId) {
|
||||||
|
this.$router.push({ name: 'MatchDetail', params: { orderId } });
|
||||||
|
},
|
||||||
|
goToDemandMatched(orderId) {
|
||||||
|
this.$router.push({ name: 'DemandMatched', params: { orderId } });
|
||||||
|
},
|
||||||
|
goToEvaluateTrip(orderId) {
|
||||||
|
this.$router.push({ name: 'Evaluation', params: { orderId } });
|
||||||
|
},
|
||||||
|
cancel(orderId) {
|
||||||
|
const did = parseInt(this.orderId, 10);
|
||||||
|
axios.post(`/serve/DemandMatch/refuse`,{did:did})
|
||||||
|
.then(response => {
|
||||||
|
if(response.data == 1){
|
||||||
|
alert('取消成功');
|
||||||
|
location.reload();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error('Error fetching user:', error);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
cancelTrip(orderId) {
|
||||||
|
const did = parseInt(this.orderId, 10);
|
||||||
|
axios.post(`/serve/demands/delbyid`,{did:did})
|
||||||
|
.then(response => {
|
||||||
|
if(response.data == 1){
|
||||||
|
alert('取消成功');
|
||||||
|
this.$router.push('/demandlist');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error('Error fetching user:', error);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
over(orderId) {
|
||||||
|
const did = parseInt(this.orderId, 10);
|
||||||
|
axios.post(`/serve/DemandMatch/finish`,{did:did})
|
||||||
|
.then(response => {
|
||||||
|
if(response.data == 1){
|
||||||
|
location.reload();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error('Error fetching user:', error);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
deleteOrder(orderId) {
|
||||||
|
const did = parseInt(this.orderId, 10);
|
||||||
|
axios.post(`/serve/DemandMatch/delete`,{did:did})
|
||||||
|
.then(response => {
|
||||||
|
if(response.data == 1){
|
||||||
|
alert('删除成功');
|
||||||
|
this.$router.push('/demandlist');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error('Error fetching user:', error);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
returnList() {
|
||||||
|
this.$router.push('/demandlist');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@ -0,0 +1,220 @@
|
|||||||
|
<template>
|
||||||
|
<Layout :title="title" class="title" :links="computedLinks">
|
||||||
|
<div class="container">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="experience">有无相关经历:</label>
|
||||||
|
<!-- 单选按钮组使用flex布局在同一行显示并居中 -->
|
||||||
|
<div class="radio-group">
|
||||||
|
<div class="radio-label">
|
||||||
|
<input type="radio" id="has-experience-yes" value="true" v-model="registerToGuide.re" required>
|
||||||
|
<label for="has-experience-yes">有</label>
|
||||||
|
</div>
|
||||||
|
<div class="radio-label">
|
||||||
|
<input type="radio" id="has-experience-no" value="false" v-model="registerToGuide.re">
|
||||||
|
<label for="has-experience-no">无</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="rsd">居住地区:</label>
|
||||||
|
<input type="text" id="rsd" v-model="registerToGuide.rsd">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="familiar-area">熟悉区域:</label>
|
||||||
|
<textarea id="familiar-area" v-model="registerToGuide.fa"></textarea>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="syns">个人简介:</label>
|
||||||
|
<textarea id="syns" v-model="registerToGuide.syns"></textarea>
|
||||||
|
</div>
|
||||||
|
<button @click="Submit()">提交申请</button>
|
||||||
|
</div>
|
||||||
|
</Layout>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import axios from 'axios';
|
||||||
|
import Layout from '../components/Layout.vue'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'ApplyGuide',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
phone: sessionStorage.getItem('phone') || '',
|
||||||
|
title: '导游资格申请',
|
||||||
|
links: [{ name: '首页', path: '/home' }, { name: '个人信息', path: '/mine' }, { name: '添加出行', path: '/addDemandPage' }, { name: '历史出行', path: '/demandList' }],
|
||||||
|
user: {
|
||||||
|
role: 'member',
|
||||||
|
},
|
||||||
|
registerToGuide: {
|
||||||
|
uid: 0,
|
||||||
|
re: '',
|
||||||
|
rsd: '',
|
||||||
|
fa: '',
|
||||||
|
syns: '',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
computedLinks() {
|
||||||
|
return this.user.role === 'admin'
|
||||||
|
? this.links.concat([{ name: '服务发布', path: '/addServe' }, { name: '导游记录', path: '/serveList' }])
|
||||||
|
: this.links.concat([{ name: '注册导游', path: '/registerGuide' }]);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.fetchUser(this.phone);
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
fetchUser(phone) {
|
||||||
|
axios.get(`/serve/users/getByPhone?phone=${phone}`)
|
||||||
|
.then(response => {
|
||||||
|
this.user = response.data;
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error('Error fetching user:', error);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
Submit() {
|
||||||
|
axios.get(`/serve/users/getUid?phone=${this.phone}`)
|
||||||
|
.then(response => {
|
||||||
|
this.registerToGuide.uid = response.data;
|
||||||
|
axios.post(`/serve/users/registerToGuide`, { registerToGuide: this.registerToGuide })
|
||||||
|
.then(response => {
|
||||||
|
if (response.data == 1) {
|
||||||
|
alert("申请成功!");
|
||||||
|
this.$router.push('/addServe');
|
||||||
|
} else {
|
||||||
|
alert("申请未通过!");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error('Error posting registration:', error);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error('Error fetching user UID:', error);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
Layout,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.container {
|
||||||
|
background-color: rgba(255, 255, 255, 0.2);
|
||||||
|
}
|
||||||
|
/* 页面基础样式 */
|
||||||
|
body {
|
||||||
|
font-family: 'Arial', sans-serif;
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
color: #333;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
height: 100vh;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 表单容器样式 */
|
||||||
|
form {
|
||||||
|
width: 100%;
|
||||||
|
height: 90vh;
|
||||||
|
|
||||||
|
padding: 20px;
|
||||||
|
background: white;
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
|
||||||
|
box-sizing: border-box;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 表单组样式 */
|
||||||
|
.form-group {
|
||||||
|
width: 100%;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 单选按钮组样式 */
|
||||||
|
.radio-group {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between; /* 使得单选按钮平均分布在父元素中 */
|
||||||
|
width: 10%;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 单选按钮样式 */
|
||||||
|
.radio-label {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-right: 15px; /* 单选按钮之间的间距 */
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="radio"] {
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 输入框、文本区域样式 */
|
||||||
|
input[type="text"],
|
||||||
|
textarea {
|
||||||
|
width: 60%;
|
||||||
|
padding: 10px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
border-radius: 4px;
|
||||||
|
font-size: 16px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
margin-top: 5px; /* 调整输入框与标题的间距 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 按钮样式 */
|
||||||
|
button {
|
||||||
|
width: 30%;
|
||||||
|
padding: 10px;
|
||||||
|
background-color: #007bff;
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
border-radius: 5px;
|
||||||
|
font-size: 18px;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background-color 0.3s ease;
|
||||||
|
margin-top: 20px;
|
||||||
|
background-image: linear-gradient(to right, #6a11cb 0%, #2575fc 100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
button:hover {
|
||||||
|
background-image: linear-gradient(to right, #6a11cb 0%, #2575fc 100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
label {
|
||||||
|
font-weight: bold; /* 标题加粗 */
|
||||||
|
font-size: 18px; /* 放大标题字体 */
|
||||||
|
margin-bottom: 10px; /* 标题与输入框之间的间距 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 表单组样式调整 */
|
||||||
|
.form-group {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;/* 标题和输入框左对齐 */
|
||||||
|
align-items: center;
|
||||||
|
width: 100%;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 单选按钮组样式调整 */
|
||||||
|
.radio-group {
|
||||||
|
width: 40%; /* 根据需要调整宽度 */
|
||||||
|
justify-content: space-around; /* 单选按钮均匀分布 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 悬停效果、选中效果和错误信息样式保持不变 */
|
||||||
|
</style>
|
||||||