ThinkAdmin/application/index/view/wap.payqrc.html
2017-04-14 16:52:18 +08:00

50 lines
1.4 KiB
PHP

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>扫码支付DEMO</title>
<link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">
</head>
<body style="text-align:center">
<h3>扫码支付DEMO</h3>
<div id="showbox">
</div>
<p id="orderno">
</p>
<button data-reset class="btn btn-default">重置订单号</button>
</body>
<script src="//cdn.bootcss.com/jquery/1.11.0/jquery.min.js"></script>
<script src="//cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script>
$(function () {
payTest.call(this), setInterval(payTest, 3000);
/*! 支付测试动作 */
function payTest() {
$.get('{:url("payqrc")}', {'action': 'payqrc'}, function (ret) {
if (ret.code === 2) {
ret.url = '__STATIC__/theme/default/img/wechat/qrc_payed.jpg';
}
if (ret.code === 1) {
$('#showbox').html('<img src="' + ret.url + '"/>');
}
$('#orderno').html('订单号:' + ret.order_no);
});
}
$('[data-reset]').on('click', function () {
$.get('{:url("payqrc")}', {'action': 'reset'}, function () {
window.location.reload();
});
});
});
</script>
</html>