mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
[更新]增加微信支付测试功能
This commit is contained in:
parent
801cd99a4b
commit
2b5a896725
@ -103,12 +103,13 @@
|
|||||||
function payTest() {
|
function payTest() {
|
||||||
$.form.load('{:url("pay")}?action=payqrc', {}, 'get', function (ret) {
|
$.form.load('{:url("pay")}?action=payqrc', {}, 'get', function (ret) {
|
||||||
if (ret.code === 1 || ret.code === 2) {
|
if (ret.code === 1 || ret.code === 2) {
|
||||||
if(ret.code===2){
|
if (ret.code === 2) {
|
||||||
ret.url = '__STATIC__/theme/default/img/wechat/qrc_payed.jpg';
|
ret.url = '__STATIC__/theme/default/img/wechat/qrc_payed.jpg';
|
||||||
|
timer && window.clearInterval(timer), timer = null;
|
||||||
}
|
}
|
||||||
if(isShow){
|
if (isShow) {
|
||||||
$('.pay-qrc-test').attr('src',ret.url)
|
$('.pay-qrc-test').attr('src', ret.url)
|
||||||
}else{
|
} else {
|
||||||
layer.open({
|
layer.open({
|
||||||
type: 1, title: false, closeBtn: 1, shadeClose: true,
|
type: 1, title: false, closeBtn: 1, shadeClose: true,
|
||||||
content: '<img class="pay-qrc-test" onerror="this.src=__STATIC__/theme/default/img/wechat/qrc_payed.jpg" src="' + ret.url + '"/>'
|
content: '<img class="pay-qrc-test" onerror="this.src=__STATIC__/theme/default/img/wechat/qrc_payed.jpg" src="' + ret.url + '"/>'
|
||||||
@ -116,11 +117,11 @@
|
|||||||
+ '<p class="refund-qrc-test"><a class="btn btn-xs btn-warning">退款测试</a></p>',
|
+ '<p class="refund-qrc-test"><a class="btn btn-xs btn-warning">退款测试</a></p>',
|
||||||
end: function () {
|
end: function () {
|
||||||
isShow = false;
|
isShow = false;
|
||||||
timer && window.clearInterval(timer);
|
timer && window.clearInterval(timer), timer = null;
|
||||||
},
|
},
|
||||||
success: function (layero, index) {
|
success: function (layero, index) {
|
||||||
isShow = true;
|
isShow = true;
|
||||||
timer = setInterval(payTest,1000);
|
timer = setInterval(payTest, 1000);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -128,6 +129,7 @@
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$('[data-pay-test]').on('click', payTest);
|
$('[data-pay-test]').on('click', payTest);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user