-
Notifications
You must be signed in to change notification settings - Fork 0
/
orders.html
357 lines (309 loc) · 15.8 KB
/
orders.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
<!DOCTYPE html>
<html lang="zh-TW">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>訂單列表-後台管理-六角西餐廳</title>
<link rel="stylesheet" href="./scss/all.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css">
</head>
<body class="vsc-initialized ">
<div class="d-flex">
<!--側欄選單-->
<aside class="sidebar vh-100 border-end pt-3 d-flex flex-column bg-white ">
<!-- 1. 後台名稱 -->
<div class="px-4">
<strong>六角西餐廳</strong>
- 後台管理
</div>
<!-- 2. 選單 -->
<div class="overflow-auto mt-3">
<!-- 首頁-不包含子選單 -->
<div>
<a class="sidebar-link " href="index.html" role="button">
<div class="px-4">
<i class="bi bi-house me-2"></i> 首頁
</div>
</a>
</div>
<!-- 訂單管理-包含子選項 "collapse"-->
<div>
<a class="sidebar-link" data-bs-toggle="collapse" href="#menu-order" role="button" >
<div class="d-flex justify-content-between px-4">
<p class="mb-0">
<i class="bi bi-card-checklist me-2"></i>訂單管理
</p>
<i class="bi bi-caret-down"></i>
</div>
</a>
<div class="collapse show" id="menu-order" >
<a href="orders.html" class="d-block ps-5 text-dark text-decoration-none sidebar-link active" role="button">
訂單列表
</a>
<a href="order.html" class="d-block ps-5 text-dark text-decoration-none sidebar-link" role="button">
單一訂單細節
</a>
</div>
</div>
<!-- 參考連結-不包含子選單 -->
<div>
<a class="sidebar-link" href="index.html" role="button">
<div class="px-4">
<i class="bi bi-list-stars me-2"></i> 參考連結
</div>
</a>
</div>
</div>
<!-- 3. 登出按鈕 -->
<a href="#" class="mt-auto sidebar-link ">
<div class="px-4">
<i class="bi bi-box-arrow-in-right me-2"></i>登出
</div>
</a>
</aside>
<!--主要區塊-->
<main class="main">
<!-- 側欄收合按鈕 -->
<div class="bg-white border-bottom sticky-top w-100">
<a href="#"
class="d-inline-block py-3 px-4 border-end" id="toggle-btn">
<i class="bi bi-arrows-angle-expand"></i>
</a>
</div>
<!-- 主要內容 -->
<div class="p-4">
<!--訂單管理-導覽列-->
<ul class="nav nav-pills mb-4">
<li class="nav-item">
<a class="nav-link rounded-pill active" aria-current="page" href="#">所有訂單
<span class="badge rounded-pill bg-light text-dark">900</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link rounded-pill" href="#">待處理
<span class="badge rounded-pill bg-light text-dark">600</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link rounded-pill" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link rounded-pill">Disabled</a>
</li>
</ul>
<!--表格-訂單列表-->
<div class="card shadow-sm">
<!--表頭-搜尋框-->
<div class="card-header bg-transparent">
<div class="input-group">
<!--下拉選單-操作-->
<div class="dropdown">
<button class="btn btn-outline-dark dropdown-toggle btn-sm" type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false">
操作
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenuButton1">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li><a class="dropdown-item" href="#">Something else here</a></li>
</ul>
</div>
<span class="input-group-text border-0 bg-transparent pe-0">
<i class="bi bi-search"></i>
</span>
<input type="search" class="form-control border-0 shadow-none">
</div>
</div>
<!--表格內容-->
<div class="card-body p-0">
<div class="table-responsive">
<table class="table table-hover mb-0">
<thead class="table-light">
<tr class="align-middle">
<th scope="col" class="ps-4"></th>
<th scope="col" class="py-3 ">訂單編號</th>
<th scope="col" >Email</th>
<th scope="col">用戶姓名</th>
<th scope="col">購買品項</th>
<th scope="col">付款狀態</th>
<th scope="col">購買金額</th>
<th scope="col" class="pe-4">編輯</th>
</tr>
</thead>
<tbody class="text-nowrap">
<tr>
<td class="ps-4">
<input type="checkbox" class="form-check-input">
</td>
<td scope="row">TX123456788</td>
<td>[email protected]</td>
<td>
卡小伯
</td>
<td>六角西餐:大麥克全家餐</td>
<td><div class="text-muted">尚未付款</div></td>
<td class="text-end">900</td>
<td class="text-end pe-4">
<div class="btn-group">
<a href="#"
class="btn btn-sm btn-outline-dark">
編輯 <i class="bi bi-pen"></i></a>
<!--下拉選單-操作:刪除/修改-->
<button class="btn btn-sm btn-outline-dark dropdown-toggle" type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false">
操作
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenuButton1">
<li><a class="dropdown-item" href="#">修改狀態</a></li>
<li>
<a class="dropdown-item text-danger" href="#"
data-bs-toggle="modal"
data-bs-target="#deleteModal"
data-bs-order-id="TX123456788">
刪除訂單
</a>
</li>
</ul>
</div>
</td>
</tr>
<tr>
<td class="ps-4">
<input type="checkbox" class="form-check-input">
</td>
<td scope="row">TX123456789</td>
<td>[email protected]</td>
<td>
卡小伯
</td>
<td>六角西餐:大麥克全家餐</td>
<td><div class="text-muted">尚未付款</div></td>
<td class="text-end">900</td>
<td class="text-end pe-4">
<div class="btn-group">
<a href="#"
class="btn btn-sm btn-outline-dark">
編輯 <i class="bi bi-pen"></i></a>
<!--下拉選單-操作:刪除/修改-->
<button class="btn btn-sm btn-outline-dark dropdown-toggle" type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false">
操作
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenuButton1">
<li><a class="dropdown-item" href="#">修改狀態</a></li>
<li><a class="dropdown-item text-danger" href="#"
data-bs-toggle="modal" data-bs-target="#deleteModal"
data-bs-order-id="TX123456789">刪除訂單</a></li>
</ul>
</div>
</td>
</tr>
<tr>
<td class="ps-4">
<input type="checkbox" class="form-check-input">
</td>
<td scope="row">TX123456790</td>
<td>[email protected]</td>
<td>
卡小伯
</td>
<td>六角西餐:大麥克全家餐</td>
<td><div class="text-muted">尚未付款</div></td>
<td class="text-end">900</td>
<td class="text-end pe-4">
<div class="btn-group">
<a href="#"
class="btn btn-sm btn-outline-dark">
編輯 <i class="bi bi-pen"></i></a>
<!--下拉選單-操作:刪除/修改-->
<button class="btn btn-sm btn-outline-dark dropdown-toggle" type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false">
操作
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenuButton1">
<li><a class="dropdown-item" href="#">修改狀態</a></li>
<li><a class="dropdown-item text-danger" href="#"
data-bs-toggle="modal" data-bs-target="#deleteModal"
data-bs-order-id="TX123456790">刪除訂單</a></li>
</ul>
</div>
</td>
</tr>
<tr>
<td class="ps-4">
<input type="checkbox" class="form-check-input">
</td>
<td scope="row">TX123456791</td>
<td>[email protected]</td>
<td>
卡小伯
</td>
<td>六角西餐:大麥克全家餐</td>
<td><div class="text-muted">尚未付款</div></td>
<td class="text-end">900</td>
<td class="text-end pe-4">
<div class="btn-group">
<a href="#"
class="btn btn-sm btn-outline-dark">
編輯 <i class="bi bi-pen"></i></a>
<!--下拉選單-操作:刪除/修改-->
<button class="btn btn-sm btn-outline-dark dropdown-toggle" type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false">
操作
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenuButton1">
<li><a class="dropdown-item" href="#">修改狀態</a></li>
<li><a class="dropdown-item text-danger" href="#"
data-bs-toggle="modal" data-bs-target="#deleteModal"
data-bs-order-id="TX123456791">刪除訂單</a></li>
</ul>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!--表尾-分頁器-->
<div class="card-footer bg-transparent py-3">
<nav aria-label="Page navigation example">
<ul class="pagination justify-content-end mb-0">
<li class="page-item"><a class="page-link" href="#">Previous</a></li>
<li class="page-item"><a class="page-link" href="#">1</a></li>
<li class="page-item"><a class="page-link" href="#">2</a></li>
<li class="page-item"><a class="page-link" href="#">3</a></li>
<li class="page-item"><a class="page-link" href="#">Next</a></li>
</ul>
</nav>
</div>
<!-- Modal -->
<div class="modal fade" id="deleteModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">刪除訂單</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<p>確認刪除「<span id="deleteText"></span>」的訂單嗎?</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-outline-dark" data-bs-dismiss="modal">Close</button>
<button type="button" class="btn btn-danger">確認刪除</button>
</div>
</div>
</div>
</div>
<script>
const modalByDelete = document.querySelector('#deleteModal');
modalByDelete.addEventListener('show.bs.modal', function(event) {
const button = event.relatedTarget;
const orderId = button.dataset.bsOrderId;
console.log(button, orderId);
const modalText = modalByDelete.querySelector('#deleteText');
modalText.textContent = orderId;
})
</script>
</div>
</div>
</main>
</div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-geWF76RCwLtnZ8qwWowPQNguL3RmwHVBC9FhGdlKrxdiJJigb/j/68SIy3Te4Bkz" crossorigin="anonymous"></script>
<script src="./javascripts/all.js"></script>
</body>
</html>