jack 7 years ago
parent
commit
bd0dfbcd2b
4 changed files with 232 additions and 60 deletions
  1. 216 53
      js/attention-list.js
  2. 3 1
      js/cmpInforShow.js
  3. 4 3
      js/patentShow.js
  4. 9 3
      workspaces.html

+ 216 - 53
js/attention-list.js

@ -97,45 +97,30 @@ $(function() {
97 97
				}
98 98
				rlist += '</span>';
99 99
			}
100

101
			/*获取资源信息*/
102
			var resources = item.professor.resources;
103
			var zlist = '';
104
			for(var m = 0; m < resources.length; m++) {
105
				//console.log(resources[m].caption);
106
				zlist += '<span>' + resources[m].resourceName
107
				if(m < resources.length - 1) {
108
					zlist += " , "
100
			var arr = [];
101
			arr[0] = item.professor.title || item.professor.office;
102
			arr[1] = item.professor.orgName || "";
103
			if(arr[0]) {
104
				if(arr[1]) {
105
					arr[2] = arr[0] + "," + arr[1]
106
				} else {
107
					arr[2] = arr[0];
108
				}
109
			} else {
110
				
111
				if(arr[1]) {
112
					arr[2] = arr[1];
113
				}else{
114
					arr[2] = "";
109 115
				}
110
				zlist += '</span>';
111
			}
112

113
			var title = item.professor.title || "";
114
			var office = item.professor.office || "";
115
			var orgName = item.professor.orgName || "";
116
			var address = item.professor.address || "";
117

118
			if(title != "") {
119
				title = title + " , ";
120
			}
121
			if(office != "") {
122
				office = office + " , ";
123
			}
124
			if(orgName != "") {
125
				orgName = orgName;
126
			}
127
			if(address != "") {
128
				address = " | " + address;
129 116
			}
130

131 117
			var li = document.createElement('li');
132 118
			li.innerHTML = '<a class="proinfor clearfix" target="_blank" href="userInforShow.html?professorId=' + item.professor.id + '">' +
133 119
				'<div class="headblock floatL"><img id="proHead" class="headimg userRadius" src="' + img + '"></div>' +
134
				'<div class="mediaBody">' +
135
				'<span class="listtit">' + item.professor.name + '<em class="authiconNew authicon-pro"></em></span>' +
136
				'<p class="listtit2"><span>' + title + '</span><span>' + office + '</span><span>' + orgName + '</span><span>' + address + '</span></p>' +
137
				'<p class="ellipsisSty listtit3">' + rlist + '</p>' +
138
				'<p class="ellipsisSty listtit3">' + zlist + '</p>' +
120
				'<div class="mediaBody" style="padding-top:20px;">' +
121
				'<p class="h1font"><span class="listtit">' + item.professor.name + '<em class="authiconNew authicon-pro"></em></span></p>' +
122
				'<p class="listtit2 h2font">'+arr[2]+'</p>' +
123
				'<p class="ellipsisSty listtit3 h2font">' + rlist + '</p>' +
139 124
				'</div></a></li>';
140 125

141 126
			$("#expert").append(li);
@ -165,32 +150,14 @@ $(function() {
165 150
						stl.title="认证企业";	
166 151
					}
167 152
					oName=item.resource.organization.name;
168
				 }
169
			/*var title = item.resource.editProfessor.title || "";
170
			var office = item.resource.editProfessor.office || "";
171
			var orgName = item.resource.editProfessor.orgName || "";
172
			var address = item.resource.editProfessor.address || "";
173

174
			if(title != "") {
175
				title = title + " , ";
176 153
			}
177
			if(office != "") {
178
				office = office + " , ";
179
			}
180
			if(orgName != "") {
181
				orgName = orgName;
182
			}
183
			if(address != "") {
184
				address = " | " + address;
185
			}*/
186

187 154
			var li = document.createElement('li');
188 155

189 156
			li.innerHTML = '<a class="proinfor clearfix" target="_blank"  href="resourceShow.html?resourceId=' + item.resource.resourceId + '">' +
190 157
				'<div class="headblock floatL ResImgBox"><img id="proHead" class="resImg" src="' + img + '"></div>' +
191 158
				'<div class="mediaBody" style="float:left;width:450px;overflow:hidden;">' +
192 159
				'<span class=" ellipsisSty listtit">' + item.resource.resourceName + '</span>' +
193
				'<p class="ellipsisSty listtit2">' + item.resource.supportedServices + '</p>' +
160
				'<p class="ellipsisSty listtit2">用途:' + item.resource.supportedServices + '</p>' +
194 161
				'<span class="listtit">' +oName+ '<em class="authiconNew '+stl.sty+'" title="'+stl.title+'"></em></span>' +
195 162
				//'<p class="listtit2"><span>' + title + '</span><span>' + office + '</span><span>' + orgName + '</span><span>' + address + '</span></p>' +
196 163
				'</div></a></li>';
@ -249,4 +216,200 @@ $(function() {
249 216
		});
250 217
	}
251 218
	article();
219
	/*关注专利信息*/
220
	function patent() {
221
		var data = {
222
			"professorId": userid,
223
			"watchType": 4,
224
			"pageNo": 1,
225
			"pageSize": 1000
226
		}
227
		$.ajax({
228
			url: "/ajax/watch/qaPro",
229
			data: data,
230
			dataType: 'json', //数据格式类型
231
			type: 'get', //http请求类型
232
			success: function(data) {
233
				console.log(data);
234
				if(data.success && data.data.data != "") {
235
					var arr=[];
236
					for(var i in data.data.data) {
237
						arr[i]=data.data.data[i].watchObject;
238
					}
239
					$.ajax({
240
						url: "/ajax/ppatent/qm",
241
						data: {
242
							id:arr,
243
						},
244
						dataType: 'json', //数据格式类型
245
						type: 'get', //http请求类型
246
						traditional: true,
247
						success: function(data) {
248
							console.log(data);
249
							if(data.success && data.data != "") {
250
								var $data=data.data;
251
								for(var i=0;i<$data.length;i++) {
252
									var li = document.createElement('li');
253
								li.innerHTML = '<a class="proinfor clearfix" target="_blank"  href="patentShow.html?patentId='+$data[i].id+'">' +
254
								'<div class="headblock floatL ResImgBox"><img id="proHead" class="resImg" src="../images/default-patent.jpg"></div>' +
255
								'<div class="mediaBody">' +
256
								'<span class="listtit" style="display:block;">'+$data[i].name+'</span>' +
257
								'<span class="listtit">'+$data[i].authors.substring(0,$data[i].authors.length-1)+'</span>' +
258
								'<p class="listtit">'+$data[i].reqPerson+'</p>' +
259
								'</div></a></li>';
260
								$("#patent").append(li)
261
								}
262
							}
263
						},
264
						error: function() {
265
							$.MsgBox.Alert('提示', "服务器链接超时");
266
						}
267
					});
268
				}
269
			},
270
			error: function() {
271
				$.MsgBox.Alert('提示', "服务器链接超时");
272
			}
273
		});
274
	}
275
	patent();
276
	/*关注论文信息*/
277
	function paper() {
278
		var data = {
279
			"professorId": userid,
280
			"watchType": 5,
281
			"pageNo": 1,
282
			"pageSize": 1000
283
		}
284
		$.ajax({
285
			url: "/ajax/watch/qaPro",
286
			data: data,
287
			dataType: 'json', //数据格式类型
288
			type: 'get', //http请求类型
289
			success: function(data) {
290
				console.log(data);
291
				if(data.success && data.data.data != "") {
292
					var arr=[];
293
					for(var i in data.data.data) {
294
						arr[i]=data.data.data[i].watchObject;
295
					}
296
					$.ajax({
297
						url: "/ajax/ppaper/qm",
298
						data: {
299
							id:arr,
300
						},
301
						dataType: 'json', //数据格式类型
302
						type: 'get', //http请求类型
303
						traditional: true,
304
						success: function(data) {
305
							console.log(data);
306
							if(data.success && data.data != "") {
307
								var $data=data.data;
308
								for(var i=0;i<$data.length;i++) {
309
									var li = document.createElement('li');
310
								li.innerHTML = '<a class="proinfor clearfix" target="_blank"  href="paperShow.html?paperId='+$data[i].id+'">' +
311
								'<div class="headblock floatL ResImgBox"><img id="proHead" class="resImg" src="../images/default-paper.jpg"></div>' +
312
								'<div class="mediaBody">' +
313
								'<span class="listtit" style="display:block;">'+$data[i].name+'</span>' +
314
								'<span class="listtit">'+$data[i].authors.substring(0,$data[i].authors.length-1)+'</span>' +
315
								'<p class="listtit">'+$data[i].pubDay+'</p>' +
316
								'</div></a></li>';
317
								$("#paper").append(li)
318
								}
319
							}
320
						},
321
						error: function() {
322
							$.MsgBox.Alert('提示', "服务器链接超时");
323
						}
324
					});
325
				}
326
			},
327
			error: function() {
328
				$.MsgBox.Alert('提示', "服务器链接超时");
329
			}
330
		});
331
	}
332
	paper();
333
	/*关注企业信息*/
334
	/*关注论文信息*/
335
	function company() {
336
		var data = {
337
			"professorId": userid,
338
			"watchType": 6,
339
			"pageNo": 1,
340
			"pageSize": 1000
341
		}
342
		$.ajax({
343
			url: "/ajax/watch/qaPro",
344
			data: data,
345
			dataType: 'json', //数据格式类型
346
			type: 'get', //http请求类型
347
			success: function(data) {
348
				console.log(data);
349
				if(data.success && data.data.data != "") {
350
					var arr=[];
351
					for(var i in data.data.data) {
352
						arr[i]=data.data.data[i].watchObject;
353
					}
354
					$.ajax({
355
						url: "/ajax/org/qm",
356
						data: {
357
							id:arr,
358
						},
359
						dataType: 'json', //数据格式类型
360
						type: 'get', //http请求类型
361
						traditional: true,
362
						success: function(data) {
363
							console.log(data);
364
							if(data.success && data.data != "") {
365
								var $data=data.data;
366
								console.log($data);
367
								for(var i=0;i<$data.length;i++) {
368
									var li = document.createElement('li');
369
									
370
								li.innerHTML = '<a class="proinfor clearfix" target="_blank"  href="">' +
371
								'<div class="headblock floatL ResImgBox"><img id="proHead" class="resImg" src=""></div>' +
372
								'<div class="mediaBody">' +
373
								'<p><span class="listtit">'+$data[i].name+'<em class="authiconNew" title=""></em></span></p>'+
374
								'<span class="listtit" id="orgTit"></span>' +
375
								'<span class="listtit" id="orgOther"></span>' +
376
								'</div></a></li>';
377
								var $itemlist=$(li);
378
								$("#company").append(li);
379
								$itemlist.find("a").attr("href", "cmpInforShow.html?orgId=" + $data[i].id );
380
									if($data[i].hasOrgLogo) {
381
										$itemlist.find("#proHead").attr("src", "/images/org/" + $data[i].id + ".jpg" );
382
									}else{
383
										$itemlist.find("#proHead").attr("src", "/images/default-icon.jpg" );
384
									}
385
									if($data[i].authStatus == 3) {
386
										$itemlist.find(".authiconNew").addClass("authicon-com-ok").attr("title", "科袖认证企业");;	
387
									}
388
									console.log($data[i])
389
								var orgOther = "";
390
								
391
								if($data[i].industry) {
392
									orgOther = $data[i].industry.replace(/,/gi, " | ");
393
								}
394
								$itemlist.find("#orgOther").text(orgOther);
395
								
396
								if($data[i].orgType == "2") {
397
									$itemlist.find("#orgTit").html(orgTypeShow[$data[i].orgType] + "<span style='margin-right:10px;'></span>");
398
								}
399
								}
400
								
401
							}
402
						},
403
						error: function() {
404
							$.MsgBox.Alert('提示', "服务器链接超时");
405
						}
406
					});
407
				}
408
			},
409
			error: function() {
410
				$.MsgBox.Alert('提示', "服务器链接超时");
411
			}
412
		});
413
	}
414
	company();
252 415
})

+ 3 - 1
js/cmpInforShow.js

@ -492,8 +492,10 @@ $(function() {
492 492
						}
493 493
						$("#comMes").html(str);
494 494
					}else {
495
						$("#comMes").parents("coninfobox").hide();
495
						$("#comMes").parents(".coninfobox").hide();
496 496
					}
497
				}else{
498
					$("#comMes").parents(".coninfobox").hide();
497 499
				}
498 500
			},
499 501
			"error": function() {

+ 4 - 3
js/patentShow.js

@ -103,6 +103,7 @@ $(document).ready(function() {
103 103
		var weibourl = window.location.href;
104 104
		var weibopic = "http://" + window.location.host + "/images/default-patent.jpg";
105 105
		$("#weibo").attr("href", "http://service.weibo.com/share/share.php?appkey=3677230589&title=" + encodeURIComponent(weibotitle) + "&url=" + encodeURIComponent(weibourl) + "&pic=" + encodeURIComponent(weibopic) + "&content=utf-8" + "&ralateUid=6242830109&searchPic=false&style=simple");
106
		$obj.bindEvent($obj);
106 107
	}
107 108
	Patent.prototype.patentAuth = function($data, $obj) {
108 109
		if($data.length < 5) {
@ -130,7 +131,7 @@ $(document).ready(function() {
130 131
					Fun: $obj.profess
131 132
				});
132 133
			}
133
			$obj.bindEvent($obj);
134
			
134 135
		}
135 136
	}
136 137
	Patent.prototype.profess = function($data, $obj) {
@ -173,7 +174,7 @@ $(document).ready(function() {
173 174
		$("#faM").prepend(otr);
174 175
	}
175 176
	Patent.prototype.bindEvent = function($obj) {
176
		$("#faM").on("click", "li", function() {
177
		$("#faM").on("click", ".flexCenter", function() {
177 178
			var oDataId = $(this).attr("data-id");
178 179
			if(oDataId.substring(0, 1) != "#")
179 180
				location.href = "userInforShow.html?professorId=" + oDataId
@ -181,7 +182,7 @@ $(document).ready(function() {
181 182
		$('#attention em').click(function() {
182 183
			if(userid && userid != "null" && userid != null) {
183 184
				if($(this).is('.icon-collected')) {
184
					cancelCollectionAbout(GetQueryString("patentId"), 4)
185
					cancelCollectionAbout(GetQueryString("patentId"), 4);
185 186
				} else {
186 187
					collectionAbout(GetQueryString("patentId"), 4);
187 188
				}

+ 9 - 3
workspaces.html

@ -44,15 +44,21 @@
44 44
		<div class="topTit">关注与收藏</div>
45 45
		<div class="fixbox">
46 46
			<ul class="fixbtn" id="fixbtn">
47
				<li index="0" class="col-xs-4 liactive">专家</li>
47
				<li index="0" class="col-xs-2 liactive">专家</li>
48
				<li index="1" class="col-xs-2">企业</li>
48 49
				<!--当前选中状态    'liactive'-->
49
				<li index="1" class="col-xs-4">资源</li>
50
				<li index="2" class="col-xs-4">文章</li>
50
				<li index="2" class="col-xs-2">资源</li>
51
				<li index="3" class="col-xs-2">专利</li>
52
				<li index="4" class="col-xs-2">论文</li>
53
				<li index="5" class="col-xs-2">文章</li>
51 54
			</ul>
52 55
		</div>
53 56
		<div class="attentsCon">
54 57
			<ul class="attentList" id="expert"></ul>
58
			<ul class="attentList" id="company"></ul>
55 59
			<ul class="attentList" id="resources"></ul>
60
			<ul class="attentList" id="patent"></ul>
61
			<ul class="attentList" id="paper"></ul>
56 62
			<ul class="attentList" id="article"></ul>
57 63
		</div>
58 64
		<div style="height: 20px;"></div>