-
Notifications
You must be signed in to change notification settings - Fork 0
/
flower-order.html
107 lines (95 loc) · 4.62 KB
/
flower-order.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
<!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="flower-order.css">
</head>
<body>
<header>
<h1>花籃訂購</h1>
</header>
<main>
<section class="product-section">
<h2>選擇花籃</h2>
<div class="product-grid">
<!-- 每个花篮项 -->
<div class="product" onclick="openModal('花籃 A', 'image/花籃A.JPG', '精緻花籃A,適合各類場合,包含紅色玫瑰、百合等。', 2500)">
<img src="image/花籃A.JPG" alt="花籃 A">
<h3>花籃 A</h3>
<p>價格: NT$2500</p>
</div>
<div class="product" onclick="openModal('花籃 B', 'image/花籃B.JPG', '典雅花籃B,包含粉色玫瑰、康乃馨等。', 3000)">
<img src="image/花籃B.JPG" alt="花籃 B">
<h3>花籃 B</h3>
<p>價格: NT$3000</p>
</div>
<!-- 添加其他花篮项 -->
</div>
</section>
<!-- 模态窗口 -->
<div id="flowerModal" class="modal">
<div class="modal-content">
<span class="close" onclick="closeModal()">×</span>
<h2 id="modalTitle">花籃名稱</h2>
<img id="modalImage" src="" alt="花篮图片" style="width:100%;">
<p id="modalDescription">花籃详细描述...</p>
<div class="quantity-controls">
<button onclick="updateQuantity(-1)">-</button>
<span id="quantity">1</span>
<button onclick="updateQuantity(1)">+</button>
</div>
<button id="addToCartBtn" onclick="addToCart()">添加到購物車</button>
</div>
</div>
<section class="cart-section">
<h2>購物車</h2>
<ul id="cartItems"></ul>
<div class="invoice-options">
<label>
<input type="checkbox" id="invoice-checkbox" onchange="updateTotal()">
需要發票
</label>
</div>
<p id="totalPrice">總金額(未稅): NT$0</p>
<p>發票附加費 (5%):NT$<span id="invoice-charge">0</span></p>
<p>最終金額:NT$<span id="final-amount">0</span></p>
<form id="order-form" onsubmit="return confirmOrder()">
<label for="recipient-name">致贈給:</label>
<input type="text" id="recipient-name" name="recipient-name" required>
<label for="orderer-name">訂購人姓名:</label>
<input type="text" id="orderer-name" name="orderer-name" required>
<label for="orderer-phone">訂購人聯絡電話:</label>
<input type="tel" id="orderer-phone" name="orderer-phone" required>
<label for="orderer-names">落款名單(用逗號分隔):</label>
<input type="text" id="orderer-names" name="orderer-names" required>
<div id="invoice-details" class="hidden">
<label for="company-name">公司抬頭:</label>
<input type="text" id="company-name" name="company-name">
<label for="recipient-address">收件地址:</label>
<input type="text" id="recipient-address" name="recipient-address">
</div>
<button type="submit">確認訂單</button>
</form>
</section>
<section class="contact-section">
<p>如有問題,隨時與我們聯繫:</p>
<a href="tel:0938179858" class="contact-icon" title="撥打電話"><img src="phone-icon.png" alt="電話圖標"></a>
<a href="https://line.me/ti/p/line-id" class="contact-icon" title="添加LINE"><img src="line-icon.png" alt="LINE圖標"></a>
</section>
</main>
<footer>
<p>© 2024 祥安生命有限公司. 版權所有.</p>
</footer>
<audio id="background-music" preload="auto" loop>
<source src="background-music.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
<div id="music-control">
<button id="play-music" style="background: url('images/sound-on.png');">🔊</button>
<button id="stop-music" style="display: none; background: url('images/sound-off.png');">🔇</button>
</div>
<script src="flower-order.js"></script>
</body>
</html>