commitdevelop97f19cd357
Author: zcx <1078327420@qq.com> Date: Thu May 16 17:05:07 2024 +0800 1 commitee7d59566a
Author: zcx <1078327420@qq.com> Date: Wed May 15 10:18:52 2024 +0800 修改上传文件结构 commitc143d66957
Author: zcx <1078327420@qq.com> Date: Wed May 15 10:12:58 2024 +0800 1 commitd4b226f46c
Author: zcx <1078327420@qq.com> Date: Wed May 15 09:39:59 2024 +0800 1 commit18119839d9
Author: zcx <1078327420@qq.com> Date: Wed May 15 09:08:06 2024 +0800 修改 commit4ca319060a
Author: zcx <1078327420@qq.com> Date: Sun May 12 21:41:25 2024 +0800 1 commit420c9925aa
Author: zcx <1078327420@qq.com> Date: Sun May 12 21:00:08 2024 +0800 修改文件结构 commitdece352494
Author: zcx <1078327420@qq.com> Date: Sun May 12 19:47:44 2024 +0800 1 commitc4de9ccc45
Author: zcx <1078327420@qq.com> Date: Sun May 12 19:36:07 2024 +0800 1 commit05aefb2d55
Author: zcx <1078327420@qq.com> Date: Sun May 12 19:28:09 2024 +0800 1 commit2991a0288e
Author: zcx <1078327420@qq.com> Date: Sun May 12 19:24:16 2024 +0800 1 commitf0a01dc52a
Author: zcx <1078327420@qq.com> Date: Sun May 12 19:14:07 2024 +0800 1 commit103b91481d
Merge:3f241a6
d73c814
Author: zcx <1078327420@qq.com> Date: Sat May 11 16:10:15 2024 +0800 Merge branch 'develop' of https://bdgit.educoder.net/mwxbgi697/softegg into 曾晨曦_branch # Conflicts: # src/前端/walktofree/src/api/auth.js # src/前端/walktofree/src/components/NavigationBar.vue # src/前端/walktofree/src/main.js # src/前端/walktofree/src/pages/Evaluation.vue # src/前端/walktofree/src/pages/HomePage.vue # src/前端/walktofree/src/pages/Login.vue # src/前端/walktofree/src/pages/Register.vue # src/前端/walktofree/src/pages/addDemand.vue # src/前端/walktofree/src/pages/mine.vue # src/前端/walktofree/src/router/index.js
parent
0f844484d9
commit
123fb36b7a
@ -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