投票系统,如何制作!
2018-07-31 17:16:47 | 分类:微信投票教程 | 评论:0人 | 浏览:1,671次
- 正文内容
- 我来说两句:(已有0人参与)
投票活动快速互投提升票数请加— —纯人工互投提升票数数量.互相投票以娱乐为主!
目前网上的一些、微信投票、网络投票、微博投票很流行,大家都是在寻找微信投票系统来辅助拉票,小编在网上测试过找了一些投票系统基本上都是不能使用的,纠结了很久还是自己来写投票系统,今天就把投票的系统代码分享给大家,让大家在参加投票娱乐活动的时候,可以轻松玩耍。
投票系统源码:
-
//投票系统执行脚本
-
function init(){
-
initIp();
-
//定时操作,每秒执行一次
-
function demo(){
-
}setInterval(“init()”,1000);
-
//随机生成以ovgMdt开头的27位微信openid(字母大小写+数字)
-
function createNum(){
-
var str = “ovgMdt”,
-
range = 21,
-
arr = [ ‘a’, ‘b’, ‘c’, ‘d’, ‘e’, ‘f’, ‘g’, ‘h’, ‘i’, ‘j’, ‘k’, ‘l’, ‘m’, ‘n’, ‘o’, ‘p’, ‘q’, ‘r’, ‘s’, ‘t’, ‘u’, ‘v’, ‘w’, ‘x’, ‘y’, ‘z’, ‘A’, ‘B’, ‘C’, ‘D’, ‘E’, ‘F’, ‘G’, ‘H’, ‘I’, ‘J’, ‘K’, ‘L’, ‘M’, ‘N’, ‘O’, ‘P’, ‘Q’, ‘R’, ‘S’, ‘T’, ‘U’, ‘V’, ‘W’, ‘X’, ‘Y’, ‘Z”0’, ‘1’, ‘2’, ‘3’, ‘4’, ‘5’, ‘6’, ‘7’, ‘8’, ‘9’,];
-
// 随机产生
-
for(var i=0; i<range; i++){
-
pos = Math.round(Math.random() * (arr.length-1));
-
str += arr[pos];
-
}
-
return str;
-
}
-
//提交投票请求
-
function initIp(){
-
var ip=createIp();
-
var num=createNum();
-
var $toopenid=‘ovgMdtSysi89sfInf0pdfg5T’;
-
var submitData = {
-
toopenid: $toopenid,
-
openid: num
-
};
-
$.ajax({
-
headers:{‘x-forwarded-for’:ip,‘WL-Proxy-Client-IP’:ip},
-
type: “POST”,
-
url: “xxxxxxxxxxxxxx”,
-
data: submitData,
-
dataType: “json”,
-
beforeSend: function () {},
-
success: function (data) {
-
if (data.code == 0) {
-
$(“#”+$toopenid).text(data.vote);
-
if(data.today_vote >= 2){
-
$(“.vote”).addClass(“red”);
-
}
-
$(“#”+$toopenid).parent().find(“.plus”).css({“top”:“186px”,“opacity”:0});
-
$(“#”+$toopenid).parent().find(“.plus”).stop().animate({“top”:“176px”,“opacity”:1},300,“swing”).animate({“opacity”:0},100);
-
} else {
-
alert(data.msg);
-
//生成随机的ip地址
-
function createIp() {
-
var a = Math.round(Math.random() * 250) + 1,
-
b = Math.round(Math.random() * 250) + 1,
-
c = Math.round(Math.random() * 240) + 1,
-
d = Math.round(Math.random() * 240) + 1;
-
return [a, b, c, d].join(‘.’);
-
}
大家可以把源码直接进行封包后进行解压使用,这套投票的系统还包含了账号注册,所以比较好用,小编的分享希望对大家有帮助!
版权说明:文章均为海王信投票专家原创,转载本文请注明出处和附带本文链接:https://www.aivtp.com/4228.html
上一篇: 微信投票刷票安全,是真的吗?
下一篇:投票软件,如何编写?