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

68 lines
1.8 KiB
Plaintext

<div class="loginIn">
<div>
<p class="weui_cells_title wechat-error">
<%= @wechat_bind_errors %>
</p>
</div>
<%= form_tag(bind_wechat_path,:id=>'main_login_form',:method=>'post') do %>
<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="请输入邮箱地址或昵称"/>
</div>
</div>
<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" type="password" name="password" placeholder="请输密码"/>
</div>
</div>
<input type="hidden" value="<%=@code%>" name="code">
<div class="weui_btn_area">
<a class="weui_btn weui_btn_primary" id="submitForm">确定</a>
</div>
</div>
<% end %>
</div>
<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",
url: $("#main_login_form").attr("action"),
data:data,
dataType: 'json',
success: function(data){
console.log(data);
if(data.status == 0){
byConfirm(data.msg, function(){
window.closeWindow();
});
} else {
byAlert(data.msg, "绑定失败");
}
}
});
})
});
</script>