register.html 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport">
  6. <meta content="yes" name="apple-mobile-web-app-capable">
  7. <meta content="black" name="apple-mobile-web-app-status-bar-style">
  8. <meta content="telephone=no" name="format-detection">
  9. <title>注册</title>
  10. <link rel="stylesheet" type="text/css" href="images/style.css"/>
  11. <link rel="stylesheet" href="https://cdn.bootcss.com/weui/1.1.3/style/weui.min.css">
  12. <link rel="stylesheet" href="https://cdn.bootcss.com/jquery-weui/1.2.1/css/jquery-weui.min.css">
  13. <style>
  14. .weui-cells::before {
  15. display: none;
  16. }
  17. </style>
  18. </head>
  19. <body>
  20. <div class="warp" style="background: #fff">
  21. <div class="weui-cells weui-cells_form" style="margin-top: 0px;">
  22. <form id="registerForm">
  23. <div class="weui-cell ">
  24. <div class="weui-cell__hd">
  25. <label class="weui-label">手机号</label>
  26. </div>
  27. <div class="weui-cell__bd">
  28. <input name="phone" class="weui-input" type="tel">
  29. </div>
  30. <!--<div class="weui-cell__ft">-->
  31. <!--<button class="weui-vcode-btn">获取验证码</button>-->
  32. <!--</div>-->
  33. </div>
  34. <div class="weui-cell">
  35. <div class="weui-cell__hd"><label for="birthDate" class="weui-label">生日</label></div>
  36. <div class="weui-cell__bd">
  37. <input id="birthDate" name="birthDate" type="text">
  38. </div>
  39. </div>
  40. <div class="weui-cell">
  41. <div class="weui-cell__hd"><label class="weui-label">昵称</label></div>
  42. <div class="weui-cell__bd">
  43. <input name="nickName" class="weui-input" type="text">
  44. </div>
  45. </div>
  46. <div class="weui-cell">
  47. <div class="weui-cell__hd"><label class="weui-label">性别</label></div>
  48. <label class="weui-cell" style="padding: 0px;position: static;">
  49. <div class="weui-cell__bd weui-cells_checkbox">
  50. <input type="radio" class="weui-check" name="sex" value="1">
  51. <i class="weui-icon-checked"></i>
  52. </div>
  53. <div class="weui-cell__bd">
  54. <p>男</p>
  55. </div>
  56. </label>
  57. <label class="weui-cell" style="padding: 0px 0px 0px 15px;position: static;">
  58. <div class="weui-cell__bd weui-cells_checkbox">
  59. <input type="radio" class="weui-check" name="sex" value="2">
  60. <i class="weui-icon-checked"></i>
  61. </div>
  62. <div class="weui-cell__bd">
  63. <p>女</p>
  64. </div>
  65. </label>
  66. </div>
  67. </form>
  68. <div class="weui-btn-area">
  69. <a class="weui-btn weui-btn_primary" href="javascript:" onclick="submit();">提交</a>
  70. </div>
  71. </div>
  72. </div>
  73. <script src="js/jquery-3.2.1.js"></script>
  74. <script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
  75. <script src="js/global.js"></script>
  76. <script src="https://cdn.bootcss.com/jquery/1.11.0/jquery.min.js"></script>
  77. <script src="https://cdn.bootcss.com/jquery-weui/1.2.1/js/jquery-weui.min.js"></script>
  78. <script src="https://cdn.bootcss.com/jquery-weui/1.2.1/js/swiper.min.js"></script>
  79. <script src="https://cdn.bootcss.com/jquery-weui/1.2.1/js/city-picker.min.js"></script>
  80. <script type="text/javascript">
  81. $("#birthDate").calendar();
  82. function submit() {
  83. $.showLoading('数据提交中');
  84. //获取js-sdk签名
  85. createJsapiSignature(currentUrl);
  86. //config信息验证成功后会执行ready方法
  87. wx.ready(function() {
  88. getLocation(
  89. function (latitude,longitude) {
  90. var arr = $("#registerForm").serializeArray();
  91. arr.push({name:"openId",value:getUrlParam("openid")},{name:"latitude",value:latitude},{name:"longitude",value:longitude});
  92. var json = {};
  93. $.each(arr, function () {
  94. json[this.name] = this.value;
  95. });
  96. $.ajax({
  97. url: api+"marketing/weixin/terminalUser",
  98. type: "PUT",
  99. data: {
  100. abbreviationName:abbreviationName,
  101. json:JSON.stringify(json)
  102. },
  103. success: function (data) {
  104. $.hideLoading();
  105. if (data.code == 0) {
  106. $.toast(data.msg);
  107. hrefIndex();
  108. }
  109. },
  110. error: function (data) {
  111. $.hideLoading();
  112. $.toast("请求失败", "cancel");
  113. }
  114. });
  115. }
  116. );
  117. });
  118. //config信息验证失败后会执行error方法
  119. wx.error(function(res){
  120. alert("获取凭据失败:"+res);
  121. });
  122. }
  123. </script>
  124. </body>
  125. </html>