socialforge/app/views/wechats/login.html.erb

68 lines
1.8 KiB
Plaintext
Raw Normal View History

2016-01-19 15:06:40 +08:00
2016-01-19 14:28:13 +08:00
<div class="loginIn">
<div>
2016-01-20 22:14:47 +08:00
<p class="weui_cells_title wechat-error">
2016-01-19 14:28:13 +08:00
<%= @wechat_bind_errors %>
</p>
</div>
2016-01-20 21:49:22 +08:00
2016-01-19 14:28:13 +08:00
<%= form_tag(bind_wechat_path,:id=>'main_login_form',:method=>'post') do %>
2016-01-20 21:49:22 +08:00
<div class="weui_cells weui_cells_form">
<div class="weui_cell">
<div class="weui_cell_hd"><label class="weui_label">用户名</label></div>
<div class="weui_cell_bd weui_cell_primary">
<input class="weui_input" autocapitalize="off" type="text" name="username" placeholder="请输入邮箱/登录名"/>
2016-01-20 21:49:22 +08:00
</div>
</div>
2016-01-19 14:28:13 +08:00
2016-01-20 21:49:22 +08:00
<div class="weui_cell">
<div class="weui_cell_hd"><label class="weui_label">密码</label></div>
2016-01-20 21:49:22 +08:00
<div class="weui_cell_bd weui_cell_primary">
<input class="weui_input" type="password" name="password" placeholder="请输入密码"/>
2016-01-19 14:28:13 +08:00
</div>
2016-01-20 21:49:22 +08:00
</div>
2016-01-19 14:28:13 +08:00
2016-03-01 17:55:03 +08:00
<input type="hidden" value="<%=@code%>" name="code">
2016-01-19 14:28:13 +08:00
2016-01-20 21:49:22 +08:00
<div class="weui_btn_area">
2016-03-01 15:21:20 +08:00
<a class="weui_btn weui_btn_primary" id="submitForm">确定</a>
2016-01-20 21:49:22 +08:00
</div>
2016-01-19 14:28:13 +08:00
</div>
<% end %>
2016-01-19 15:06:40 +08:00
</div>
2016-03-01 15:37:48 +08:00
<script type="text/javascript">
$(function(){
console.log("started.");
$("#submitForm").click(function(){
var data = {};
$("#main_login_form").serializeArray().map(function(x){data[x.name] = x.value;});
console.log(data);
$.ajax({
type: "POST",
2016-03-01 15:42:37 +08:00
url: $("#main_login_form").attr("action"),
2016-03-01 15:37:48 +08:00
data:data,
2016-03-01 16:56:37 +08:00
dataType: 'json',
success: function(data){
console.log(data);
if(data.status == 0){
byConfirm(data.msg, function(){
window.closeWindow();
});
} else {
byAlert(data.msg, "绑定失败");
}
}
2016-03-01 15:37:48 +08:00
});
})
});
2016-03-01 16:13:37 +08:00
</script>