master
parent
9eb3a3a341
commit
6d63961541
@ -0,0 +1,75 @@
|
|||||||
|
<template>
|
||||||
|
<div class="return">
|
||||||
|
<button class="returnList" @click="returnList()">返回</button>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<h1>订单列表</h1>
|
||||||
|
<div
|
||||||
|
v-for="(list, index) in lists"
|
||||||
|
:key="lists.orderId"
|
||||||
|
class="order-box"
|
||||||
|
@click="goToOrderDetails(list.did)"
|
||||||
|
>
|
||||||
|
<p>目的地: {{ list.city }}</p>
|
||||||
|
<p>开始时间: {{ list.departureDate }}</p>
|
||||||
|
<p>结束时间: {{ list.endDate }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import axios from 'axios';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
phone: sessionStorage.getItem('phone') || '',
|
||||||
|
lists: [],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
async created() {
|
||||||
|
// 在组件创建后立即发送请求
|
||||||
|
axios.get(`http://192.168.243.35:9000/SendDemand/sendAllDemands?phone=${this.phone}`)
|
||||||
|
.then(response => {
|
||||||
|
this.lists = response.data
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error('Error fetching user:', error);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
goToOrderDetails(orderId) {
|
||||||
|
this.$router.push({ name: 'OrderDetails', params: { orderId } });
|
||||||
|
},
|
||||||
|
returnList() {
|
||||||
|
this.$router.push('/mine');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.order-box {
|
||||||
|
/* 样式代码,用于美化订单盒子 */
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
padding: 10px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
.returnList {
|
||||||
|
/* 定义返回按钮的样式 */
|
||||||
|
position: fixed; /* 使按钮位置固定 */
|
||||||
|
top: 10px;
|
||||||
|
left: 10px;
|
||||||
|
margin: 0;
|
||||||
|
padding: 10px 20px;
|
||||||
|
border: none;
|
||||||
|
border-radius: 5px;
|
||||||
|
background-color: #ccc;
|
||||||
|
color: #333;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.returnList:hover {
|
||||||
|
background-color: #aaaaaa;
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,93 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<h2>订单号: {{ orderId }}</h2>
|
||||||
|
<div v-for="(service, index) in services" :key="service.gid" class="service-box">
|
||||||
|
<div class="service-info">
|
||||||
|
<p class="nickname">{{ service.nickname }}</p>
|
||||||
|
<p class="end-date">{{ service.endDate }}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button class="send-button" @click="sendServiceId(service.gid)">点击发送</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
/* 为按钮添加一些样式 */
|
||||||
|
.send-button {
|
||||||
|
display: block;
|
||||||
|
margin-left: auto; /* 将按钮推到右侧 */
|
||||||
|
margin-top: 10px; /* 顶部添加一些间距 */
|
||||||
|
padding: 5px 10px; /* 内边距 */
|
||||||
|
border: none; /* 移除边框 */
|
||||||
|
border-radius: 4px; /* 添加圆角 */
|
||||||
|
background-color: #4CAF50; /* 背景色 */
|
||||||
|
color: white; /* 文字颜色 */
|
||||||
|
cursor: pointer; /* 鼠标悬停时显示小手 */
|
||||||
|
transition: background-color 0.3s ease; /* 添加背景色过渡效果 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.send-button:hover {
|
||||||
|
background-color: #45a049; /* 鼠标悬停时改变背景色 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 为服务信息盒子添加样式 */
|
||||||
|
.service-box {
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
padding: 15px;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
background-color: #fff; /* 添加背景色 */
|
||||||
|
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* 添加阴影效果 */
|
||||||
|
border-radius: 5px; /* 添加圆角 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 为昵称和结束日期添加样式 */
|
||||||
|
.service-info {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between; /* 内容两端对齐 */
|
||||||
|
align-items: center; /* 内容垂直居中 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.nickname, .end-date {
|
||||||
|
margin: 0; /* 移除默认的外边距 */
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import axios from 'axios';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
props: ['orderId'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
services: []
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async sendServiceId(gid) {
|
||||||
|
try {
|
||||||
|
// 假设后端API接受gid和did作为POST请求体
|
||||||
|
const orderIdAsInt = parseInt(this.orderId, 10);
|
||||||
|
const gidAsInt = parseInt(gid, 10);
|
||||||
|
const response = await axios.post('http://192.168.243.35:9000/DemandMatch/match', { did:orderIdAsInt,gid:gidAsInt});
|
||||||
|
alert('已向导游发送确认信息');
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error sending service ID and order ID:', error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async created() {
|
||||||
|
// 在组件创建后立即发送请求
|
||||||
|
axios.get(`http://192.168.243.35:9000/DemandMatch/register?did=${this.orderId}`)
|
||||||
|
.then(response => {
|
||||||
|
this.services = response.data
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error('Error fetching user:', error);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
@ -0,0 +1,161 @@
|
|||||||
|
<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>
|
||||||
|
.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>
|
||||||
|
import axios from 'axios';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
props: ['orderId'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
ebody: '',
|
||||||
|
satisfaction:'',
|
||||||
|
did:'',
|
||||||
|
evaluation: {}, // 添加一个用于存储评价信息的变量
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
send() {
|
||||||
|
axios.post('http://192.168.243.35:9000/evaluate/addEvaluation', {
|
||||||
|
did: this.orderId,
|
||||||
|
satisfaction: this.evaluation.satisfaction,
|
||||||
|
ebody: this.evaluation.ebody,
|
||||||
|
}, {
|
||||||
|
withCredentials: true,
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
}
|
||||||
|
}).then(response => {
|
||||||
|
// 处理成功发送评价的情况
|
||||||
|
location.reload();
|
||||||
|
}).catch(error => {
|
||||||
|
// 处理发送评价失败的情况
|
||||||
|
console.error('评价发送失败', error);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
fetchEvaluation() {
|
||||||
|
axios.get(`http://192.168.243.35:9000/evaluate/getEvaluation?eid=${this.orderId}`)
|
||||||
|
.then(response => {
|
||||||
|
this.evaluation = response.data;// 将获取到的评价信息存储到 evaluation 变量中
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error('获取评价信息失败', error);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleRateChange(satisfaction) {
|
||||||
|
this.evaluation.satisfaction = satisfaction; // 更新星级值
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.fetchEvaluation(); // 在组件挂载时调用 fetchEvaluation 方法获取评价信息
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</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,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,133 @@
|
|||||||
|
<template>
|
||||||
|
<div class="return">
|
||||||
|
<button class="returnList" @click="returnList()">返回</button>
|
||||||
|
</div>
|
||||||
|
<h1>订单</h1>
|
||||||
|
<div class="server-details">
|
||||||
|
<h2>订单详情</h2>
|
||||||
|
<p>目的地: {{ list.city }}</p>
|
||||||
|
<p>开始时间: {{ list.departureDate }}</p>
|
||||||
|
<p>结束时间: {{ list.endDate }}</p>
|
||||||
|
<p>创建时间: {{ list.createTime }}</p>
|
||||||
|
<p>备注: {{ list.message }}</p>
|
||||||
|
<p>当前状态:
|
||||||
|
<span v-if="list.status === 0">匹配中</span>
|
||||||
|
<span v-else-if="list.status === 1">匹配中</span>
|
||||||
|
<span v-else-if="list.status === 2">匹配成功</span>
|
||||||
|
<span v-else-if="list.status === 3">已完成</span>
|
||||||
|
<span v-else>未知状态</span>
|
||||||
|
</p>
|
||||||
|
<div>
|
||||||
|
<button v-if="list.status === 0" @click="goToServerMatch(serverId)">查看详情</button>
|
||||||
|
<button v-if="list.status === 1" @click="goToServerMatch(serverId)">查看详情</button>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<button v-if="list.status === 0" @click="goToServerMatched(serverId)">查看申请</button>
|
||||||
|
<button v-if="list.status === 1" @click="goToServerMatched(serverId)">查看申请</button>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<button v-if="list.status === 0" @click="cancelTrip(serverId)">取消服务</button>
|
||||||
|
<button v-if="list.status === 1" @click="cancelTrip(serverId)">取消服务</button>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<button v-if="list.status === 2" @click="cancel(serverId)">取消服务</button>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<button v-if="list.status === 3" @click="deleteOrder(serverId)">删除订单</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.returnList {
|
||||||
|
/* 定义返回按钮的样式 */
|
||||||
|
position: fixed; /* 使按钮位置固定 */
|
||||||
|
top: 10px;
|
||||||
|
left: 10px;
|
||||||
|
margin: 0;
|
||||||
|
padding: 10px 20px;
|
||||||
|
border: none;
|
||||||
|
border-radius: 5px;
|
||||||
|
background-color: #ccc;
|
||||||
|
color: #333;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.returnList:hover {
|
||||||
|
background-color: #aaaaaa;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import axios from 'axios';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
props: ['serverId'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
phone: sessionStorage.getItem('phone') || '',
|
||||||
|
list: [],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
async created() {
|
||||||
|
// 在组件创建后立即发送请求
|
||||||
|
axios.get(`http://192.168.243.35:9000/guideService/findbyid?gid=${this.serverId}`)
|
||||||
|
.then(response => {
|
||||||
|
this.list = response.data
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error('Error fetching user:', error);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
goToServerMatch(serverId) {
|
||||||
|
this.$router.push({ name: 'ServerMatch', params: { serverId } });
|
||||||
|
},
|
||||||
|
goToServerMatched(serverId) {
|
||||||
|
this.$router.push({ name: 'ServerMatched', params: { serverId } });
|
||||||
|
},
|
||||||
|
cancel(serverId) {
|
||||||
|
const gid = parseInt(this.serverId, 10);
|
||||||
|
axios.post(`http://192.168.243.35:9000/GuideMatch/refuse`,{gid:gid})
|
||||||
|
.then(response => {
|
||||||
|
if(response.data == 1){
|
||||||
|
alert('取消成功');
|
||||||
|
location.reload();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error('Error fetching user:', error);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
cancelTrip(serverId) {
|
||||||
|
const gid = parseInt(this.serverId, 10);
|
||||||
|
axios.post(`http://192.168.243.35:9000/guideService/delbyid`,{gid:gid})
|
||||||
|
.then(response => {
|
||||||
|
if(response.data == 1){
|
||||||
|
alert('取消成功');
|
||||||
|
this.$router.push('/serverList')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error('Error fetching user:', error);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
deleteOrder(serverId) {
|
||||||
|
const gid = parseInt(this.serverId, 10);
|
||||||
|
axios.post(`http://192.168.243.35:9000/GuideMatch/delete`,{gid:gid})
|
||||||
|
.then(response => {
|
||||||
|
if(response.data == 1){
|
||||||
|
alert('删除成功');
|
||||||
|
this.$router.push('/serverList')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error('Error fetching user:', error);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
returnList() {
|
||||||
|
this.$router.push('/serverList');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
@ -0,0 +1,75 @@
|
|||||||
|
<template>
|
||||||
|
<div class="return">
|
||||||
|
<button class="returnList" @click="returnList()">返回</button>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<h1>订单列表</h1>
|
||||||
|
<div
|
||||||
|
v-for="(list, index) in lists"
|
||||||
|
:key="list.gid"
|
||||||
|
class="order-box"
|
||||||
|
@click="goToServerDetails(list.gid)"
|
||||||
|
>
|
||||||
|
<p>目的地: {{ list.city }}</p>
|
||||||
|
<p>开始时间: {{ list.departureDate }}</p>
|
||||||
|
<p>结束时间: {{ list.endDate }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import axios from 'axios';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
phone: sessionStorage.getItem('phone') || '',
|
||||||
|
lists: [],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
async created() {
|
||||||
|
// 在组件创建后立即发送请求
|
||||||
|
axios.get(`http://192.168.243.35:9000/SendGuideService/sendAllGuideService?phone=${this.phone}`)
|
||||||
|
.then(response => {
|
||||||
|
this.lists = response.data
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error('Error fetching user:', error);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
goToServerDetails(serverId) {
|
||||||
|
this.$router.push({ name: 'ServerDetail', params: { serverId } });
|
||||||
|
},
|
||||||
|
returnList() {
|
||||||
|
this.$router.push('/mine');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.order-box {
|
||||||
|
/* 样式代码,用于美化订单盒子 */
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
padding: 10px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
.returnList {
|
||||||
|
/* 定义返回按钮的样式 */
|
||||||
|
position: fixed; /* 使按钮位置固定 */
|
||||||
|
top: 10px;
|
||||||
|
left: 10px;
|
||||||
|
margin: 0;
|
||||||
|
padding: 10px 20px;
|
||||||
|
border: none;
|
||||||
|
border-radius: 5px;
|
||||||
|
background-color: #ccc;
|
||||||
|
color: #333;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.returnList:hover {
|
||||||
|
background-color: #aaaaaa;
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,146 @@
|
|||||||
|
<template>
|
||||||
|
<div class="home-page">
|
||||||
|
<div class="page-header">
|
||||||
|
<h1 class="page-title">首页</h1>
|
||||||
|
</div>
|
||||||
|
<div class="carousel-container">
|
||||||
|
<el-carousel :interval="4000" arrow="always" type="card">
|
||||||
|
<el-carousel-item
|
||||||
|
v-for="(item, index) in imagePaths"
|
||||||
|
:key="index"
|
||||||
|
:class="['carousel-item', index === Math.floor(imagePaths.length / 2) ? 'center-item' : '']"
|
||||||
|
>
|
||||||
|
<img :src="item" :alt="`Image ${index + 1}`" class="carousel-image">
|
||||||
|
</el-carousel-item>
|
||||||
|
</el-carousel>
|
||||||
|
</div>
|
||||||
|
<div class="search-container">
|
||||||
|
<input type="text" class="search-input" placeholder="世界这么大出去看看吧">
|
||||||
|
<button class="search-button" @click="gotoSearchPage()">搜索</button>
|
||||||
|
</div>
|
||||||
|
<div class="return">
|
||||||
|
<button class="addDemand-button" @click="gotoAddDemandPage()">我要出行</button>
|
||||||
|
<isRegisterGuide />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div><NavigationBar /></div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
|
import NavigationBar from '../components/NavigationBar.vue';
|
||||||
|
import isRegisterGuide from '../components/isRegisterGuide.vue';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
NavigationBar,
|
||||||
|
isRegisterGuide
|
||||||
|
},
|
||||||
|
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'
|
||||||
|
]);
|
||||||
|
const router = useRouter();
|
||||||
|
// 假设你有一个跳转到搜索页面的方法
|
||||||
|
function gotoSearchPage() {
|
||||||
|
router.push('/searchPage');
|
||||||
|
}
|
||||||
|
function gotoAddDemandPage() {
|
||||||
|
router.push('/addDemandPage');
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
imagePaths,
|
||||||
|
gotoSearchPage,
|
||||||
|
gotoAddDemandPage
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.home-page {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 100vh; /* 设置页面高度为视口高度 */
|
||||||
|
padding: 20px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-title {
|
||||||
|
margin: 0 0 20px; /* 为标题添加下边距,与轮播图分隔开 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.carousel-container {
|
||||||
|
width: 100%;
|
||||||
|
/* 根据需要添加其他样式 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.carousel-item {
|
||||||
|
/* 默认的轮播项样式 */
|
||||||
|
width: 80%; /* 假设默认宽度是80% */
|
||||||
|
margin: 0 auto; /* 水平居中 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.center-item {
|
||||||
|
/* 居中的轮播项样式 */
|
||||||
|
width: 100%; /* 居中的项宽度为100% */
|
||||||
|
/* 可以添加其他样式,如高度、边框等 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.carousel-image {
|
||||||
|
width: 100%; /* 图片宽度与轮播项宽度一致 */
|
||||||
|
height: auto; /* 保持图片比例 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-container {
|
||||||
|
margin-top: 20px;
|
||||||
|
text-align: center; /* 让搜索框和按钮居中 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-input {
|
||||||
|
padding: 10px;
|
||||||
|
border-radius: 4px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
width: 300px; /* 可选,设置输入框宽度 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-button {
|
||||||
|
padding: 10px 20px;
|
||||||
|
border-radius: 4px;
|
||||||
|
background-color: #4CAF50; /* 绿色背景 */
|
||||||
|
border: none;
|
||||||
|
color: white; /* 白色文字 */
|
||||||
|
text-align: center;
|
||||||
|
text-decoration: none;
|
||||||
|
display: inline-block;
|
||||||
|
font-size: 16px;
|
||||||
|
margin: 4px 2px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.addDemand-button {
|
||||||
|
/* 定义返回按钮的样式 */
|
||||||
|
position: fixed; /* 使按钮位置固定 */
|
||||||
|
top: 10px;
|
||||||
|
left: 10px;
|
||||||
|
margin: 0;
|
||||||
|
padding: 10px 20px;
|
||||||
|
border: none;
|
||||||
|
border-radius: 5px;
|
||||||
|
background-color: #ccc;
|
||||||
|
color: #333;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.addDemand-button:hover {
|
||||||
|
background-color: #aaaaaa;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* 可以添加更多样式来进一步美化 */
|
||||||
|
</style>
|
Loading…
Reference in new issue