-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpay.html
242 lines (213 loc) · 18.6 KB
/
pay.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link type="favicon" rel="shortcut icon" href="https://drive.jerryz.com.cn/Photos/favicon.png" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="mengkun">
<meta name="renderer" content="webkit">
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-2597042766299857"
crossorigin="anonymous"></script>
<link type="favicon" rel="shortcut icon" href="https://jerryz.com.cn/favicon.png" />
<script async src="https://umami.jerryz.com.cn/script.js"
data-website-id="05c49609-102a-4737-9f42-ed47d90d5452"></script>
<meta http-equiv="Cache-Control" content="no-siteapp">
<title>万能收款码 | by Jerry Zhou</title>
<meta name="description" content="万能收款码,支持微信、支付宝、QQ三码合一">
<script>
var setting = {
qqUrl: "https://i.qianbao.qq.com/wallet/sqrcode.htm?m=tenpay&f=wallet&a=1&ac=CAEQ6fPM6AcY8urNngZCIDE2ZDkwNDQ2ZmUzZGRjMzI5ZThhNzEzYjQ3OTE3ZTM0_xxx_sign&u=2098412009&n=Jerry+Zhou",
wechatUrl: "wxp://f2f0jj9EboroovcuVkxyeYHmg0MWARpB8o4olyEpMiZ8GXY",
aliUrl: "https://qr.alipay.com/fkx13303ygvlmbeaxt5rd5c"
}
</script>
<style>
* {
margin: 0;
padding: 0;
font-family: Microsoft yahei;
}
body {
background-color: #fff;
}
.code-item {
width: 100%;
max-width: 400px;
margin: 0 auto;
padding-bottom: 1px;
display: none;
background-color: #279cff;
}
.code-title {
height: 100px;
background-color: #f2f2f2;
background-position: center;
background-repeat: no-repeat;
background-size: 50%;
}
.code-area {
text-align: center;
}
.code-area img {
margin: 80px auto;
width: 60%;
min-width: 100px;
background: #fff;
padding: 10px;
border-radius: 5px;
}
.code-footer {
height: 80px;
text-align: center;
background-color: #fff;
color: #555;
line-height: 40px;
font-size: 20px;
margin: 0 4px 3px 4px;
}
#code-all>.code-title {
background-image: url("https://img.examcoo.com/ask/7386438/202303/167785900587690.png");
}
#code-qq {
background-color: #12b7f5;
}
#code-qq>.code-title {
background-image: url("https://img.examcoo.com/ask/7386438/202303/167785890786440.png");
}
#code-wechat {
background-color: #0cc160;
}
#code-wechat>.code-title {
background-image: url("https://img.examcoo.com/ask/7386438/202303/167785891216150.png");
}
#code-alipay {
background-color: #1678ff;
}
#code-alipay>.code-title {
background-image: url("https://img.examcoo.com/ask/7386438/202303/167785891216150.png");
}
.message {
text-align: center;
font-size: 24px;
}
.error {
display: none;
color: red;
}
.copyright {
text-align: center;
margin: 7px 0;
color: #999;
font-size: 14px;
}
.copyright a {
text-decoration: none;
font-weight: bold;
color: unset;
transition: opacity 0.2s;
}
.copyright a:hover {
opacity: 0.5;
}
</style>
</head>
<body>
<div>
<center>
<h1>万能收款码</h1>
</center>
</div>
<div id="message" class="message">
<div id="loading" style="display: none;">加载中...</div>
<div id="error" class="error">请输入正确的ID</div>
</div>
<!-- 万能收款码展示区域 -->
<div class="code-item" id="code-all">
<div class="code-title"></div>
<div class="code-area">
<img id="page-url" src="https://img.examcoo.com/ask/7386438/202401/170568067966800.png">
</div>
<div class="code-footer">扫描以上二维码向我付款<br>感谢您的支持</div>
</div>
<!-- QQ钱包二维码展示区域 -->
<div class="code-item" id="code-qq">
<div class="code-title"></div>
<div class="code-area">
<img id="qq-url" src="https://img.examcoo.com/ask/7386438/202401/170568067966800.png">
</div>
<div class="code-footer">长按以上二维码向我付款<br>感谢您的支持</div>
</div>
<!-- 微信二维码展示区域 -->
<div class="code-item" id="code-wechat">
<div class="code-title"></div>
<div class="code-area">
<img id="wechat-url" src="https://img.examcoo.com/ask/7386438/202401/170568067966800.png">
</div>
<div class="code-footer">保存以上二维码并扫描向我付款<br>感谢您的支持</div>
</div>
<!-- 支付宝二维码展示区域 -->
<div class="code-item" id="code-alipay">
<div class="code-title"></div>
<div class="code-area">
<img id="alipay-url" src="https://img.examcoo.com/ask/7386438/202401/170568067966800.png">
</div>
<div class="code-footer">保存以上二维码并扫描向我付款<br>感谢您的支持</div>
</div>
<div class="copyright">
Powered by <a href="https://p.jerryz.com.cn" target="_blank">万能收款码</a>
<br>
Copyright © 2024
<a href="https://jerryz.com.cn" target="_blank">Jerry Zhou</a>
</div>
<script>
/* 二维码生成 https://github.com/lifthrasiir/qr.js/ */
!function (r, n, t) { "function" == typeof define && define.amd ? define([], t) : "object" == typeof module && module.exports ? module.exports = t() : r.QRCode = t() }(this, 0, function () { for (var r = [null, [[10, 7, 17, 13], [1, 1, 1, 1], []], [[16, 10, 28, 22], [1, 1, 1, 1], [4, 16]], [[26, 15, 22, 18], [1, 1, 2, 2], [4, 20]], [[18, 20, 16, 26], [2, 1, 4, 2], [4, 24]], [[24, 26, 22, 18], [2, 1, 4, 4], [4, 28]], [[16, 18, 28, 24], [4, 2, 4, 4], [4, 32]], [[18, 20, 26, 18], [4, 2, 5, 6], [4, 20, 36]], [[22, 24, 26, 22], [4, 2, 6, 6], [4, 22, 40]], [[22, 30, 24, 20], [5, 2, 8, 8], [4, 24, 44]], [[26, 18, 28, 24], [5, 4, 8, 8], [4, 26, 48]], [[30, 20, 24, 28], [5, 4, 11, 8], [4, 28, 52]], [[22, 24, 28, 26], [8, 4, 11, 10], [4, 30, 56]], [[22, 26, 22, 24], [9, 4, 16, 12], [4, 32, 60]], [[24, 30, 24, 20], [9, 4, 16, 16], [4, 24, 44, 64]], [[24, 22, 24, 30], [10, 6, 18, 12], [4, 24, 46, 68]], [[28, 24, 30, 24], [10, 6, 16, 17], [4, 24, 48, 72]], [[28, 28, 28, 28], [11, 6, 19, 16], [4, 28, 52, 76]], [[26, 30, 28, 28], [13, 6, 21, 18], [4, 28, 54, 80]], [[26, 28, 26, 26], [14, 7, 25, 21], [4, 28, 56, 84]], [[26, 28, 28, 30], [16, 8, 25, 20], [4, 32, 60, 88]], [[26, 28, 30, 28], [17, 8, 25, 23], [4, 26, 48, 70, 92]], [[28, 28, 24, 30], [17, 9, 34, 23], [4, 24, 48, 72, 96]], [[28, 30, 30, 30], [18, 9, 30, 25], [4, 28, 52, 76, 100]], [[28, 30, 30, 30], [20, 10, 32, 27], [4, 26, 52, 78, 104]], [[28, 26, 30, 30], [21, 12, 35, 29], [4, 30, 56, 82, 108]], [[28, 28, 30, 28], [23, 12, 37, 34], [4, 28, 56, 84, 112]], [[28, 30, 30, 30], [25, 12, 40, 34], [4, 32, 60, 88, 116]], [[28, 30, 30, 30], [26, 13, 42, 35], [4, 24, 48, 72, 96, 120]], [[28, 30, 30, 30], [28, 14, 45, 38], [4, 28, 52, 76, 100, 124]], [[28, 30, 30, 30], [29, 15, 48, 40], [4, 24, 50, 76, 102, 128]], [[28, 30, 30, 30], [31, 16, 51, 43], [4, 28, 54, 80, 106, 132]], [[28, 30, 30, 30], [33, 17, 54, 45], [4, 32, 58, 84, 110, 136]], [[28, 30, 30, 30], [35, 18, 57, 48], [4, 28, 56, 84, 112, 140]], [[28, 30, 30, 30], [37, 19, 60, 51], [4, 32, 60, 88, 116, 144]], [[28, 30, 30, 30], [38, 19, 63, 53], [4, 28, 52, 76, 100, 124, 148]], [[28, 30, 30, 30], [40, 20, 66, 56], [4, 22, 48, 74, 100, 126, 152]], [[28, 30, 30, 30], [43, 21, 70, 59], [4, 26, 52, 78, 104, 130, 156]], [[28, 30, 30, 30], [45, 22, 74, 62], [4, 30, 56, 82, 108, 134, 160]], [[28, 30, 30, 30], [47, 24, 77, 65], [4, 24, 52, 80, 108, 136, 164]], [[28, 30, 30, 30], [49, 25, 81, 68], [4, 28, 56, 84, 112, 140, 168]]], n = /^\d*$/, t = /^[A-Za-z0-9 $%*+\-./:]*$/, e = /^[A-Z0-9 $%*+\-./:]*$/, o = [], a = [-1], u = 0, f = 1; u < 255; ++u)o.push(f), a[f] = u, f = 2 * f ^ (f >= 128 ? 285 : 0); var i = [[]]; for (u = 0; u < 30; ++u) { for (var h = i[u], s = [], c = 0; c <= u; ++c) { var l = c < u ? o[h[c]] : 0, v = o[(u + (h[c - 1] || 0)) % 255]; s.push(a[l ^ v]) } i.push(s) } var p = {}; for (u = 0; u < 45; ++u)p["0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:".charAt(u)] = u; var g = [function (r, n) { return (r + n) % 2 == 0 }, function (r, n) { return r % 2 == 0 }, function (r, n) { return n % 3 == 0 }, function (r, n) { return (r + n) % 3 == 0 }, function (r, n) { return ((r / 2 | 0) + (n / 3 | 0)) % 2 == 0 }, function (r, n) { return r * n % 2 + r * n % 3 == 0 }, function (r, n) { return (r * n % 2 + r * n % 3) % 2 == 0 }, function (r, n) { return ((r + n) % 2 + r * n % 3) % 2 == 0 }], d = function (r) { return r > 6 }, m = function (n, t) { var e = -8 & function (n) { var t = r[n], e = 16 * n * n + 128 * n + 64; return d(n) && (e -= 36), t[2].length && (e -= 25 * t[2].length * t[2].length - 10 * t[2].length - 55), e }(n), o = r[n]; return e -= 8 * o[0][t] * o[1][t] }, w = function (r, n) { switch (n) { case 1: return r < 10 ? 10 : r < 27 ? 12 : 14; case 2: return r < 10 ? 9 : r < 27 ? 11 : 13; case 4: return r < 10 ? 8 : 16; case 8: return r < 10 ? 8 : r < 27 ? 10 : 12 } }, C = function (r, n, t) { var e = m(r, t) - 4 - w(r, n); switch (n) { case 1: return 3 * (e / 10 | 0) + (e % 10 < 4 ? 0 : e % 10 < 7 ? 1 : 2); case 2: return 2 * (e / 11 | 0) + (e % 11 < 6 ? 0 : 1); case 4: return e / 8 | 0; case 8: return e / 13 | 0 } }, A = function (r, n) { for (var t = r.slice(0), e = r.length, u = n.length, f = 0; f < u; ++f)t.push(0); for (f = 0; f < e;) { var i = a[t[f++]]; if (i >= 0) for (var h = 0; h < u; ++h)t[f + h] ^= o[(i + n[h]) % 255] } return t.slice(e) }, x = function (r, n, t, e) { for (var o = r << e, a = n - 1; a >= 0; --a)o >> e + a & 1 && (o ^= t << a); return r << e | o }, b = function (r, n, t) { for (var e = g[t], o = r.length, a = 0; a < o; ++a)for (var u = 0; u < o; ++u)n[a][u] || (r[a][u] ^= e(a, u)); return r }, y = function (r, n, t, e) { for (var o = r.length, a = 21522 ^ x(t << 3 | e, 5, 1335, 10), u = 0; u < 15; ++u) { var f = [o - 1, o - 2, o - 3, o - 4, o - 5, o - 6, o - 7, o - 8, 7, 5, 4, 3, 2, 1, 0][u]; r[[0, 1, 2, 3, 4, 5, 7, 8, o - 7, o - 6, o - 5, o - 4, o - 3, o - 2, o - 1][u]][8] = r[8][f] = a >> u & 1 } return r }, $ = function (r) { for (var n = function (r) { for (var n = 0, t = 0; t < r.length; ++t)r[t] >= 5 && (n += r[t] - 5 + 3); for (t = 5; t < r.length; t += 2) { var e = r[t]; r[t - 1] == e && r[t - 2] == 3 * e && r[t - 3] == e && r[t - 4] == e && (r[t - 5] >= 4 * e || r[t + 1] >= 4 * e) && (n += 40) } return n }, t = r.length, e = 0, o = 0, a = 0; a < t; ++a) { var u, f = r[a]; u = [0]; for (var i = 0; i < t;) { for (h = 0; i < t && f[i]; ++h)++i; for (u.push(h), h = 0; i < t && !f[i]; ++h)++i; u.push(h) } e += n(u), u = [0]; for (i = 0; i < t;) { var h; for (h = 0; i < t && r[i][a]; ++h)++i; for (u.push(h), h = 0; i < t && !r[i][a]; ++h)++i; u.push(h) } e += n(u); var s = r[a + 1] || []; o += f[0]; for (i = 1; i < t; ++i) { var c = f[i]; o += c, f[i - 1] == c && s[i] === c && s[i - 1] === c && (e += 3) } } return e += 10 * (Math.abs(o / t / t - .5) / .05 | 0) }, k = function (n, t, e, o, a) { var u = r[t], f = function (r, n, t, e) { var o = [], a = 0, u = 8, f = t.length, i = function (r, n) { if (n >= u) { for (o.push(a | r >> (n -= u)); n >= 8;)o.push(r >> (n -= 8) & 255); a = 0, u = 8 } n > 0 && (a |= (r & (1 << n) - 1) << (u -= n)) }, h = w(r, n); switch (i(n, 4), i(f, h), n) { case 1: for (var s = 2; s < f; s += 3)i(parseInt(t.substring(s - 2, s + 1), 10), 10); i(parseInt(t.substring(s - 2), 10), [0, 4, 7][f % 3]); break; case 2: for (s = 1; s < f; s += 2)i(45 * p[t.charAt(s - 1)] + p[t.charAt(s)], 11); f % 2 == 1 && i(p[t.charAt(s - 1)], 6); break; case 4: for (s = 0; s < f; ++s)i(t[s], 8) }for (i(0, 4), u < 8 && o.push(a); o.length + 1 < e;)o.push(236, 17); return o.length < e && o.push(236), o }(t, e, n, m(t, o) >> 3); f = function (r, n, t) { for (var e = [], o = r.length / n | 0, a = 0, u = n - r.length % n, f = 0; f < u; ++f)e.push(a), a += o; for (f = u; f < n; ++f)e.push(a), a += o + 1; e.push(a); var i = []; for (f = 0; f < n; ++f)i.push(A(r.slice(e[f], e[f + 1]), t)); var h = [], s = r.length / n | 0; for (f = 0; f < s; ++f)for (var c = 0; c < n; ++c)h.push(r[e[c] + f]); for (c = u; c < n; ++c)h.push(r[e[c + 1] - 1]); for (f = 0; f < t.length; ++f)for (c = 0; c < n; ++c)h.push(i[c][f]); return h }(f, u[1][o], i[u[0][o]]); var h = function (n) { for (var t = r[n], e = function (r) { return 4 * r + 17 }(n), o = [], a = [], u = 0; u < e; ++u)o.push([]), a.push([]); var f = function (r, n, t, e, u) { for (var f = 0; f < t; ++f)for (var i = 0; i < e; ++i)o[r + f][n + i] = u[f] >> i & 1, a[r + f][n + i] = 1 }; f(0, 0, 9, 9, [127, 65, 93, 93, 93, 65, 383, 0, 64]), f(e - 8, 0, 8, 9, [256, 127, 65, 93, 93, 93, 65, 127]), f(0, e - 8, 9, 8, [254, 130, 186, 186, 186, 130, 254, 0, 0]); for (u = 9; u < e - 8; ++u)o[6][u] = o[u][6] = 1 & ~u, a[6][u] = a[u][6] = 1; var i = t[2], h = i.length; for (u = 0; u < h; ++u)for (var s = 0 == u ? h - 1 : h, c = 0 == u || u == h - 1 ? 1 : 0; c < s; ++c)f(i[u], i[c], 5, 5, [31, 17, 21, 17, 31]); if (d(n)) { var l = x(n, 6, 7973, 12), v = 0; for (u = 0; u < 6; ++u)for (c = 0; c < 3; ++c)o[u][e - 11 + c] = o[e - 11 + c][u] = l >> v++ & 1, a[u][e - 11 + c] = a[e - 11 + c][u] = 1 } return { matrix: o, reserved: a } }(t), s = h.matrix, c = h.reserved; if (function (r, n, t) { for (var e = r.length, o = 0, a = -1, u = e - 1; u >= 0; u -= 2) { 6 == u && --u; for (var f = a < 0 ? e - 1 : 0, i = 0; i < e; ++i) { for (var h = u; h > u - 2; --h)n[f][h] || (r[f][h] = t[o >> 3] >> (7 & ~o) & 1, ++o); f += a } a = -a } }(s, c, f), a < 0) { b(s, c, 0), y(s, 0, o, 0); var l = 0, v = $(s); for (b(s, c, 0), a = 1; a < 8; ++a) { b(s, c, a), y(s, 0, o, a); var g = $(s); v > g && (v = g, l = a), b(s, c, a) } a = l } return b(s, c, a), y(s, 0, o, a), s }, L = { generate: function (r, o) { var a = { numeric: 1, alphanumeric: 2, octet: 4 }, u = { L: 1, M: 0, Q: 3, H: 2 }, f = (o = o || {}).version || -1, i = u[(o.ecclevel || "L").toUpperCase()], h = o.mode ? a[o.mode.toLowerCase()] : -1, s = "mask" in o ? o.mask : -1; if (h < 0) h = "string" == typeof r ? r.match(n) ? 1 : r.match(e) ? 2 : 4 : 4; else if (1 != h && 2 != h && 4 != h) throw "invalid or unsupported mode"; if (null === (r = function (r, e) { switch (r) { case 1: return e.match(n) ? e : null; case 2: return e.match(t) ? e.toUpperCase() : null; case 4: if ("string" == typeof e) { for (var o = [], a = 0; a < e.length; ++a) { var u = e.charCodeAt(a); u < 128 ? o.push(u) : u < 2048 ? o.push(192 | u >> 6, 128 | 63 & u) : u < 65536 ? o.push(224 | u >> 12, 128 | u >> 6 & 63, 128 | 63 & u) : o.push(240 | u >> 18, 128 | u >> 12 & 63, 128 | u >> 6 & 63, 128 | 63 & u) } return o } return e } }(h, r))) throw "invalid data format"; if (i < 0 || i > 3) throw "invalid ECC level"; if (f < 0) { for (f = 1; f <= 40 && !(r.length <= C(f, h, i)); ++f); if (f > 40) throw "too large data" } else if (f < 1 || f > 40) throw "invalid version"; if (-1 != s && (s < 0 || s > 8)) throw "invalid mask"; return k(r, f, h, i, s) }, generatePNG: function (r, n) { n = n || {}; var t, e = L.generate(r, n), o = Math.max(n.modulesize || 5, .5), a = Math.max(null != n.margin ? n.margin : 4, 0), u = e.length, f = o * (u + 2 * a), i = document.createElement("canvas"); if (i.width = i.height = f, !(t = i.getContext("2d"))) throw "canvas support is needed for PNG output"; t.fillStyle = "#fff", t.fillRect(0, 0, f, f), t.fillStyle = "#000"; for (var h = 0; h < u; ++h)for (var s = 0; s < u; ++s)e[h][s] && t.fillRect(o * (a + s), o * (a + h), o, o); return i.toDataURL() } }; return L });
var urlParams = new URLSearchParams(window.location.search);
var id = urlParams.get('id');
var loadingElement = document.getElementById('loading');
var errorElement = document.getElementById('error');
loadingElement.style.display = 'block';
if (id) {
fetch(`https://g3rvbpemgm.us.aircode.run/pay?id=${id}`)
.then(response => response.json())
.then(data => {
loadingElement.style.display = 'none';
if (data.result == "ID not found!") {
errorElement.style.display = 'block';
} else {
// 将获取到的链接更新到页面上
setting.qqUrl = data.qq;
setting.wechatUrl = data.wechat;
setting.aliUrl = data.alipay;
// 根据用户代理设置相应的二维码图片
if (navigator.userAgent.match(/Alipay/i)) {
/* 支付宝 */
if (setting.aliUrl) window.location.href = setting.aliUrl;
else document.getElementById("code-alipay").style.display = "block";
} else if (navigator.userAgent.match(/MicroMessenger\//i)) {
/* 微信 */
if (setting.wechatUrl) document.getElementById("wechat-url").src = QRCode.generatePNG(setting.wechatUrl, { margin: 0 });
document.getElementById("code-wechat").style.display = "block";
} else if (navigator.userAgent.match(/QQ\//i)) {
/* QQ */
if (setting.qqUrl) document.getElementById("qq-url").src = QRCode.generatePNG(setting.qqUrl, { margin: 0 });
document.getElementById("code-qq").style.display = "block";
} else {
/* 其它,显示“万能码” */
document.getElementById("page-url").src = QRCode.generatePNG(window.location.href, { margin: 0 });
document.getElementById("code-all").style.display = "block";
}
}
})
.catch(error => {
console.error('Error fetching data: ', error);
loadingElement.style.display = 'none';
});
} else {
loadingElement.style.display = 'none';
errorElement.style.display = 'block';
}
</script>
</body>
</html>