全球主机交流论坛
标题:
二维码API接口源码
[打印本页]
作者:
vps1
时间:
2019-5-3 18:07
标题:
二维码API接口源码
把以下代码重命名为 index.html. 打开就能使用。
用gitee,github,coding等免费空间均可。
演示地址:https://120424.com/qrcode/
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="shortcut icon" type="image/ico" >
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no,minimal-ui">
<title>QRCode API_二维码网址接口</title>
<link rel="stylesheet" >
<style>
body {
overflow-x: hidden !important;
word-wrap: break-word;
}
pre {
overflow: auto;
}
html ::-webkit-scrollbar {
width: 6px;
height: 4px;
background: 0 0;
}
html ::-webkit-scrollbar-thumb {
background: rgba(0, 0, 0, .3);
}
</style>
</head>
<body>
<div class="container grid-md">
<h1 class="h2 text-center sk-mt-8">二维码 API 接口</h1>
<div class="sk-mt-4">
<h2 class="h4">西部数码二维码接口
<small class="sk-pl-2">微信支付</small>
</h2>
<pre><code>https://www.west.cn/web/tool/codepayimg?uuid={{Text}}</code></pre>
<div class="form-group">
<textarea class="form-input" id="inputWestCN" type="text" placeholder="Input some text here ..."></textarea>
<button class="btn btn-primary" type="submit" onclick="generateWestCN()">Generate</button>
</div>
<img id="qrWestCN">
</div>
<div class="sk-mt-4">
<h2 class="h4">百度网盘二维码接口
<small class="sk-pl-2">链接分享</small>
</h2>
<pre><code>https://pan.baidu.com/share/qrcode?w={{Width}}&h={{Height}}&url={{Text}}?from=pan.baidu.com</code></pre>
<div class="form-group">
<textarea class="form-input" id="inputBaiduPan" type="text" placeholder="Input some text here ..."></textarea>
<button class="btn btn-primary" type="submit" onclick="generateBaiduPan()">Generate</button>
</div>
<img id="qrBaiduPan">
</div>
<div class="sk-mt-4">
<h2 class="h4">QQ 二维码接口
<small class="sk-pl-2">不支持 HTTPS</small>
</h2>
<pre><code>http://mobile.qq.com/qrcode?width={{Width}}&height={{Height}}&url=12345{{Text}}</code></pre>
<div class="form-group">
<textarea class="form-input" id="inputQQ" type="text" placeholder="Input some text here ..."></textarea>
<button class="btn btn-primary" type="submit" onclick="generateQQ()">Generate</button>
</div>
<img id="qrQQ">
</div>
<div class="sk-mt-4">
<h2 class="h4">网易 LOFTER 二维码接口
<small class="sk-pl-2">微信分享</small>
</h2>
<pre><code>https://www.lofter.com/genBitmaxImage?url={{Text}}&h={{height}}&w={{width}}</code></pre>
<div class="form-group">
<textarea class="form-input" id="inputLofter" type="text" placeholder="Input some text here ..."></textarea>
<button class="btn btn-primary" type="submit" onclick="generateLofter()">Generate</button>
</div>
<img id="qrLofter">
</div>
<div class="sk-mt-4">
<h2 class="h4">bbj.me 二维码接口
<small class="sk-pl-2">bbj.me
<del>个人</del>大佬搭建</small>
</h2>
<div class="form-group">
<textarea class="form-input" id="inputLWL" type="text" placeholder="Input some text here ..."></textarea>
<button class="btn btn-primary" type="submit" onclick="generateLWL()">Generate</button>
</div>
<img id="qrLWL">
</div>
<div class="sk-mt-4">
<h2 class="h4">915 短网址 / 12i 短网址 二维码接口
<small class="sk-pl-2">LWL
<del>个人</del>大佬搭建</small>
</h2>
<pre><code>https://12i.cn/codeImage.ashx?text={{Text}}</code></pre>
<pre><code>https://915.im/codeImage.ashx?text={{Text}}</code></pre>
<div class="form-group">
<textarea class="form-input" id="input951" type="text" placeholder="Input some text here ..."></textarea>
<button class="btn btn-primary" type="submit" onclick="generate951()">Generate</button>
</div>
<img id="qr951"><img id="qr12i">
</div>
</div>
<script>
function generateWestCN() {
document.getElementById('qrWestCN').src = "https://www.west.cn/web/tool/codepayimg?uuid=" + document.getElementById('inputWestCN').value.replace(/\&/g, '%26').replace(/\?/g, '%3f');
}
function generateBaiduPan() {
if (document.getElementById('inputBaiduPan').value.indexOf('?') === -1) {
document.getElementById('qrBaiduPan').src = "https://pan.baidu.com/share/qrcode?w=256&h=256&url=" + document.getElementById('inputBaiduPan').value.replace(/\&/g, '%26').replace(/\?/g, '%3f') + "%3ffrom=pan.baidu.com";
} else {
document.getElementById('qrBaiduPan').src = "https://pan.baidu.com/share/qrcode?w=256&h=256&url=" + document.getElementById('inputBaiduPan').value.replace(/\&/g, '%26').replace(/\?/g, '%3f') + "%26from=pan.baidu.com";
}
}
function generateQQ() {
document.getElementById('qrQQ').src = "http://mobile.qq.com/qrcode?width=256&height=256&url=" + document.getElementById('inputQQ').value.replace(/\&/g, '%26').replace(/\?/g, '%3f');
}
function generateLofter() {
document.getElementById('qrLofter').src = "https://www.lofter.com/genBitmaxImage?url=" + document.getElementById('inputLofter').value.replace(/\&/g, '%26').replace(/\?/g, '%3f') + "&w=200&h=200";
}
function generateLWL() {
document.getElementById('qrLWL').src = "https://bbj.me/qr.php?text=" + document.getElementById('inputLWL').value.replace(/\&/g, '%26').replace(/\?/g, '%3f');
}
function generate951() {
document.getElementById('qr951').src = "https://915.im/codeImage.ashx?text=" + document.getElementById('input951').value.replace(/\&/g, '%26').replace(/\?/g, '%3f');
document.getElementById('qr12i').src = "https://12i.cn/codeImage.ashx?text=" + document.getElementById('input951').value.replace(/\&/g, '%26').replace(/\?/g, '%3f');
}
</script>
<script>!function (a, b, c, d, e) { var f = c.screen, g = encodeURIComponent, h = ["ga=" + a, "dt=" + g(d.title), "dr=" + g(d.referrer), "ul=" + (e.language || e.browserLanguage || e.userLanguage), "sd=" + f.colorDepth + "-bit", "sr=" + f.width + "x" + f.height, "vp=" + Math.max(d.documentElement.clientWidth, c.innerWidth || 0) + "x" + Math.max(d.documentElement.clientHeight, c.innerHeight || 0), "z=" + +new Date]; c.__ga_img = new Image, c.__ga_img.src = b + "?" + h.join("&") }("UA-122669675-3", "https://ga.giuem.com", window, document, navigator, location);</script>
</body>
</html>
复制代码
作者:
Wo18cm
时间:
2019-5-3 18:15
收藏了,谢谢楼主。
作者:
翻车的老司机
时间:
2019-5-3 18:31
已收藏
作者:
H48
时间:
2019-5-3 18:46
已下载谢谢
作者:
52Fancy
时间:
2019-5-3 19:54
谢谢分享
欢迎光临 全球主机交流论坛 (https://fd.vvwvv.eu.org/)
Powered by Discuz! X3.4