@ -1,23 +1,30 @@
|
|||||||
.DS_Store
|
# Logs
|
||||||
node_modules
|
logs
|
||||||
/dist
|
*.log
|
||||||
|
|
||||||
|
|
||||||
# local env files
|
|
||||||
.env.local
|
|
||||||
.env.*.local
|
|
||||||
|
|
||||||
# Log files
|
|
||||||
npm-debug.log*
|
npm-debug.log*
|
||||||
yarn-debug.log*
|
yarn-debug.log*
|
||||||
yarn-error.log*
|
yarn-error.log*
|
||||||
pnpm-debug.log*
|
pnpm-debug.log*
|
||||||
|
lerna-debug.log*
|
||||||
|
|
||||||
|
node_modules
|
||||||
|
.DS_Store
|
||||||
|
dist
|
||||||
|
dist-ssr
|
||||||
|
coverage
|
||||||
|
*.local
|
||||||
|
|
||||||
|
/cypress/videos/
|
||||||
|
/cypress/screenshots/
|
||||||
|
|
||||||
# Editor directories and files
|
# Editor directories and files
|
||||||
|
.vscode/*
|
||||||
|
!.vscode/extensions.json
|
||||||
.idea
|
.idea
|
||||||
.vscode
|
|
||||||
*.suo
|
*.suo
|
||||||
*.ntvs*
|
*.ntvs*
|
||||||
*.njsproj
|
*.njsproj
|
||||||
*.sln
|
*.sln
|
||||||
*.sw?
|
*.sw?
|
||||||
|
|
||||||
|
*.tsbuildinfo
|
||||||
|
@ -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>
|
@ -1,19 +1,8 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "es5",
|
|
||||||
"module": "esnext",
|
|
||||||
"baseUrl": "./",
|
|
||||||
"moduleResolution": "node",
|
|
||||||
"paths": {
|
"paths": {
|
||||||
"@/*": [
|
"@/*": ["./src/*"]
|
||||||
"src/*"
|
}
|
||||||
]
|
},
|
||||||
},
|
"exclude": ["node_modules", "dist"]
|
||||||
"lib": [
|
|
||||||
"esnext",
|
|
||||||
"dom",
|
|
||||||
"dom.iterable",
|
|
||||||
"scripthost"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,25 +1,27 @@
|
|||||||
{
|
{
|
||||||
"name": "web",
|
"name": "walktofree",
|
||||||
"version": "0.1.0",
|
"version": "0.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"serve": "vue-cli-service serve",
|
"dev": "vite",
|
||||||
"build": "vue-cli-service build"
|
"build": "vite build",
|
||||||
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"core-js": "^3.8.3",
|
"@element-plus/icons-vue": "^2.3.1",
|
||||||
"goeasy": "^2.12.4",
|
"@vuepic/vue-datepicker": "^8.6.0",
|
||||||
"vue": "^3.2.13",
|
"axios": "^1.6.8",
|
||||||
"vue-router": "^4.0.3"
|
"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": {
|
"devDependencies": {
|
||||||
"@vue/cli-plugin-babel": "~5.0.0",
|
"@vitejs/plugin-vue": "^5.0.4",
|
||||||
"@vue/cli-service": "~5.0.0"
|
"@vue/cli-service": "^5.0.8",
|
||||||
},
|
"vite": "^5.2.8"
|
||||||
"browserslist": [
|
}
|
||||||
"> 1%",
|
|
||||||
"last 2 versions",
|
|
||||||
"not dead",
|
|
||||||
"not ie 11"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.2 KiB |
After Width: | Height: | Size: 208 KiB |
@ -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,45 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, watchEffect } from 'vue'
|
||||||
|
import { format } from 'date-fns'
|
||||||
|
const startDateValue = ref(format(new Date(), 'yyyy-MM-dd'))
|
||||||
|
const endDateValue = ref(format(new Date(), 'yyyy-MM-dd'))
|
||||||
|
watchEffect(() => {
|
||||||
|
console.log('startDateValue:', startDateValue.value)
|
||||||
|
console.log('endDateValue:', endDateValue.value)
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<VueDatePicker
|
||||||
|
placeholder="请选择预计出发日期"
|
||||||
|
:min-date="new Date()"
|
||||||
|
format="yyyy-MM-dd"
|
||||||
|
v-model="startDateValue" />
|
||||||
|
<VueDatePicker
|
||||||
|
placeholder="请选择预计返回日期"
|
||||||
|
:min-date="new Date()"
|
||||||
|
format="yyyy-MM-dd"
|
||||||
|
v-model="endDateValue" />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, watchEffect } from 'vue'
|
||||||
|
import { format } from 'date-fns'
|
||||||
|
const startDateValue = ref(format(new Date(), 'yyyy-MM-dd'))
|
||||||
|
const endDateValue = ref(format(new Date(), 'yyyy-MM-dd'))
|
||||||
|
watchEffect(() => {
|
||||||
|
console.log('startDateValue:', startDateValue.value)
|
||||||
|
console.log('endDateValue:', endDateValue.value)
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
<template>
|
||||||
|
<VueDatePicker
|
||||||
|
placeholder="请选择预计出发日期"
|
||||||
|
:min-date="new Date()"
|
||||||
|
format="yyyy-MM-dd"
|
||||||
|
v-model="startDateValue" />
|
||||||
|
<VueDatePicker
|
||||||
|
placeholder="请选择预计返回日期"
|
||||||
|
:min-date="new Date()"
|
||||||
|
format="yyyy-MM-dd"
|
||||||
|
v-model="endDateValue" />
|
||||||
|
</template>
|
@ -1,32 +1,76 @@
|
|||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'return',
|
|
||||||
methods: {
|
|
||||||
gotohome() {
|
|
||||||
this.$router.push('/home');
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<template>
|
<template>
|
||||||
<div class="return">
|
<div style="height:100vh;width:100%;">
|
||||||
<button class="return-button" @click="gotohome()">返回</button>
|
<!-- 标题栏 -->
|
||||||
</div>
|
<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>
|
</template>
|
||||||
<style>.return-button {
|
|
||||||
/* 定义返回按钮的样式 */
|
<script setup>
|
||||||
position: fixed; /* 使按钮位置固定 */
|
import { defineComponent, ref, onMounted, nextTick } from 'vue';
|
||||||
top: 10px;
|
import { useRoute } from 'vue-router';
|
||||||
left: 10px;
|
|
||||||
margin: 0;
|
// 导航栏的链接数据和逻辑
|
||||||
padding: 10px 20px;
|
const links = ref([
|
||||||
border: none;
|
{ to: '/home', text: '首页' },
|
||||||
border-radius: 5px;
|
{ to: '/mine', text: '个人信息' },
|
||||||
background-color: #ccc;
|
{ to: '/addDemand', text: '添加出行' },
|
||||||
color: #333;
|
{ to: '/order', text: '历史订单' },
|
||||||
cursor: pointer;
|
]);
|
||||||
|
|
||||||
.return-button:hover {
|
const route = useRoute();
|
||||||
background-color: #aaaaaa;
|
const activeLink = ref(route.path);
|
||||||
}
|
|
||||||
} </style>
|
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>
|
After Width: | Height: | Size: 223 KiB |
After Width: | Height: | Size: 406 KiB |
After Width: | Height: | Size: 208 KiB |
After Width: | Height: | Size: 266 KiB |
After Width: | Height: | Size: 923 KiB |
After Width: | Height: | Size: 188 KiB |
@ -1,146 +1,191 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="home-page">
|
<Layout :title="title" :links="computedLinks">
|
||||||
<div class="page-header">
|
<!-- 将flex-direction改为row以实现水平排列 -->
|
||||||
<h1 class="page-title">首页</h1>
|
<div class="main-content" :style="{ display: 'flex', flexDirection: 'row' }">
|
||||||
</div>
|
<div class="left-container" :style="{ flex: '3', height: 'calc(100vh - 20px)' }">
|
||||||
<div class="carousel-container">
|
<h2>全国城市旅游热力图</h2>
|
||||||
<el-carousel :interval="4000" arrow="always" type="card">
|
<MapComponent></MapComponent>
|
||||||
<el-carousel-item
|
</div>
|
||||||
v-for="(item, index) in imagePaths"
|
|
||||||
:key="index"
|
<div class="right-container" :style="{ flex: '1', height: '100vh', marginLeft: '20px' }">
|
||||||
:class="['carousel-item', index === Math.floor(imagePaths.length / 2) ? 'center-item' : '']"
|
<h1>排行榜</h1>
|
||||||
>
|
<div class="ranking-container">
|
||||||
<img :src="item" :alt="`Image ${index + 1}`" class="carousel-image">
|
<div v-for="(item, index) in rankingList" :key="index" class="ranking-item">
|
||||||
</el-carousel-item>
|
<span class="ranking-number">{{ index + 1 }}.</span>
|
||||||
</el-carousel>
|
<span class="city-name">{{ item.city }}</span>
|
||||||
</div>
|
<span class="visitors-count">{{ item.visitors }}人</span>
|
||||||
<div class="search-container">
|
</div>
|
||||||
<input type="text" class="search-input" placeholder="世界这么大出去看看吧">
|
</div>
|
||||||
<button class="search-button" @click="gotoSearchPage()">搜索</button>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="return">
|
</Layout>
|
||||||
<button class="addDemand-button" @click="gotoAddDemandPage()">我要出行</button>
|
</template>
|
||||||
<isRegisterGuide />
|
|
||||||
</div>
|
<script>
|
||||||
</div>
|
import Layout from '../components/Layout.vue'; // 确保路径正确
|
||||||
<div><NavigationBar /></div>
|
import MapComponent from '../components/map.vue';
|
||||||
</template>
|
import axios from 'axios';
|
||||||
|
|
||||||
<script>
|
|
||||||
import { ref } from 'vue';
|
|
||||||
import { useRouter } from 'vue-router';
|
|
||||||
import NavigationBar from '../components/NavigationBar.vue';
|
|
||||||
import isRegisterGuide from '../components/isRegisterGuide.vue';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
name: 'HomePage',
|
||||||
NavigationBar,
|
components: {
|
||||||
isRegisterGuide
|
Layout,
|
||||||
},
|
MapComponent
|
||||||
setup() {
|
},
|
||||||
const imagePaths = ref([
|
data() {
|
||||||
'https://dimg04.c-ctrip.com/images/0102p12000828jmogCF2E_C_1600_1200.jpg',
|
return {
|
||||||
'https://pic.kuaizhan.com/g3/b7/18/7a16-bad5-4d28-b5aa-571710c674cb36',
|
phone: sessionStorage.getItem('phone') || '',
|
||||||
'https://img.shetu66.com/2023/07/11/1689058469100908.png'
|
title: '首页',
|
||||||
]);
|
links: [{ name: '首页', path: '/home' }, { name: '个人信息', path: '/mine' }, { name: '添加出行', path: '/addDemandPage' },{ name: '历史出行', path: '/demandList' }],
|
||||||
const router = useRouter();
|
user: {
|
||||||
// 假设你有一个跳转到搜索页面的方法
|
},
|
||||||
function gotoSearchPage() {
|
rankingList: [
|
||||||
router.push('/searchPage');
|
{ city: '广东', visitors: 3 },
|
||||||
}
|
{ city: '湖南', visitors: 2 },
|
||||||
function gotoAddDemandPage() {
|
// ...其他城市数据
|
||||||
router.push('/addDemandPage');
|
],
|
||||||
}
|
};
|
||||||
|
},
|
||||||
return {
|
computed: {
|
||||||
imagePaths,
|
computedLinks() {
|
||||||
gotoSearchPage,
|
// 根据用户角色返回不同的链接数组
|
||||||
gotoAddDemandPage
|
return this.user.membertype === true
|
||||||
};
|
? this.links.concat([{ name: '服务发布', path: '/addServe' },{ name: '导游记录', path: '/serverList' }])
|
||||||
}
|
: this.links.concat([{name:'注册导游',path:'/registerGuide'}]);
|
||||||
};
|
}
|
||||||
</script>
|
},
|
||||||
|
mounted() {
|
||||||
<style scoped>
|
this.fetchUser(this.phone);
|
||||||
.home-page {
|
},
|
||||||
display: flex;
|
methods: {
|
||||||
flex-direction: column;
|
fetchUser(phone) {
|
||||||
height: 100vh; /* 设置页面高度为视口高度 */
|
// 从后端 API 请求
|
||||||
padding: 20px;
|
axios.get(`/serve/users/getByPhone?phone=${phone}`)
|
||||||
box-sizing: border-box;
|
.then(response => {
|
||||||
}
|
this.user = response.data
|
||||||
|
})
|
||||||
.page-title {
|
.catch(error => {
|
||||||
margin: 0 0 20px; /* 为标题添加下边距,与轮播图分隔开 */
|
console.error('Error fetching user:', error);
|
||||||
}
|
});
|
||||||
|
},
|
||||||
.carousel-container {
|
}
|
||||||
width: 100%;
|
}
|
||||||
/* 根据需要添加其他样式 */
|
</script>
|
||||||
}
|
|
||||||
|
<style scoped>
|
||||||
.carousel-item {
|
/* 整体页面样式 */
|
||||||
/* 默认的轮播项样式 */
|
.main-content {
|
||||||
width: 80%; /* 假设默认宽度是80% */
|
height: calc(100vh - 80px);
|
||||||
margin: 0 auto; /* 水平居中 */
|
padding: 20px;
|
||||||
}
|
transition: background-color 0.3s; /* 过渡效果 */
|
||||||
|
background-color: rgba(255, 255, 255, 0.1);
|
||||||
.center-item {
|
}
|
||||||
/* 居中的轮播项样式 */
|
|
||||||
width: 100%; /* 居中的项宽度为100% */
|
/* 左侧容器样式 */
|
||||||
/* 可以添加其他样式,如高度、边框等 */
|
.left-container {
|
||||||
}
|
flex: 3;
|
||||||
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||||
.carousel-image {
|
border-radius: 5px;
|
||||||
width: 100%; /* 图片宽度与轮播项宽度一致 */
|
padding: 20px;
|
||||||
height: auto; /* 保持图片比例 */
|
transition: box-shadow 0.3s, transform 0.3s; /* 过渡效果 */
|
||||||
}
|
background-color: rgba(255, 255, 255, 0.1);
|
||||||
|
}
|
||||||
.search-container {
|
|
||||||
margin-top: 20px;
|
/* 右侧容器样式 */
|
||||||
text-align: center; /* 让搜索框和按钮居中 */
|
.right-container {
|
||||||
}
|
flex: 1;
|
||||||
|
margin-left: 20px;
|
||||||
.search-input {
|
background-color: rgba(255, 255, 255, 0.1);
|
||||||
padding: 10px;
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||||
border-radius: 4px;
|
border-radius: 5px;
|
||||||
border: 1px solid #ccc;
|
padding: 20px;
|
||||||
width: 300px; /* 可选,设置输入框宽度 */
|
transition: box-shadow 0.3s, transform 0.3s; /* 过渡效果 */
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-button {
|
/* 排行榜容器样式 */
|
||||||
padding: 10px 20px;
|
.ranking-container {
|
||||||
border-radius: 4px;
|
width: 100%;
|
||||||
background-color: #4CAF50; /* 绿色背景 */
|
border: 1px solid #666c6e;
|
||||||
border: none;
|
border-radius: 5px;
|
||||||
color: white; /* 白色文字 */
|
padding: 10px;
|
||||||
text-align: center;
|
background-color: #abd4ee;
|
||||||
text-decoration: none;
|
transition: background-color 0.3s; /* 过渡效果 */
|
||||||
display: inline-block;
|
}
|
||||||
font-size: 16px;
|
|
||||||
margin: 4px 2px;
|
/* 排行榜项样式 */
|
||||||
cursor: pointer;
|
.ranking-item {
|
||||||
}
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
.addDemand-button {
|
margin-bottom: 5px;
|
||||||
/* 定义返回按钮的样式 */
|
padding: 8px;
|
||||||
position: fixed; /* 使按钮位置固定 */
|
border-bottom: 1px solid #28a7a3;
|
||||||
top: 10px;
|
transition: background-color 0.3s, transform 0.3s; /* 过渡效果 */
|
||||||
left: 10px;
|
}
|
||||||
margin: 0;
|
|
||||||
padding: 10px 20px;
|
.ranking-item:hover {
|
||||||
border: none;
|
background-color: #e0e2e3;
|
||||||
border-radius: 5px;
|
transform: scale(1.02); /* 放大效果 */
|
||||||
background-color: #ccc;
|
}
|
||||||
color: #333;
|
|
||||||
cursor: pointer;
|
/* 排行榜序号样式 */
|
||||||
}
|
.ranking-number {
|
||||||
|
font-weight: bold;
|
||||||
.addDemand-button:hover {
|
margin-right: 5px;
|
||||||
background-color: #aaaaaa;
|
color: #333;
|
||||||
}
|
transition: color 0.3s; /* 过渡效果 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 城市名称样式 */
|
||||||
/* 可以添加更多样式来进一步美化 */
|
.city-name {
|
||||||
</style>
|
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>
|
||||||
|
@ -1,79 +1,220 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<Layout :title="title" class="title" :links="computedLinks">
|
||||||
<Return></Return>
|
<div class="container">
|
||||||
</div>
|
<div class="form-group">
|
||||||
<div>
|
<label for="experience">有无相关经历:</label>
|
||||||
<h1>平台导游资格申请</h1>
|
<!-- 单选按钮组使用flex布局在同一行显示并居中 -->
|
||||||
<form @submit.prevent="submitForm">
|
<div class="radio-group">
|
||||||
<div>
|
<div class="radio-label">
|
||||||
<label for="experience">有无相关经历:</label>
|
<input type="radio" id="has-experience-yes" value="true" v-model="registerToGuide.re" required>
|
||||||
<input type="radio" id="has-experience-yes" value="true" v-model="registerToGuide.re" required>
|
<label for="has-experience-yes">有</label>
|
||||||
<label for="has-experience-yes">有</label>
|
</div>
|
||||||
<input type="radio" id="has-experience-no" value="false" v-model="registerToGuide.re">
|
<div class="radio-label">
|
||||||
<label for="has-experience-no">无</label>
|
<input type="radio" id="has-experience-no" value="false" v-model="registerToGuide.re">
|
||||||
</div>
|
<label for="has-experience-no">无</label>
|
||||||
<div>
|
</div>
|
||||||
<label for="rsd">居住地区:</label>
|
</div>
|
||||||
<input type="text" id="rsd" v-model="registerToGuide.rsd">
|
</div>
|
||||||
</div>
|
<div class="form-group">
|
||||||
<div>
|
<label for="rsd">居住地区:</label>
|
||||||
<label for="familiar-area">熟悉区域:</label>
|
<input type="text" id="rsd" v-model="registerToGuide.rsd">
|
||||||
<textarea id="familiar-area" v-model="registerToGuide.fa"></textarea>
|
</div>
|
||||||
</div>
|
<div class="form-group">
|
||||||
<div>
|
<label for="familiar-area">熟悉区域:</label>
|
||||||
<label for="syns">个人简介:</label>
|
<textarea id="familiar-area" v-model="registerToGuide.fa"></textarea>
|
||||||
<textarea id="syns" v-model="registerToGuide.syns"></textarea>
|
</div>
|
||||||
</div>
|
<div class="form-group">
|
||||||
<button @click="Submit()">提交申请</button>
|
<label for="syns">个人简介:</label>
|
||||||
</form>
|
<textarea id="syns" v-model="registerToGuide.syns"></textarea>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
<button @click="Submit()">提交申请</button>
|
||||||
|
</div>
|
||||||
<script>
|
</Layout>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import Return from '../components/return.vue'
|
import Layout from '../components/Layout.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
name: 'ApplyGuide',
|
||||||
return{
|
data() {
|
||||||
registerToGuide:{
|
return {
|
||||||
uid:0,
|
phone: sessionStorage.getItem('phone') || '',
|
||||||
re: '',
|
title: '导游资格申请',
|
||||||
rsd: '',
|
links: [{ name: '首页', path: '/home' }, { name: '个人信息', path: '/mine' }, { name: '添加出行', path: '/addDemandPage' }, { name: '历史出行', path: '/demandList' }],
|
||||||
fa: '',
|
user: {
|
||||||
syns: '',
|
role: 'member',
|
||||||
},
|
},
|
||||||
};
|
registerToGuide: {
|
||||||
},
|
uid: 0,
|
||||||
methods:{
|
re: '',
|
||||||
Submit(){
|
rsd: '',
|
||||||
axios.get(`http://192.168.243.35:9000/users/getUid?phone=${sessionStorage.getItem('phone')}`)
|
fa: '',
|
||||||
.then(response => {
|
syns: '',
|
||||||
this.registerToGuide.uid = response.data
|
},
|
||||||
axios.post(`http://192.168.243.35:9000/users/registerToGuide`,{registerToGuide:this.registerToGuide})
|
};
|
||||||
.then(response => {
|
},
|
||||||
if(response.data == 1){
|
computed: {
|
||||||
alert("申请成功!")
|
computedLinks() {
|
||||||
this.$router.push('/addServe')
|
return this.user.role === 'admin'
|
||||||
}else{
|
? this.links.concat([{ name: '服务发布', path: '/addServe' }, { name: '导游记录', path: '/serveList' }])
|
||||||
alert("申请未通过!")
|
: this.links.concat([{ name: '注册导游', path: '/registerGuide' }]);
|
||||||
}
|
},
|
||||||
})
|
},
|
||||||
.catch(error => {
|
mounted() {
|
||||||
console.error('Error fetching user:', error);
|
this.fetchUser(this.phone);
|
||||||
});
|
},
|
||||||
})
|
methods: {
|
||||||
.catch(error => {
|
fetchUser(phone) {
|
||||||
console.error('Error fetching user:', error);
|
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:{
|
components: {
|
||||||
Return,
|
Layout,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</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;
|
||||||
|
|
||||||
<style scoped>
|
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>
|
</style>
|
@ -1,75 +1,128 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="return">
|
<Layout :title="title" :links="computedLinks">
|
||||||
<button class="returnList" @click="returnList()">返回</button>
|
<div class="order-container">
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<h1>订单列表</h1>
|
|
||||||
<div
|
<div
|
||||||
v-for="(list, index) in lists"
|
v-for="(list, index) in lists"
|
||||||
:key="list.gid"
|
:key="list.gid"
|
||||||
class="order-box"
|
class="order-card"
|
||||||
@click="goToServerDetails(list.gid)"
|
@click="goToServerDetails(list.gid)"
|
||||||
>
|
>
|
||||||
<p>目的地: {{ list.city }}</p>
|
<div class="order-header">
|
||||||
<p>开始时间: {{ list.departureDate }}</p>
|
<h3>{{ list.city }}</h3>
|
||||||
<p>结束时间: {{ list.endDate }}</p>
|
</div>
|
||||||
</div>
|
<div class="order-body">
|
||||||
</div>
|
<p>开始时间: {{ list.departureDate }}</p>
|
||||||
</template>
|
<p>结束时间: {{ list.endDate }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Layout>
|
||||||
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
import Layout from '../components/Layout.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
components: {
|
||||||
|
Layout
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
phone: sessionStorage.getItem('phone') || '',
|
phone: sessionStorage.getItem('phone') || '',
|
||||||
lists: [],
|
lists: [],
|
||||||
|
title: '导游记录',
|
||||||
|
links: [{ name: '首页', path: '/home' }, { name: '个人信息', path: '/mine' }, { name: '添加出行', path: '/addDemandPage' },{ name: '历史出行', path: '/demandList' }],
|
||||||
|
user: {
|
||||||
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
async created() {
|
async created() {
|
||||||
// 在组件创建后立即发送请求
|
// 在组件创建后立即发送请求
|
||||||
axios.get(`http://192.168.243.35:9000/SendGuideService/sendAllGuideService?phone=${this.phone}`)
|
try {
|
||||||
.then(response => {
|
const response = await axios.get(`/serve/SendGuideService/sendAllGuideService?phone=${this.phone}`);
|
||||||
this.lists = response.data
|
this.lists = response.data;
|
||||||
})
|
} catch (error) {
|
||||||
.catch(error => {
|
console.error('Error fetching guide services:', error.response || error.message);
|
||||||
console.error('Error fetching user:', error);
|
}
|
||||||
});
|
|
||||||
},
|
try {
|
||||||
methods: {
|
const response = await axios.get(`/serve/users/getByPhone?phone=${this.phone}`);
|
||||||
|
this.user = response.data;
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error fetching user data:', error.response || error.message);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
computedLinks() {
|
||||||
|
// 根据用户角色返回不同的链接数组
|
||||||
|
return this.user.membertype === true
|
||||||
|
? this.links.concat([{ name: '服务发布', path: '/addServe' },{ name: '导游记录', path: '/serverList' }])
|
||||||
|
: this.links.concat([{name:'注册导游',path:'/registerGuide'}]);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
goToServerDetails(serverId) {
|
goToServerDetails(serverId) {
|
||||||
this.$router.push({ name: 'ServerDetail', params: { serverId } });
|
this.$router.push({ name: 'ServerDetail', params: { serverId } });
|
||||||
},
|
}
|
||||||
returnList() {
|
|
||||||
this.$router.push('/mine');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.order-box {
|
.trip-info p {
|
||||||
/* 样式代码,用于美化订单盒子 */
|
margin: 8px 0;
|
||||||
border: 1px solid #ccc;
|
font-size: 16px;
|
||||||
padding: 10px;
|
color: #333;
|
||||||
margin-bottom: 10px;
|
}
|
||||||
|
|
||||||
|
/* 订单容器样式 */
|
||||||
|
.order-container {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 订单卡片样式 */
|
||||||
|
.order-card {
|
||||||
|
border: 1px solid #eaeaea;
|
||||||
|
border-radius: 10px;
|
||||||
|
margin: 10px;
|
||||||
|
padding: 20px;
|
||||||
|
background-color: #fff;
|
||||||
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||||
|
width: calc(33% - 40px);
|
||||||
|
cursor: pointer;
|
||||||
|
transition: transform 0.3s, box-shadow 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-card:hover {
|
||||||
|
transform: translateY(-5px);
|
||||||
|
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 订单头部和内容样式 */
|
||||||
|
.order-header h3 {
|
||||||
|
margin: 0 0 10px;
|
||||||
|
font-size: 20px;
|
||||||
|
color: #007BFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-body {
|
||||||
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
.returnList {
|
|
||||||
/* 定义返回按钮的样式 */
|
/* 响应式设计 */
|
||||||
position: fixed; /* 使按钮位置固定 */
|
@media (max-width: 768px) {
|
||||||
top: 10px;
|
.order-card {
|
||||||
left: 10px;
|
width: calc(50% - 40px);
|
||||||
margin: 0;
|
}
|
||||||
padding: 10px 20px;
|
|
||||||
border: none;
|
|
||||||
border-radius: 5px;
|
|
||||||
background-color: #ccc;
|
|
||||||
color: #333;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.returnList:hover {
|
@media (max-width: 480px) {
|
||||||
background-color: #aaaaaa;
|
.order-card {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
@ -0,0 +1,103 @@
|
|||||||
|
<template>
|
||||||
|
<div class="user-feedback">
|
||||||
|
<!-- 输入评价 -->
|
||||||
|
<div class="feedback-input">
|
||||||
|
<h2>意见反馈</h2>
|
||||||
|
<form>
|
||||||
|
<textarea id="ebody" v-model.trim="ebody" rows="4" cols="50" placeholder="在这里输入您的使用意见"></textarea>
|
||||||
|
<button type="submit" @click="send">发布</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<el-space direction="vertical">
|
||||||
|
<el-row>
|
||||||
|
<el-text>星级评价</el-text>
|
||||||
|
<el-rate class="ml-1"
|
||||||
|
v-model="satisfaction"
|
||||||
|
:texts="['oops', 'disappointed', 'normal', 'good', 'great']"
|
||||||
|
show-text
|
||||||
|
@change="handleRateChange"
|
||||||
|
clearable />
|
||||||
|
</el-row>
|
||||||
|
</el-space>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import axios from 'axios';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
user: {},
|
||||||
|
eid: '',
|
||||||
|
ebody: '',
|
||||||
|
satisfaction:'',
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
send() {
|
||||||
|
axios.post('http://106.52.218.118:8081/evaluate/addEvaluation', {
|
||||||
|
eid : 1,
|
||||||
|
satisfaction :this.satisfaction,
|
||||||
|
ebody :this.ebody,
|
||||||
|
}, {
|
||||||
|
// 配置跨域请求时携带 cookie
|
||||||
|
withCredentials: true,
|
||||||
|
// 设置请求头部为 JSON 格式
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleRateChange(){
|
||||||
|
this.satisfaction = satisfaction; // 更新星级值
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.user-feedback {
|
||||||
|
max-width: 600px;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.feedback-input {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
textarea {
|
||||||
|
width: 100%;
|
||||||
|
padding: 8px;
|
||||||
|
font-size: 16px;
|
||||||
|
border: 1px solid #28a7a3;
|
||||||
|
border-radius: 4px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
padding: 8px 16px;
|
||||||
|
font-size: 16px;
|
||||||
|
border: none;
|
||||||
|
border-radius: 4px;
|
||||||
|
background-color: #007bff;
|
||||||
|
color: #003f3f;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.submitted-feedback {
|
||||||
|
border-top: 1px solid #a6cfee;
|
||||||
|
padding-top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.feedback-item {
|
||||||
|
background-color: #abd4ee;
|
||||||
|
border: 1px solid #c2f1fb;
|
||||||
|
border-radius: 4px;
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.feedback-item p {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,25 @@
|
|||||||
|
import { fileURLToPath, URL } from 'node:url'
|
||||||
|
|
||||||
|
import { defineConfig } from 'vite'
|
||||||
|
import vue from '@vitejs/plugin-vue'
|
||||||
|
|
||||||
|
// https://vitejs.dev/config/
|
||||||
|
export default defineConfig({
|
||||||
|
plugins: [
|
||||||
|
vue(),
|
||||||
|
],
|
||||||
|
resolve: {
|
||||||
|
alias: {
|
||||||
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
server: {
|
||||||
|
proxy: {
|
||||||
|
'/serve': {
|
||||||
|
target: 'http://192.168.205.145:8080', // 替换为您要代理到的目标地址
|
||||||
|
changeOrigin: true, // 允许跨域
|
||||||
|
rewrite: (path) => path.replace(/^\/serve/, '') // 重写路径
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|