Browse Source

科研资源信息中,咨询未登录,提示,并连接登陆页

dell 8 years ago
parent
commit
4fae8fa119
2 changed files with 25 additions and 16 deletions
  1. 24 15
      src/main/webapp/js/information.brow.js
  2. 1 1
      src/main/webapp/js/search.js

+ 24 - 15
src/main/webapp/js/information.brow.js

@ -199,16 +199,10 @@ loginStatus();//读取用户头像
199 199
			     }
200 200
			     return ret;
201 201
			}
202
	
202
203
203 204
			$("#researchAreaShow").on("click",".plus",function(){
204 205
				if(userid && userid != null && userid != "null"){
205
					//点赞变化样式
206
					if($(this).data("isagree")>-1){
207
						$(this).stop(true,true).animate({backgroundPositionY:0},300);//变成未点赞样式
208
					}else{
209
						$(this).stop(true,true).animate({backgroundPositionY:-26},300);//变成点赞样式
210
					}
211
					
212 206
					$.ajax({
213 207
						"url" : $(this).data("isagree")>-1?"/ajax/researchArea/unAgree":"/ajax/researchArea/agree",
214 208
						"type" : "POST",
@ -241,7 +235,6 @@ loginStatus();//读取用户头像
241 235
					/*location.href="login.html"*/
242 236
				}
243 237
				
244
				
245 238
			})
246 239
247 240
	    	$.get("/ajax/professor/info/" + professorId, function($data) {
@ -655,12 +648,28 @@ var resou;
655 648
	
656 649
	//科研资源中的咨询
657 650
	function clickResourceConsult(){
658
		var professorId = $(this).attr("professorId");
659
		consultHandler();
651
		if(userid){
652
			var professorId = $(this).attr("professorId");
653
			consultHandler();
654
			
655
			$("ul.menucon").children().eq(1).addClass("clicknow");
656
			var consultTitleVal = $(this).parent().parent().parent().find(".consultTitleVal").text();
657
			$("#consultTitle").val("关于"+consultTitleVal+"的咨询");
658
		}else {
659
			$.MsgBox.Alert("message","请登录");
660
			var aele = document.createElement('a');
661
			$("#mb_btnbox").append(aele);
662
			$("#mb_btnbox a").css({
663
				'display':"block",
664
				'width':'100%',
665
				'height':'40px',
666
				'position':'relative',
667
				'bottom':'40px',
668
				'left':0
669
				});
670
			aele.setAttribute('href', '../login.html');
671
		}
660 672
		
661
		$("ul.menucon").children().eq(1).addClass("clicknow");
662
		var consultTitleVal = $(this).parent().parent().parent().find(".consultTitleVal").text();
663
		$("#consultTitle").val("关于"+consultTitleVal+"的咨询");
664 673
		
665 674
	};
666 675
	
@ -827,7 +836,7 @@ if(resou==0&&ass==0){
827 836
			});
828 837
	}
829 838
830
839
	
831 840
	
832 841
})
833 842

+ 1 - 1
src/main/webapp/js/search.js

@ -602,7 +602,7 @@ $(function(){
602 602
			var consultTitleVal = $(this).parent().prev().find("a").text();
603 603
			console.log($(this).parent());
604 604
			console.log($(this).parent().prev());
605
			alert(consultTitleVal);
605
			//alert(consultTitleVal);
606 606
			$("#consultTitle").val("关于"+consultTitleVal+"的咨询");
607 607
			//点击的发送
608 608
			$("#sendConsultBtn").click(function(){