曾晨曦_branch
zcx 1 year ago
parent ee7d59566a
commit 97f19cd357

@ -1,6 +1,6 @@
import axios from 'axios'
const baseURL = 'https:106.52.218.118:12607'
const baseURL = 'https:106.52.218.118:8081'
export const login = (data) => {
return axios.post(`${baseURL}/Login/login`, data)

@ -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>

@ -5,8 +5,13 @@ import ElementPlus from 'element-plus';
import 'element-plus/theme-chalk/index.css';
import VueDatePicker from '@vuepic/vue-datepicker';
import '@vuepic/vue-datepicker/dist/main.css';
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
const app = createApp(App);
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
app.component(key, component)
}
app.use(ElementPlus);
app.use(router);
app.component('VueDatePicker', VueDatePicker);

@ -14,10 +14,12 @@
</div>
</div>
</div>
<div><NavigationBar /></div>
</template>
<script>
import axios from 'axios';
import NavigationBar from '../components/NavigationBar.vue';
export default {
data() {
@ -26,6 +28,9 @@ export default {
newMessage: '',
};
},
components: {
NavigationBar
},
methods: {
async fetchMessages() {
try {

@ -36,7 +36,7 @@ export default {
},
methods: {
send() {
axios.post('http://106.52.218.118:12607/evaluate/addEvaluation', {
axios.post('http://106.52.218.118:8081/evaluate/addEvaluation', {
eid : 1,
satisfaction :this.satisfaction,
ebody :this.ebody,

@ -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>

@ -14,12 +14,9 @@
<img src="../data/picture/background.png" alt="图片描述" class="search-image">
</div>
<div class="footer-nav">
<button>首页</button>
<button @click="gotomessage()"></button>
<button @click="gotomine()"></button>
</div>
</div>
<div><NavigationBar /></div>
</div>
</template>
<style scoped>
@ -84,38 +81,15 @@
color: #333;
cursor: pointer;
}
.footer-nav {
/* 定义底部导航的样式 */
position: fixed;
bottom: 0;
left: 0;
right: 0;
display: flex;
justify-content: space-around;
padding: 10px;
background-color: #f5f5f5; /* 示例背景色 */
}
.footer-nav button {
/* 定义按钮的样式 */
flex: 1;
border: none;
padding: 10px;
background-color: #ccc;
color: #333;
cursor: pointer;
}
.footer-nav button:hover {
/* 按钮点击时的样式 */
background-color: #bbb;
}
</style>
<script>
import NavigationBar from '../components/NavigationBar.vue';
export default {
name: 'Home',
name: 'Home',
components: {
NavigationBar
},
methods: {
gotomessage() {
this.$router.push('/message');

@ -65,7 +65,7 @@ export default {
console.log("手机号:", this.phone);
console.log("密码:", this.password);
axios.post('http://106.52.218.118:12607/Login/login', {
axios.post('http://106.52.218.118:8081/Login/login', {
//
phone: this.phone,
password: this.password

@ -84,7 +84,7 @@ export default {
console.log("身份证号:",this.IDcard);
console.log("昵称:",this.nickname);
axios.post('http://106.52.218.118:12607/Login/register', {
axios.post('http://106.52.218.118:8081/Login/register', {
//
phone: this.phone,
password: this.password,

@ -25,7 +25,7 @@ const getProvinceList = async () => {
const publish = () => {
//
if(city.value!=''){
axios.post(`http://106.52.218.118:12607/users/pupdate`,{city:city.value,time:rangeValue.value,remark:remark.value})
axios.post(`http://106.52.218.118:8081/users/pupdate`,{city:city.value,time:rangeValue.value,remark:remark.value})
.then(response => {
alert("发布成功");
})

@ -33,11 +33,7 @@
<button @click="togglePhoneInput"></button>
</div>
<div class="footer-nav">
<button @click="gotohome()"></button>
<button @click="gotomessage()"></button>
<button>我的</button>
</div>
<div><NavigationBar /></div>
</div>
</template>
@ -66,37 +62,11 @@ button {
padding-bottom: 50px;
}
.footer-nav {
/* 定义底部导航的样式 */
position: fixed;
bottom: 0;
left: 0;
right: 0;
display: flex;
justify-content: space-around;
padding: 10px;
background-color: #f5f5f5; /* 示例背景色 */
}
.footer-nav button {
/* 定义按钮的样式 */
flex: 1;
border: none;
padding: 10px;
background-color: #ccc;
color: #333;
cursor: pointer;
}
.footer-nav button:hover {
/* 按钮点击时的样式 */
background-color: #bbb;
}
</style>
<script>
import axios from 'axios';
import NavigationBar from '../components/NavigationBar.vue';
export default {
data() {
@ -113,16 +83,16 @@ export default {
status: 0,
};
},
/*computed: {
...mapGetters(['getPhone'])
},*/
components: {
NavigationBar
},
created() {
this.fetchUser(this.phone);
},
methods: {
fetchUser(phone) {
// API
axios.get(`http://106.52.218.118:12607/users/getByPhone?phone=${phone}`)
axios.get(`http://106.52.218.118:8081/users/getByPhone?phone=${phone}`)
.then(response => {
this.user = response.data;
})
@ -137,7 +107,7 @@ export default {
},
updateNickname(){
this.user.nickname = this.nickname;
axios.post(`http://106.52.218.118:12607/users/pupdate`,{user:this.user})
axios.post(`http://106.52.218.118:8081/users/pupdate`,{user:this.user})
.then(response => {
this.user.nickname = this.nickname;
this.toggleNicknameInput(); //
@ -153,7 +123,7 @@ export default {
updateEmail() {
//
this.user.email = this.email;
axios.post(`http://106.52.218.118:12607/users/pupdate`,{user:this.user})
axios.post(`http://106.52.218.118:8081/users/pupdate`,{user:this.user})
.then(response => {
this.user.email = this.email;
this.toggleEmailInput(); //
@ -168,7 +138,7 @@ export default {
},
updatePhone(){
this.user.phone = this.phone;
axios.post(`http://106.52.218.118:12607/users/pupdate`,{user:this.user})
axios.post(`http://106.52.218.118:8081/users/pupdate`,{user:this.user})
.then(response => {
sessionStorage.setItem('phone', this.phone);
this.user.phone = this.phone;
@ -178,12 +148,12 @@ export default {
console.error('Error updating phone:', error);
});
},
gotohome() {
this.$router.push('/home');
},
gotomessage() {
this.$router.push('/message');
},
// gotohome() {
// this.$router.push('/home');
// },
// gotomessage() {
// this.$router.push('/message');
// },
}
};
</script>

@ -11,6 +11,8 @@ import addDemand from "@/pages/addDemand.vue";
import DemandList from "@/pages/DemandList.vue";
import Evaluation from "@/pages/Evaluation.vue";
import SecurityVerification from "@/pages/SecurityVerification.vue";
import EvaluationEdit from "@/pages/EvaluationEdit.vue";
import EvaluationList from "@/pages/EvaluationList.vue";
const routes = [
{ path: '/', redirect: '/login' }, // 重定向到/login路径
@ -25,7 +27,9 @@ const routes = [
{ path: '/pay', component:Pay},
{ path: '/demandlist', component:DemandList},
{ path: '/evaluation', component:Evaluation},
{ path: '/SecurityVerification', component:SecurityVerification}
{ path: '/SecurityVerification', component:SecurityVerification},
{ path: '/EvaluationEdit', component:EvaluationEdit},
{ path: '/EvaluationList', component:EvaluationList}
];
const router = createRouter({

Loading…
Cancel
Save