forked from jieeeee-code/editable-notepad
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
603 lines (567 loc) · 21 KB
/
Copy pathindex.html
File metadata and controls
603 lines (567 loc) · 21 KB
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
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="format-detection" content="telephone=no">
<title>扫码验证</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
/* 系统无衬线字体,匹配微信原生页面字体 */
font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
}
body {
background-color: #f6f6f6;
color: #222222;
max-width: 750px;
margin: 0 auto;
min-height: 100vh;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
-webkit-tap-highlight-color: transparent;
}
/* 顶部导航栏 */
.top-nav {
display: flex;
align-items: center;
justify-content: center;
position: relative;
padding: 18px 14px;
background: #ffffff;
}
.back-icon {
position: absolute;
left: 14px;
font-size: 24px;
color: #222;
text-decoration: none;
}
.page-title {
font-size: 22px;
font-weight: 500;
color: #111;
}
/* 校徽标题区域 */
.logo-header {
background: #fff;
padding: 22px 16px;
display: flex;
align-items: center;
justify-content: center;
gap: 14px;
}
/* 精准复刻福大圆形校徽(支持替换真实图片) */
.fzu-logo {
width: 68px;
height: 68px;
border-radius: 50%;
border: 2px solid #c8102e;
position: relative;
background: #fff;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
}
.fzu-logo .logo-fallback {
font-size: 30px;
font-weight: bold;
color: #c8102e;
}
.fzu-logo img {
width: 100%;
height: 100%;
object-fit: cover;
border-radius: 50%;
position: absolute;
top: 0;
left: 0;
}
.logo-main-text {
font-size: 28px;
font-weight: 500;
color: #1a1a1a;
}
/* 图书馆顶部横幅(支持替换真实图片) */
.banner-library {
width: 100%;
height: 168px;
background-color: #c9c9c9;
background-size: cover;
background-position: center;
background-repeat: no-repeat;
position: relative;
overflow: hidden;
}
.banner-library img {
width: 100%;
height: 100%;
object-fit: cover;
position: absolute;
top: 0;
left: 0;
}
/* 主查询卡片容器 */
.result-wrap {
margin: 22px 14px;
background: #fff;
border-radius: 2px;
overflow: hidden;
}
/* 卡片顶部蓝色标题栏 精准匹配原图深蓝色 #32479E */
.card-head {
background-color: #32479E;
color: #ffffff;
padding: 14px 18px;
font-size: 18px;
font-weight: 500;
}
/* 表格行 两栏布局 严格左右分割线 */
.table-row {
display: grid;
grid-template-columns: 130px 1fr;
border-bottom: 1px solid #eeeeee;
}
/* 最后一行无下边框 */
.table-row:last-child {
border-bottom: none;
}
/* 左侧标签栏 浅灰底色 */
.table-left {
padding: 16px 18px;
background-color: #f8f8f8;
font-size: 16px;
color: #333333;
border-right: 1px solid #eee;
}
/* 右侧内容栏 */
.table-right {
padding: 16px 18px;
font-size: 16px;
color: #111111;
word-break: break-all;
}
/* 数据核实 证明预览区域 */
.proof-preview-box {
width: 100%;
display: flex;
justify-content: center;
padding: 10px 0;
background: #fafafa;
}
.proof-paper {
width: 88%;
height: 340px;
position: relative;
overflow: hidden;
background: #fff;
border: 1px solid #ddd;
}
/* 原图完整斜向水印文字:仅供内容预览核验 */
.paper-watermark {
position: absolute;
width: 200%;
height: 200%;
top: -50%;
left: -50%;
background-image: repeating-linear-gradient(
42deg,
transparent,
transparent 70px,
rgba(100, 100, 100, 0.11) 70px,
rgba(100, 100, 100, 0.11) 130px
);
background-size: 160px 160px;
background-repeat: repeat;
pointer-events: none;
z-index: 1;
}
.paper-watermark::after {
content: "仅供内容预览核验";
position: absolute;
width: 100%;
height: 100%;
font-size: 14px;
color: #666;
opacity: 0.12;
transform: rotate(-42deg);
white-space: nowrap;
line-height: 160px;
letter-spacing: 2px;
}
/* 证明内部模拟图(支持替换真实图片) */
.paper-inner {
position: relative;
z-index: 2;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-evenly;
}
.paper-inner .proof-real-img {
position: absolute;
width: 100%;
height: 100%;
object-fit: contain;
z-index: 0;
}
.paper-seal-red {
width: 76px;
height: 76px;
border: 2px solid #c8102e;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
color: #c8102e;
font-size: 12px;
text-align: center;
position: relative;
z-index: 3;
}
.qrcode-demo {
width: 44px;
height: 44px;
background: #222;
position: relative;
z-index: 3;
}
/* 查询结果绿色文字区域 精准色值 #00A846 */
.success-text-box {
display: flex;
align-items: center;
gap: 8px;
color: #00A846;
font-size: 16px;
flex-wrap: wrap;
}
.green-dot {
width: 18px;
height: 18px;
border-radius: 50%;
background-color: #00C050;
display: flex;
align-items: center;
justify-content: center;
color: #fff;
font-size: 13px;
flex-shrink: 0;
}
/* 查询失败样式 */
.fail-text-box {
display: flex;
align-items: center;
gap: 8px;
color: #c8102e;
font-size: 16px;
flex-wrap: wrap;
}
.red-dot {
width: 18px;
height: 18px;
border-radius: 50%;
background-color: #c8102e;
display: flex;
align-items: center;
justify-content: center;
color: #fff;
font-size: 13px;
flex-shrink: 0;
}
.loading-text-box {
display: flex;
align-items: center;
gap: 8px;
color: #999;
font-size: 16px;
}
.gray-dot {
width: 18px;
height: 18px;
border-radius: 50%;
background-color: #999;
display: flex;
align-items: center;
justify-content: center;
color: #fff;
font-size: 13px;
flex-shrink: 0;
}
/* 底部联系电话 */
.tel-notice {
text-align: center;
padding: 20px 16px;
font-size: 17px;
color: #111;
}
/* 页面最底部技术支持 */
.footer-info {
text-align: center;
padding: 10px 16px 30px;
font-size: 16px;
color: #707070;
}
/* ========== 移动端适配 ========== */
@media (max-width: 480px) {
.page-title { font-size: 18px; }
.back-icon { font-size: 20px; }
.logo-header { padding: 16px 12px; gap: 10px; }
.fzu-logo { width: 52px; height: 52px; }
.fzu-logo .logo-fallback { font-size: 24px; }
.logo-main-text { font-size: 22px; }
.banner-library { height: 120px; }
.result-wrap { margin: 14px 8px; }
.card-head { font-size: 16px; padding: 10px 14px; }
.table-row { grid-template-columns: 100px 1fr; }
.table-left { padding: 12px 10px; font-size: 14px; }
.table-right { padding: 12px 10px; font-size: 14px; }
.proof-paper { width: 96%; height: 240px; }
.paper-seal-red { width: 56px; height: 56px; font-size: 10px; }
.qrcode-demo { width: 34px; height: 34px; }
.success-text-box,
.fail-text-box,
.loading-text-box { font-size: 14px; }
.tel-notice { font-size: 14px; padding: 14px 12px; }
.footer-info { font-size: 13px; padding: 8px 12px 24px; }
}
@media (max-width: 360px) {
.table-row { grid-template-columns: 85px 1fr; }
.table-left { padding: 10px 8px; font-size: 12px; }
.table-right { padding: 10px 8px; font-size: 12px; }
.logo-main-text { font-size: 18px; }
.page-title { font-size: 16px; }
}
</style>
</head>
<body>
<!-- 顶部返回箭头 + 页面标题 -->
<div class="top-nav">
<a href="javascript:history.back();" class="back-icon"><</a>
<div class="page-title">扫码验证</div>
</div>
<!-- 校徽+校级防伪验证中心标题 -->
<div class="logo-header">
<div class="fzu-logo" id="fzuLogo">
<!-- 默认文字校徽;配置真实图片 URL 后自动替换 -->
<span class="logo-fallback" id="logoFallback">福</span>
</div>
<div class="logo-main-text">校级防伪验证中心</div>
</div>
<!-- 图书馆横幅图片 -->
<div class="banner-library" id="bannerLibrary">
<!-- 默认使用占位图;配置 BANNER_IMAGE_URL 后自动替换 -->
</div>
<!-- 主查询结果卡片 -->
<div class="result-wrap">
<div class="card-head">查询结果</div>
<!-- 文件编号 -->
<div class="table-row">
<div class="table-left">文件编号</div>
<div class="table-right" id="val-fileNo">----</div>
</div>
<!-- 文件名称 -->
<div class="table-row">
<div class="table-left">文件名称</div>
<div class="table-right" id="val-fileName">----</div>
</div>
<!-- 打印日期 -->
<div class="table-row">
<div class="table-left">打印日期</div>
<div class="table-right" id="val-printDate">----</div>
</div>
<!-- 学生姓名 -->
<div class="table-row">
<div class="table-left">学生姓名</div>
<div class="table-right" id="val-studentName">----</div>
</div>
<!-- 学工号 -->
<div class="table-row">
<div class="table-left">学工号</div>
<div class="table-right" id="val-studentId">----</div>
</div>
<!-- 数据核实行 -->
<div class="table-row">
<div class="table-left">数据核实</div>
<div class="table-right proof-preview-box">
<div class="proof-paper" id="proofPaper">
<div class="paper-watermark"></div>
<div class="paper-inner" id="paperInner">
<div style="text-align:center; font-size:13px; line-height:1.5; position:relative; z-index:3;">
<span style="color:#c8102e; font-weight:bold;" id="previewCollege">福州大学</span><br>
<span id="previewDocType">在编在岗证明</span>
</div>
<div class="paper-seal-red">校章</div>
<div class="qrcode-demo"></div>
</div>
</div>
</div>
</div>
<!-- 查询结果行(动态切换 成功/失败/加载中) -->
<div class="table-row" id="resultRow">
<div class="table-left">查询结果</div>
<div class="table-right success-text-box" id="resultBox">
<span class="green-dot" id="resultIcon">✓</span>
<span id="resultMsg">正在查询,请稍候…</span>
</div>
</div>
</div>
<!-- 联系电话提示 -->
<div class="tel-notice">进一步核实,请拨打电话0591-22865284</div>
<!-- 页面底部技术支持文字 -->
<div class="footer-info">技术支持:信息中心</div>
<script>
(function() {
'use strict';
// ==================== 配置 ====================
// 后端 API 地址:替换为你的真实接口
var API_BASE = 'https://your-api-server.com/api';
var VERIFY_ENDPOINT = API_BASE + '/verify';
// 图片资源 URL(替换为真实图片地址)
var BANNER_IMAGE_URL = ''; // 图书馆横幅背景图
var LOGO_IMAGE_URL = ''; // 福州大学官方校徽
var PROOF_IMAGE_URL = ''; // 真实证明文件预览图
// ==================== 图片替换 ====================
function applyImages() {
// 横幅图
if (BANNER_IMAGE_URL) {
var banner = document.getElementById('bannerLibrary');
banner.style.backgroundImage = 'url(' + BANNER_IMAGE_URL + ')';
} else {
// 默认占位图
document.getElementById('bannerLibrary').style.backgroundImage =
'url(https://picsum.photos/id/1060/960/168)';
}
// 校徽图片
if (LOGO_IMAGE_URL) {
var logo = document.getElementById('fzuLogo');
var fallback = document.getElementById('logoFallback');
if (fallback) fallback.style.display = 'none';
var img = document.createElement('img');
img.src = LOGO_IMAGE_URL;
img.alt = '校徽';
img.onerror = function() {
img.remove();
if (fallback) fallback.style.display = '';
};
logo.appendChild(img);
}
// 证明预览图(在 paper-inner 中叠放真实证明图)
if (PROOF_IMAGE_URL) {
var inner = document.getElementById('paperInner');
var proofImg = document.createElement('img');
proofImg.className = 'proof-real-img';
proofImg.src = PROOF_IMAGE_URL;
proofImg.alt = '证明预览';
proofImg.onerror = function() { proofImg.remove(); };
inner.appendChild(proofImg);
}
}
applyImages();
// ==================== URL 参数读取 ====================
function getQueryParam(name) {
var params = new URLSearchParams(window.location.search);
return params.get(name) || '';
}
// ==================== 填充表格 ====================
function fillTable(data) {
document.getElementById('val-fileNo').textContent = data.fileNo || '----';
document.getElementById('val-fileName').textContent = data.fileName || '----';
document.getElementById('val-printDate').textContent = data.printDate || '----';
document.getElementById('val-studentName').textContent = data.studentName || '----';
document.getElementById('val-studentId').textContent = data.studentId || '----';
// 预览区文字
if (data.college) document.getElementById('previewCollege').textContent = data.college;
if (data.docType) document.getElementById('previewDocType').textContent = data.docType;
}
// ==================== 结果状态切换 ====================
function setResult(status, message) {
var box = document.getElementById('resultBox');
var icon = document.getElementById('resultIcon');
var msg = document.getElementById('resultMsg');
// 清除所有状态 class
box.className = 'table-right';
if (status === 'success') {
box.classList.add('success-text-box');
icon.className = 'green-dot';
icon.textContent = '✓';
msg.textContent = message || '查询通过,请进一步核对文件内容信息.';
} else if (status === 'fail') {
box.classList.add('fail-text-box');
icon.className = 'red-dot';
icon.textContent = '✗';
msg.textContent = message || '查询未通过,未找到对应文件信息。';
} else if (status === 'loading') {
box.classList.add('loading-text-box');
icon.className = 'gray-dot';
icon.textContent = '…';
msg.textContent = message || '正在查询,请稍候…';
}
}
// ==================== API 调用 ====================
async function queryVerifyData(queryCode) {
if (!queryCode) {
setResult('fail', '缺少查询参数,请通过正规渠道扫码访问。');
return;
}
setResult('loading');
try {
var response = await fetch(VERIFY_ENDPOINT, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ code: queryCode, timestamp: Date.now() })
});
if (!response.ok) throw new Error('HTTP ' + response.status);
var result = await response.json();
if (result.success && result.data) {
fillTable(result.data);
setResult('success', result.message || '查询通过,请进一步核对文件内容信息.');
} else {
fillTable({});
setResult('fail', result.message || '查询未通过,未找到对应文件信息。');
}
} catch (err) {
console.error('API 请求失败:', err);
// 后端未配置时使用演示数据
if (API_BASE.indexOf('your-api-server') !== -1) {
useDemoData(queryCode);
} else {
fillTable({});
setResult('fail', '网络请求失败,请稍后重试。');
}
}
}
// ==================== 演示数据(后端未配置时自动使用) ====================
function useDemoData(code) {
fillTable({
fileNo: code || '202610032775',
fileName: '在编在岗证明',
printDate: '2026-06-05 17:51:22',
studentName: '陈纾',
studentId: 'T07097',
college: '福州大学',
docType: '在编在岗证明'
});
setResult('success', '查询通过,请进一步核对文件内容信息.');
console.warn('⚠️ 演示模式:请将 API_BASE 替换为真实后端地址。');
}
// ==================== 入口 ====================
var queryCode = getQueryParam('code') || getQueryParam('id') || getQueryParam('fileNo');
queryVerifyData(queryCode);
// ==================== WeChat JS-SDK 兼容 ====================
if (typeof window.WeixinJSBridge !== 'undefined') {
document.addEventListener('WeixinJSBridgeReady', function() {
console.log('WeChat environment detected');
}, false);
}
})();
</script>
</body>
</html>