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.
 
 
 
 
 
 

158 lines
4.9 KiB

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
  6. <title>免费巴士自由行 | 蜘蛛免单 VOL.1</title>
  7. <style type="text/css">
  8. *{margin:0px;padding: 0px;font-family: "黑体";}
  9. .main{width:100%;overflow: hidden;}
  10. .jiangpin{width:100%;height: 183px;margin-bottom: 5px;}
  11. .shuoming{width:100%;text-align: center;font-size: 14px;margin-bottom: 5px;}
  12. .tishi{width: 100%;text-align: center;font-size: 16px;margin-top:10px;}
  13. .xianleft{position:absolute;height: 2px;background: #E2E2E2;width:60px;left:3.5%;top:9px;}
  14. .xianright{position:absolute;height: 2px;background: #E2E2E2;width:60px;right:3.5%;top:9px;}
  15. .moblie{width:100%;text-align: center;margin-top:20px;}
  16. .moblie span{font-size: 16px;}
  17. #moblienum{width: 38%;height: 20px;border:2px solid #CCCCCC;border-radius: 5px;padding-left: 1em;font-size:15px;}
  18. .ps{margin-left:3.5%;margin-right: 3.5%;text-align: center;color:#9d9d9d;margin-top:13px;line-height: 22px;margin-bottom:50px;}
  19. .anniu{width: 100%;margin:auto;height: 40px;color: #FFFFFF;background: #33d6b0;text-align: center;line-height: 40px;font-size: 18px;position: fixed;bottom:0px;}
  20. </style>
  21. <!-- 百度统计star -->
  22. <script>
  23. var _hmt = _hmt || [];
  24. (function() {
  25. var hm = document.createElement("script");
  26. hm.src = "//hm.baidu.com/hm.js?3d4ede42cef05a99fcd8bda849831ada";
  27. var s = document.getElementsByTagName("script")[0];
  28. s.parentNode.insertBefore(hm, s);
  29. })();
  30. </script>
  31. <!-- 百度统计end -->
  32. </head>
  33. <body id="body">
  34. <div class="main" id="main" >
  35. <img class="jiangpin" src="img/qiandaohu.jpg"/>
  36. <div class="shuoming">千岛湖</div>
  37. <img class="jiangpin" src="img/fo3.jpg"/>
  38. <div class="shuoming">普陀山</div>
  39. <div style="position: relative;">
  40. <div class="xianleft"></div>
  41. <div class="tishi">请输入手机号参与报名</div>
  42. <div class="xianright"></div>
  43. </div>
  44. <input type="hidden" id="yonghuid" value=""/>
  45. <div class="moblie">
  46. <span>手机号</span>
  47. <input id="moblienum" type="text" />
  48. </div>
  49. <div class="ps">中奖信息将发至手机,请如实填写!</div>
  50. <div class="anniu" id="anniu" >参加抽奖</div>
  51. </div>
  52. </body>
  53. <script>
  54. var moblienum=document.getElementById("moblienum");
  55. var yonghuid=document.getElementById("yonghuid");
  56. var myform=document.getElementById("myform");
  57. var anniu=document.getElementById("anniu");
  58. var regtel=/(13\d|14[57]|15[^4,\D]|17[678]|18\d)\d{8}|170[059]\d{7}/;
  59. anniu.onclick=function(){
  60. if(regtel.test(moblienum.value)&&moblienum.value.length==11){
  61. var str = moblienum.value;
  62. var openid = yonghuid.value;
  63. // var xhr = new XMLHttpRequest();
  64. // xhr.open("POST","http://wx.zhizhuchuxing.com/wechat/jssdk/lotteryinfo.php?openidtel="+str,true);
  65. // xhr.send(null);
  66. // xhr.onload = function(){
  67. // console.log(xhr.responseText);
  68. ajax({
  69. method : 'post',
  70. url : 'http://wx.zhizhuchuxing.com/wechat/jssdk/lotteryinfo.php',
  71. data : str+openid,
  72. //data : {str:str,aa:openid},
  73. success : function (text) {
  74. var jieguo=JSON.parse("text")
  75. if(jieguo.errorcode==0){
  76. alert(jieguo.errorinfo);
  77. window.location.href = "http://wx.zhizhuchuxing.com/wechat/jssdk/lotteryinfo.php";
  78. }else{
  79. alert(jieguo.errorinfo);
  80. }
  81. },
  82. async : true
  83. });
  84. }
  85. else{
  86. alert("请输入正确手机号!");
  87. return false;
  88. }
  89. }
  90. function createXHR() {
  91. if (typeof XMLHttpRequest != 'undefined') {
  92. return new XMLHttpRequest();
  93. } else if (typeof ActiveXObject != 'undefined') {
  94. var version = [
  95. 'MSXML2.XMLHttp.6.0',
  96. 'MSXML2.XMLHttp.3.0',
  97. 'MSXML2.XMLHttp'
  98. ];
  99. for (var i = 0; version.length; i ++) {
  100. try {
  101. return new ActiveXObject(version[i]);
  102. } catch (e) {
  103. //跳过
  104. }
  105. }
  106. } else {
  107. throw new Error('您的系统或浏览器不支持XHR对象!');
  108. }
  109. }
  110. function ajax(obj) {
  111. var xhr = createXHR();
  112. obj.url = obj.url + '?rand=' + Math.random();
  113. //console.log(obj.data)
  114. if (obj.method === 'get') obj.url += obj.url.indexOf('?') == -1 ? '?' + obj.data : '&' + obj.data;
  115. if (obj.async === true) {
  116. xhr.onreadystatechange = function () {
  117. if (xhr.readyState == 4) {
  118. callback();
  119. }
  120. };
  121. }
  122. xhr.open(obj.method, obj.url, obj.async);
  123. if (obj.method === 'post') {
  124. xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
  125. xhr.send(obj.data);
  126. } else {
  127. xhr.send(null);
  128. }
  129. if (obj.async === false) {
  130. callback();
  131. }
  132. function callback() {
  133. if (xhr.status == 200) {
  134. obj.success(xhr.responseText); //回调传递参数
  135. } else {
  136. alert('获取数据错误!错误代号:' + xhr.status + ',错误信息:' + xhr.statusText);
  137. }
  138. }
  139. }
  140. //名值对转换为字符串
  141. function params(data) {
  142. var arr = [];
  143. for (var i in data) {
  144. arr.push(encodeURIComponent(i) + '=' + encodeURIComponent(data[i]));
  145. }
  146. return arr.join('&');
  147. }
  148. </script>
  149. </html>