//提交表单
$("#finished_button").on("click", function(){
  var oldpassw = $("#detail_form").find("input[name='oldpassw']");
  var newpassw = $("#detail_form").find("input[name='newpassw']");
  if($(oldpassw).val()==""){
    $.toast("请填写旧密码");
    return false;
  }
  if($(newpassw).val()==""){
    $.toast("请填写新密码");
    return false;
  }
  $.ajax({
    url: '/user/chanpass/basicok', 
    type: 'POST',
    dataType: "json", 
    data: $("#detail_form").serialize(),
    beforeSend: function(){
      $.showIndicator();
    },
    success: function(data){
      if(data.code=="success"){
        $.toast("修改成功");
      }else{
        $.toast(data.msg);
      }
    },
    error: function(){
      $.toast("系统错误，请联系管理员");
    },
    complete: function(){
      $.hideIndicator();
    }
  });
  return false;
});