li 7 years ago
parent
commit
d77c797674
4 changed files with 909 additions and 12 deletions
  1. 3 3
      js/serviceIssue.js
  2. 10 9
      js/serviceList.js
  3. 696 0
      js/sevriceShow.js
  4. 200 0
      sevriceShow.html

+ 3 - 3
js/serviceIssue.js

@ -298,7 +298,7 @@ $(document).ready(function() {
298 298
			"type": "POST",
299 299
			"success": function(data) {
300 300
				if(data.success) {
301
					location.href = "sevriceList.html"
301
					location.href = "serviceList.html"
302 302
				}
303 303
			},
304 304
			"data": {
@ -342,7 +342,7 @@ $(document).ready(function() {
342 342
	/*发布函数*/
343 343
	function ajsPost(pa1, pa2) {
344 344
		var oUrl;
345
		if(flag) {
345
		if(sevriceId) {
346 346
			oUrl = "/ajax/ware/publish/update";
347 347
		} else {
348 348
			oUrl = "/ajax/ware/publish";
@ -383,7 +383,7 @@ $(document).ready(function() {
383 383
				} else {
384 384
					$.MsgBox.Alert('提示', '服务发布成功!');
385 385
					$("#mb_msgicon").css("background", 'url("images/sign_icon_chenggong_nor.png") 0% 0% / contain');
386
					location.href = "sevriceList.html"
386
					location.href = "serviceList.html"
387 387
				}
388 388

389 389
			} else {

+ 10 - 9
js/serviceList.js

@ -19,7 +19,6 @@ $(document).ready(function(){
19 19
			"url": "/ajax/ware/pq/search",
20 20
			"type": "GET",
21 21
			"success": function(data) {
22
				console.log(data)
23 22
				if(data.success) {
24 23
					$("#resourceList").html("");
25 24
					if(num==1) {
@ -63,21 +62,23 @@ $(document).ready(function(){
63 62
	 	for(var i=0;i<$data.length;i++) {
64 63
	 		var imgSrc="../images/default-service.jpg";
65 64
	 		var oTime,pageview="",draftLable="",oHtml,oLi='';
66
	 		if($data[i].images.split(",").length) {
65
	 		if($data[i].images) {
67 66
	 			imgSrc="/data/ware"+$data[i].images.split(",")[0]
68 67
	 		}
69
	 		if($data[i].status==0) {
68
	 		if($data[i].state=='2') {
69
	 			console.log($data[i].modifyTime)
70 70
	 			oTime="修改于 "+TimeTr($data[i].modifyTime);
71 71
	 			draftLable='<span class="draftLable">草稿</span>';
72 72
	 			oHtml="sevriceIssue.html";
73 73
	 			oLi="class='draftList'"
74
	 		}else{
75
	 			oTime="发布于 "+TimeTr($data[i].publishTime);
74
	 		}else if($data[i].state=='1'){
75
	 			console.log($data[i].createTime)
76
	 			oTime="发布于 "+TimeTr($data[i].createTime);
76 77
	 			pageview='<li><span>浏览量 '+$data[i].pageViews+'</span></li>';
77
	 			oHtml="resourceShow.html"
78
	 			oHtml="sevriceShow.html"
78 79
	 		}
79 80
	 	var oStr='<li '+oLi+'>'+
80
				'<a href="'+oHtml+'?resourceId='+$data[i].id+'" target="_blank">'+
81
				'<a href="'+oHtml+'?sevriceId='+$data[i].id+'&flag='+$data[i].state+'" target="_blank">'+
81 82
					'<div class="madiaHead resouseHead" style="background-image: url('+imgSrc+');"></div>'	+						
82 83
						'<div class="madiaInfo">'+					
83 84
							'<p class="h1Font ellipsisSty">'+$data[i].name+'</p>'+						
@ -92,7 +93,7 @@ $(document).ready(function(){
92 93
				'</ul>'+
93 94
			'</li>'	
94 95
			var $oStr=$(oStr);
95
			$("#resourceList").append(oStr);
96
			$("#resourceList").append($oStr);
96 97
			$oStr.find(".editThis").attr("data-state",$data[i].state);
97 98
	 	}
98 99
	 }
@ -108,7 +109,7 @@ $(document).ready(function(){
108 109
	/*删除函数*/
109 110
	function deleResource() {
110 111
			$.ajax({
111
					"url": "/ajax/resource/delete",
112
					"url": "/ajax/ware/delete",
112 113
					"type": "POST",
113 114
					"success": function(data) {
114 115
						if(data.success) {	

+ 696 - 0
js/sevriceShow.js

@ -0,0 +1,696 @@
1
$(document).ready(function() {
2
	loginStatus(); //判断个人是否登录
3
	var userid = $.cookie("userid");
4
	var sevriceId = GetQueryString("sevriceId");
5
	if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) {
6
		location.href = "http://" + window.location.host + "/e/r.html?id=" + sevriceId;
7
	}
8
	$(".jqzoom").imagezoom();
9
	$("#thumblist").on("click", "li a", function() {
10
		$(this).parents("li").addClass("tb-selected").siblings().removeClass("tb-selected");
11
		$(".jqzoom").attr('src', $(this).find("img").attr("src"));
12
		$(".jqzoom").attr('rel', $(this).find("img").attr("src"));
13
	});
14
	$('.shareWeixin').hover(function() {
15
		$('.shareCode').stop(true, false).fadeToggle();
16
	});
17

18
	function ajaxRequist(url, obj, type, fn) {
19
		$.ajax({
20
			url: url,
21
			data: obj,
22
			dataType: 'json', //服务器返回json格式数据
23
			type: type, //支持'GET'和'POST'
24
			traditional: true,
25
			success: function(data) {
26
				if(data.success) {
27
					fn(data)
28
				}
29
			},
30
			error: function(xhr, type, errorThrown) {
31
				$.MsgBox.Alert('提示', '服务器请求失败');
32
			}
33
		});
34
	}
35
	ifcollectionAbout(sevriceId, $("#attention").find("em"), 2)
36
	var professorId = "";
37
	getRecourceMe();
38
	relatedArticles();
39
	interestingResources();
40

41
	//热门资源
42
	function recentlyRe(catagory, owner) {
43
		$.ajax({
44
			"url": "/ajax/ware/byOwnerWithPageViews",
45
			"type": "GET",
46
			"dataType": "json",
47
			"data": {
48
				'id': sevriceId,
49
				'category': catagory,
50
				'owner': owner,
51
				'rows': 5,
52
			},
53
			"success": function(data) {
54
				if(data.success) {
55
					var $data = data.data;
56
					if($data.length) {
57
						$(".recentlyList").parents(".currentBlock").removeClass("displayNone");
58
						for(var i = 0; i < $data.length; i++) {
59
							var resIM = "../images/default-service.jpg";
60
							if($data[i].images.split(",").length) {
61
								resIM = '/data/ware' + $data[i].images.split(",")[0];
62
							}
63
							var str = '<li><a class="flexCenter" style="min-height:46px;" href="sevriceShow.html?sevriceId=' + $data[i].id + '">' +
64
								'<div class="madiaHead resourceHead" style="width:50px;height:36px;margin-top:-18px;background-image: url(' + resIM + ');"></div>' +
65
								'<div class="madiaInfo"><p class="h2Font ellipsisSty-2">' + $data[i].name + '</p></div></a></li>'
66
							$(".recentlyList").append(str);
67
						}
68
					}
69
				}
70

71
			},
72
			"error": function() {
73
				$.MsgBox.Alert('提示', '链接服务器超时')
74
			}
75
		});
76
	}
77
	/*获取服务信息*/
78
	function getRecourceMe() {
79
		$.ajax({
80
			"url": "/ajax/ware/qo",
81
			"type": "GET",
82
			"success": function(data) {
83
				console.log(data);
84
				if(data.success) {
85
					resourceHtml(data.data);
86
					var resourceName = data.data.name + "-科袖网";
87
					document.title = resourceName;
88
				}
89
			},
90
			"data": {
91
				"id": sevriceId
92
			},
93
			dataType: "json",
94
			'error': function() {
95
				$.MsgBox.Alert('提示', '服务器连接超时!');
96
			}
97
		});
98
	}
99
	/*合作备注及性能参数存储换行格式*/
100
	function outHTML(selecter) {
101
		var getValue = selecter;
102
		var aa = "";
103
		if(getValue) {
104
			var endValue = ((getValue.replace(/<(.+?)>/gi, "&lt;$1&gt;")).replace(/ /gi, "&nbsp;")).replace(/\n/gi, "|");
105
			var cc = endValue.split("|");
106
			for(var i = 0; i < cc.length; i++) {
107
				aa += cc[i] + '<br/>'
108
			}
109
		}
110
		return aa;
111
	}
112
	/*处理资源html代码*/
113
	function resourceHtml($da) {
114
		$("#resourceName").text($da.name); //名字
115
		$("#application").text($da.cnt); //应用用途
116
		if($da.category == 1) {
117
			ajaxRequist("/ajax/professor/baseInfo/" + $da.owner, {}, "get", function(data) {
118
				$da.editProfessor = data.data;
119
				recentlyRe(1, $da.editProfessor.id);
120
				$("#person").show();
121
				if($da.orgName) { //所属机构
122
					$("#organizationName").text($da.orgName).parents("li").show();
123
				}
124
				$("#nameS").text($da.editProfessor.name);
125
				if($da.editProfessor.title) {
126
					$("#titleOffice").text($da.editProfessor.title);
127
				} else {
128
					if($da.editProfessor.office) {
129
						$("#titleOffice").text($da.editProfessor.office);
130
					}
131
				}
132
				if($da.editProfessor.orgName) {
133
					$("#orgType").text($da.editProfessor.orgName);
134
				}
135
				professorId = $da.editProfessor.id;
136
				if(userid != professorId) {
137
					ifcollectionAbout(professorId, $("#person").find(".attenSpan"), 1)
138
					$(".goSpan").show();
139
				}
140
				var professorFlag = autho($da.editProfessor.authType, $da.editProfessor.orgAuth, $da.editProfessor.authStatus);
141
				$("#authFlag").addClass(professorFlag.sty).attr("title", professorFlag.title);
142
				if($da.editProfessor.hasHeadImage == 1) {
143
					$("#headImg").css("background-image", 'url(/images/head/' + $da.editProfessor.id + '_l.jpg)');
144
				} else {
145
					$("#headImg").css("background-image", 'url(../images/default-photo.jpg)');
146
				}
147

148
			})
149
		} else {
150
			ajaxRequist("/ajax/org/" + $da.owner, {}, "get", function(data) {
151
				$da.organization = data.data;
152
				recentlyRe(2, $da.organization.id);
153
				$("#enterprise").show();
154
				$(".qiyego").attr('dataid', $da.organization.id);
155
				$(".qiyego").attr("href", "cmpInforShow.html?orgId=" + $da.organization.id);
156
				if($da.organization.hasOrgLogo) {
157
					$("#companyImg").attr("src", "/images/org/" + $da.organization.id + ".jpg");
158
				} else {
159
					$("#companyImg").attr("src", "/images/default-icon.jpg");
160
				}
161
				if($da.organization.authStatus == 3) {
162
					$("#QauthFlag").addClass("authicon-com-ok").attr("title", "认证企业");
163
				}
164
				if($da.organization.forShort) {
165
					$("#Qname").text($da.organization.forShort).attr("href", "cmpInforShow.html?orgId=" + $da.organization.id);
166
				} else {
167
					$("#Qname").text($da.organization.name).attr("href", "cmpInforShow.html?orgId=" + $da.organization.id);
168
				}
169

170
				$("#Qindustry").text($da.organization.industry);
171
				$("#QorgType").text(orgTypeShow[$da.organization.orgType])
172
				if(userid) {
173
					ifcollectionAbout($da.organization.id, $("#enterprise").find(".attenSpan"), 6)
174
				}
175
			})
176
		}
177
		if($da.cooperation) { //合作备注
178
			$("#remarkContent").html(outHTML($da.cooperation)).parents("li").show();
179
		}
180
		if($da.keywords) {
181
			var oSub = $da.keywords.split(",");
182
			var oSt = "";
183
			for(var i = 0; i < oSub.length; i++) {
184
				oSt += '<li><p class="h2Font">' + oSub[i] + '</p></li>'
185
			}
186
			$(".tagList").html(oSt);
187
		}
188
		if($da.descp) { //编辑器
189
			$("#descp").html($da.descp).parents("li").show();
190
		}
191
		var weibotitle = $da.name;
192
		var weibourl = window.location.href;
193
		//return;
194
		if($da.images.split(",").length) {
195
			var weibopic = "http://" + window.location.host + "/data/ware" + $da.images.split(",")[0];
196
			$("#firstFigure").attr({
197
				"src": "/data/ware" + $da.images.split(",")[0],
198
				"rel": "/data/ware" + $da.images.split(",")[0]
199
			}).parent().attr("href", "/data/ware" + $da.images.split(",")[0]);
200
			var arr = "";
201
			for(var i = 0; i < $da.images.split(",").length; i++) {
202
				if($da.images.split(",")[i] == $da.images.split(",")[0]) {
203
					var oString = '<li class="tb-selected">' +
204
						'<div class="tb-pic tb-s66">' +
205
						'<a href="javascript:void(0);">' +
206
						'<img src="/data/ware' + $da.images.split(",")[i] + '"/>' +
207
						'</a>' +
208
						'</div>' +
209
						'</li>'
210
				} else {
211
					var oString = '<li >' +
212
						'<div class="tb-pic tb-s66">' +
213
						'<a href="javascript:void(0);">' +
214
						'<img src="/data/ware' + $da.images.split(",")[i] + '"/>' +
215
						'</a>' +
216
						'</div>' +
217
						'</li>'
218
				}
219

220
				arr += oString;
221
			}
222
			$("#thumblist").html(arr);
223
		} else {
224
			var weibopic = "http://" + window.location.host + "../images/default-service.jpg";
225
			$("#firstFigure").attr({
226
				"src": '../images/default-service.jpg',
227
				"rel": '../images/default-service.jpg'
228
			});
229
		}
230
		$("#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");
231
	}
232
	/*点击名字及头像跳转个人浏览页面*/
233
	$("#nameS,#headImg").click(function() {
234
		location.href = "userInforShow.html?professorId=" + professorId;
235
	})
236
	//关键词标签点击进去搜索
237
	$(".tagList").on("click", "li", function() {
238
		var tagText = $(this).find("p").text();
239
		location.href = "searchNew.html?searchContent=" + tagText + "&tagflag=2";
240
	})
241
	seresource()
242
	/*感兴趣的资源*/
243
	function seresource() {
244
		$.ajax({
245
			"url": "/ajax/ware/res",
246
			"type": "GET",
247
			"data": {
248
				"id": sevriceId
249
			},
250
			"traditional": true,
251
			dataType: "json",
252
			"success": function(data) {
253
				if(data.success) {
254
					if(data.data.length == 0) {
255
						return;
256
					}
257
					$("#oResource").parents(".otherShow").removeClass("displayNone");
258
					for(var i = 0; i < data.data.length; i++) {
259
						(function(n) {
260
							ajaxRequist("/ajax/resource/queryOne", {
261
								"resourceId": data.data[n].resource
262
							}, "get", function(data) {
263
								sevrResource(data.data);
264
							})
265
						})(i)
266
					}
267
				}
268
			},
269
			'error': function() {
270
				$.MsgBox.Alert('提示', '服务器连接超时!');
271
			}
272
		});
273
	}
274
	/*感兴趣资源的html*/
275
	function sevrResource($respond) {
276
		var imgL = "../images/default-resource.jpg";
277
		if($respond.images.length) {
278
			imgL = '/data/resource/' + $respond.images[0].imageSrc
279
		}
280
		var oURL;
281
		if($respond.resourceType == 1) {
282
			oURL = "/ajax/professor/baseInfo/" + $respond.professorId;
283
		} else {
284
			oURL = "/ajax/org/" + $respond.orgId;
285
		}
286
		$.ajax({
287
			"url": oURL,
288
			"type": "GET",
289
			'dataType': "json",
290
			"success": function(data) {
291
				if(data.success) {
292
					//console.log(data)
293
					var thisName, userType, thisAuth, thisTitle
294
					if(data.data.forShort) {
295
						thisName = data.data.forShort;
296
					} else {
297
						thisName = data.data.name;
298
					}
299
					if($respond.resourceType == 1) {
300
						userType = autho(data.data.authType, data.data.orgAuth, data.data.authStatus);
301
						thisTitle = userType.title;
302
						thisAuth = userType.sty;
303
					} else {
304
						if(data.data.authStatus == 3) {
305
							thisTitle = "科袖认证企业";
306
							thisAuth = "authicon-com-ok";
307
						}
308
					}
309
					var add = document.createElement("li");
310
					add.className = "mui-table-view-cell";
311
					add.setAttribute("data-id", $respond.resourceId);
312
					var itemlist = '<a class="flexCenter OflexCenter"><div class="madiaHead resourceHead" style="background-image:url(' + imgL + ')"></div>';
313
					itemlist += '<div class="madiaInfo OmadiaInfo">';
314
					itemlist += '<p class="ellipsisSty h1Font" id="usertitle">' + $respond.resourceName + '</p>';
315
					itemlist += '<p><span class="h2Font">' + thisName + '</span><em class="authiconNew ' + thisAuth + '" title="' + thisTitle + '"></em></p>';
316
					itemlist += '<p class="ellipsisSty-2 h2Font">用途:' + $respond.supportedServices + '</p>';
317
					itemlist += '</div></a>';
318

319
					add.innerHTML = itemlist;
320
					document.getElementById("oResource").appendChild(add);
321
				}
322
			},
323
			'error': function() {
324
				$.MsgBox.Alert('提示', '服务器连接超时!');
325
			}
326
		});
327
	}
328
	/*点击资源列表*/
329
	$("#oResource").on("click", "li", function() {
330
		location.href = "resourceShow.html?resourceId=" + $(this).attr("data-id");
331
	})
332
	/*服务里面相关文章*/
333
	function relatedArticles() {
334
		$.ajax({
335
			"url": "/ajax/article/lq/byWare",
336
			"type": "GET",
337
			"data": {
338
				"ware": sevriceId,
339
				"rows": 5
340
			},
341
			dataType: "json",
342
			"success": function(data) {
343
				if(data.success) {
344
					if(data.data.length > 0) {
345
						var $data=data.data;
346
						console.log($data)
347
						$("#oArticle").parents(".otherShow").removeClass("displayNone");
348
						for(var i = 0; i < $data.length; i++) {
349
							var str = "",ovel="";
350
							if($data[i].pageViews) {
351
								ovel="浏览量 "+$data[i].pageViews;
352
							}
353
							str += '<li data-id="' + $data[i].articleId + '" data-createTime="' + $data[i].createTime + '" data-shareId="' + $data[i].shareId + '"><a class="flexCenter OflexCenter">'
354
							if( $data[i].articleImg) {
355
								str += '<div class="madiaHead artHead" style="background-image: url(/data/article/' +  $data[i].articleImg + ')"></div>'
356
							} else {
357
								str += '<div class="madiaHead artHead"></div>'
358
							}
359
							str += '<div class="madiaInfo"  style="margin-top:18px;padding-bottom:8px">'
360
							str += '<p class="h1Font ellipsisSty">' +  $data[i].articleTitle + '</p>'
361
							str += '<p><span class="h2Font name" style="margin-right:10px"></span><span class="time" style="margin-right:10px;">' + commenTime( $data[i].publishTime) + '</span><span class="yue" style="margin-right:10px">'+ovel+'</span><span class="zan" style="margin-right:10px"></span><span class="leword"></span></p>'
362
							str += '</div></a></li>'
363
							var $str=$(str);
364
							$("#oArticle").append($str);
365
							(function($str,i) {
366
								console.log($str);
367
								console.log(i)
368
								if($data[i].articleType=="1") {
369
									ajaxRequist("/ajax/professor/baseInfo/" + $data[i].professorId, {}, "get", function(data) {
370
										$str.find(".name").text(data.data.name);
371
									})
372
								}else{
373
									ajaxRequist("/ajax/org/" + $data[i].orgId, {}, "get", function(data) {
374
										if(data.data.forShort) {
375
											$str.find(".name").text(data.data.forShort);
376
										}else{
377
											$str.find(".name").text(data.data.name);
378
										}
379
									})
380
								}
381
								if($data[i].articleAgree) {
382
									$str.find(".zan").text('赞 ' + $data[i].articleAgree);
383
								}
384
								ajaxRequist("/ajax/leavemsg/count" , {sid:$data[i].articleId,stype:1}, "get", function(data) {
385
										console.log(data)
386
										if(data.data) {
387
											$str.find(".leword").text('留言 ' + data.data);
388
										}
389
									})
390
							})($str,i)
391
						}
392
					}
393
				}
394
			},
395
			'error': function() {
396
				$.MsgBox.Alert('提示', '服务器连接超时!');
397
			}
398
		});
399
	}
400
	/*文章跳转*/
401
	$("#oArticle").on("click", "li", function() {
402
		var oArticle = {
403
			shareId: $(this).attr("data-shareId"),
404
			createTime: $(this).attr("data-createTime")
405
		};
406
		location.href = "/" + pageUrl('a', oArticle)
407
	})
408
	/*感兴趣的服务*/
409
	function interestingResources() {
410
		$.ajax({
411
			"url": "/ajax/ware/ralateWare",
412
			"type": "GET",
413
			"data": {
414
				"id": sevriceId,
415
				"rows": 5
416
			},
417
			"traditional": true,
418
			dataType: "json",
419
			"success": function(data) {
420
				//console.log(data);
421
				if(data.success) {
422
					if(data.data.length == 0) {
423
						return;
424
					}
425
					console.log(JSON.stringify(data.data))
426
					$("#relateArt").parents(".otherShow").removeClass("displayNone");
427
					var arr = [];
428
					for(var i = 0; i < data.data.length; i++) {
429
						arr.push(data.data[i].id)
430
					}
431
					console.log(arr)
432
					ajaxRequist("/ajax/ware/qm", {
433
						"id": arr
434
					}, "get", function(data) {
435
						for(var i = 0; i < data.data.length; i++)
436
							(function(i) {
437
								interestingResourcesHtml(data.data[i]);
438
							})(i)
439

440
					})
441
				}
442
			},
443
			'error': function() {
444
				$.MsgBox.Alert('提示', '服务器连接超时!');
445
			}
446
		});
447
	}
448
	/*感兴趣资源的html*/
449
	function interestingResourcesHtml($respond) {
450
		console.log($respond)
451
		var imgL = "../images/default-sevrice.jpg";
452
		if($respond.images.split(",").length) {
453
			imgL = '/data/ware' + $respond.images.split(",")[0]
454
		}
455
		var oURL;
456
		if($respond.category == 1) {
457
			oURL = "/ajax/professor/baseInfo/" + $respond.owner;
458
		} else {
459
			oURL = "/ajax/org/" + $respond.owner;
460
		}
461
		$.ajax({
462
			"url": oURL,
463
			"type": "GET",
464
			'dataType': "json",
465
			"success": function(data) {
466
				if(data.success) {
467
					//console.log(data)
468
					var thisName, userType, thisAuth, thisTitle
469
					if(data.data.forShort) {
470
						thisName = data.data.forShort;
471
					} else {
472
						thisName = data.data.name;
473
					}
474
					if($respond.resourceType == 1) {
475
						userType = autho(data.data.authType, data.data.orgAuth, data.data.authStatus);
476
						thisTitle = userType.title;
477
						thisAuth = userType.sty;
478
					} else {
479
						if(data.data.authStatus == 3) {
480
							thisTitle = "科袖认证企业";
481
							thisAuth = "authicon-com-ok";
482
						}
483
					}
484
					if($respond.cnt) {
485
						var cnt = "内容:" + $respond.cnt;
486
					} else {
487
						var cnt = ""
488
					}
489
					var add = document.createElement("li");
490
					add.className = "mui-table-view-cell";
491
					add.setAttribute("data-id", $respond.id);
492
					var itemlist = '<a class="flexCenter OflexCenter"><div class="madiaHead resourceHead" style="background-image:url(' + imgL + ')"></div>';
493
					itemlist += '<div class="madiaInfo OmadiaInfo">';
494
					itemlist += '<p class="ellipsisSty h1Font" id="usertitle">' + $respond.name + '</p>';
495
					itemlist += '<p><span class="h2Font">' + thisName + '</span><em class="authiconNew ' + thisAuth + '" title="' + thisTitle + '"></em></p>';
496
					itemlist += '<p class="ellipsisSty-2 h2Font ">' + cnt + '</p>';
497
					itemlist += '</div></a>';
498

499
					add.innerHTML = itemlist;
500
					document.getElementById("relateArt").appendChild(add);
501
				}
502
			},
503
			'error': function() {
504
				$.MsgBox.Alert('提示', '服务器连接超时!');
505
			}
506
		});
507
	}
508
	/*点击资源列表*/
509
	$("#relateArt").on("click", "li", function() {
510
		location.href = "sevriceShow.html?sevriceId=" + $(this).attr("data-id");
511
	})
512
	/*点击咨询*/
513
	$("#consultin").on('click', function() {
514
		if(userid && userid != null && userid != 'null' && userid != undefined && userid != 'undefined') {
515
			location.href = "tidings.html?id=" + professorId
516
		} else {
517
			quickLog();
518
			operatTab();
519
			closeLog();
520
		}
521
	});
522
	$("#expertli").on("click", ".addbtn", function() {
523
		if(userid && userid != null && userid != 'null' && userid != undefined && userid != 'undefined') {
524
			var id = $(this).attr("data-id");
525
			location.href = "tidings.html?id=" + id;
526
		} else {
527
			quickLog();
528
			operatTab();
529
			closeLog();
530
		}
531
	});
532
	//点击专家关注
533
	$("#person").on("click", '.attenSpan', function() {
534
		if(userid && userid != "null" && userid != null) {
535
			if($(this).is('.attenedSpan')) {
536
				cancelCollectionAbout(professorId, $(this), 1)
537
			} else {
538
				collectionAbout(professorId, $(this), 1);
539
			}
540
		} else {
541
			quickLog();
542
			operatTab();
543
			closeLog();
544
		}
545
	});
546
	$("#enterprise").on("click", '.attenSpan', function() {
547
		if(userid && userid != "null" && userid != null) {
548
			if($(this).is('.attenedSpan')) {
549
				cancelCollectionAbout($(".qiyego").attr('dataid'), $(this), 6)
550
			} else {
551
				collectionAbout($(".qiyego").attr('dataid'), $(this), 6);
552
			}
553
		} else {
554
			quickLog();
555
			operatTab();
556
			closeLog();
557
		}
558
	})
559

560
	//点击资源收藏
561
	$('#attention em').click(function() {
562
		if(userid && userid != "null" && userid != null) {
563
			if($(this).is('.icon-collected')) {
564
				cancelCollectionAbout(sevriceId, $(this), 10)
565
			} else {
566
				collectionAbout(sevriceId, $(this), 10)
567
			}
568
		} else {
569
			quickLog();
570
			operatTab();
571
			closeLog();
572
		}
573
	})
574

575
	//服务浏览量
576
	function pageViewsVal() {
577
		$.ajax({
578
			"url": "/ajax/ware/incPageViews",
579
			"type": "POST",
580
			"dataType": "json",
581
			"data": {
582
				"id": sevriceId
583
			},
584
			"success": function(data) {
585
				console.log(data);
586
				if(data.success) {}
587
			},
588
			"error": function() {
589
				$.MsgBox.Alert('提示', '链接服务器超时')
590
			}
591
		});
592
	}
593
	pageViewsVal();
594
	selUse();
595

596
	function selUse() {
597
		$.ajax({
598
			url: "/ajax/ware/pro",
599
			type: "GET",
600
			timeout: 10000,
601
			dataType: "json",
602
			async: true,
603
			data: {
604
				"id": sevriceId,
605
			},
606
			success: function(data, textState) {
607
				console.log(data)
608
				if(data.success) {
609
					if(data.data.length > 0) {
610
						$("#expertli").parents(".currentBlock").removeClass("displayNone");
611
						unauthUser(data.data);
612
					} else {
613
						$("#expertli").parents(".currentBlock").addClass("displayNone");
614
					}
615

616
				}
617
			},
618
			error: function(XMLHttpRequest, textStats, errorThrown) {
619
				$.MsgBox.Alert('提示', '服务器请求失败')
620
			}
621
		})
622
	}
623

624
	function unauthUser(data) {
625
		for(var i = 0; i < data.length; i++) {
626
			(function(i) {
627
				ajaxRequist("/ajax/professor/baseInfo/" + data[i].professor, {}, "get", function($res) {
628
					var osting = ""
629
					var img;
630
					var styC = "";
631
					var oClass = autho($res.authType, $res.orgAuth, $res.authStatus);
632
					var oTitle = "";
633
					if($res.title) {
634
						oTitle = $res.title;
635
					} else {
636
						if($res.office) {
637
							oTitle = $res.office;
638
						}
639
					}
640
					if($res.hasHeadImage) {
641
						img = "/images/head/" + $res.id + "_l.jpg";
642
					} else {
643
						img = "../images/default-photo.jpg"
644
					}
645
					var oSt = '<li class="flexCenter">'
646
					oSt += '<div class="madiaHead useHead" id="userimg" style="background-image: url(' + img + ');"></div>'
647
					oSt += '<div class = "madiaInfo">'
648
					oSt += '<p class = "ellipsisSty">'
649
					oSt += '<span class = "h1Font" id="name">' + $res.name + '</span><em class="authiconNew ' + oClass.sty + '" title="' + oClass.title + '"></em >'
650
					oSt += '</p>'
651
					oSt += '<p class="h2Font ellipsisSty">' + oTitle + '</p>'
652
					oSt += '</div>'
653
					oSt += '<span class="addbtn" data-id="' + $res.id + '">联系</span>'
654
					oSt += '</li>'
655
					osting += oSt;
656

657
					$("#expertli").html(osting);
658
				})
659
			})(i)
660
		}
661
	}
662

663
	//纠错反馈
664
	$(".correctSubmit").on("click", function() {
665
		var cntCon = $(this).siblings(".correctCon").val();
666
		var cntUser = "";
667
		if(userid && userid != null && userid != "null") {
668
			cntUser = userid;
669
		}
670
		if(cntCon.length > 500) {
671
			$.MsgBox.Alert('提示', '纠错反馈内容不得超过500个字');
672
			return;
673
		} else {
674
			$.ajax({
675
				"url": "/ajax/feedback/error/ware",
676
				"type": "POST",
677
				"dataType": "json",
678
				"async": true,
679
				"data": {
680
					"id": sevriceId,
681
					"cnt": cntCon,
682
					"user": cntUser
683
				},
684
				"success": function(data) {
685
					if(data.success) {
686
						backSuccessed();
687
					}
688
				},
689
				"error": function() {
690
					$.MsgBox.Alert('提示', '链接服务器超时')
691
				}
692
			});
693
		}
694
	})
695

696
})

+ 200 - 0
sevriceShow.html

@ -0,0 +1,200 @@
1
 <!DOCTYPE html>
2
<html>
3
<head>
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
6
<meta http-equiv="X-UA-Compatible" content="IE=edge">
7
<title>浏览资源-科袖网</title>
8
<link rel="shortcut icon" type="image/x-icon" href="images/favicon.png" media="screen" />
9
<link href="css/bootstrap.min.css" rel="stylesheet">
10
<link type="text/css" href="css/common.css" rel="stylesheet">
11
<link type="text/css" href="css/popup.css" rel="stylesheet">
12
<link type="text/css" href="css/genindex.css" rel="stylesheet">
13
<script type="text/javascript" src="js/jquery-1.11.1.js"></script>
14
<script type="text/javascript" src="js/jquery.imagezoom.min.js"></script>
15

16
</head>
17

18
<body>
19
<header id="header">
20
	<script src="js/header.js"></script>
21
</header>
22
<div id="container">
23
	<div class="containerCon">
24
		<div class="contentCon clearfix conBlock">
25
			<div class="leftconBox floatL leftconBox2">
26
				<div class="showDetail">
27
					<!--资源基本信息-->
28
					<div class="showReBasic clearfix">
29
						<div class="Imagebox floatL">
30
		                    <div class="tb-booth tb-pic tb-s360">
31
		                        <a href="" target="_blank">
32
		                            <img src="" class="jqzoom" id="firstFigure"/>
33
		                        </a>
34
		                    </div>
35
		                    <ul class="tb-thumb" id="thumblist">
36
		                       
37
		                    </ul>
38
		                </div>
39
		                <div class="reInfoBlock floatL">
40
		                	<div class="h1Font" id="resourceName"></div>
41
		                	<div class="h2Font">应用用途:<span id="application"></span></div>
42
		                	<div class="operateBlock resShareUl">
43
		                		<ul>
44
		                			<li id="attention"><span>收藏</span> <em class="operateicon operateicon2 icon-collect"></em></li>
45
									<li>
46
										<span>分享到</span>
47
										<a href="" id="weibo" target="_blank"><em class="operateicon operateicon2 icon-sina"></em></a>
48
										<em class="operateicon operateicon2 icon-wechat shareWeixin">
49
											<div class="shareCode clearfix">
50
												<div class="floatL" id="qrcode"></div>
51
												<div class="shareWord floatR">
52
													<p>打开微信“扫一扫”,<br/>打开网页后点击屏幕右上角“分享”按钮</p>
53
												</div>
54
											</div>
55
										</em>
56
									</li>
57
		                		</ul>
58
		                	</div>
59
		                </div>
60
	                </div>
61
	                <div class="showReOther">
62
						<!--资源详情区-->
63
						<div class="showMain showMain2">
64
							<ul>
65
								<li>
66
									<div class="showTit">合作备注:</div>
67
									<div class="showCon" id="remarkContent">
68
									</div>
69
								</li>
70
								<li id="articleContent">
71
									<div class="showTit">详细介绍:</div>
72
									<div class="showCon" id="descp">
73
									</div>
74
								</li>
75
							</ul>
76
						</div>
77
						<!--标签模块-->
78
						<ul class="tagList">
79
							
80
						</ul>
81
						<!--相关资源-->
82
						<div class="form-item otherShow displayNone">
83
							<div class="aboutTit">相关资源</div>
84
							<div class="form-result aboutRes pointOk">
85
								<ul id="oResource">
86
								</ul>
87
							</div>
88
						</div>
89
						<!--相关文章-->
90
						<div class="form-item otherShow displayNone">
91
							<div class="aboutTit">相关文章</div>
92
							<div class="form-result aboutRes pointOk">
93
								<ul id="oArticle">
94
								</ul>
95
							</div>
96
						</div>
97
						<!--您可能感兴趣的资源-->
98
						<div class="form-item otherShow displayNone">
99
							<div class="aboutTit">您可能感兴趣的服务</div>
100
							<div class="form-result aboutRes pointOk">
101
								<ul id="relateArt">
102
									
103
								</ul>
104
							</div>
105
						</div>
106
					</div>
107
				</div>
108
			</div>
109
			<div class="rightconBox floatR">
110
				<div class="conItem conItemG alignCenter displayNone" id="person">
111
					<div class="madiaHead useHead" id="headImg" style="cursor:pointer"></div>
112
					<div class="proInfo">
113
						<div class="h3Font clearfix">
114
							<span class="h1Font" id="nameS" style="cursor:pointer"></span>
115
							<span class="authiconNew" title="" id="authFlag"></span>
116
						</div>
117
						<p class="h2Font" id="titleOffice"></p>
118
						<p class="h2Font" id="orgType"></p>
119
					</div>
120
					<div class="goSpan displayNone">
121
						<span class="consultSpan" id="consultin">联系</span>
122
						<span class="attenSpan">关注</span>
123
					</div>
124
					<div class="form-item otherBlock currentBlock displayNone">
125
						<div class="aboutTit">热门服务</div>
126
						<div class="form-result currentArt">
127
							<ul class="recentlyList">
128
							</ul>
129
						</div>
130
					</div>	
131
				</div>
132
				<div class="conItem conItemG alignCenter displayNone" id="enterprise">
133
					<a href="" class="qiyego">
134
						<div class="madiaHead cmpHead" id="Qimg">
135
							<div class="boxBlock">
136
								<img class="boxBlockimg" src="" id="companyImg">
137
							</div>
138
						</div>
139
					</a>
140
					<div class="proInfo">
141
						<div class="h3Font clearfix">
142
							<a  class="h1Font qiyego" id="Qname"></a>
143
							<span class="authiconNew" title="" id="QauthFlag"></span>
144
						</div>
145
						<p class="h2Font ellipsisSty" id="Qindustry"></p>
146
						<p class="h2Font" id="QorgType"></p>
147
					</div>
148
					<div class="goSpan">
149
						<span class="attenSpan">关注</span>
150
					</div>
151
					<div class="form-item otherBlock currentBlock displayNone">
152
						<div class="aboutTit">联系人</div>
153
						<div class="form-result addexpertRe" style="margin-top:0">
154
							<ul class="addexpert" id="expertli">
155
								
156
							</ul>
157
						</div>
158
					</div>
159
					<div class="form-item otherBlock currentBlock displayNone">
160
						<div class="aboutTit">热门资源</div>
161
						<div class="form-result currentArt">
162
							<ul class="recentlyList">
163
							</ul>
164
						</div>
165
					</div>
166
				</div>
167
			</div>
168
		</div>
169
	</div>
170
</div>
171
<!--反馈建议-->
172
<script type="text/javascript" src="js/correctBack.js"></script>
173
<footer>
174
	<script type="text/javascript" src="js/footer.js"></script>
175
</footer>
176
<script type="text/javascript" src="js/jquery.cookie.js"></script>
177
<script type="text/javascript" src="js/jquery.similar.msgbox.js"></script>
178
<script type="text/javascript" src="js/weixinshare/qrcode.min.js"></script>
179
<script type="text/javascript" src="js/jquery.page.js"></script>
180
<script type="text/javascript" src="js/common.js"></script>
181
<!--<script type="text/javascript" src="js/popup.js"></script>-->
182
<script type="text/javascript" src="js/sevriceShow.js"></script>
183
<script type="text/javascript" src="js/quickLogin.js"></script>
184
<script type="text/javascript">
185
	//微信分享
186
	var qrcode = new QRCode(document.getElementById("qrcode"), {
187
		width : 100,
188
		height : 100
189
	});
190
	function makeCode(){
191
		var hurl = window.location.host;
192
		var resourceId =  GetQueryString("resourceId");
193
		var elurl = "http://" + hurl + "/e/r.html?id=" + resourceId ; 
194
		qrcode.makeCode(elurl);
195
	}
196
	makeCode();
197
	
198
</script>
199
</body>
200
</html>