强制修改基本资料:申请单位点击确定后,进入主页面;提问按钮不可用

This commit is contained in:
daiao 2016-08-25 15:29:04 +08:00
parent a3ec35c008
commit a466fdd64e
4 changed files with 145 additions and 39 deletions

View File

@ -0,0 +1,40 @@
<%= javascript_include_tag "feedback" %>
<div class="scrollsidebar" id="scrollsidebar">
<div class="side_content">
<div class="side_list">
<div class="side_title">
<a title="<%= l(:button_hide) %>" class="close_btn">
<span>
</span>
</a>
</div>
<div class="side_center">
<div class="custom_service">
<% get_memo %>
<%= form_for(@new_memo, :url => create_feedback_forum_path(@public_forum)) do |f| %>
<%= f.text_area :subject, :id=>"subject", :class => "opnionText", :placeholder => l(:label_feedback_tips) %>
<%= f.hidden_field :content,:id => 'hidden', :required => true , :value => l(:label_feedback_value) %>
<label class="c_grey">您还能输入<span id="textCount" class="c_orange">50</span>个字符</label>
<a href="javascript:void(0);" class="opnionButton" style=" color:#fff;height:21px" id="" onclick="">
<%= l(:label_submit)%>
</a>
<% end %>
</div>
<div class="mt5" style="color: #269ac9;cursor: default">
<!--<a target="hiddentab" href="http://wpa.qq.com/msgrd?v=1&uin=1554253403&site=qq&menu=yes" style="color: #269ac9;">-->
<%#= l(:label_technical_support) %>
<!--白&nbsp;&nbsp;&nbsp;羽</a> http://shang.qq.com/wpa/qunwpa?idkey=4fe2d63a4527cddce038f04f0b1d728a62082074fb4a74870a5444ee1a6910ad-->
<!--<p style="text-align: center"> 请加入师姐师兄答疑群</p> <p style="text-align: center"></p>-->
<!--<a href="mqqapi://card/show_pslcard?src_type=internal&version=1&uin=173184401&card_type=group&source=qrcode">QQ群号173184401</a>-->
<a target="_blank" href="http://shang.qq.com/wpa/qunwpa?idkey=fb938b1f6f991fc100f3d32b6ef38b7888dd4097c71d0eb8b239eaa8749a6afd"><img border="0" src="http://pub.idqqimg.com/wpa/images/group.png" alt="Trustie师姐师兄答疑群" title="Trustie师姐师兄答疑群"></a>
</div>
</div>
<div class="side_bottom"></div>
</div>
</div>
<div class="show_btn">
<span><%= l(:label_submit)%></span>
<a href="javascript:void(0)" class="closeSidebar"></a>
</div>
</div>

View File

@ -233,7 +233,7 @@
<%= yield %>
</div>
</div>
<%= render :partial => 'layouts/new_feedback' %>
<%= render :partial => 'layouts/forbidden_new_feedback' %>
</div>
<div class="cl"></div>
<%= render :partial => 'layouts/footer_show' %>

View File

@ -60,7 +60,7 @@
</li>
<li><label class="fl">说明:</label><textarea id = "remarks" class="winbox_textarea fl" placeholder="如果您有特别需要说明的内容请填入"></textarea></li>
<div class="cl"></div>
<li><label class="fl">&nbsp;&nbsp;</label><button class="fl winbox_btn_blue mt10" onclick = "commit_add_school();">确定</button></li>
<li><label class="fl">&nbsp;&nbsp;</label><button id="apply_school" class="fl winbox_btn_blue mt10">确定</button></li>
</ul>
<script type="text/javascript">
@ -103,8 +103,9 @@
if(data.result == 0){
$("input[name='province']").val(data.name);
$("input[name='occupation']").val(data.school_id);
var htmlvalue = "</br><div style='width:550px;text-align:center'>添加成功!您可以继续使用了。</div></br><div style='width:550px;text-align:center'>后续我们将对您的高校(单位)进行审核,如有问题我们再联系您。</div></br><div style='width:67px; margin:0 auto; text-align:center'></div>";
//$('#province').onload();
//$('#my_account_form_link').click();
pop_up_box(htmlvalue,500,30,50);
}
else if (data.result == 1){
@ -119,7 +120,32 @@
}
});
}
function pop_up_box(value,tWidth,tTop,tLeft){
if(!tWidth){
var tWidth = 580;
}
if(!tTop){
var tTop = 30;
}
if(!tLeft){
var tLeft = 50;
}
$("#ajax-modal").html(value);
showModal('ajax-modal', tWidth + "px");
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal(); my_account_form_submit();' style='margin-right: 5px; margin-top:-10px;right:0;' class='resourceClose'></a>");
$('#ajax-modal').parent().css("top", tTop+"%").css("left", tLeft+"%").css("padding-top", "10px").css("position", "fixed");
$('#ajax-modal').parent().addClass("resourceUploadPopup");
$('#ajax-modal').css("padding-left", "16px").css("padding-bottom", "16px");
function hideModal(){
$('#ajax-modal').hide();
}
}
function ifNameRepeat(){
//名称不能为空也不能重复
@ -147,4 +173,8 @@
}
});
}
$('#apply_school').on("click",(function(e){
commit_add_school();
}));
</script>

View File

@ -78,7 +78,7 @@
<span id="identity_hint" style="display: none"></span>
</li>
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;"><%= text_field_tag :lastname,@user.lastname+@user.firstname,:no_label=>true, :required => true,:nh_required=>"1",:class=>"w210" %>
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;"><%= text_field_tag :lastname,@user.lastname+@user.firstname,:no_label=>true, :required => true,:nh_required=>"1",:class=>"w210" %><span id="last_name_notice" class="none c_red">姓名不能为空</span>
<li nhname="tag" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" style="display:none;">
<% if User.current.user_extensions && User.current.user_extensions.gender && User.current.user_extensions.gender == 1 %>
@ -175,7 +175,7 @@
<li style="height:auto;"><textarea name="description" class="w450 h200" maxlength="255" style="resize:none;"><%= (@user.user_extensions.nil?) ? '' : @user.user_extensions.description %></textarea></li>
<li style="display:none;"><%= f.select :language, :Chinese => :zh, :English => :en %></li>
<li class="ml2">
<a href="javascript:void(0);" id="my_account_form_link" class="blue_btn fl" style="background: #3b94d6; padding: 0 25px;">确定</a>
<a href="javascript:void(0);" id="my_account_form_link" class="blue_btn fl" onclick="my_account_form_submit();" style="background: #3b94d6; padding: 0 25px;">确定</a>
<input type="submit" id="my_account_form_btn" style="display:none;"/>
<!--<a href="javascript:void(0);" class="grey_btn ml10 fl">取消</a>-->
</li>
@ -560,44 +560,80 @@
$("#users_tb_2").click();
<% end %>
$('#my_account_form_link').on("click",(function(e){
//$('#my_account_form_link').click(function(e){
if($("#userIdentity").val() == -1 ) {
$("#identity_hint").html('<span style="color:red">请选择身份</span>').show();
e.stopImmediatePropagation();
return;
}
if( $("input[name='province']").val().trim() != '' && $("input[name='occupation']").val().trim() == ''){ //学校名字和id不对的话
$("#hint").html('<span style="color:red">单位名称必须是从下拉列表中选择的,不能手动修改</span>').show();
e.stopImmediatePropagation();
return;
}
//姓名不能为空
if( $("#lastname").val() == '' ){
$("#lastname").focus();
e.stopImmediatePropagation();
return;
}
if( $("input[name='province']").val().trim() == '' ){ //学校名字必须填写
$("#hint").html('<span style="color:red">高校(单位)名称不能为空</span>').show();
e.stopImmediatePropagation();
return;
}
if($("#no").is(":visible") == true && $("#no").val() == ""){
$("#no").focus();
e.stopImmediatePropagation();
return;
}
$('#my_account_form_btn').click();
}));
// $('#my_account_form_link').on("click",(function(e){
// //$('#my_account_form_link').click(function(e){
// if($("#userIdentity").val() == -1 ) {
// $("#identity_hint").html('<span style="color:red">请选择身份</span>').show();
// e.stopImmediatePropagation();
// return;
// }
// if( $("input[name='province']").val().trim() != '' && $("input[name='occupation']").val().trim() == ''){ //学校名字和id不对的话
// $("#hint").html('<span style="color:red">单位名称必须是从下拉列表中选择的,不能手动修改</span>').show();
// e.stopImmediatePropagation();
// return;
// }
//
// //姓名不能为空
// if( $("#lastname").val() == '' ){
// $("#lastname").focus();
// $("#last_name_notice").show();
// e.stopImmediatePropagation();
// return;
// }
//
// if( $("input[name='province']").val().trim() == '' ){ //学校名字必须填写
// $("#hint").html('<span style="color:red">高校(单位)名称不能为空</span>').show();
// e.stopImmediatePropagation();
// return;
// }
//
// if($("#no").is(":visible") == true && $("#no").val() == ""){
// $("#no").focus();
// e.stopImmediatePropagation();
// return;
// }
//
// $('#my_account_form').submit();
// }));
$('#my_password_form_link').click(function(){
$('#my_password_form_btn').click();
});
});
function my_account_form_submit(){
if($("#userIdentity").val() == -1 ) {
$("#identity_hint").html('<span style="color:red">请选择身份</span>').show();
e.stopImmediatePropagation();
return;
}
if( $("input[name='province']").val().trim() != '' && $("input[name='occupation']").val().trim() == ''){ //学校名字和id不对的话
$("#hint").html('<span style="color:red">单位名称必须是从下拉列表中选择的,不能手动修改</span>').show();
e.stopImmediatePropagation();
return;
}
//姓名不能为空
if( $("#lastname").val() == '' ){
$("#lastname").focus();
$("#last_name_notice").show();
e.stopImmediatePropagation();
return;
}
if( $("input[name='province']").val().trim() == '' ){ //学校名字必须填写
$("#hint").html('<span style="color:red">高校(单位)名称不能为空</span>').show();
e.stopImmediatePropagation();
return;
}
if($("#no").is(":visible") == true && $("#no").val() == ""){
$("#no").focus();
e.stopImmediatePropagation();
return;
}
$('#my_account_form').submit();
}
</script>
<script type="text/javascript">
function g(o){return document.getElementById(o);}