-
${escHtml(m.client_name || "—")}
-
- ${escHtml(m.address || "адрес не указан")}
-
-
- ${escHtml(whenText)} · ${statusLabel}
-
+ const today = _startOfDay(new Date());
+ // Конец этой недели: воскресенье вечером
+ const weekEnd = new Date(today);
+ const dayIdx = (today.getDay() + 6) % 7; // 0 = Пн, 6 = Вс
+ weekEnd.setDate(today.getDate() + (6 - dayIdx));
+ weekEnd.setHours(23, 59, 59, 999);
+
+ // Группируем
+ const groups = new Map();
+ for (const m of measurements) {
+ const g = _groupForMeasurement(m, today, weekEnd);
+ if (!groups.has(g.key)) groups.set(g.key, { ...g, items: [] });
+ groups.get(g.key).items.push(m);
+ }
+ // Сортируем группы и внутри — по дате
+ const sortedGroups = [...groups.values()].sort((a, b) => a.order - b.order);
+ for (const g of sortedGroups) {
+ g.items.sort((a, b) => (a.scheduled_at || "").localeCompare(b.scheduled_at || ""));
+ const groupEl = el(`
+
+
${g.title}${g.items.length}
+
-
${ICONS.chevron || "›"}
-
+ `);
+ const list = groupEl.querySelector(".inbox-group-list");
+ g.items.forEach(m => list.appendChild(renderInboxItem(m, g.key)));
+ container.appendChild(groupEl);
+ }
+}
+
+/* ----------------- Week strip — загрузка по дням ----------------- */
+
+function renderWeekStrip(measurements) {
+ const today = _startOfDay(new Date());
+ const dayIdx = (today.getDay() + 6) % 7; // Пн = 0
+ const monday = new Date(today);
+ monday.setDate(today.getDate() - dayIdx);
+ const days = [];
+ for (let i = 0; i < 7; i++) {
+ const d = new Date(monday);
+ d.setDate(monday.getDate() + i);
+ days.push(d);
+ }
+ // Считаем сколько замеров на каждый день
+ const countByDay = days.map(d => {
+ const start = _startOfDay(d).getTime();
+ const end = start + 86400000;
+ return measurements.filter(m => {
+ if (!m.scheduled_at) return false;
+ const t = new Date(m.scheduled_at).getTime();
+ return t >= start && t < end;
+ }).length;
+ });
+ const maxCount = Math.max(1, ...countByDay);
+
+ const dayNames = ["Пн", "Вт", "Ср", "Чт", "Пт", "Сб", "Вс"];
+ const section = el(`
+
+
+ ${monday.getDate()}–${days[6].getDate()} ${monday.toLocaleString("ru-RU", { month: "long" })}
+
+
+ ${days.map((d, i) => {
+ const cnt = countByDay[i];
+ const heightPct = cnt ? Math.round((cnt / maxCount) * 100) : 0;
+ const isToday = _startOfDay(d).getTime() === today.getTime();
+ const isPast = _startOfDay(d).getTime() < today.getTime();
+ const loadClass = cnt >= 5 ? "load-hot" : cnt >= 3 ? "load-mid" : cnt > 0 ? "load-low" : "load-zero";
+ return `
+
+
${dayNames[i]}
+
${d.getDate()}
+
+
${cnt || "—"}
+
+ `;
+ }).join("")}
+
+
`);
- item.addEventListener("click", () => {
+ return section;
+}
+
+/* ----------------- Карточка заявки в инбоксе ----------------- */
+
+function renderInboxItem(m, groupKey) {
+ // Когда: точное время если назначено + день недели для не-today
+ let timeLine;
+ if (m.scheduled_at) {
+ const d = new Date(m.scheduled_at);
+ const hh = String(d.getHours()).padStart(2, "0");
+ const mi = String(d.getMinutes()).padStart(2, "0");
+ if (groupKey === "today" || groupKey === "tomorrow") {
+ timeLine = `${hh}:${mi}`;
+ } else if (groupKey === "overdue") {
+ timeLine = `${String(d.getDate()).padStart(2,"0")}.${String(d.getMonth()+1).padStart(2,"0")} ${hh}:${mi}`;
+ } else {
+ const dayNames = ["Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"];
+ timeLine = `${dayNames[d.getDay()]} ${String(d.getDate()).padStart(2,"0")}.${String(d.getMonth()+1).padStart(2,"0")} ${hh}:${mi}`;
+ }
+ } else {
+ timeLine = formatPreferredHuman(m);
+ }
+
+ const phoneClean = (m.client_phone || "").replace(/[^\d+]/g, "");
+ const callHref = phoneClean ? `tel:${phoneClean}` : "";
+
+ const item = el(`
+
+
+ ${callHref
+ ? `
📞`
+ : ""}
+
+ `);
+ item.querySelector(".inbox-row-main").addEventListener("click", () => {
haptic && haptic("impact");
location.hash = `#/inbox/${m.id}`;
});
diff --git a/miniapp/assets/podbor.css b/miniapp/assets/podbor.css
index 0e6722d..1ea9a8f 100644
--- a/miniapp/assets/podbor.css
+++ b/miniapp/assets/podbor.css
@@ -2538,6 +2538,173 @@
.checklist-md .cl-table th, .checklist-md .cl-table td { border: 1px solid rgba(107, 74, 43, 0.18); padding: 4px 8px; text-align: left; }
.checklist-md .cl-table th { background: rgba(107, 74, 43, 0.08); font-weight: 600; }
+/* ===== Кабинет замерщика: week strip + grouped inbox ===== */
+
+/* Week strip — загрузка по дням */
+.cal-strip-block {
+ background: var(--card, #fff);
+ border: 1px solid rgba(107, 74, 43, 0.12);
+ border-radius: 14px;
+ padding: 12px 10px 10px;
+ margin-bottom: 14px;
+}
+.cal-strip-head {
+ font-family: var(--font-display, "Newsreader", serif);
+ font-style: italic;
+ font-size: 16px;
+ color: var(--ink, #1F1A14);
+ text-align: center;
+ margin-bottom: 10px;
+ text-transform: capitalize;
+}
+.cal-strip {
+ display: grid;
+ grid-template-columns: repeat(7, 1fr);
+ gap: 4px;
+}
+.cal-day {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ padding: 6px 2px 8px;
+ border-radius: 8px;
+ background: var(--paper, #FBF7F0);
+ border: 1px solid transparent;
+ position: relative;
+}
+.cal-day.today {
+ border-color: var(--walnut, #6B4A2B);
+ background: var(--warm, rgba(107, 74, 43, 0.08));
+}
+.cal-day.past { opacity: 0.5; }
+.cal-day-name {
+ font-size: 9px;
+ font-family: var(--font-mono, "JetBrains Mono", monospace);
+ letter-spacing: 0.08em;
+ text-transform: uppercase;
+ color: var(--muted, #998877);
+ margin-bottom: 2px;
+}
+.cal-day-num {
+ font-size: 15px;
+ font-weight: 600;
+ color: var(--ink, #1F1A14);
+ line-height: 1;
+}
+.cal-day.today .cal-day-num { color: var(--walnut, #6B4A2B); }
+.cal-day-bar {
+ width: 18px;
+ height: 28px;
+ margin: 6px 0 4px;
+ background: rgba(107, 74, 43, 0.08);
+ border-radius: 3px;
+ display: flex;
+ align-items: flex-end;
+ overflow: hidden;
+}
+.cal-day-bar .bar {
+ width: 100%;
+ border-radius: 3px;
+ transition: height 0.25s ease;
+}
+.cal-day-bar .bar.load-zero { background: transparent; }
+.cal-day-bar .bar.load-low { background: rgba(107, 74, 43, 0.5); }
+.cal-day-bar .bar.load-mid { background: var(--walnut, #6B4A2B); }
+.cal-day-bar .bar.load-hot { background: #C0392B; }
+.cal-day-count {
+ font-size: 10px;
+ font-family: var(--font-mono, "JetBrains Mono", monospace);
+ color: var(--muted, #998877);
+ letter-spacing: 0.04em;
+}
+
+/* Grouped inbox */
+.inbox-group { margin-bottom: 14px; }
+.inbox-group-head {
+ display: flex;
+ align-items: baseline;
+ gap: 6px;
+ margin: 12px 0 8px;
+ font-size: 13px;
+ font-weight: 600;
+ color: var(--ink, #1F1A14);
+ letter-spacing: 0.01em;
+}
+.inbox-group-head .count {
+ font-size: 11px;
+ color: var(--muted, #998877);
+ font-family: var(--font-mono, "JetBrains Mono", monospace);
+ font-weight: 400;
+}
+.inbox-group-list {
+ display: flex;
+ flex-direction: column;
+ gap: 6px;
+}
+.inbox-row {
+ display: flex;
+ gap: 8px;
+ background: var(--card, #fff);
+ border: 1px solid rgba(107, 74, 43, 0.14);
+ border-radius: 10px;
+ overflow: hidden;
+}
+.inbox-row-main {
+ flex: 1;
+ display: flex;
+ align-items: center;
+ gap: 12px;
+ padding: 10px 12px;
+ background: transparent;
+ border: none;
+ cursor: pointer;
+ text-align: left;
+ font-family: inherit;
+ min-width: 0;
+}
+.inbox-row-main:active { background: rgba(107, 74, 43, 0.06); }
+.inbox-time {
+ font-family: var(--font-mono, "JetBrains Mono", monospace);
+ font-size: 13px;
+ font-weight: 600;
+ color: var(--walnut, #6B4A2B);
+ min-width: 50px;
+ text-align: center;
+}
+.inbox-row-body { flex: 1; min-width: 0; }
+.inbox-client {
+ font-size: 14px;
+ font-weight: 500;
+ color: var(--ink, #1F1A14);
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+.inbox-addr {
+ font-size: 12px;
+ color: var(--muted, #998877);
+ margin-top: 2px;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+.inbox-arrow {
+ color: var(--muted, #998877);
+ font-size: 18px;
+}
+.inbox-call {
+ display: grid;
+ place-items: center;
+ width: 44px;
+ background: rgba(39, 174, 96, 0.08);
+ color: #27AE60;
+ text-decoration: none;
+ font-size: 18px;
+ flex-shrink: 0;
+ border-left: 1px solid rgba(107, 74, 43, 0.12);
+}
+.inbox-call:active { background: rgba(39, 174, 96, 0.18); }
+
/* ===== Кабинет сотрудника (замерщик/сборщик) ===== */
.staff-head {
display: flex;
diff --git a/miniapp/index.html b/miniapp/index.html
index 43e87b7..f1b197e 100644
--- a/miniapp/index.html
+++ b/miniapp/index.html
@@ -12,8 +12,8 @@
-
-
+
+
@@ -31,14 +31,14 @@
Сделано с душой!