li 7 years ago
parent
commit
2359328298
3 changed files with 46 additions and 38 deletions
  1. 2 2
      js/common.js
  2. 2 2
      js/inform.js
  3. 42 34
      js/userInforShow.js

+ 2 - 2
js/common.js

@ -276,8 +276,8 @@ function unInformCount(id){//查询指定用户的未读消息数量
276 276
		success:function(data){
277 277
			console.log(data)
278 278
			if(data.success){
279
				if(data.unRead!=0){
280
					$(".mymessage").eq(0).find(".badge").text(data.data);
279
				if(data.data.unRead!=0){
280
					$(".mymessage").eq(0).find(".badge").text(data.data.unRead);
281 281
				}else{
282 282
					$(".mymessage").eq(0).find(".badge").text("");
283 283
				}

+ 2 - 2
js/inform.js

@ -93,7 +93,7 @@ $(function() {
93 93
			traditional: true, //传数组必须加这个
94 94
			success: function(data) {
95 95
				if(data.success) {
96
					console.log(JSON.stringify(data))
96
					$(".mymessage").eq(0).find(".badge").text("")
97 97
				}
98 98

99 99
			},
@ -108,7 +108,7 @@ $(function() {
108 108
		if(dobj.opType == 0) {
109 109
			ourl = "userInforShow.html?professorId=" + dobj.uid;
110 110
		} else if(dobj.opType == 1) {
111
			ourl = 'userInforShow.html?professorId=' + dobj.pid + '&flag=1'
111
			ourl = 'userInforShow.html?professorId=' + dobj.pid + '&flag='+dobj.cnt.substring(dobj.cnt.indexOf(">") + 1, dobj.cnt.lastIndexOf("<"))
112 112
		} else if(dobj.opType == 2) {
113 113
			$.ajax({
114 114
				url: "/ajax/article/query?articleId="+dobj.pid

+ 42 - 34
js/userInforShow.js

@ -2,6 +2,46 @@ $(function() {
2 2
	loginStatus();//判断个人是否登录
3 3
	var userid = $.cookie("userid");
4 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 45
	if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){
6 46
	 	location.href="http://" + window.location.host + "/e/p.html?id="+professorId;
7 47
	}
@ -206,41 +246,9 @@ $(function() {
206 246
		//点击每个研究方向弹出研究方向详情窗口
207 247
		$("#researchAreaShow").on("click", ".favorBox,.favorCount", function() {
208 248
			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
			});
249
			researchAlert(cap)
243 250
		});
251
		
244 252
		//关闭按钮
245 253
		$("#workclose").click(function() {
246 254
			$(".resAreaCover").fadeOut();