-
Notifications
You must be signed in to change notification settings - Fork 7
/
info.html
87 lines (80 loc) · 3 KB
/
info.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
<!-- http://127.0.0.1:5500/index.html?plateNumber=%E8%BD%A6%E7%89%8C%E5%8F%B7&phoneNumber=%E6%89%8B%E6%9C%BA%E5%8F%B7 -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>快点挪车-信息</title>
<!-- Bootstrap CSS -->
<link href="https://jsd.quickso.cn/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
<style>
/* Custom styles */
.card {
margin: 20px;
}
.car {
color: #fff;
background-color: #4b5cc4;
border-radius: 6px;
border: 1px solid #fff;
text-align: center;
padding: 10px 0;
box-shadow: 0 0 2px 4px #4b5cc4;
width: 95%;
margin: 15px auto;
font-size: 40px;
letter-spacing: 5px;
text-transform: uppercase;
}
</style>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-6 offset-md-3">
<div class="car" style="background: rgb(75, 92, 196); box-shadow: rgb(75, 92, 196) 0px 0px 2px 4px; color: rgb(255, 255, 255);">
<span class="car-province">京</span><span class="car-letter">A</span><span class="car-dot">•</span><span class="car-number">12345</span>
</div>
<div id="cardContainer"></div>
</div>
</div>
</div>
<script>
// 从 URL 中获取车牌号和手机号
const urlParams = new URLSearchParams(window.location.search);
const plateNumber = urlParams.get('plateNumber');
const phoneNumber = urlParams.get('phoneNumber');
// 找到显示车牌号的各个元素
const carProvince = document.querySelector('.car-province');
const carLetter = document.querySelector('.car-letter');
const carNumber = document.querySelector('.car-number');
// 将从 URL 中获取到的车牌号填充到相应的位置
if (plateNumber) {
carProvince.textContent = plateNumber.charAt(0); // 假设第一个字符为省份
carLetter.textContent = plateNumber.charAt(1); // 假设第二个字符为字母
carNumber.textContent = plateNumber.slice(2); // 从第三个字符开始为数字
}
// 生成卡片内容
const cardContent = `
<div class="card">
<div class="card-body">
<h1 class="card-title">挪车信息</h1>
<h2 class="card-text">临时停靠,请多关照</p>
<p class="card-text">车牌号: ${plateNumber}</p>
<p class="card-text">联系电话: ${phoneNumber}</p>
<button type="button" class="btn btn-primary" onclick="callNumber('${phoneNumber}')">一键呼叫</button>
</div>
</div>
`;
// 将卡片添加到页面中
const cardContainer = document.getElementById('cardContainer');
cardContainer.innerHTML = cardContent;
// 一键呼叫函数
function callNumber(phoneNumber) {
window.location.href = 'tel:' + phoneNumber;
}
</script>
<!-- Bootstrap JS (optional) -->
<script src="https://jsd.quickso.cn/npm/[email protected]/dist/js/bootstrap.min.js"></script>
</body>
</html>