Переработаны роутеры приложения

Переписано APi WebSocket для работы с новыми роутерами
This commit is contained in:
2025-10-03 17:11:31 +03:00
parent d75fb7ec3d
commit 6ec6523d71
54 changed files with 2593 additions and 3749 deletions

View File

@@ -1,4 +1,4 @@
<div class="page-stand">
<div class="page-stand-card">
<!-- <label for="dateSelect">Виберіть дату:</label>
<select id="dateSelect"></select> -->

View File

@@ -1,7 +1,7 @@
const Stand = {
const Stand_card = {
schedule: [],
init: async () => {
let html = await fetch('/lib/pages/stand/index.html').then((response) => response.text());
init: async (id) => {
let html = await fetch('/lib/pages/stand/card/index.html').then((response) => response.text());
app.innerHTML = html;
let listDate = [1, 4];
@@ -35,7 +35,7 @@ const Stand = {
}
// generateAvailableDates();
Stand.generator();
Stand_card.generator();
},
generator: () => {
let block_schedule = document.getElementById('stand-schedule');
@@ -48,19 +48,19 @@ const Stand = {
geo: { lat: 0, lng: 0 },
hour_start: 9,
hour_end: 14,
quantity_sheep: 4,
quantity_sheep: 2,
week_days: [0, 2, 4, 6],
processing_time: 0.5,
updated_at: null
}
Stand.schedule = [];
Stand_card.schedule = [];
// Кількість годин служіння
let stand_length = (stand.hour_end - stand.hour_start) / stand.processing_time;
for (let z = 0; z < stand.week_days.length; z++) {
Stand.schedule.push([]);
Stand_card.schedule.push([]);
let date = new Date();
date.setDate(date.getDate() + stand.week_days[z]);
@@ -97,7 +97,7 @@ const Stand = {
</select>
`;
Stand.schedule[z].push({
Stand_card.schedule[z].push({
id: (i + z) * stand.quantity_sheep + q,
hour: stand.hour_start + (stand.processing_time * i),
number_sheep: q,
@@ -114,7 +114,7 @@ const Stand = {
html += `</div>`; // закриваємо day
}
document.getElementById('stand-info-title').innerText = stand.title;
document.getElementById('stand-info-title').innerText = Stand_card.title;
document.getElementById('stand-info-geo').innerHTML = '';
document.getElementById('stand-info-image').setAttribute('src', '');

View File

@@ -1,4 +1,4 @@
.page-stand {
.page-stand-card {
width: calc(100% - 40px);
display: flex;
flex-direction: column;
@@ -6,7 +6,7 @@
margin: 20px 20px 0 20px;
}
.page-stand details {
.page-stand-card details {
border-radius: var(--border-radius);
width: 100%;
display: flex;
@@ -19,7 +19,7 @@
box-shadow: var(--shadow-l1);
}
.page-stand summary {
.page-stand-card summary {
width: calc(100% - 40px);
cursor: pointer;
color: var(--ColorThemes3);

View File

@@ -0,0 +1,3 @@
<div class="page-stand-list">
</div>

View File

@@ -0,0 +1,6 @@
const Stand_list = {
init: async () => {
let html = await fetch('/lib/pages/stand/list/index.html').then((response) => response.text());
app.innerHTML = html;
},
}

View File

@@ -0,0 +1,7 @@
.page-stand-list {
width: calc(100% - 40px);
display: flex;
flex-direction: column;
align-items: center;
margin: 20px 20px 0 20px;
}