Переработаны роутеры приложения
Переписано APi WebSocket для работы с новыми роутерами
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<div class="page-stand">
|
||||
<div class="page-stand-card">
|
||||
<!-- <label for="dateSelect">Виберіть дату:</label>
|
||||
<select id="dateSelect"></select> -->
|
||||
|
||||
@@ -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', '');
|
||||
|
||||
@@ -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);
|
||||
3
web/lib/pages/stand/list/index.html
Normal file
3
web/lib/pages/stand/list/index.html
Normal file
@@ -0,0 +1,3 @@
|
||||
<div class="page-stand-list">
|
||||
|
||||
</div>
|
||||
6
web/lib/pages/stand/list/script.js
Normal file
6
web/lib/pages/stand/list/script.js
Normal 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;
|
||||
},
|
||||
}
|
||||
7
web/lib/pages/stand/list/style.css
Normal file
7
web/lib/pages/stand/list/style.css
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user