Pārlūkot izejas kodu

[add]

檀家詳細画面の作成
IDごとに檀家情報を取得
poohr 1 mēnesi atpakaļ
vecāks
revīzija
a4db853692

+ 125
- 0
src/app/pages/danka-detail/danka-detail.html Parādīt failu

@@ -0,0 +1,125 @@
1
+<app-header></app-header>
2
+
3
+<div class="breadcrumb">
4
+  ホーム &gt; 檀家(世帯) &gt; 鈴木家
5
+</div>
6
+
7
+<div class="danka-detail-page">
8
+  <app-side-menu></app-side-menu>
9
+
10
+  <main class="danka-detail-main">
11
+    <section class="detail-panel">
12
+      <div class="page-title-row">
13
+        <div>
14
+          <h1>檀家(世帯)詳細 - 基本情報</h1>
15
+
16
+          <nav class="tab-list">
17
+            <a href="#" class="tab-button active">基本情報</a>
18
+            <a href="#" class="tab-button">家族</a>
19
+            <a href="#" class="tab-button">過去帳</a>
20
+            <a href="#" class="tab-button">家系図</a>
21
+          </nav>
22
+        </div>
23
+
24
+        <button type="button" class="edit-button">
25
+          編集
26
+        </button>
27
+      </div>
28
+
29
+      <section class="family-summary">
30
+        <div class="family-name-area">
31
+          <p class="family-name">{{ danka?.householder }}</p>
32
+          <p class="family-head">世帯主: {{ danka?.householdName }}</p>
33
+        </div>
34
+
35
+        <div class="family-address">
36
+          <p>郵便番号 〒{{ danka?.postalCode }}</p>
37
+          <p>住所 {{ danka?.address }}</p>
38
+        </div>
39
+
40
+        <button type="button" class="memo-button">
41
+          回忌を見る
42
+        </button>
43
+      </section>
44
+
45
+      <div class="detail-content">
46
+        <section class="basic-info-section">
47
+          <div class="section-heading">
48
+            <h2>基本情報</h2>
49
+          </div>
50
+
51
+          <div class="info-form">
52
+            <div class="info-row">
53
+              <div class="info-label">世帯主</div>
54
+              <div class="info-value">{{ danka?.householdName }}</div>
55
+            </div>
56
+
57
+            <div class="info-row">
58
+              <div class="info-label">郵便番号</div>
59
+              <div class="info-value">{{ danka?.postalCode }}</div>
60
+            </div>
61
+
62
+            <div class="info-row">
63
+              <div class="info-label">住所</div>
64
+              <div class="info-value">{{ danka?.address }}</div>
65
+            </div>
66
+
67
+            <div class="info-row phone-row">
68
+              <div class="info-label">電話番号</div>
69
+
70
+              <div class="phone-table">
71
+                <div class="phone-header">
72
+                  <div>番号</div>
73
+                  <div>備考</div>
74
+                </div>
75
+
76
+                @if (danka) {
77
+                  @for (phone of danka.phones; track $index) {
78
+                    <div class="phone-item">
79
+                      <div>{{ phone.tel }}</div>
80
+                      <div>{{ phone.note }}</div>
81
+                    </div>
82
+                  }
83
+                }
84
+
85
+              </div>
86
+            </div>
87
+          </div>
88
+        </section>
89
+
90
+        <aside class="status-panel">
91
+          <h2>この世帯の状況</h2>
92
+
93
+          <div class="status-card-list">
94
+            <a href="#" class="status-card">
95
+              <p class="status-label">家族</p>
96
+              <p class="status-count">4 名</p>
97
+              <p class="status-link">詳細へ</p>
98
+            </a>
99
+
100
+            <a href="#" class="status-card">
101
+              <p class="status-label">過去帳</p>
102
+              <p class="status-count">2 名</p>
103
+              <p class="status-link">詳細へ</p>
104
+            </a>
105
+          </div>
106
+
107
+          <section class="next-memorial">
108
+            <h3>次の法要</h3>
109
+
110
+            <div class="memorial-card">
111
+              <p class="memorial-title">佐藤 ハナ - 三回忌</p>
112
+              <p class="memorial-text">対象年 2026 / 没年月日 2024-01-08</p>
113
+            </div>
114
+          </section>
115
+
116
+          <div class="status-button-list">
117
+            <a href="#" class="status-button">家族を見る</a>
118
+            <a href="#" class="status-button">過去帳を見る</a>
119
+          </div>
120
+        </aside>
121
+      </div>
122
+    </section>
123
+  </main>
124
+</div>
125
+

+ 390
- 0
src/app/pages/danka-detail/danka-detail.scss Parādīt failu

@@ -0,0 +1,390 @@
1
+:host {
2
+  position: relative;
3
+  display: block;
4
+  min-height: 100vh;
5
+  background: #f4eee4;
6
+  color: #2f2720;
7
+}
8
+
9
+.breadcrumb {
10
+  position: absolute;
11
+  top: 28px;
12
+  left: 50%;
13
+  transform: translateX(-50%);
14
+  color: #7b6b5c;
15
+  font-size: 14px;
16
+  z-index: 2;
17
+}
18
+
19
+.danka-detail-page {
20
+  display: flex;
21
+  align-items: flex-start;
22
+  gap: 8px;
23
+  background: #f4eee4;
24
+}
25
+
26
+.danka-detail-main {
27
+  flex: 1;
28
+  padding-right: 34px;
29
+  box-sizing: border-box;
30
+}
31
+
32
+.detail-panel {
33
+  min-height: 650px;
34
+  padding: 26px 34px 36px;
35
+  background: #ffffff;
36
+  border: 2px solid #d8caba;
37
+  border-radius: 76px;
38
+  box-sizing: border-box;
39
+}
40
+
41
+.page-title-row {
42
+  display: flex;
43
+  justify-content: space-between;
44
+  align-items: flex-start;
45
+  margin-bottom: 20px;
46
+}
47
+
48
+.page-title-row h1 {
49
+  margin: 0 0 8px;
50
+  color: #2f2720;
51
+  font-size: 32px;
52
+  line-height: 1.2;
53
+  font-weight: 800;
54
+  letter-spacing: 0.02em;
55
+}
56
+
57
+.tab-list {
58
+  display: flex;
59
+  align-items: center;
60
+  gap: 8px;
61
+}
62
+
63
+.tab-button {
64
+  width: 150px;
65
+  height: 42px;
66
+  border: 2px solid #d8caba;
67
+  border-radius: 6px;
68
+  background: #f1e7d8;
69
+  color: #2f2720;
70
+  font-size: 16px;
71
+  font-weight: 700;
72
+  text-decoration: none;
73
+  display: flex;
74
+  align-items: center;
75
+  justify-content: center;
76
+  box-sizing: border-box;
77
+}
78
+
79
+.tab-button.active {
80
+  background: #8a6543;
81
+  border-color: #8a6543;
82
+  color: #ffffff;
83
+}
84
+
85
+.tab-button:hover {
86
+  background: #eadfce;
87
+}
88
+
89
+.tab-button.active:hover {
90
+  background: #765639;
91
+}
92
+
93
+.edit-button {
94
+  width: 140px;
95
+  height: 46px;
96
+  margin-top: 36px;
97
+  border: 2px solid #8a6543;
98
+  border-radius: 6px;
99
+  background: #8a6543;
100
+  color: #ffffff;
101
+  font-size: 18px;
102
+  font-weight: 800;
103
+  cursor: pointer;
104
+  box-sizing: border-box;
105
+}
106
+
107
+.edit-button:hover {
108
+  background: #765639;
109
+}
110
+
111
+.family-summary {
112
+  min-height: 82px;
113
+  margin-bottom: 28px;
114
+  padding: 14px 26px;
115
+  border: 2px solid #d8caba;
116
+  border-radius: 14px;
117
+  background: #eadfce;
118
+  display: grid;
119
+  grid-template-columns: 1.2fr 1.6fr auto;
120
+  align-items: center;
121
+  column-gap: 24px;
122
+  box-sizing: border-box;
123
+}
124
+
125
+.family-name {
126
+  margin: 0;
127
+  color: #2f2720;
128
+  font-size: 28px;
129
+  font-weight: 800;
130
+  line-height: 1.1;
131
+}
132
+
133
+.family-head {
134
+  margin: 2px 0 0;
135
+  color: #6f6257;
136
+  font-size: 16px;
137
+}
138
+
139
+.family-address p {
140
+  margin: 2px 0;
141
+  color: #2f2720;
142
+  font-size: 16px;
143
+}
144
+
145
+.memo-button {
146
+  width: 150px;
147
+  height: 40px;
148
+  border: 2px solid #d8caba;
149
+  border-radius: 6px;
150
+  background: #ffffff;
151
+  color: #2f2720;
152
+  font-size: 16px;
153
+  font-weight: 800;
154
+  cursor: pointer;
155
+  box-sizing: border-box;
156
+}
157
+
158
+.memo-button:hover {
159
+  background: #f6efe6;
160
+}
161
+
162
+.detail-content {
163
+  display: grid;
164
+  grid-template-columns: minmax(0, 1fr) 500px;
165
+  gap: 48px;
166
+  align-items: start;
167
+}
168
+
169
+.basic-info-section {
170
+  padding-left: 8px;
171
+}
172
+
173
+.section-heading {
174
+  margin-bottom: 8px;
175
+}
176
+
177
+.section-heading h2 {
178
+  margin: 0;
179
+  color: #2f2720;
180
+  font-size: 22px;
181
+  font-weight: 800;
182
+}
183
+
184
+.section-heading p {
185
+  margin: 3px 0 0;
186
+  color: #7b6b5c;
187
+  font-size: 14px;
188
+}
189
+
190
+.info-form {
191
+  width: 650px;
192
+}
193
+
194
+.info-row {
195
+  display: grid;
196
+  grid-template-columns: 120px 1fr;
197
+  align-items: center;
198
+  margin-top: 10px;
199
+}
200
+
201
+.info-label {
202
+  color: #4b3c31;
203
+  font-size: 17px;
204
+  font-weight: 800;
205
+}
206
+
207
+.info-value {
208
+  min-height: 40px;
209
+  padding: 8px 12px;
210
+  border: 2px solid #d8caba;
211
+  border-radius: 6px;
212
+  background: #fffdf9;
213
+  color: #2f2720;
214
+  font-size: 17px;
215
+  box-sizing: border-box;
216
+  display: flex;
217
+  align-items: center;
218
+}
219
+
220
+.phone-row {
221
+  align-items: start;
222
+  margin-top: 18px;
223
+}
224
+
225
+.phone-row .info-label {
226
+  padding-top: 8px;
227
+}
228
+
229
+.phone-table {
230
+  width: 100%;
231
+}
232
+
233
+.phone-header,
234
+.phone-item {
235
+  display: grid;
236
+  grid-template-columns: 1fr 1.4fr 1.2fr;
237
+  align-items: center;
238
+}
239
+
240
+.phone-header {
241
+  min-height: 36px;
242
+  padding: 0 10px;
243
+  border: 2px solid #d8caba;
244
+  border-radius: 6px;
245
+  background: #eadfce;
246
+  color: #5a4a3c;
247
+  font-size: 15px;
248
+  font-weight: 800;
249
+  box-sizing: border-box;
250
+}
251
+
252
+.phone-item {
253
+  min-height: 52px;
254
+  margin-top: 4px;
255
+  padding: 0 10px;
256
+  border: 2px solid #d8caba;
257
+  border-radius: 8px;
258
+  background: #fffdf9;
259
+  color: #2f2720;
260
+  font-size: 16px;
261
+  box-sizing: border-box;
262
+}
263
+
264
+.status-panel {
265
+  min-height: 382px;
266
+  padding: 30px 24px 22px;
267
+  border: 2px solid #d8caba;
268
+  border-radius: 62px;
269
+  background: #fffdf9;
270
+  box-sizing: border-box;
271
+}
272
+
273
+.status-panel h2 {
274
+  margin: 0 0 18px;
275
+  color: #2f2720;
276
+  font-size: 22px;
277
+  font-weight: 800;
278
+}
279
+
280
+.status-card-list {
281
+  display: grid;
282
+  grid-template-columns: 1fr 1fr;
283
+  gap: 14px;
284
+  margin-bottom: 20px;
285
+}
286
+
287
+.status-card {
288
+  min-height: 104px;
289
+  padding: 14px 18px;
290
+  border: 2px solid #d8caba;
291
+  border-radius: 14px;
292
+  background: #ffffff;
293
+  color: #2f2720;
294
+  text-decoration: none;
295
+  box-sizing: border-box;
296
+}
297
+
298
+.status-card:hover {
299
+  background: #f6efe6;
300
+}
301
+
302
+.status-label {
303
+  margin: 0;
304
+  color: #7b6b5c;
305
+  font-size: 16px;
306
+}
307
+
308
+.status-count {
309
+  margin: 2px 0 0;
310
+  color: #2f2720;
311
+  font-size: 32px;
312
+  font-weight: 800;
313
+  line-height: 1.1;
314
+}
315
+
316
+.status-link {
317
+  margin: 4px 0 0;
318
+  color: #7b6b5c;
319
+  font-size: 14px;
320
+}
321
+
322
+.next-memorial {
323
+  margin-bottom: 20px;
324
+}
325
+
326
+.next-memorial h3 {
327
+  margin: 0 0 8px;
328
+  color: #4b3c31;
329
+  font-size: 17px;
330
+  font-weight: 800;
331
+}
332
+
333
+.memorial-card {
334
+  min-height: 72px;
335
+  padding: 14px 20px;
336
+  border: 2px solid #d8caba;
337
+  border-radius: 10px;
338
+  background: #ffffff;
339
+  box-sizing: border-box;
340
+}
341
+
342
+.memorial-title {
343
+  margin: 0;
344
+  color: #2f2720;
345
+  font-size: 16px;
346
+  font-weight: 800;
347
+}
348
+
349
+.memorial-text {
350
+  margin: 4px 0 0;
351
+  color: #7b6b5c;
352
+  font-size: 14px;
353
+}
354
+
355
+.status-button-list {
356
+  display: grid;
357
+  grid-template-columns: 1fr 1fr;
358
+  gap: 14px;
359
+}
360
+
361
+.status-button {
362
+  height: 48px;
363
+  border: 2px solid #d8caba;
364
+  border-radius: 8px;
365
+  background: #ffffff;
366
+  color: #2f2720;
367
+  font-size: 16px;
368
+  font-weight: 800;
369
+  text-decoration: none;
370
+  display: flex;
371
+  align-items: center;
372
+  justify-content: center;
373
+  box-sizing: border-box;
374
+}
375
+
376
+.status-button:hover {
377
+  background: #f6efe6;
378
+}
379
+
380
+.bottom-note {
381
+  width: 700px;
382
+  margin: 18px 0 22px 36px;
383
+  padding: 4px 12px;
384
+  border: 2px solid #d8caba;
385
+  border-radius: 4px;
386
+  background: #eadfce;
387
+  color: #7b6b5c;
388
+  font-size: 14px;
389
+  box-sizing: border-box;
390
+}

+ 22
- 0
src/app/pages/danka-detail/danka-detail.spec.ts Parādīt failu

@@ -0,0 +1,22 @@
1
+import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+import { DanakDetail } from './danka-detail';
4
+
5
+describe('DanakDetail', () => {
6
+  let component: DanakDetail;
7
+  let fixture: ComponentFixture<DanakDetail>;
8
+
9
+  beforeEach(async () => {
10
+    await TestBed.configureTestingModule({
11
+      imports: [DanakDetail],
12
+    }).compileComponents();
13
+
14
+    fixture = TestBed.createComponent(DanakDetail);
15
+    component = fixture.componentInstance;
16
+    await fixture.whenStable();
17
+  });
18
+
19
+  it('should create', () => {
20
+    expect(component).toBeTruthy();
21
+  });
22
+});

+ 27
- 0
src/app/pages/danka-detail/danka-detail.ts Parādīt failu

@@ -0,0 +1,27 @@
1
+import { Component } from '@angular/core';
2
+import { ActivatedRoute } from '@angular/router';
3
+import { DankaService } from '../../services/dankaService';
4
+import { Danka } from '../../models/danka';
5
+import { AppHeader } from '../../share/header/app-header';
6
+import { AppSideMenu } from '../../share/side-menu/app-side-menu';
7
+
8
+@Component({
9
+  selector: 'app-danka-detail',
10
+  imports: [AppHeader, AppSideMenu],
11
+  templateUrl: './danka-detail.html',
12
+  styleUrl: './danka-detail.scss',
13
+})
14
+export class DankaDetail {
15
+  danka: Danka | undefined;
16
+
17
+  constructor(
18
+    private dankaService: DankaService,
19
+    private route: ActivatedRoute,
20
+  ) {
21
+    const id = this.route.snapshot.params['id'];
22
+    if (id) {
23
+      this.danka = this.dankaService.getDankaById(id);
24
+    }
25
+    console.log(this.danka);
26
+  }
27
+}

Notiek ielāde…
Atcelt
Saglabāt