曾晨曦_branch
parent
ee7d59566a
commit
97f19cd357
@ -0,0 +1,67 @@
|
|||||||
|
<template>
|
||||||
|
<div class="footer-nav">
|
||||||
|
<div class="button-with-icon" @click="gotohome()">
|
||||||
|
<el-icon><House /></el-icon>
|
||||||
|
<span>首页</span>
|
||||||
|
</div>
|
||||||
|
<div class="button-with-icon" @click="gotomessage()()">
|
||||||
|
<el-icon><ChatDotSquare /></el-icon>
|
||||||
|
<span>消息</span>
|
||||||
|
</div>
|
||||||
|
<div class="button-with-icon" @click="gotomine()">
|
||||||
|
<el-icon><User /></el-icon>
|
||||||
|
<span>我的</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'Home',
|
||||||
|
methods: {
|
||||||
|
gotohome() {
|
||||||
|
this.$router.push('/home');
|
||||||
|
},
|
||||||
|
gotomessage() {
|
||||||
|
this.$router.push('/message');
|
||||||
|
},
|
||||||
|
gotomine() {
|
||||||
|
this.$router.push('/mine');
|
||||||
|
},
|
||||||
|
gotoSearchPage() {
|
||||||
|
this.$router.push('/searchPage');
|
||||||
|
},
|
||||||
|
gotoAddDemandPage() {
|
||||||
|
this.$router.push('/addDemandPage');
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.footer-nav {
|
||||||
|
/* 定义底部导航的样式 */
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-around;
|
||||||
|
padding: 10px;
|
||||||
|
background-color: #f5f5f5; /* 示例背景色 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.button-with-icon {
|
||||||
|
/* 定义按钮的样式 */
|
||||||
|
flex: 1;
|
||||||
|
border: none;
|
||||||
|
padding: 10px;
|
||||||
|
background-color: #d5d5d5;
|
||||||
|
color: #333;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button-with-icon:hover {
|
||||||
|
background-color: #aaaaaa;
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,121 @@
|
|||||||
|
<template>
|
||||||
|
<div class="user-feedback">
|
||||||
|
<!-- 输入评价 -->
|
||||||
|
<div class="feedback-input">
|
||||||
|
<h2>修改你的评价</h2>
|
||||||
|
<form>
|
||||||
|
<textarea id="ebody" v-model.trim="evaluation.ebody" rows="4" cols="50"></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="evaluation.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 {
|
||||||
|
ebody: '',
|
||||||
|
satisfaction:'',
|
||||||
|
ct:'',
|
||||||
|
eid: 1, // 添加一个用于存储 eid 的变量
|
||||||
|
evaluation: {}, // 添加一个用于存储评价信息的变量
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
send() {
|
||||||
|
axios.post('http://106.52.218.118:8081/evaluate/editEvaluation', {
|
||||||
|
eid: this.eid, // 将 eid 包含在请求中
|
||||||
|
satisfaction: this.evaluation.satisfaction,
|
||||||
|
ct:this.evaluation.ct,
|
||||||
|
ebody: this.evaluation.ebody,
|
||||||
|
}, {
|
||||||
|
withCredentials: true,
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
}
|
||||||
|
}).then(response => {
|
||||||
|
// 处理成功发送评价的情况
|
||||||
|
console.log('评价发送成功');
|
||||||
|
}).catch(error => {
|
||||||
|
// 处理发送评价失败的情况
|
||||||
|
console.error('评价发送失败', error);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
fetchEvaluation() {
|
||||||
|
axios.get(`http://106.52.218.118:8081/evaluate/getEvaluation?eid=${this.eid}`)
|
||||||
|
.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,11 @@
|
|||||||
|
<script setup>
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
@ -0,0 +1,47 @@
|
|||||||
|
<template>
|
||||||
|
<el-button @click="add">Add Item</el-button>
|
||||||
|
<el-button @click="onDelete">Delete Item</el-button>
|
||||||
|
<el-scrollbar max-height="800px">
|
||||||
|
<p v-for="item in count" :key="item" class="scrollbar-demo-item">
|
||||||
|
{{ item }}
|
||||||
|
</p>
|
||||||
|
<p v-for="review in reviews" :key="review.id" class="scrollbar-demo-item">
|
||||||
|
{{ review.content }}
|
||||||
|
</p>
|
||||||
|
</el-scrollbar>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
|
||||||
|
<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);
|
||||||
|
}
|
||||||
|
</style>
|
Loading…
Reference in new issue