Commit 3bd02ed5 by kaisa

feat:更新火箭升空兑换露水频繁点击弹出问题

parent 0a69bc91
Showing with 14 additions and 8 deletions
...@@ -907,6 +907,7 @@ ...@@ -907,6 +907,7 @@
}) })
} }
var lastExchangeTime = 0;
function bet(gid, type) { function bet(gid, type) {
$.ajax({ $.ajax({
url: $ip + '/rocketlaunch/playGame', url: $ip + '/rocketlaunch/playGame',
...@@ -923,16 +924,21 @@ ...@@ -923,16 +924,21 @@
if (sessionStorage.lang == 2 || sessionStorage.lang == 0) layer.msg("露水不足") if (sessionStorage.lang == 2 || sessionStorage.lang == 0) layer.msg("露水不足")
else layer.msg("no DEWs") else layer.msg("no DEWs")
setTimeout(function () { setTimeout(function () {
var obj = { var currentTime = new Date().getTime();
"cid": 12, // 新增防抖 避免用户频繁操作导致兑换露水页面重复弹出
"reqCode": new Date().getTime(), if (currentTime - lastExchangeTime > 3000) {
"data": { lastExchangeTime = currentTime;
"msg": "兌換露水", var obj = {
"jumptype": 15, "cid": 12,
"reqCode": new Date().getTime(),
"data": {
"msg": "兌換露水",
"jumptype": 15,
}
} }
var obj2 = JSON.stringify(obj);
appCollaboration(obj2);
} }
var obj2 = JSON.stringify(obj);
appCollaboration(obj2);
}, 1000); }, 1000);
} }
else if (data.code != 1) { else if (data.code != 1) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment