zoukankan      html  css  js  c++  java
  • 下次遇到这种游戏,这种抽奖你还点吗?

    http://mp.weixin.qq.com/s?__biz=MzAxMDEwOTg3Mw==&mid=202981537&idx=1&sn=217dbc2893930f65d220202ac2a6b57b#rd

     
    注意了,最终解释权在官方哦,我玩这个也纯属娱乐,不为iphone6. 自然没那么好拿。 但是,这个有那么多人玩,自然有它可取之处,吸引人的地方就是利用人的贪心和不忍心放弃。我写脚本测试,100次试验的最后结果是有无初次只差100块,你恨不得掏一百块现金给他们来补齐,但是对不起,下次点击的时候,一定会减掉500或者200,使你进入下一轮点击和无限接近iphone6.
     
    但是后台逻辑是封装的额,前段代码倒是简单的只要懂js的人都能改写,首先,url可以通过web访问,且未加密。更好玩的是js代码还带了注释!O(∩_∩)O哈哈~
     
     
     
    js代码嵌入到了html代码里,不要在chrome的工具 source下面找,发现根本找不到。
    代码全部内容如下:
     
    <script>
         //是不是本人
         var ifUser="false";
         var openid="osaFqs9irH-AOMhR4k5_H4lDTpPA";
         var servername="http://www.pinpaizzz.com";
         var residue=parseInt("-191");
         var shareaddr="http://mp.weixin.qq.com/s?__biz=MzAxMDEwOTg3Mw==&amp;mid=202981537&amp;idx=1&amp;sn=217dbc2893930f65d220202ac2a6b57b#rd";
         if(ifUser=="false"){
              //不是本人
              $(".mainpage").find(".js-user").html("这个小伙伴");
              $(".mainpage").find(".js-button").find(".addmoney,.concern").show();
         }else if(ifUser=="true"){
              //是本人
              $(".mainpage").find(".js-button").find(".addmoney,.begin").show();
         }
        
         $(".mainpage").find(".begin").click(function(){
              document.title="我的iphone6还差"+$("#money").html()+"元,帮我开奖时带点任性,我才有钱!";
              //分享遮罩层
              $("#sbg").attr("class","sbgshow");
         });
        
        
         if (residue > 0) {
              //开奖
              $(".mainpage").find(".addmoney").click(function() {
                   //访问后台为其加钱
                        //$("#addmoney").hide();
                        //$("#addloading").show();

                        $.ajax( {
                             url : "PrizeC.addmoney?openid=" + openid,
                             success : function(data) {
                                  if (data) {
                                       residue = residue - 1;
                                       if (0 == residue) {
                                            removeButton(".addmoney");
                                       } else {
                                            $("#residue").html(residue);
                                       }
                                       //$("#addloading").hide();
                                       $("#addmoney").show("fast").html(
                                                 "" + data.addmoney + "元!");
                                       refreshMoney();
                                  }
                             },
                             error : function() {
                                  alert(errorThrown);
                                  $(".js-button .addmoney").hide();
                             }

                        });
                   });
         }else{
              removeButton(".addmoney");
         }

         //引导关注
         $(".mainpage")
                   .find(".concern")
                   .click(
                             function() {
                                  window
                                            .open(shareaddr);
                             });

         //取消分享页面
         function sharecancel() {
              $("#sbg").attr("class", "sbg");
         }

         function removeButton(name) {
              $(name).off().css("background-color", "#ccc").find("p").html(
                        "今天"+(ifUser?"我的":"为ta")+"开奖的机会用完");
         }

         function refreshMoney() {
              $.ajax( {
                   url : "PrizeC.queryMoney?openid=" + openid,
                   success : function(data) {
                        if (data) {
                             $("#money").html(data.money);
                        }
                   }
              });
         }
        
        
         function querytotalmoney(){
              $("#qmbtn").hide();
              $.ajax( {
                   url : "PrizeC.queryTotalMoney?openid=" + openid,
                   success : function(data) {
                        if (data) {
                             $("#currentmoney").html(data.money);
                             $("#currentmoneydiv").show();
                        }
                   },
                   error:function(){
                        alert("查询失败");
                        $("#qmbtn").show();
                   }
                  
              });
         }
        
         function hidecurrmoneydiv(){
              $("#currentmoneydiv").hide();
              $("#qmbtn").show();
         }

         //开始这个众筹
         function beginGame() {
              $.ajax( {
                   url : "PrizeC.begin?openid=" + openid,
                   success : function(data) {

                   }
              });
         }

         //绑定微信关注返回事件
         _WXShare();
         function getTitle(){
              var tit="我的iphone6还差"+$("#money").html()+"元,帮我开奖时带点任性,我才有钱!";
              return tit;
         }
         /**分享*/
         function _WXShare(img, width, height, title, desc, url, appid) {
              //初始化参数
              img = img || servername+'/public/images/iphone/i6-comp-agent1.png';
              width = width || 100;
              height = height || 100;
              title = getTitle();
              desc = desc || document.title;
              url = url || document.location.href;
              appid = appid || '';
              //微信内置方法
              function _ShareFriend() {
                   beginGame();
                   WeixinJSBridge.invoke('sendAppMessage', {
                        'appid' : appid,
                        'img_url' : img,
                        'img_width' : width,
                        'img_height' : height,
                        'link' : url,
                        'desc' : desc,
                        'title' : document.title
                   }, function(res) {
                        _report('send_msg', res.err_msg);
                   });
              }
              function _ShareTL() {
                   beginGame();
                   WeixinJSBridge.invoke('shareTimeline', {
                        'img_url' : img,
                        'img_width' : width,
                        'img_height' : height,
                        'link' : url,
                        'desc' : desc,
                        'title' : document.title
                   }, function(res) {
                        _report('timeline', res.err_msg);
                   });
              }

              // 当微信内置浏览器初始化后会触发WeixinJSBridgeReady事件。
              document.addEventListener('WeixinJSBridgeReady',
                        function onBridgeReady() {
                             // 发送给好友
                        WeixinJSBridge.on('menu:share:appmessage', function(argv) {
                             _ShareFriend();
                        });
                        // 分享到朋友圈
                        WeixinJSBridge.on('menu:share:timeline', function(argv) {
                             _ShareTL();
                        });
                   }, false);
         }
    </script>
     
    整个页面的source 我也下载一下,打个包: 抽奖活动.zip 
     
     
    嘻嘻,我写了个脚本直接在console下面运行: 
    var residue = 100;
    addmoney =function() {
         $.ajax( {
         url : "PrizeC.addmoney?openid=" + openid,
         success : function(data) {
              if (data) {
                   residue = residue - 1;
                   if (0 == residue) {
                        removeButton(".addmoney");
                   } else {
                        $("#residue").html(residue);
                   }
                   //$("#addloading").hide();
                   $("#addmoney").show("fast").html(
                             "" + data.addmoney + "元!");
                   refreshMoney();

                   if(parseInt($("#money").html())<=0){
                        alert(done);
                        clearTimeout(tm);
                   }
              }
         },
         error : function() {
              alert(errorThrown);
              $(".js-button .addmoney").hide();
         }

         });
    }
    var tm = setTimeout(addmoney,30000);//间隔30秒钟执行a循环
     
    residue  不受后端控制,所以随意改啦,一天点击10000次为自己加钱也没关系啦,但是你不肯那个只加不减啦,逻辑在后台,不然iphone6 岂不是白白的就送了很多出去啦嘛。
    纪念一下下:  O(∩_∩)O哈哈~
    活动22号截止,我在想最终的获奖者会怎么产生呢??22号零点的那个?
    还是后台有其他的抽奖机制,随便送2个? 还是压根不会有人中奖啊?公布的名单是假的咯。
     
     
    by the way,  几个通过url  get方式进行查询,加钱的链接也贴出来:
     
    http://wxserver.aliapp.com/prize/PrizeC.mainpage?openid=osaFqs9irH-AOMhR4k5_H4lDTpPA  进入自己的活动页面,其实openid是接口,你的微信信息是cookie里自带的?  
     
     
  • 相关阅读:
    Identity Server 4 从入门到落地(六)—— 简单的单页面客户端
    Identity Server 4 从入门到落地(十一)—— Docker部署
    C# 脚本
    网站迁移纪实:从Web Form 到 Asp.Net Core (Abp vNext 自定义开发)
    Identity Server 4 从入门到落地(七)—— 控制台客户端
    Robot Framework 使用总结
    Asp.Net Core 使用Monaco Editor 实现代码编辑器
    Identity Server 4 从入门到落地(五)—— 使用Ajax访问Web Api
    C# RabbitMQ的使用
    创建VS Code 扩展插件
  • 原文地址:https://www.cnblogs.com/xiami303/p/4186790.html
Copyright © 2011-2022 走看看