add logic

This commit is contained in:
2026-10-07 17:32:25 +03:00
parent cdcdd22526
commit f86777e2cd
69 changed files with 1519 additions and 637 deletions
+49 -32
View File
@@ -1,18 +1,26 @@
@if (landmark(); as item) {
@if (claiming()) {
<app-claim-flow [landmark]="item" />
<app-claim-flow
[landmark]="item"
[cityName]="area()?.name ?? ''"
[opened]="openedCount()"
[total]="totalCount()"
[areaId]="areaId()"
/>
} @else {
<article class="object" [class.object--owned]="collected()">
<header class="object__hero">
<img class="object__hero-img" [src]="item.background" alt="" />
@if (item.backgroundUrl || item.photoUrl) {
<img class="object__hero-img" [src]="item.backgroundUrl || item.photoUrl" alt="" />
}
<button class="object__back" type="button" aria-label="Назад" (click)="goBack()">
<app-icon name="chevron-left" [size]="22" />
</button>
<span class="object__city">{{ city.name }}</span>
<span class="object__city">{{ area()?.name }}</span>
</header>
<div class="object__intro">
<h1>{{ item.title }}</h1>
<h1>{{ item.name }}</h1>
<div class="object__chips">
<span class="chip" [class.chip--open]="collected()">
@@ -21,39 +29,44 @@
</span>
</div>
<div class="object__address">
<app-icon name="pin" [size]="18" />
<div>
<p>{{ item.address }}</p>
<span>{{ item.addressHint }}</span>
@if (item.address) {
<div class="object__address">
<app-icon name="pin" [size]="18" />
<div>
<p>{{ item.address }}</p>
</div>
</div>
</div>
}
</div>
<div class="object__body">
<section>
<h2>О месте</h2>
<p>{{ item.description }}</p>
</section>
@if (item.about) {
<section>
<h2>О месте</h2>
<p>{{ item.about }}</p>
</section>
}
<section>
<h2>Аудиогид</h2>
<app-audio-guide [src]="item.audio" />
</section>
@if (item.facts.length > 0) {
<section>
<h2>Интересные факты</h2>
<ol class="facts">
@for (fact of item.facts; track fact; let index = $index) {
<li>
<span class="facts__number">{{ index + 1 }}</span>
<span class="facts__value">{{ fact }}</span>
</li>
}
</ol>
</section>
}
<section>
<h2>Интересные факты</h2>
<ol class="facts">
@for (fact of item.facts; track fact; let index = $index) {
<li>
<span class="facts__number">{{ index + 1 }}</span>
<span class="facts__value">
{{ fact }}
</span>
</li>
}
</ol>
</section>
@if (item.audioUrl) {
<section>
<h2>Аудиогид</h2>
<app-audio-guide [src]="item.audioUrl" />
</section>
}
@if (collected()) {
<section>
@@ -111,9 +124,13 @@
</div>
}
}
} @else if (status() === 'loading') {
<section class="object object--empty">
<p>Загружаем…</p>
</section>
} @else {
<section class="object object--empty">
<p>Объект не найден.</p>
<p>{{ error() || 'Объект не найден.' }}</p>
<button matButton="outlined" type="button" (click)="goBack()">Назад</button>
</section>
}