-
Notifications
You must be signed in to change notification settings - Fork 0
/
Items.html
247 lines (241 loc) · 12 KB
/
Items.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="keyword" content="配件选择">
<meta name="description" content="配件选择">
<meta name="author" content="MSTIFIY">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta charset="UTF-8">
<title>配件选择</title>
<link rel="stylesheet" type="text/css" href="style.css">
<script language="JavaScript" type="text/javascript">
let match = Array(8).fill(0)//用于记录配件的选择情况
//跳转到支付页面
function go_payment() {
let s = "";
for(let i in match){
s = s + match[i];
}
let price_all = document.getElementById("price_all").innerText.toString();
window.location.href = "payment.html?match=" + s + "&" + "price_all=" +price_all;//页面间Url传值
}
//显示总价格
function show_price_all() {
let result = 0;
let e;
for (let i = 0; i < 8; i++) {//遍历数组
if (match[i] === 1) {
e = document.getElementById("price_" + (i + 1));
result = result + Number.parseFloat(e.innerText.toString())
}
}
document.getElementById("price_all").innerText = result.toFixed(2).toString();
}
//“添加"按钮event
function change_bt_state(id) {
const e = document.getElementById(id);
let num = Number.parseInt(id.toString().replace("select_bt_",""))
if(e.innerText!=="已添加至组装"){
e.style.backgroundColor="deepskyblue";
e.style.color="#fff";
e.innerText="已添加至组装";
e.style.fontSize="20px";
e.style.fontWeight="bold";
match[num-1] = 1; //状态值置1,表示选中
}
else {
e.style.backgroundColor="white"
e.style.color="#000";
e.innerText="添加至组装";
e.style.fontSize="20px";
e.style.fontWeight="bold";
match[num-1] = 0;
}
show_price_all();
}
</script>
</head>
<body class="bg" background="res/images/bg_img.jpg">
<h1 style="font-weight: bold;text-align: center;font-family: 'Copperplate Gothic Bold',sans-serif;font-size: 50px">Breathing the World!</h1><br/><br/>
<h2 style="font-weight: bold;font-size: 40px">配件列表</h2>
<div id="choose_list">
<div id="item_1" style="margin-bottom: 50px">
<div class="item">
<div class="introduce_area">
<img id="管道" src="res/images/管道.jpg" class="border_element" width="317" height="260" title="管道图片" alt="管道图片" >
<div class="border_element introduce_text">
<label class="font1">介绍:</label>
<label id="管道描述" class="description">呼吸机管道,用于连接呼吸机机体和呼吸面罩,引导气流。</label>
</div>
</div>
<br/>
<div>
<div class="border_element select_text">
<label class="font1">价格:</label>
<label id="price_1" style="font-size: 30px"><b>12.79</b></label>
</div><br/>
<button id="select_bt_1" class="select_bt" style="font-size: 20px;font-weight: bold" onclick="change_bt_state(this.id)">添加至组装</button>
</div>
</div>
</div>
<div id="item_2" style="margin-top: 50px;margin-bottom: 50px">
<div class="item">
<div class="introduce_area">
<img id="氧气罐" src="res/images/氧气罐.jpg" class="border_element" width="317" height="260" title="氧气罐图片" alt="氧气罐图片" >
<div class="border_element introduce_text">
<label class="font1">介绍:</label>
<label id="氧气罐描述" class="description">该模块由氧气罐罐体和气压表组成。
这是罐体(用于储备压缩氧气),这是氧气出口,这是气压表(用于实时检测氧气气压大小)。
当然,对于不需要提供氧气含量的人群,可选择不组装这一模块。
之后,可添加控制模块,对氧气浓度进行调控,以满足不同个体需求。
以及添加报警模块,防止气压异常,引发安全事故。</label>
</div>
</div>
<br/>
<div>
<div class="border_element select_text">
<label class="font1">价格:</label>
<label id="price_2" style="font-size: 30px"><b>55.51</b></label>
</div><br/>
<button id="select_bt_2" class="select_bt" style="font-size: 20px;font-weight: bold" onclick="change_bt_state(this.id)">添加至组装</button>
</div>
</div>
</div>
<div id="item_3" style="margin-top: 50px;margin-bottom: 50px">
<div class="item">
<div class="introduce_area">
<img id="温湿度控制器" src="res/images/温湿度控制器.jpg" class="border_element" width="317" height="260" title="温湿度控制器图片" alt="温湿度控制器图片" >
<div class="border_element introduce_text">
<label class="font1">介绍:</label>
<label id="温湿度控制器描述" class="description">该模块分为湿化、加热和显示三个部分。
这是进气口,这是出气口,这是纯化水接口,用于添加和更换纯化水,
这是电阻丝(用于加热),气体会经过这个显示屏,它用于实时显示气体湿度和温度。
之后,可添加控制部分,实现使用者对气体湿度和温度的差异化动态调控。
</label>
</div>
</div>
<br/>
<div>
<div class="border_element select_text">
<label class="font1">价格:</label>
<label id="price_3" style="font-size: 30px"><b>46.98</b></label>
</div><br/>
<button id="select_bt_3" class="select_bt" style="font-size: 20px;font-weight: bold" onclick="change_bt_state(this.id)">添加至组装</button>
</div>
</div>
</div>
<div id="item_4" style="margin-top: 50px;margin-bottom: 50px">
<div class="item">
<div class="introduce_area">
<img id="便携结构" src="res/images/便携结构.jpg" class="border_element" width="317" height="260" title="便携结构图片" alt="便携结构图片" >
<div class="border_element introduce_text">
<label class="font1">介绍:</label>
<label id="便携结构描述" class="description">该模块有助于呼吸机的携带。
</label>
</div>
</div>
<br/>
<div>
<div class="border_element select_text">
<label class="font1">价格:</label>
<label id="price_4" style="font-size: 30px"><b>15.88</b></label>
</div><br/>
<button id="select_bt_4" class="select_bt" style="font-size: 20px;font-weight: bold" onclick="change_bt_state(this.id)">添加至组装</button>
</div>
</div>
</div>
<div id="item_5" style="margin-top: 50px;margin-bottom: 50px">
<div class="item">
<div class="introduce_area">
<img id="涡轮离心风机" src="res/images/涡轮离心风机.jpg" class="border_element" width="317" height="260" title="涡轮离心风机图片" alt="涡轮离心风机图片" >
<div class="border_element introduce_text">
<label class="font1">介绍:</label>
<label id="涡轮离心风机描述" class="description">该模块实现了空气的吸入和呼出。
</label>
</div>
</div>
<br/>
<div>
<div class="border_element select_text">
<label class="font1">价格:</label>
<label id="price_5" style="font-size: 30px"><b>76.65</b></label>
</div><br/>
<button id="select_bt_5" class="select_bt" style="font-size: 20px;font-weight: bold" onclick="change_bt_state(this.id)">添加至组装</button>
</div>
</div>
</div>
<div id="item_6" style="margin-top: 50px;margin-bottom: 50px">
<div class="item">
<div class="introduce_area">
<img id="出气口" src="res/images/出气口.jpg" class="border_element" width="317" height="260" title="出气口图片" alt="出气口图片" >
<div class="border_element introduce_text">
<label class="font1">介绍:</label>
<label id="出气口描述" class="description">呼吸机出气口,连接管道。
</label>
</div>
</div>
<br/>
<div>
<div class="border_element select_text">
<label class="font1">价格:</label>
<label id="price_6" style="font-size: 30px"><b>24.59</b></label>
</div><br/>
<button id="select_bt_6" class="select_bt" style="font-size: 20px;font-weight: bold" onclick="change_bt_state(this.id)">添加至组装</button>
</div>
</div>
</div>
<div id="item_7" style="margin-top: 50px;margin-bottom: 50px">
<div class="item">
<div class="introduce_area">
<img id="呼吸面罩" src="res/images/呼吸面罩.jpg" class="border_element" width="317" height="260" title="呼吸面罩图片" alt="呼吸面罩图片" >
<div class="border_element introduce_text">
<label class="font1">介绍:</label>
<label id="呼吸面罩描述" class="description">呼吸面罩,佩戴用于呼吸。
</label>
</div>
</div>
<br/>
<div>
<div class="border_element select_text">
<label class="font1">价格:</label>
<label id="price_7" style="font-size: 30px"><b>24.59</b></label>
</div><br/>
<button id="select_bt_7" class="select_bt" style="font-size: 20px;font-weight: bold" onclick="change_bt_state(this.id)">添加至组装</button>
</div>
</div>
</div>
<div id="item_8" style="margin-top: 50px;margin-bottom: 50px">
<div class="item">
<div class="introduce_area">
<img id="过滤层" src="res/images/过滤层.jpg" class="border_element" width="317" height="260" title="过滤层图片" alt="过滤层图片" >
<div class="border_element introduce_text">
<label class="font1">介绍:</label>
<label id="过滤层描述" class="description">过滤层,分为阻水层-过滤层-阻水层三层结构,
用于过滤空气中的杂质、有毒气体、病毒细菌等。
</label>
</div>
</div>
<br/>
<div>
<div class="border_element select_text">
<label class="font1">价格:</label>
<label id="price_8" style="font-size: 30px"><b>19.65</b></label>
</div><br/>
<button id="select_bt_8" class="select_bt" style="font-size: 20px;font-weight: bold" onclick="change_bt_state(this.id)">添加至组装</button>
</div>
</div>
</div>
</div>
<div style="margin-top: 50px;margin-bottom: 100px">
<div class="font1" style="display: flex;justify-content: space-between">
<div class="border_element" style="padding: 25px 10px 10px 10px;width: 400px;font-size: 40px;color: white;font-weight: bold;">
<label>总金额:</label>
<label id="price_all">0.00</label>
</div>
<button style="margin-right: 100px;border-radius: 15px / 50%;cursor: pointer;margin-right: 100px" onclick="go_payment()">
<input type="image" src="res/images/buy.png">
</button>
</div>
</div>
</body>
</html>