123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <meta content="yes" name="apple-mobile-web-app-capable">
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,minimum-scale=1.0,user-scalable=0" />
- <title>账本邀请</title>
- <link rel="stylesheet" type="text/css" href="public/public_css.css"/>
- <style type="text/css">
- body{
- background: #ffffff;
- }
- .userImg{
- width: 0.87rem;
- height: 0.87rem;
- border-radius: 50%;
- margin: auto;
- margin-top: 0.41rem;
- margin-bottom: 0.22rem;
- }
- .inviting{
- max-width: 2.4rem;
- text-align: center;
- font-size: 0.16rem;
- color: #878787;
- line-height: 0.22rem;
- margin: auto;
- margin-bottom: 0.37rem;
- }
- .inviting text{
- color:#646464;
- }
- .label{
- color: #444444;
- font-size: 0.16rem;
- display: inline-block;
- width: 0.55rem;
- }
- input{
- border: none;
- font-size: 0.16rem;
- outline: none;
- margin-left: 0.16rem;
- }
- .tel{
- width: 3.2rem;
- margin: auto;
- border-bottom: 0.01rem solid #D8D8D8;
- margin-top: 0.16rem;
- padding-bottom: 0.05rem;
- }
- .forget_password{
- display: inline-block;
- color: #666666;
- font-size: 0.14rem;
- line-height: 0.2rem;
- /*margin-left: 0.3rem;*/
- margin-top: 0.16rem;
- }
- .forget{
- display: flex;
- justify-content: space-between;
- width: 3.2rem;
- margin: auto;
- }
- .forget span{
- display: inline-block;
- color: #666666;
- font-size: 0.14rem;
- line-height: 0.2rem;
- margin-left: 0.3rem;
- margin-top: 0.16rem;
- }
- .forget span b{
- font-weight: normal;
- color: #FFE100;
- }
- .button{
- width: 2.18rem;
- height: 0.41rem;
- border-radius: 0.26rem;
- background: #FFE100;
- color: #FFFFFF;
- box-shadow:0px 0.02rem 0px rgba(251,179,179,0.5);
- font-size: 0.2rem;
- margin: auto;
- margin-top: 0.56rem;
- display: block;
- }
- .other{
- color: #999999;
- font-size: 0.14rem;
- line-height: 0.2rem;
- margin-top: 0.45rem;
- text-align: center;
- }
- .register_weixin{
- width: 0.6rem;
- height: 0.6rem;
- margin: auto;
- }
- .mobilePhone,.pass_word{
- display: none;
- font-size: 0.14rem;
- color: red;
- margin-left: 0.9rem;
- margin-top: 0.10rem;
- margin-bottom: -0.10rem;
- }
- </style>
- </head>
- <body>
- <img class="userImg" src="image/logo.png" />
- <p class="inviting">Hi,我是<text>小小小零首付</text>,邀请你加入《<span>旅行账本</span>》一起记账</p>
- <p class="mobilePhone">请输入手机号</p>
- <div class="tel"><div class="label">手机号</div><input id="mobile" type="tel" placeholder="请输入手机号" onchange="mobilePhoneEvent()"/></div>
- <p class="pass_word">请输入密码</p>
- <div class="tel"><div class="label">密码</div><input id="pwd" type="password" placeholder="请输入密码" onchange="passwordEvent()"/></div>
- <div class="forget"><text class="forget_password" onclick="goForgetPassword()">忘记密码?</text><span>没有账号?<b onclick="addWeixin()">立即注册</b></span></div>
- <button class="button" onclick="goAddSuccess()">立即加入</button>
- <div class="other">——其他方式——</div>
- <img onclick="addWeixin()" src="image/weixin.png" class="register_weixin"/>
-
- <div class="mask">
- <div class="content">
- <h3>提示</h3>
- <p>密码错误啊啊啊啊啊</p>
- <div onclick="iknow()">我知道了</div>
- </div>
- </div>
-
- </body>
- </html>
- <script type="text/javascript" src="public/qs.js"></script>
- <script type="text/javascript" src="public/jquery-2.1.0.js"></script>
- <script type="text/javascript">
- document.documentElement.style.fontSize = 100 * (document.documentElement.clientWidth/375) + "px";
- window.onresize = function(){
- document.documentElement.style.fontSize = 100 * (document.documentElement.clientWidth/375) + "px";
- }
- var flagButton = false;
- var book_id = '';
- // var openid = '';
- // var unionid = '';
- var wechat = '';
- var userName = '';
- var userImg = '';
- var appUrl = '';
- var cid = '';
- var accountBook = '';
- var str=location.href; //取得整个地址栏
- localStorage.setItem('addUrl',str)
- var num=str.indexOf("?");
- str=str.substr(num+1); //str得到?之后的字符串
- var brr=str.split("&");
- for(var i = 0 ; i<brr.length; i++){
- if(brr[i].indexOf('book_id') != -1){
- book_id = brr[i].split('=')[1];
- }
- if(brr[i].indexOf('cid') != -1){
- cid = brr[i].split('=')[1];
- }
- // if(brr[i].indexOf('openid') != -1){
- // openid = brr[i].split('=')[1];
- // }
- // if(brr[i].indexOf('unionid') != -1){
- // unionid = brr[i].split('=')[1];
- // }
- if(brr[i].indexOf('userName') != -1){
- userName = brr[i].split('=')[1];
- userName = decodeURI(userName);
- }
- if(brr[i].indexOf('user_url') != -1){
- userImg = brr[i].split('=')[1];
- userImg = decodeURIComponent(userImg)
- }
- if(brr[i].indexOf('appUrl') != -1){
- appUrl = brr[i].split('=')[1];
- appUrl = decodeURIComponent(appUrl)
- localStorage.setItem('appUrl',appUrl)
- }
- if(brr[i].indexOf('accountBook') != -1){
- accountBook = brr[i].split('=')[1];
- accountBook = decodeURI(accountBook)
- localStorage.setItem('accountBook',accountBook)
- }
- if(brr[i].indexOf('weChat') != -1){
- wechat = brr[i].split('=')[1];
- wechat = decodeURIComponent(wechat);
- }
- }
- window.onload = function () {
- var we_chat_Arr=wechat.split("&");
- var redirect_uri = '';
- for(var i = 0 ; i<we_chat_Arr.length; i++){
- if(we_chat_Arr[i].indexOf('redirect_uri') != -1){
- redirect_uri = we_chat_Arr[i].split('=')[1];
- redirect_uri = decodeURIComponent(redirect_uri)
- var redirect = redirect_uri + "?book_id=" + book_id + "&cid=" + cid;
- redirect = encodeURIComponent(redirect);
- we_chat_Arr[i] = "redirect_uri=" + redirect;
- }
- }
- wechat = we_chat_Arr.join("&")
- $(".inviting text").html(userName);
- if(userImg == ''){
- $(".userImg").attr("src","image/logo.png");
- }else{
- $(".userImg").attr("src",userImg);
- }
- $(".inviting span").html(accountBook)
- }
- function goAddSuccess() {
- if($("#mobile").val() == ''){
- $(".mobilePhone").css("display","block");
- $(".mobilePhone").html('请输入手机号');
- return
- }
- if($("#pwd").val() == ''){
- $(".pass_word").css("display","block");
- return
- }else{
- $(".pass_word").css("display","none");
- }
- mobilePhoneEvent();
- if(flagButton){
- var data = {
- "book_id":book_id,
- 'type':1,
- 'mobile':$("#mobile").val(),
- 'password':$("#pwd").val()
- }
- addMobile(data);
- }
- }
- function addWeixin(){
- window.location.href = wechat;
- }
-
-
- function goForgetPassword() {
- window.location.href="forgetPassword.html";
- }
- function iknow() {
- $(".mask").css("visibility","hidden");
- }
- function mobilePhoneEvent () {
- var teleNumber = $("#mobile").val();
- var myMobile=/^[0-9]{11}$/;
- if (!myMobile.test(teleNumber)) {
- //手机号码未填写及填写不正确
- $(".mobilePhone").css("display","block");
- $(".mobilePhone").html('手机号格式错误');
- flagButton = false;
- }else{
- $(".mobilePhone").css("display","none");
- flagButton = true;
- }
- }
-
- function passwordEvent () {
- if($("#pwd").val() == ''){
- $(".pass_word").css("display","block");
- return false;
- }else{
- $(".pass_word").css("display","none");
- }
- }
-
- function addMobile(data){
- $.ajax({
- type:"post",
- url:"/api/V1/shareBook",
- data: data,
- success: function (res) {
- console.log(JSON.parse(res))
- if(JSON.parse(res).code == 0){
- if(Boolean(JSON.parse(res).res)){
- window.location.href="addSuccess.html";
- localStorage.setItem('avatar',JSON.parse(res).res.avatar)
- localStorage.setItem('book_name',JSON.parse(res).res.book_name)
- localStorage.setItem('user_name',JSON.parse(res).res.user_name)
- }else{
- $(".mask").css("visibility","visible");
- $(".content p").html(JSON.parse(res).message[0]);
- }
- }else{
- var msg = JSON.parse(res).message[0]
- $(".mask").css("visibility","visible");
- if(msg.indexOf("password") != -1){
- msg = msg.replace('password', '密码');
- }
- $(".content p").html(msg);
- }
- }
- });
- }
- </script>
|