You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
176 lines
5.3 KiB
176 lines
5.3 KiB
//时间倒计时
|
|
let Downtime = "";
|
|
|
|
function CountDown(endMsRes, data, name) {
|
|
let countDownTime = 10;
|
|
data.attr("disabled", "disabled")
|
|
countDownTime = Math.ceil((endMsRes - new Date().getTime()) / 1000); //剩余多少秒
|
|
Downtime = setTimeout(function() {
|
|
countDownTime--;
|
|
data.text(countDownTime + "s")
|
|
if (countDownTime < 1) {
|
|
countDownTime = 10;
|
|
data.removeAttr("disabled")
|
|
data.text("同意")
|
|
localStorage.removeItem(name);
|
|
if (data.selector == "#btn_submit") {
|
|
localStorage.setItem("Privacy", "00");
|
|
} else if (data.selector == "#btn_user_submit") {
|
|
localStorage.setItem("User", "00");
|
|
} else if (data.selector == "#btn_exceptions") {
|
|
localStorage.setItem("exceptions", "00");
|
|
}
|
|
clearTimeout(Downtime);
|
|
} else {
|
|
CountDown(endMsRes, data, name);
|
|
}
|
|
}, 1000);
|
|
}
|
|
|
|
//点击x
|
|
$("#close_x").bind("click", function() {
|
|
if (localStorage.getItem("Privacy") == null) {
|
|
clearTimeout(Downtime);
|
|
localStorage.removeItem("countdown");
|
|
localStorage.removeItem("Privacy");
|
|
$('#myModal05').show();
|
|
} else {
|
|
$('#myModal05').show();
|
|
}
|
|
});
|
|
|
|
$("#btn_disagree").bind("click", function() {
|
|
$('#myModal05').show();
|
|
clearTimeout(Downtime);
|
|
localStorage.removeItem("countdown");
|
|
localStorage.removeItem("Privacy");
|
|
});
|
|
|
|
//交易主体进场协议
|
|
$("#new_privacy_pers").bind("click", function() {
|
|
$('#myModal05').modal({
|
|
//点击背景不关闭
|
|
backdrop: "static",
|
|
//触发键盘esc事件时不关闭
|
|
keyboard: false
|
|
});
|
|
if (localStorage.getItem("Privacy") == null) {
|
|
let endMsRes = new Date().getTime() + 10000; //当前时间戳加上一分钟的时间戳,相当于当前时间一分钟以后的时间戳
|
|
localStorage.setItem("countdown", JSON.stringify(endMsRes));
|
|
CountDown(endMsRes, $("#btn_submit"), "countdown");
|
|
}
|
|
});
|
|
|
|
//点击查看隐私保护协议
|
|
$("#new_privacy").bind("click", function() {
|
|
$('#myModal05').modal({
|
|
//点击背景不关闭
|
|
backdrop: "static",
|
|
//触发键盘esc事件时不关闭
|
|
keyboard: false
|
|
});
|
|
if (localStorage.getItem("Privacy") == null) {
|
|
let endMsRes = new Date().getTime() + 10000; //当前时间戳加上一分钟的时间戳,相当于当前时间一分钟以后的时间戳
|
|
localStorage.setItem("countdown", JSON.stringify(endMsRes));
|
|
CountDown(endMsRes, $("#btn_submit"), "countdown");
|
|
}
|
|
});
|
|
|
|
//点击查看用户注册协议
|
|
$("#new_user_pers").bind("click", function() {
|
|
$('#my_userModal').modal({
|
|
//点击背景不关闭
|
|
backdrop: "static",
|
|
//触发键盘esc事件时不关闭
|
|
keyboard: false
|
|
});
|
|
if (localStorage.getItem("User") == null) {
|
|
let endMsRes = new Date().getTime() + 10000; //当前时间戳加上一分钟的时间戳,相当于当前时间一分钟以后的时间戳
|
|
localStorage.setItem("UserTime", JSON.stringify(endMsRes));
|
|
CountDown(endMsRes, $("#btn_user_submit"), "UserTime");
|
|
}
|
|
});
|
|
|
|
//点击查看用户注册协议
|
|
$("#new_user").bind("click", function() {
|
|
$('#my_userModal').modal({
|
|
//点击背景不关闭
|
|
backdrop: "static",
|
|
//触发键盘esc事件时不关闭
|
|
keyboard: false
|
|
});
|
|
if (localStorage.getItem("User") == null) {
|
|
let endMsRes = new Date().getTime() + 10000; //当前时间戳加上一分钟的时间戳,相当于当前时间一分钟以后的时间戳
|
|
localStorage.setItem("UserTime", JSON.stringify(endMsRes));
|
|
CountDown(endMsRes, $("#btn_user_submit"), "UserTime");
|
|
}
|
|
});
|
|
|
|
$("#btn_user_disagree").bind("click", function() {
|
|
$('#my_userModal').show();
|
|
clearTimeout(Downtime);
|
|
localStorage.removeItem("UserTime");
|
|
localStorage.removeItem("User");
|
|
});
|
|
|
|
//点击x
|
|
$("#close_user_x").bind("click", function() {
|
|
if (localStorage.getItem("User") == null) {
|
|
clearTimeout(Downtime);
|
|
localStorage.removeItem("UserTime");
|
|
localStorage.removeItem("User");
|
|
$('#my_userModal').show();
|
|
} else {
|
|
$('#my_userModal').show();
|
|
}
|
|
});
|
|
|
|
|
|
$("#new_exceptions_pers").bind("click", function() {
|
|
$('#my_exceptions').modal({
|
|
//点击背景不关闭
|
|
backdrop: "static",
|
|
//触发键盘esc事件时不关闭
|
|
keyboard: false
|
|
});
|
|
if (localStorage.getItem("exceptions") == null) {
|
|
let endMsRes = new Date().getTime() + 10000; //当前时间戳加上一分钟的时间戳,相当于当前时间一分钟以后的时间戳
|
|
localStorage.setItem("ExceptionsTime", JSON.stringify(endMsRes));
|
|
CountDown(endMsRes, $("#btn_exceptions"), "ExceptionsTime");
|
|
}
|
|
});
|
|
|
|
//点击查看免责条款
|
|
$("#new_exceptions").bind("click", function() {
|
|
$('#my_exceptions').modal({
|
|
//点击背景不关闭
|
|
backdrop: "static",
|
|
//触发键盘esc事件时不关闭
|
|
keyboard: false
|
|
});
|
|
if (localStorage.getItem("exceptions") == null) {
|
|
let endMsRes = new Date().getTime() + 10000; //当前时间戳加上一分钟的时间戳,相当于当前时间一分钟以后的时间戳
|
|
localStorage.setItem("ExceptionsTime", JSON.stringify(endMsRes));
|
|
CountDown(endMsRes, $("#btn_exceptions"), "ExceptionsTime");
|
|
}
|
|
});
|
|
|
|
|
|
$("#btn_exceptions_disagree").bind("click", function() {
|
|
$('#my_exceptions').show();
|
|
clearTimeout(Downtime);
|
|
localStorage.removeItem("ExceptionsTime");
|
|
localStorage.removeItem("exceptions");
|
|
});
|
|
|
|
//点击x
|
|
$("#close_exceptions_x").bind("click", function() {
|
|
if (localStorage.getItem("exceptions") == null) {
|
|
clearTimeout(Downtime);
|
|
localStorage.removeItem("ExceptionsTime");
|
|
localStorage.removeItem("exceptions");
|
|
$('#my_exceptions').show();
|
|
} else {
|
|
$('#my_exceptions').show();
|
|
}
|
|
});
|
|
|