Skip to content

Commit

Permalink
update front
Browse files Browse the repository at this point in the history
  • Loading branch information
Dariiiii committed Dec 18, 2024
1 parent ef1a5f0 commit d9cb05c
Show file tree
Hide file tree
Showing 10 changed files with 583 additions and 9 deletions.
3 changes: 3 additions & 0 deletions frontend/src/views/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ export default {
notificationVisible: false,
};
},
mounted() {
document.title = "Вход";
},
methods: {
async submitForm() {
try {
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/views/Register.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ export default {
notificationVisible: false,
};
},
mounted() {
document.title = "Регистрация";
},
methods: {
async submitForm() {
if (this.password !== this.confirmPassword) {
Expand Down
81 changes: 81 additions & 0 deletions frontend/src/views/RequestDetail.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<template>
<div class="request-detail">
<h1>Детали заявки</h1>
<div v-if="request">
<div><strong>Название кредита:</strong> {{ request.loan_name }}</div>
<div><strong>Дата заявки:</strong> {{ formatDate(request.request_time) }}</div>
<div><strong>Статус:</strong> {{ request.status }}</div>
<div><strong>Сумма:</strong> {{ request.amount }} руб.</div>
<div><strong>Ставка:</strong> {{ request.interest_rate }} %</div>
<div><strong>Срок:</strong> {{ request.expiration_time }} мес.</div>
<div><strong>Комментарий:</strong> {{ request.comment || 'Нет комментария' }}</div>
</div>
<div v-else>
<p>Заявка не найдена.</p>
</div>
</div>
</template>

<script>
import axios from 'axios';
export default {
name: 'RequestDetail',
data() {
return {
request: null
};
},
created() {
this.getRequestDetails();
},
methods: {
async getRequestDetails() {
const requestId = this.$route.params.id;
try {
const response = await axios.get(`http://127.0.0.1:5000/credit_request/${requestId}`);
this.request = response.data;
} catch (error) {
console.log('Ошибка при получении данных заявки:', error);
}
},
formatDate(date) {
const options = {
year: 'numeric',
month: 'long',
day: 'numeric',
hour: '2-digit',
minute: '2-digit',
second: '2-digit'
};
return new Date(date).toLocaleString('ru-RU', options);
}
}
};
</script>

<style scoped>
.request-detail {
padding: 20px;
}
h1 {
text-align: center;
margin-bottom: 20px;
}
div {
margin-bottom: 10px;
}
strong {
font-weight: bold;
}
p {
text-align: center;
color: red;
}
</style>

5 changes: 4 additions & 1 deletion frontend/src/views/admin/Main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ export default {
userName() {
return localStorage.getItem('userName') || 'Админ';
}
}
},
mounted() {
document.title = "Главная";
},
};
</script>

Expand Down
3 changes: 3 additions & 0 deletions frontend/src/views/admin/Profile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ export default {
components: {
Button
},
mounted() {
document.title = "Профиль";
},
methods: {
logout() {
localStorage.setItem('authToken', false);
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/views/admin/Statistics.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ export default {
file: null
};
},
mounted() {
document.title = "Статистика";
},
methods: {
async exportData() {
try {
Expand Down
Loading

0 comments on commit d9cb05c

Please sign in to comment.