Commit ac7ce2df by kaisa

feat:新增防抖测试

parent 8c512b09
Showing with 6 additions and 0 deletions
...@@ -1061,6 +1061,7 @@ ...@@ -1061,6 +1061,7 @@
}); });
} }
var lastExchangeTime = 0;
function bet(gid, type) { function bet(gid, type) {
$.ajax({ $.ajax({
url: $ip + "/rocketlaunch/playGame", url: $ip + "/rocketlaunch/playGame",
...@@ -1078,6 +1079,9 @@ ...@@ -1078,6 +1079,9 @@
layer.msg("露水不足"); layer.msg("露水不足");
else layer.msg("no DEWs"); else layer.msg("no DEWs");
setTimeout(function () { setTimeout(function () {
var currentTime = new Date().getTime();
if (currentTime - lastExchangeTime > 3000) {
lastExchangeTime = currentTime;
var obj = { var obj = {
cid: 12, cid: 12,
reqCode: new Date().getTime(), reqCode: new Date().getTime(),
...@@ -1088,6 +1092,8 @@ ...@@ -1088,6 +1092,8 @@
}; };
var obj2 = JSON.stringify(obj); var obj2 = JSON.stringify(obj);
appCollaboration(obj2); appCollaboration(obj2);
}
}, 1000); }, 1000);
} else if (data.code != 1) { } else if (data.code != 1) {
layer.msg(data.msg); layer.msg(data.msg);
......
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