Squashed commit of the following:

commit dece352494
Author: zcx <1078327420@qq.com>
Date:   Sun May 12 19:47:44 2024 +0800

    1

commit c4de9ccc45
Author: zcx <1078327420@qq.com>
Date:   Sun May 12 19:36:07 2024 +0800

    1

commit 05aefb2d55
Author: zcx <1078327420@qq.com>
Date:   Sun May 12 19:28:09 2024 +0800

    1

commit 2991a0288e
Author: zcx <1078327420@qq.com>
Date:   Sun May 12 19:24:16 2024 +0800

    1

commit f0a01dc52a
Author: zcx <1078327420@qq.com>
Date:   Sun May 12 19:14:07 2024 +0800

    1

commit 103b91481d
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/components/DemandList.vue
#	src/前端/walktofree/src/router/index.js
wuyifan_branch
zcx 1 year ago
parent 5770cc6dd5
commit 093ac28300

@ -39,15 +39,15 @@ export default {
try { try {
await axios.post('http://example.com/messages', { await axios.post('http://example.com/messages', {
content: this.newMessage, content: this.newMessage,
sender: 'Me', // You can replace 'Me' with the sender's name sender: 'Me', // Me
}); });
this.newMessage = ''; // Clear the input field after sending this.newMessage = ''; //
// You might want to fetch messages again here to update the UI with the latest messages // 使 UI
} catch (error) { } catch (error) {
console.error('Error sending message:', error); console.error('Error sending message:', error);
} }
}, },
// WebSocket logic to receive messages // WebSocket
setupWebSocket() { setupWebSocket() {
const ws = new WebSocket('ws://example.com/socket'); const ws = new WebSocket('ws://example.com/socket');
ws.onmessage = (event) => { ws.onmessage = (event) => {
@ -57,8 +57,8 @@ export default {
}, },
}, },
created() { created() {
this.fetchMessages(); // Fetch messages when the component is created this.fetchMessages(); //
this.setupWebSocket(); // Setup WebSocket connection this.setupWebSocket(); // WebSocket
}, },
}; };
</script> </script>
@ -70,7 +70,7 @@ export default {
} }
.chat { .chat {
border: 2px solid #ccc; border: 2px solid #28a7a3;
border-radius: 10px; border-radius: 10px;
padding: 20px; padding: 20px;
display: flex; display: flex;
@ -100,7 +100,7 @@ export default {
.input input { .input input {
flex: 1; flex: 1;
padding: 8px; padding: 8px;
border: 1px solid #ccc; border: 1px solid #003f3f;
border-radius: 5px; border-radius: 5px;
font-size: 16px; font-size: 16px;
} }
@ -110,7 +110,7 @@ export default {
border: none; border: none;
border-radius: 5px; border-radius: 5px;
background-color: #007bff; background-color: #007bff;
color: #fff; color: #a6cfee;
font-size: 16px; font-size: 16px;
cursor: pointer; cursor: pointer;
margin-left: 10px; margin-left: 10px;

@ -2,7 +2,7 @@
<div class="user-feedback"> <div class="user-feedback">
<!-- 输入评价 --> <!-- 输入评价 -->
<div class="feedback-input"> <div class="feedback-input">
<h2>输入评价</h2> <h2>写下你的评价吧</h2>
<form @submit.prevent="submitFeedback"> <form @submit.prevent="submitFeedback">
<textarea id="feedback" v-model.trim="feedback" rows="4" cols="50" placeholder="在这里输入您的评价"></textarea> <textarea id="feedback" v-model.trim="feedback" rows="4" cols="50" placeholder="在这里输入您的评价"></textarea>
<button type="submit">发布评价</button> <button type="submit">发布评价</button>
@ -62,7 +62,7 @@ textarea {
width: 100%; width: 100%;
padding: 8px; padding: 8px;
font-size: 16px; font-size: 16px;
border: 1px solid #ccc; border: 1px solid #28a7a3;
border-radius: 4px; border-radius: 4px;
margin-bottom: 10px; margin-bottom: 10px;
} }
@ -73,18 +73,18 @@ button {
border: none; border: none;
border-radius: 4px; border-radius: 4px;
background-color: #007bff; background-color: #007bff;
color: #fff; color: #003f3f;
cursor: pointer; cursor: pointer;
} }
.submitted-feedback { .submitted-feedback {
border-top: 1px solid #ccc; border-top: 1px solid #a6cfee;
padding-top: 20px; padding-top: 20px;
} }
.feedback-item { .feedback-item {
background-color: #f9f9f9; background-color: #abd4ee;
border: 1px solid #ccc; border: 1px solid #c2f1fb;
border-radius: 4px; border-radius: 4px;
padding: 10px; padding: 10px;
} }

Loading…
Cancel
Save