微信绑定页面

This commit is contained in:
cxt 2017-04-06 14:48:23 +08:00
parent 5ad25dcc9c
commit ad84bfffd7
6 changed files with 182 additions and 19 deletions

View File

@ -389,6 +389,12 @@ class AccountController < ApplicationController
render :json => req
end
def wechat_bind
respond_to do |format|
format.html { render :layout => "login_bigdata"}
end
end
def reset_psd
if request.get?
@user = User.where("phone = '#{params[:value]}' or mail = '#{params[:value]}'").first

View File

@ -11,10 +11,10 @@
<div class="new_login_box clearfix">
<ul class="new_login_weixin clearfix">
<p class="" style="text-align: center; font-size: 18px;">登录</p>
<!--<li id="login_weixin_nav_1" class="login_weixin_nav_hover" onclick="HoverLi(1);">-->
<!--<li id="login_weixin_nav_1" class="login_weixin_nav_hover" onclick="bigDataHoverLi(1);">-->
<!--<a href="javascript:void(0);" class="login_weixin_nav_nomal" ><i class="fa fa-qrcode mr10 mt3 font-16"></i>扫码登录</a>-->
<!--</li>-->
<!--<li id="login_weixin_nav_2" onclick="HoverLi(2);" >-->
<!--<li id="login_weixin_nav_2" onclick="bigDataHoverLi(2);" >-->
<!--<a href="javascript:void(0);" class="login_weixin_nav_nomal" ><i class="fa fa-desktop mr10 mt3 "></i>密码登录</a>-->
<!--</li>-->
</ul>

View File

@ -10,10 +10,10 @@
<div class="new_login_con">
<div class="new_login_box clearfix">
<ul class="new_login_weixin fl" >
<li id="login_weixin_nav_1" class="login_weixin_nav_hover" onclick="HoverLi(1);">
<li id="login_weixin_nav_1" class="login_weixin_nav_hover" onclick="bigDataHoverLi(1);">
<a href="javascript:void(0);" class="login_weixin_nav_nomal"><i class="fa fa-mobile-phone font-16 mr10 mt3"></i>手机注册</a>
</li>
<li id="login_weixin_nav_2" onclick="HoverLi(2);" >
<li id="login_weixin_nav_2" onclick="bigDataHoverLi(2);" >
<a href="javascript:void(0);" class="login_weixin_nav_nomal"><i class="fa fa-envelope-o font-16 mr10 mt3"></i>邮箱注册</a>
</li>
</ul>
@ -26,9 +26,9 @@
<%= error_messages_for 'user' %>
<input type="text" name="none_name" style="display: none">
<input type="password" name="none_psw" style="display: none">
<ul >
<li class="new_loggin_users ">
<i class="fa fa-mobile-phone font-16 ml10 color-grey"></i>
<ul>
<li class="new_loggin_users">
<i class="fa fa-mobile-phone font-16 ml10 color-grey"></i>
<input type="text" id="user_phone_num" name="user[phone]" class="new_loggin_input" autocomplete="off" placeholder="请输入手机号码">
<i class="fa font-16 mr5" id="user_phone_check"></i>
<div class="new-login-error" style="display: none;">
@ -36,7 +36,7 @@
</div>
</li>
<li class="new_loggin_users">
<i class="fa fa-lock font-16 ml10 color-grey"></i>
<i class="fa fa-lock font-16 ml10 color-grey"></i>
<input type="text" onfocus="this.type='password'" class="new_loggin_input" style="width: 292px;" name="user[password]" id="user_password_1" autocomplete="off" placeholder="密码至少由8位由字母或特殊符号和数字结合">
<i class="fa font-16 mr5" id="user_password_1_check"></i>
<div class="new-login-error" style="display: none;">
@ -128,17 +128,6 @@
}
};
$('#drag').drag();
function g(o){
return document.getElementById(o);
}
function HoverLi(n){
for(var i=1;i<=2;i++){
g('login_weixin_nav_'+i).className='login_weixin_nav_nomal';
g('login_weixin_content_'+i).className='undis';
}
g('login_weixin_nav_'+n).className='login_weixin_nav_hover';
g('login_weixin_content_'+n).className='dis';
}
var wait = 60;
function get_phone_verification_code(btn) {

View File

@ -0,0 +1,155 @@
<div class="new_login">
<div class="new-login-header clearfix">
<h2 class="fl">绑定账号</h2>
<p class="fr mt20 font-16">
<%= link_to '首页', home_path %>
<span class="ml5 mr5">|</span>
<%= link_to "帮助中心", "#{Setting.protocol}://#{Setting.host_name}/forums/1/memos/1168" %>
</p>
</div>
<div class="new_login_con">
<div class="new_login_box clearfix">
<div class="mb30 clearfix mt20 ml50">
<img src="images/inner/male.jpg" width="50" height="50" class="fl task-mail-img">
<p class="fl font-14 mt10 ml10"><span class="task-name fl">sa~sa~</span><span class="fl ml5">,您好!</span></p>
<div class="cl"></div>
</div>
<ul class="new_login_weixin clearfix">
<li id="login_weixin_nav_1" class="login_weixin_nav_hover" onclick="bigDataHoverLi(1);">
<a href="javascript:void(0);" class="login_weixin_nav_nomal">关联已有账号</a>
</li>
<li id="login_weixin_nav_2" onclick="bigDataHoverLi(2);">
<a href="javascript:void(0);" class="login_weixin_nav_nomal">关联新账号</a>
</li>
</ul>
<div id="login_weixin_content_1">
<div class="new_login_form">
<form class="mt20">
<ul>
<li class="new_loggin_users">
<i class="fa fa-user font-16 ml10 color-grey"></i>
<input type="text" class="new_loggin_input" style="width: 290px;" placeholder="手机/邮箱">
<i class="fa font-16 mr5"></i>
<div class="new-login-error" style="display: none;">
<p id="user_bind_login_notice"></p>
</div>
</li>
<li class="new_loggin_users">
<i class="fa fa-lock font-16 ml10 color-grey"></i>
<input type="text" class="new_loggin_input" placeholder="请输入密码">
<div class="new-login-error" style="display: none;">
<p id="user_bind_psd_notice"></p>
</div>
</li>
<li>
<a href="javascript:void(0);" id="wechat_bind_btn" class ="new_login_submit" style="text-decoration:none; color: #fff;">完成</a>
</li>
</ul>
</form>
</div>
</div>
<div id="login_weixin_content_2" class="undis">
<div class="new_login_form">
<p class="fr mt10 mb10 font-12">
<a href="javascript:void(0);" onclick="$(this).parent().parent().hide(); $(this).parent().parent().next().show();">使用邮箱账号</a>
</p>
<div class="cl"></div>
<%= form_for :user, :url => register_path,:method=>'post', :html => {:id=>'main_reg_form'} do |f| %>
<ul>
<li class="new_loggin_users">
<i class="fa fa-mobile-phone font-16 ml10 color-grey"></i>
<input type="text" id="user_phone_num" name="user[phone]" class="new_loggin_input" autocomplete="off" placeholder="请输入手机号码">
<i class="fa font-16 mr5" id="user_phone_check"></i>
<div class="new-login-error" style="display: none;">
<p id="user_phone_notice"></p>
</div>
</li>
<li class="new_loggin_users">
<i class="fa fa-lock font-16 ml10 color-grey"></i>
<input type="text" onfocus="this.type='password'" class="new_loggin_input" style="width: 292px;" name="user[password]" id="user_password_1" autocomplete="off" placeholder="密码至少由8位由字母或特殊符号和数字结合">
<i class="fa font-16 mr5" id="user_password_1_check"></i>
<div class="new-login-error" style="display: none;">
<p id="user_password_1_notice"></p>
</div>
</li>
<li class="pr">
<div id="drag" class="drag_slider"></div>
<div class="new-login-error" style="display: none;">
<p id="user_verification_notice"></p>
</div>
</li>
<li class="pr">
<input type="text" class="new_loggin_input_test fl" name="code" id="phone_verification_code" placeholder="请输入收到的短信验证码">
<a href="javascript:void(0);" class="fr task-btn-ver" onclick="get_phone_verification_code(this)" id="get_verification_code">获取验证码</a>
<div class="new-login-error" style="display: none;">
<p id="phone_verification_code_notice"></p>
</div>
<div class="cl"></div>
</li>
<li class="pr">
<label><input type="checkbox" checked="checked" id="read_and_confirm_1" class="new_login_check"> 我已阅读并同意<a href="<%= agreement_path %>" target="_blank">服务协议条款</a></label>
<div class="new-login-error" style="display: none;">
<p id="user_aggre_1_notice"></p>
</div>
<div class="cl"></div>
</li>
<li>
<a href="javascript:void(0);" id="regist_btn_phone" onclick="phone_register();" class ="new_login_submit" style="text-decoration:none; color: #fff;">完成</a>
</li>
<li style="text-align: center;"><a href="javascript:void(0);" class="link-color-green" style="text-decoration:none;">跳过,自动注册并绑定</a></li>
</ul>
<% end %>
<div class="cl"></div>
</div>
<div class="new_login_form undis">
<p class="fr mt10 mb10 font-12">
<a href="javascript:void(0);" onclick="$(this).parent().parent().hide(); $(this).parent().parent().prev().show();">使用手机账号</a>
</p>
<div class="cl"></div>
<%= form_for :user, :url => register_path,:method=>'post', :html => {:id=>'main_reg_email_form'} do |f| %>
<%= error_messages_for 'user' %>
<input type="text" style="display: none">
<input type="password" style="display: none">
<ul >
<li class="new_loggin_users">
<i class="fa fa-envelope-o font-16 ml10 color-grey"></i>
<input type="text" class="new_loggin_input" name="user[mail]" id="user_email_addr" style="width: 286px;" autocomplete="off" placeholder="请输入有效的邮箱地址">
<i class="fa font-16 mr5" id="user_email_check"></i>
<div class="new-login-error" style="display: none;">
<p id="user_email_addr_notice"></p>
</div>
</li>
<li class="new_loggin_users">
<i class="fa fa-lock font-16 ml10 color-grey"></i>
<input type="text" onfocus="this.type='password'" class="new_loggin_input" style="width: 292px;" name="user[mail_password]" id="user_password_2" autocomplete="off" placeholder="密码至少由8位由字母或特殊符号和数字结合">
<i class="fa font-16 mr5" id="user_password_2_check"></i>
<div class="new-login-error" style="display: none;">
<p id="user_password_2_notice"></p>
</div>
</li>
<li class="pr">
<label><input type="checkbox" id="read_and_confirm_2" checked="checked" class="new_login_check" > 我已阅读并同意<a href="<%= agreement_path %>" target="_blank">服务协议条款</a></label>
<div class="new-login-error" style="display: none;">
<p id="user_aggre_2_notice"></p>
</div>
<div class="cl"></div>
</li>
<li>
<a href="javascript:void(0);" id="regist_btn_email" onclick="email_register();" class ="new_login_submit" style="text-decoration:none; color: #fff;">完成</a>
</li>
<li style="text-align: center;">
<a href="javascript:void(0);" class="link-color-green" style="text-decoration:none;">跳过,自动注册并绑定</a>
</li>
</ul>
<% end %>
</div>
</div>
<div class="cl"></div>
</div>
</div>
</div>
<script>
$('#drag').drag();
</script>

View File

@ -583,6 +583,7 @@ RedmineApp::Application.routes.draw do
match 'account/valid_verification_code', :via => :get
match 'account/get_verification_code', :via => :get
match 'account/change_email', :via => :get
match 'account/wechat_bind', :via => [:get, :post]
match 'account/reset_psd', :via => [:get, :post]
match 'account/email_valid', :to => 'account#email_valid', :via => :get
match 'account/resendmail', :to => 'account#resendmail', :via=> :get, :as => 'resendmail'

View File

@ -67,6 +67,18 @@ $(function(){
});
});
function g(o){
return document.getElementById(o);
}
function bigDataHoverLi(n){
for(var i=1;i<=2;i++){
g('login_weixin_nav_'+i).className='login_weixin_nav_nomal';
g('login_weixin_content_'+i).className='undis';
}
g('login_weixin_nav_'+n).className='login_weixin_nav_hover';
g('login_weixin_content_'+n).className='dis';
}
function settime(btn){
if (lost_psd_time==0) {
$(btn).removeClass("rest-btn-ver");