Commit ac7ce2df by kaisa

feat:新增防抖测试

parent 8c512b09
Showing with 16 additions and 10 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,16 +1079,21 @@ ...@@ -1078,16 +1079,21 @@
layer.msg("露水不足"); 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, if (currentTime - lastExchangeTime > 3000) {
reqCode: new Date().getTime(), lastExchangeTime = currentTime;
data: { var obj = {
msg: "兌換露水", cid: 12,
jumptype: 15, reqCode: new Date().getTime(),
}, data: {
}; msg: "兌換露水",
var obj2 = JSON.stringify(obj); jumptype: 15,
appCollaboration(obj2); },
};
var obj2 = JSON.stringify(obj);
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