luyanan 7 vuotta sitten
vanhempi
commit
ca7e263c85
1 muutettua tiedostoa jossa 66 lisäystä ja 48 poistoa
  1. 66 48
      js/userInforShow.js

+ 66 - 48
js/userInforShow.js

2
	loginStatus();//判断个人是否登录
2
	loginStatus();//判断个人是否登录
3
	var userid = $.cookie("userid");
3
	var userid = $.cookie("userid");
4
	var professorId = GetQueryString("professorId");
4
	var professorId = GetQueryString("professorId");
5
	if(GetQueryString("flag")) {
6
		
7
		researchAlert(GetQueryString("flag"))
8
	}
9
	function researchAlert(cap){
10
			$.ajax({
11
				url: "/ajax/researchAreaLog/ql",
12
				dataType: 'json', //数据格式类型
13
				type: 'GET', //http请求类型
14
				timeout: 10000, //超时设置
15
				data: {
16
					"professorId": professorId,
17
					'caption': cap,
18
					"rows": 1000
19
				},
20
				success: function(data) {
21
					console.log(data)
22
					if(data.success) {
23
						$("#areaCon").html("");
24
						var $info = data.data;
25
						$("#subArea").text(cap);
26
						$(".resAreaCover").fadeIn();
27
						$(".resAreaTip").addClass("displayNone")
28
						$(".resAreaCon").show()
29
						if($info.length == 0) {
30
							$(".resAreaCon").hide();
31
							$(".resAreaTip").removeClass("displayNone")
32
							return;
33
						}
34
						for(var i = 0; i < $info.length; i++) {
35
							var liItem = document.createElement("li");
36
							document.getElementById("areaCon").appendChild(liItem);
37
							detailPro($info[i],liItem);
38
						}
39
					    $("body").css("position", "fixed");
40
					}
41
				},
42
				error: function() {}
43
			});
44
		}
5
	if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){
45
	if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){
6
	 	location.href="http://" + window.location.host + "/e/p.html?id="+professorId;
46
	 	location.href="http://" + window.location.host + "/e/p.html?id="+professorId;
7
	}
47
	}
27
			
67
			
28
			ifcollectionAbout(professorId,$(".goSpan").find(".attenSpan"), 1)
68
			ifcollectionAbout(professorId,$(".goSpan").find(".attenSpan"), 1)
29
			$(".goSpan").show();
69
			$(".goSpan").show();
30
			$(".moreNavUl li.attentType").hide();
31
			$(".moreNavUl li.attendMy").addClass("liNow").text("关注他的人");
70
			$(".moreBuUl li.attentType").hide();
71
			$(".moreBuUl li.attendMy").addClass("liNow").text("关注他的人");
32
			$("#item8user>.coninfobox").eq(9).show().siblings().hide();
72
			$("#item8user>.coninfobox").eq(9).show().siblings().hide();
33
			watchType=0;
73
			watchType=0;
34
			attentMy();
74
			attentMy();
38
		}
78
		}
39
		$(document).bind("click",function(e){ 
79
		$(document).bind("click",function(e){ 
40
			var target = $(e.target); 
80
			var target = $(e.target); 
41
			if(target.closest(".moreNavUl>li.rightbtn").length == 0){ 
81
			if(target.closest(".moreBuUl>li.rightbtn").length == 0){ 
42
				$(".table-drop").hide(); 
82
				$(".table-drop").hide(); 
43
			}
83
			}
44
		})
84
		})
49
		$(".navconBox>.mainNavUl").on("click","li:not('.rightbtn')",function(){
89
		$(".navconBox>.mainNavUl").on("click","li:not('.rightbtn')",function(){
50
			$(".moreNav").hide();
90
			$(".moreNav").hide();
51
		})
91
		})
52
		$(".navconBox>.mainNavUl").on("click","li.rightbtn",function(){
53
			$(".moreNav").show();
92
		$(".navconBox>.mainNavUl").on("click","li.wenda",function(){//问答
93
			$(".wendaNav").show();
94
		})
95
		$(".navconBox>.mainNavUl").on("click","li.rightbtn",function(){//更多
96
			$(".moreBu").show();
97
			$(".wendaNav").hide();
54
		})
98
		})
55
		$(".moreNavUl").on("click","li:not('.rightbtn')",function(){//获取关注对象类型标志
99
		$(".wendaUl").on("click","li",function(){//获取关注对象类型标志
56
			watchType=$(this).attr("data-num");
100
			watchType=$(this).attr("data-num");
57
			console.log($(".moreNavUl li:not('.rightbtn')").index(this))
58
			$("#item8user>.coninfobox").eq($(".moreNavUl li:not('.rightbtn')").index(this)).show().siblings().hide();
101
			console.log($(".wendaUl li").index(this))
102
			$("#item6user>.coninfobox").eq($(".wendaUl li").index(this)).show().siblings().hide();
103
			
104
		})
105
		$(".moreBuUl").on("click","li:not('.rightbtn')",function(){//获取关注对象类型标志
106
			watchType=$(this).attr("data-num");
107
			console.log($(".moreBuUl li:not('.rightbtn')").index(this))
108
			$("#item8user>.coninfobox").eq($(".moreBuUl li:not('.rightbtn')").index(this)).show().siblings().hide();
59
			if(watchType==0){
109
			if(watchType==0){
60
				attentMy()
110
				attentMy()
61
			}else{
111
			}else{
62
				collAttent(10,1,true);
112
				collAttent(10,1,true);
63
			}
113
			}
64
		})
114
		})
65
		$(".navconBox .moreNav>.moreNavUl").on("click","li.rightbtn",function(){
115
		$(".navconBox .moreBu>.moreBuUl").on("click","li.rightbtn",function(){
66
			$(this).find(".table-drop").show();
116
			$(this).find(".table-drop").show();
67
		})
117
		})
68
		$(".table-drop").on("click","li",function(){
118
		$(".table-drop").on("click","li",function(){
69
			$(".navconBox .moreNav>.moreNavUl>.rightbtn").find("span").html($(this).text());
119
			$(".navconBox .moreBu>.moreBuUl>.rightbtn").find("span").html($(this).text());
70
			$(".table-drop").fadeOut(1000);
120
			$(".table-drop").fadeOut(1000);
71
		})
121
		})
72
		
122
		
73
		$("#myAttends").on("click",function(){
123
		$("#myAttends").on("click",function(){
74
			$(".mainNavUl li.rightbtn").addClass("liNow").siblings().removeClass("liNow");
124
			$(".mainNavUl li.rightbtn").addClass("liNow").siblings().removeClass("liNow");
75
			$(".navconBox .moreNav").show();
125
			$(".navconBox .moreBu").show();
76
			$("#item8user").show().siblings().hide();
126
			$("#item8user").show().siblings().hide();
77
			$(".moreNavUl li.attentType").eq(0).addClass("liNow").siblings().removeClass("liNow");
127
			$(".moreBuUl li.attentType").eq(0).addClass("liNow").siblings().removeClass("liNow");
78
			$("#item8user>.coninfobox").eq(0).show().siblings().hide();
128
			$("#item8user>.coninfobox").eq(0).show().siblings().hide();
79
		})
129
		})
80
		$("#attendmyGo").on("click",function(){
130
		$("#attendmyGo").on("click",function(){
81
			$(".mainNavUl li.rightbtn").addClass("liNow").siblings().removeClass("liNow");
131
			$(".mainNavUl li.rightbtn").addClass("liNow").siblings().removeClass("liNow");
82
			$(".navconBox .moreNav").show();
132
			$(".navconBox .moreBu").show();
83
			$("#item8user").show().siblings().hide();
133
			$("#item8user").show().siblings().hide();
84
			$(".moreNavUl li.attendMy").addClass("liNow").siblings().removeClass("liNow");
134
			$(".moreBuUl li.attendMy").addClass("liNow").siblings().removeClass("liNow");
85
			$("#item8user>.coninfobox").eq(9).show().siblings().hide();
135
			$("#item8user>.coninfobox").eq(9).show().siblings().hide();
86
			watchType=0
136
			watchType=0
87
			attentMy();
137
			attentMy();
206
		//点击每个研究方向弹出研究方向详情窗口
256
		//点击每个研究方向弹出研究方向详情窗口
207
		$("#researchAreaShow").on("click", ".favorBox,.favorCount", function() {
257
		$("#researchAreaShow").on("click", ".favorBox,.favorCount", function() {
208
			var cap = $(this).attr("caption");
258
			var cap = $(this).attr("caption");
209
			$.ajax({
210
				url: "/ajax/researchAreaLog/ql",
211
				dataType: 'json', //数据格式类型
212
				type: 'GET', //http请求类型
213
				timeout: 10000, //超时设置
214
				data: {
215
					"professorId": professorId,
216
					'caption': cap,
217
					"rows": 1000
218
				},
219
				success: function(data) {
220
					console.log(data)
221
					if(data.success) {
222
						$("#areaCon").html("");
223
						var $info = data.data;
224
						$("#subArea").text(cap);
225
						$(".resAreaCover").fadeIn();
226
						$(".resAreaTip").addClass("displayNone")
227
						$(".resAreaCon").show()
228
						if($info.length == 0) {
229
							$(".resAreaCon").hide();
230
							$(".resAreaTip").removeClass("displayNone")
231
							return;
232
						}
233
						for(var i = 0; i < $info.length; i++) {
234
							var liItem = document.createElement("li");
235
							document.getElementById("areaCon").appendChild(liItem);
236
							detailPro($info[i],liItem);
237
						}
238
					    $("body").css("position", "fixed");
239
					}
240
				},
241
				error: function() {}
242
			});
259
			researchAlert(cap)
243
		});
260
		});
261
		
244
		//关闭按钮
262
		//关闭按钮
245
		$("#workclose").click(function() {
263
		$("#workclose").click(function() {
246
			$(".resAreaCover").fadeOut();
264
			$(".resAreaCover").fadeOut();