123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta content="名榜" http-equiv="keywords">
- <meta name="description" content="名榜,wangid">
- <meta name="viewport" content="width=device-width,user-scalable=no, initial-scale=1">
- <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
- <title>注册页面</title>
- <script type="text/javascript" src="https://cdnjs.gtimg.com/cdnjs/libs/jquery/2.1.1-rc2/jquery.min.js"></script>
- <style>
- @charset "utf-8";
- /*重置*/
- body,
- h1,
- p{
- margin: 0;
- padding: 0;
- }
- input,
- select,
- form,
- button {
- border: none;
- margin: 0;
- outline: none;
- padding: 0;
- appearance: none;
- }
- h1{
- font-weight: normal;
- }
- img {
- border: none;
- }
- a {
- text-decoration: none;
- }
- * {
- font: normal 10px/100% "Helvetica Neue", Helvetica, Arial, sans-serif;
- }
- body,
- html {
- width: 100%;
- height: 100%;
- }
- body {
- background-color: #f0f0f0;
- }
- @media screen and (min-width: 320px) {
- html {
- font-size: 50px;
- }
- }
- @media screen and (min-width: 360px) {
- html {
- font-size: 56.25px;
- }
- }
- @media screen and (min-width: 375px) {
- html {
- font-size: 58.59375px;
- }
- }
- @media screen and (min-width: 400px) {
- html {
- font-size: 62.5px;
- }
- }
- @media screen and (min-width: 414px) {
- html {
- font-size: 64.6875px;
- }
- }
- @media screen and (min-width: 440px) {
- html {
- font-size: 68.75px;
- }
- }
- @media screen and (min-width: 480px) {
- html {
- font-size: 75px;
- }
- }
- @media screen and (min-width: 520px) {
- html {
- font-size: 81.25px;
- }
- }
- @media screen and (min-width: 560px) {
- html {
- font-size: 87.5px;
- }
- }
- @media screen and (min-width: 600px) {
- html {
- font-size: 93.75px;
- }
- }
- @media screen and (min-width: 640px) {
- html {
- font-size: 100px;
- }
- }
- @media screen and (min-width: 680px) {
- html {
- font-size: 106.25px;
- }
- }
- @media screen and (min-width: 720px) {
- html {
- font-size: 112.5px;
- }
- }
- @media screen and (min-width: 760px) {
- html {
- font-size: 118.75px;
- }
- }
- @media screen and (min-width: 800px) {
- html {
- font-size: 125px;
- }
- }
- @media screen and (min-width: 960px) {
- html {
- font-size: 150px;
- }
- }
- /*top*/
- .topbox {
- position: relative;
- text-align: left;
- padding: 0 2%;
- height: .88rem;
- z-index: 10;
- }
- .topmain {
- overflow: hidden;
- text-align: left;
- width: 90%;
- margin: 0 auto;
- }
- .topmain h1 {
- display: inline-block;
- font-size: .40rem;
- line-height: .40rem;
- color: #666;
- margin-top: 10%;
- }
- .conbox {
- padding: 0 2%;
- }
- .conmain {
- padding-bottom: 5%;
- }
- .conmain form {
- width: 90%;
- margin: 0 auto;
- }
- .conmain form>div {
- margin-bottom: 3%;
- }
- .conmain form>div input {
- width: 96%;
- padding: 3.6% 2%;
- line-height: .3rem;
- font-size: .26rem;
- border: #ccc solid 1px;
- border-radius: .1rem;
- appearance: button;
- -moz-appearance: button;
- -webkit-appearance: button;
- }
- .conmain form>div input:focus {
- border: #2c8fcd solid 1px;
- }
- .conmain form>div.win_yzm input {
- width: 56%;
- margin-right: 2%;
- vertical-align: middle;
- }
- .conmain form>div.win_yzm label {
- display: inline-block;
- vertical-align: middle;
- border: #ccc solid 1px;
- width: 36.5%;
- text-align: center;
- padding: 3.6% 0;
- line-height: .3rem;
- background-color: #fff;
- border-radius: .1rem;
- font-size: .26rem;
- }
- .conmain form button {
- font-size: .32rem;
- width: 100%;
- background-color: #2c8fcd;
- color: #fff;
- padding: 4% 0;
- border-radius: .1rem;
- margin-top: 5%;
- }
- /*注册*/
- .register h2 {
- color: #666;
- font-size: .24rem;
- margin: 6% 0;
- }
- .register p {
- margin: 2% 0;
- padding-top: 2%;
- font-size: .24rem;
- }
- .register p a {
- color: #2c8fcd;
- font-size: .24rem;
- }
- #msg{
- color: red;
- font-size: .24rem;
- height: .30rem;
- }
- .msg-active{
- color: blue !important;
- }
- </style>
- </head>
- <body>
- <div class="topbox">
- <div class="topmain">
- <h1>注册</h1>
- </div>
- </div>
- <div class="conbox">
- <div class="conmain register">
- <h2></h2>
- <form>
- <div id="msg" class="msg-active"></div>
- <div>
- <input type="text" id="phone" placeholder="请输入手机号"/>
- </div>
- <div class="win_yzm">
- <input type="text" id="captchaCode" placeholder="请输入验证码"/><label id="fs" class="code">发送验证码</label>
- </div>
- <div>
- <input type="password" id="password1" placeholder="请输入您的密码"/>
- </div>
- <div>
- <input type="password" id="password2" placeholder="请再次输入您的密码"/>
- </div>
- <div style="display: none;">
- <input type="text" id="captchaId" placeholder="id"/>
- </div>
- <div>
- <input type="text" placeholder="请输入邀请码" id="inviteCode" disabled="disabled" value="000000"/>
- </div>
- <p>阅读<a href="#">《用户协议及隐私政策》</a></p>
- <button id="submit" type="button">同意以上协议并注册</button>
- <p>注册完成,<a href="https://www.pgyer.com/IzWp">下载安装包</a></p>
- </form>
- </div>
- </div>
- <script type="text/javascript">
- //获取url中的参数
- function getUrlParam(name) {
- var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
- var r = window.location.search.substr(1).match(reg); //匹配目标参数
- if (r != null) return unescape(r[2]); return null; //返回参数值
- }
- $(function(){
- var inviteCode = getUrlParam("code");
- $("#inviteCode").val(inviteCode);
- })
- $("#fs").on("click",function(){
- var phone = $("#phone").val();
- $("#msg").html("");
- if(phone == ""){
- $("#msg").html("请输入手机号!");
- return true;
- }
- $.ajax({
- type:"post",
- url: "/api/v1/common/send-validate?phone=" + phone,
- contentType: "application/json;charset=utf-8",//这个参数也是header参数
- headers: {
- "Tenant-Id": "000000",
- "Authorization": "Basic c3dvcmQ6c3dvcmRfc2VjcmV0"
- },
- success: function(res){
- var msg = res.msg;
- $("#msg").html(msg);
- $("#msg").attr("class","msg-active");
- if(res.code == 200){
- var data = res.data;
- var captchaId = data.id;
- $("#captchaId").val(captchaId);
- }
- },
- error: function(){
- $("#msg").html("网络异常,请稍等...!");
- }
- })
- })
- //请求
- $("#submit").on("click", function(){
- var inviteCode = $("#inviteCode").val();
- var captchaId = $("#captchaId").val();
- var phone = $("#phone").val();
- var captchaCode = $("#captchaCode").val();
- var password1 = $("#password1").val();
- var password2 = $("#password2").val();
- $("#msg").html("");
- if(phone == ""){
- $("#msg").html("请输入手机号!");
- return true;
- }
- if(captchaCode == ""){
- $("#msg").html("请输入验证码!");
- return true;
- }
- if(password1 == ""){
- $("#msg").html("请输入密码!");
- return true;
- }
- if(password2 == ""){
- $("#msg").html("请输入密码!");
- return true;
- }
- if(password1 != password2){
- $("#msg").html("两次输入的密码不一致!");
- return true;
- }
- //请求参数
- var param = "phone=" + phone + "&inviteCode=" + inviteCode + "&password=" + password1 + "&captchaCode=" + captchaCode + "&captchaId=" + captchaId;
- $.ajax({
- type:"post",
- url: "/api/v1/user-register?" + param,
- contentType: "application/json;charset=utf-8",//这个参数也是header参数
- headers: {
- "Tenant-Id": "000000",
- "Authorization": "Basic c3dvcmQ6c3dvcmRfc2VjcmV0"
- },
- success: function(res){
- var msg = res.msg;
- $("#msg").html(msg);
- $("#msg").attr("class","msg-active");
- },
- error: function(){
- $("#msg").html("注册失败,请联系管理员!");
- }
- })
- return true;
- })
- </script>
- </body>
- </html>
|