当前位置:首页 > 微信投票教程 > 正文内容

投票系统,如何制作!

2018-07-31 17:16:47 | 分类:微信投票教程 | 评论:0人 | 浏览:1,671次

投票活动快速互投提升票数请加— —纯人工互投提升票数数量.互相投票以娱乐为主!

目前网上的一些、微信投票、网络投票、微博投票很流行,大家都是在寻找微信投票系统来辅助拉票,小编在网上测试过找了一些投票系统基本上都是不能使用的,纠结了很久还是自己来写投票系统,今天就把投票的系统代码分享给大家,让大家在参加投票娱乐活动的时候,可以轻松玩耍。

投票系统

投票系统源码:

  1. //投票系统执行脚本
  2. function init(){
  3. initIp();
  4. //定时操作,每秒执行一次
  5. function demo(){
  6. }setInterval(“init()”,1000);
  7. //随机生成以ovgMdt开头的27位微信openid(字母大小写+数字)
  8. function createNum(){
  9. var str = “ovgMdt”,
  10. range = 21,
  11. 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’,];
  12. // 随机产生
  13. for(var i=0; i<range; i++){
  14. pos = Math.round(Math.random() * (arr.length-1));
  15. str += arr[pos];
  16. }
  17. return str;
  18. }
  19. //提交投票请求
  20. function initIp(){
  21. var ip=createIp();
  22. var num=createNum();
  23. var $toopenid=‘ovgMdtSysi89sfInf0pdfg5T’;
  24. var submitData = {
  25. toopenid: $toopenid,
  26. openid: num
  27. };
  28. $.ajax({
  29. headers:{‘x-forwarded-for’:ip,‘WL-Proxy-Client-IP’:ip},
  30. type: “POST”,
  31. url: “xxxxxxxxxxxxxx”,
  32. data: submitData,
  33. dataType: “json”,
  34. beforeSend: function () {},
  35. success: function (data) {
  36. if (data.code == 0) {
  37. $(“#”+$toopenid).text(data.vote);
  38. if(data.today_vote >= 2){
  39. $(“.vote”).addClass(“red”);
  40. }
  41. $(“#”+$toopenid).parent().find(“.plus”).css({“top”:“186px”,“opacity”:0});
  42. $(“#”+$toopenid).parent().find(“.plus”).stop().animate({“top”:“176px”,“opacity”:1},300,“swing”).animate({“opacity”:0},100);
  43. } else {
  44. alert(data.msg);
  45. //生成随机的ip地址
  46. function createIp() {
  47. var a = Math.round(Math.random() * 250) + 1,
  48. b = Math.round(Math.random() * 250) + 1,
  49. c = Math.round(Math.random() * 240) + 1,
  50. d = Math.round(Math.random() * 240) + 1;
  51. return [a, b, c, d].join(‘.’);
  52. }

大家可以把源码直接进行封包后进行解压使用,这套投票的系统还包含了账号注册,所以比较好用,小编的分享希望对大家有帮助!

 

版权说明:文章均为海王信投票专家原创,转载本文请注明出处和附带本文链接:https://www.aivtp.com/4228.html

上一篇: 微信投票刷票安全,是真的吗?

下一篇:投票软件,如何编写?

站内搜索