diff --git a/templates/web/charge_center.html b/templates/web/charge_center.html
index 7065d10375..e33e4a63e4 100644
--- a/templates/web/charge_center.html
+++ b/templates/web/charge_center.html
@@ -64,7 +64,7 @@
- 付费完成之后请点击确认!
+ 付费完成之后请点击确认
@@ -152,6 +152,8 @@
var codeBox = $("#id-qrcode-box")
var msgline = $("#id-msg-line")
var url = "{% url 'api:order' %}"
+ var queryTimer;
+
var payrequest = function () {
paynum = payinput.val()
if (paynum >= 1 && paynum % 1 == 0) {
@@ -168,6 +170,7 @@
codeBox.attr('class', '')
qrcode_url = results.qrcode_url
$("#id-qrcode-canvas").qrcode(qrcode_url)
+ var queryTimer = setInterval(payquery, 1000);
}
})
} else {
@@ -176,15 +179,21 @@
}
requestButton.click(payrequest)
- // 支付查询部分
- queryButton = $("#id-button-query")
- var payquery = function () {
- msgline.html('后台飞速查询结果中 请稍候....')
+
+ function payquery() {
+ msgline.html('后台飞速查询结果中,请稍候...');
$.getJSON(url, function (results) {
- info = results.info
- swal(info.title, info.subtitle, info.status)
- })
+ info = results.info;
+ swal(info.title, info.subtitle, info.status);
+ if (info.status == "success") {
+ // 停止定时器
+ clearInterval(queryTimer);
+ }
+ });
}
+
+ // 支付查询部分
+ queryButton = $("#id-button-query")
queryButton.click(payquery)