forked from Rene8028/pay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfullqr.html
99 lines (87 loc) · 3.13 KB
/
fullqr.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
<!--
* @Descripttion:
* @version: 1.0
* @Author: Rene8028
* @Date: 2022-07-03 10:31:12
* @LastEditors: Rene8028
* @LastEditTime: 2022-07-03 10:39:36
-->
<!--
* Pay - 一个简单的收款码展示页
* Author: Alex3236 (//github.com/alex3236)
* License: GNU General Public License v3.0
-->
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="Alex3236, and Bootstrap contributors">
<link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.1.3/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery.qrcode/1.0/jquery.qrcode.min.js"></script>
<link href="css/fullqr.css" rel="stylesheet">
<link href="css/font.css" rel="stylesheet">
<!-- 设置 -->
<title>(~ ̄▽ ̄)~</title>
<script>
const settings = {
hide: [qq], // 隐藏的支付方式列表。可以有 alipay, wechat, qq
desc: "支付宝 / 微信 扫码支付" // 描述
};
</script>
</head>
<body>
<style>
</style>
<!-- Main Container -->
<div class="main container justify-content-center text-center">
<div class="icon-group align-items-center" role="group">
<i class="icon-alipay"></i><i class="icon-wechat"></i>
</div>
<div class="code-item">
<!-- <img class="border border-2 rounded-circle mb-2 mx-auto d-block" id="avatar" alt="avatar"></img> -->
<div id="qrcode-canvas" class="hidden"></div>
<div id="qrcode" class="qrcode"></div>
<div class="code-text align-items-center" role="group">
<script>document.write(settings.desc);</script>
</div>
</div>
</div>
<!-- Footer -->
<footer class="footer fixed-bottom">
<div class="container text-center mb-2">
<p class="text-muted">
Rene8028 ©<span>
<script>document.write(/\d{4}/.exec(Date())[0]);</script>
</span>All rights reserved.
</p>
</div>
</footer>
<!-- Scripts -->
<script>
function makeCode(url) {
$("#qrcode-canvas canvas").remove();
$("#qrcode img").remove();
$("#qrcode-canvas").qrcode({ width: 350, height: 350, text: url })
var img = convertCanvasToImage($("#qrcode-canvas canvas")[0]);
$("#qrcode").append(img);
}
function convertCanvasToImage(canvas) {
undefined
var image = new Image();
image.src = canvas.toDataURL("image/png");
return image;
}
window.onload = function () {
var url = new URL(".", window.location.href).href;
console.log(url);
makeCode(url);
for (var i in settings.hide) {
$(".icon-" + settings.hide[i]).addClass("hidden");
}
}
</script>
</body>
</html>