分享一款绿色的微信手机抽奖模板,当然也支持手机浏览器,包括移动设备。微信里面的token是安全验证,程序验证请自行解决。
点击抽奖判断各种提示
$("#inner").click(function() {
if (running)
return;
if (count >= 3) {
alert("您已经抽了 3 次奖。");
return
}
if (prize != null) {
alert("亲,你不能再参加本次活动了喔!下次再来吧~");
return
}
$.ajax({url: "index.php", dataType: "json", data: {token: "o7MB9ji5fQRsE0ZoVAMU7SlnRyMI", ac: "activityuser", tid: "5", t: Math.random()}, beforeSend: function() {
running = true;
timer = setInterval(function() {
i += 5;
outter.style.webkitTransform = 'rotate(' + i + 'deg)';
outter.style.MozTransform = 'rotate(' + i + 'deg)'
}, 1)
}, success: function(data) {
if (data.error == "invalid") {
alert("您已经抽了 3 次奖。");
count = 3;
clearInterval(timer);
return
}
if (data.error == "getsn") {
alert('本次活动你已经中过奖,本次只显示你上次抽奖结果!兑奖SN码为:' + data.sn);
count = 3;
clearInterval(timer);
prize = data.prizetype;
sncode = data.sn;
start(prizeDeg[data.prizetype - 1]);
return
}
if (data.success) {
prize = data.prizetype;
sncode = data.sn;
start(prizeDeg[data.prizetype - 1])
} else {
prize = null;
start()
}
running = false;
count++
}, error: function() {
prize = null;
start();
running = false;
count++
}, timeout: 4000})
})
系统已开启自动识别垃圾评论机制,识别到的自动封号,下载出错或者资源有问题请联系全栈客服QQ 1915635791