Quellcode durchsuchen

非专领域修改

lyn7568 vor 5 Jahren
Ursprung
Commit
ff0e9f8771
7 geänderte Dateien mit 899 neuen und 813 gelöschten Zeilen
  1. 11 6
      e/2.html
  2. 28 27
      e/3.html
  3. 451 423
      js/recommend.js
  4. 4 4
      js/search_h5.js
  5. 363 340
      js/teamInforShow.js
  6. 0 1
      js/unPatentShow.js
  7. 42 12
      js/userInforShow.js

+ 11 - 6
e/2.html

@ -1378,24 +1378,29 @@
1378 1378
					var dataStr = data.data;
1379 1379
					var strAdd = '';
1380 1380
					if (dataStr.length > 0) {
1381
						if (dataStr[0].subject == undefined) {
1382
							$('.dis').css('display', 'none')
1381
						var src = "../images/default-resource.jpg";
1382
						var subject;
1383
						if(dataStr[0].pic) {
1384
							 src = '/data/researchResult' + dataStr[0].pic.split(",")[0]
1383 1385
						}
1386
						
1384 1387
						if (dataStr[0].subject) {
1385
							var subject = '应用领域:' +dataStr[0].subject
1388
							 subject = '应用领域:' + dataStr[0].subject
1389
						}else{
1390
							subject = ''
1386 1391
						}
1387
1388
1392
						var department = dataStr[0].department == undefined ? '' : '所属部门: ' + dataStr[0].department
1389 1393
1390 1394
						document.getElementById('proUnPatent').parentNode.parentNode.classList.remove("displayNone");
1391 1395
						var li = document.createElement("li");
1392 1396
						li.setAttribute("data-id", dataStr[0].id);
1393 1397
						li.className = "mui-table-view-cell";
1394 1398
						li.innerHTML = '<div class="flexCenter OflexCenter mui-clearfix">' +
1395
							'<div class="madiaHead paperHead"></div>' +
1399
							'<div class="madiaHead " style="background-image:url(' + src + ')"></div>' +
1396 1400
							'<div class="madiaInfo OmadiaInfo">' +
1397 1401
							'<p class="ellipsisSty-2 h1Font">' + dataStr[0].name + '</p>' +
1398 1402
							'<p class="ellipsisSty h2Font dis">' + subject + '</p>' +
1403
							'<p class="ellipsisSty h2Font ">' + department + '</p>' +
1399 1404
							//.substring(0, dataStr[i].authors.length - 1)    
1400 1405
							'</div>' +
1401 1406
							'</div>'

+ 28 - 27
e/3.html

@ -315,7 +315,7 @@
315 315
                            paperHtml(data.data); //非专列表渲染
316 316
                            getpatentAuthors(data.data.id) //研究者数据渲染
317 317
                            relevantarticalList(data.data.orgId) //企业
318
                           
318
319 319
                        }
320 320
                    },
321 321
                    error: function (e) {
@ -528,38 +528,39 @@
528 528
            //研究机构
529 529
            function relevantarticalList(id) {
530 530
                $.ajax({
531
                    "url": "/ajax/org/"+id,
531
                    "url": "/ajax/org/" + id,
532 532
                    "type": "GET",
533 533
                    "dataType": "json",
534
                  
535 534
                    "async": "false",
536 535
                    "success": function (data) {
537 536
                        console.log(data)
538 537
                        if (data.success && data.data != "") {
539
					                            document.getElementById("researchOrganization").parentNode
540
					                                .classList.remove("displayNone");
541
					                            document.getElementById("researchOrganization").innerHTML = "";
542
					                            var StrData = data.data
543
												// console.log(JSON.stringify(StrData.name))
544
					                                var imgL = "../images/default-artical.jpg";
545
					                                var add = document.createElement("li");
546
					                                add.className =
547
					                                    "mui-table-view-cell flexCenter OflexCenter";
548
					                                var itemlist =
549
					                                    '<div class="madiaHead artHead" style="background-image:url(' +
550
					                                    imgL + ')"></div>';
551
					                                itemlist += '<div class="madiaInfo OmadiaInfo">';
552
					                                itemlist +=
553
					                                    '<p class="ellipsisSty-2 h1Font" id="usertitle">' +
554
					                                    StrData.name + '</p>';
555
					                                itemlist +=
556
					                                    '<p><span class="h2Font" style="margin-right:10px">' +
557
					                                    '</span><span class="time">' + commenTime(StrData
558
					                                        .createTime) + '</span></p>';
559
					                                itemlist += '</div>';
560
					                                add.innerHTML = itemlist;
561
					                                document.getElementById("researchOrganization").appendChild(add);
562
					                        }
538
                            document.getElementById("researchOrganization").parentNode
539
                                .classList.remove("displayNone");
540
                            document.getElementById("researchOrganization").innerHTML = "";
541
                            var StrData = data.data
542
                            var imgL = "../images/default-artical.jpg";
543
                            if (StrData.hasOrgLogo) {
544
                                imgL = '/images/org/' + StrData.id + '.jpg'
545
                            }
546
                            var add = document.createElement("li");
547
                            add.className =
548
                                "mui-table-view-cell flexCenter OflexCenter";
549
                            var itemlist =
550
                                '<div class="madiaHead artHead" style="background-image:url(' +
551
                                imgL + ')"></div>';
552
                            itemlist += '<div class="madiaInfo OmadiaInfo">';
553
                            itemlist +=
554
                                '<p class="ellipsisSty-2 h1Font" id="usertitle">' +
555
                                StrData.name + '</p>';
556
                            itemlist +=
557
                                '<p><span class="h2Font" style="margin-right:10px">' +
558
                                '</span><span class="time">' + commenTime(StrData
559
                                    .createTime) + '</span></p>';
560
                            itemlist += '</div>';
561
                            add.innerHTML = itemlist;
562
                            document.getElementById("researchOrganization").appendChild(add);
563
                        }
563 564
                    }
564 565
565 566
                });

+ 451 - 423
js/recommend.js

@ -1,440 +1,468 @@
1
$(function() {
1
$(function () {
2 2
	$(".headnav li").eq(2).addClass("navcurrent");
3 3
	$("#feedback").hide();
4
	loginStatus();//判断个人是否登录
4
	loginStatus(); //判断个人是否登录
5 5
	var userid = $.cookie("userid");
6
	
6
7 7
	var rows = 20,
8 8
		pageNo = 1,
9 9
		dataO = {
10
			patSortNum:"",
11
			patCreateTime:"",
12
			patId:""
10
			patSortNum: "",
11
			patCreateTime: "",
12
			patId: ""
13 13
		},
14
		linkNum=0;//栏目类别导航
15
	var oAjax = function(url, dataS, otype, oFun,beforeFun,completeFun) {
16
		$.ajax({
17
			url:url,
18
			dataType: 'json',
19
			type: otype,
20
			data: dataS,
21
			traditional: true,
22
			beforeSend: beforeFun,
23
			success: function(res) {
24
				if(res.success) {
25
					oFun(res)
26
				}
27
			},
28
			complete:completeFun
29
			
30
		});
31
	},
32
	insertNodata = function (targetE,newStr) {
33
		var parent = document.getElementById(targetE).parentNode;
34
		var kong = document.createElement("div");
35
		kong.className = "con-kong";
36
		kong.innerHTML ='<div class="picbox picNull"></div>'+
37
					'<div class="txtbox">暂时没有符合该搜索条件的内容</div>'
38
		if(newStr){
39
			kong.querySelector(".txtbox").innerHTML = newStr;
40
		}
41
		if (parent.firstChild.className == "con-kong") {
42
			return
43
		} else {
44
			parent.insertBefore(kong,parent.firstChild);
45
		}
14
		linkNum = 0; //栏目类别导航
15
	var oAjax = function (url, dataS, otype, oFun, beforeFun, completeFun) {
16
			$.ajax({
17
				url: url,
18
				dataType: 'json',
19
				type: otype,
20
				data: dataS,
21
				traditional: true,
22
				beforeSend: beforeFun,
23
				success: function (res) {
24
					if (res.success) {
25
						oFun(res)
26
					}
27
				},
28
				complete: completeFun
46 29
47
	},
48
	removeNodata = function (targetE) {
49
		var parent = document.getElementById(targetE).parentNode;
50
		if (parent.firstChild.className == "con-kong") {
51
			parent.removeChild(parent.firstChild);
52
		} else {
53
			return
54
		}
55
	},
56
	patentListVal = function(isbind, flag) {
57
		var aimId="table-item-2"
58
		if (flag) {
59
			aimId="table-item-3"
60
		}
61
		oAjax("/ajax/ppatent/index/search",{
62
			"sortNum": dataO.patSortNum,
63
			"createTime":dataO.patCreateTime,
64
			"id": dataO.patId,
65
			"rows": rows
66
		}, "get", function(res){
67
			var $info = res.data;
68
			if($info.length > 0) {
69
				$("#"+aimId).show()
70
				dataO.patSortNum = $info[$info.length - 1].sortNum;
71
				dataO.patCreateTime = $info[$info.length - 1].createTime;
72
				dataO.patId = $info[$info.length - 1].id;
73
				for(var i = 0; i < $info.length; i++) {
74
					var itemlist = '<li class="flexCenter">';
75
						itemlist += '<a target="_blank" href="/' + pageUrl("pt",$info[i]) +'" class="linkhref"><div class="lefthead patenthead"></div>';
76
						itemlist += '<div class="centercon centercon2">';
77
						itemlist += '<p class="h1font ellipsisSty">'+ $info[i].name +'</p>';
78
						itemlist += '<p class="h2font ellipsisSty">发明人:'+ $info[i].authors.substring(0, $info[i].authors.length - 1) +'</p>';
79
						itemlist += '<p class="h2font ellipsisSty">申请人:'+ $info[i].reqPerson +'</p>';
80
						itemlist += '</div></a></li>';
81
					$("#"+aimId).append(itemlist)
82
				}
30
			});
31
		},
32
		insertNodata = function (targetE, newStr) {
33
			var parent = document.getElementById(targetE).parentNode;
34
			var kong = document.createElement("div");
35
			kong.className = "con-kong";
36
			kong.innerHTML = '<div class="picbox picNull"></div>' +
37
				'<div class="txtbox">暂时没有符合该搜索条件的内容</div>'
38
			if (newStr) {
39
				kong.querySelector(".txtbox").innerHTML = newStr;
83 40
			}
84
			var liLen=document.getElementById(aimId).querySelectorAll("li").length;
85
			removeNodata(aimId);
86
			if($info.length == 0 && liLen == 0 ){
87
				$("#"+aimId).hide()
88
				insertNodata(aimId);
41
			if (parent.firstChild.className == "con-kong") {
42
				return
43
			} else {
44
				parent.insertBefore(kong, parent.firstChild);
89 45
			}
90
			if(isbind){
91
				$("#"+aimId).parent().find(".js-load-more").unbind("click").on("click",function(){
92
					if (flag) {
93
						patentListVal(false, true)
94
					} else {
95
					 	patentListVal(false)
96
					}
97
				})
46
47
		},
48
		removeNodata = function (targetE) {
49
			var parent = document.getElementById(targetE).parentNode;
50
			if (parent.firstChild.className == "con-kong") {
51
				parent.removeChild(parent.firstChild);
52
			} else {
53
				return
98 54
			}
99
			if ($info.length < rows) {
100
				$("#"+aimId).parent().find(".js-load-more").unbind("click");
101
				$("#"+aimId).parent().find(".js-load-more").hide();
55
		},
56
		patentListVal = function (isbind, flag) {
57
			var aimId = "table-item-2"
58
			if (flag) {
59
				aimId = "table-item-3"
102 60
			}
103
		},function(){
104
			$("#"+aimId).parent().find(".js-load-more").attr("disabled",true);
105
			   $("#"+aimId).parent().find(".js-load-more").addClass("active");
106
		},function(){
107
			$("#"+aimId).parent().find(".js-load-more").removeAttr("disabled");
108
			$("#"+aimId).parent().find(".js-load-more").removeClass("active");
109
		})
110
	},
111
	unpatentListVal = function(isbind) {
112
		var aimId="table-item-1"
113
		oAjax("/ajax/resResult/pq",{
114
			"status": ['1'],
115
			"pageSize": rows,
116
			"pageNo": pageNo
117
		}, "get", function(res){
118
			var $info = res.data.data;
119
			if($info.length > 0) {
120
				$("#"+aimId).show()
121
				if(res.data.pageNo !== pageNo){
122
					$("#"+aimId).parent().find(".js-load-more").unbind("click");
123
					$("#"+aimId).parent().find(".js-load-more").hide();
124
					return
61
			oAjax("/ajax/ppatent/index/search", {
62
				"sortNum": dataO.patSortNum,
63
				"createTime": dataO.patCreateTime,
64
				"id": dataO.patId,
65
				"rows": rows
66
			}, "get", function (res) {
67
				var $info = res.data;
68
				if ($info.length > 0) {
69
					$("#" + aimId).show()
70
					dataO.patSortNum = $info[$info.length - 1].sortNum;
71
					dataO.patCreateTime = $info[$info.length - 1].createTime;
72
					dataO.patId = $info[$info.length - 1].id;
73
					for (var i = 0; i < $info.length; i++) {
74
						var itemlist = '<li class="flexCenter">';
75
						itemlist += '<a target="_blank" href="/' + pageUrl("pt", $info[i]) + '" class="linkhref"><div class="lefthead patenthead"></div>';
76
						itemlist += '<div class="centercon centercon2">';
77
						itemlist += '<p class="h1font ellipsisSty">' + $info[i].name + '</p>';
78
						itemlist += '<p class="h2font ellipsisSty">发明人:' + $info[i].authors.substring(0, $info[i].authors.length - 1) + '</p>';
79
						itemlist += '<p class="h2font ellipsisSty">申请人:' + $info[i].reqPerson + '</p>';
80
						itemlist += '</div></a></li>';
81
						$("#" + aimId).append(itemlist)
82
					}
83
				}
84
				var liLen = document.getElementById(aimId).querySelectorAll("li").length;
85
				removeNodata(aimId);
86
				if ($info.length == 0 && liLen == 0) {
87
					$("#" + aimId).hide()
88
					insertNodata(aimId);
89
				}
90
				if (isbind) {
91
					$("#" + aimId).parent().find(".js-load-more").unbind("click").on("click", function () {
92
						if (flag) {
93
							patentListVal(false, true)
94
						} else {
95
							patentListVal(false)
96
						}
97
					})
98
				}
99
				if ($info.length < rows) {
100
					$("#" + aimId).parent().find(".js-load-more").unbind("click");
101
					$("#" + aimId).parent().find(".js-load-more").hide();
125 102
				}
126
				for(var i = 0; i < $info.length; i++) {
127
					var resIM='<div class="lefthead patenthead"></div>'
128
					if ($info[i].pic) {
129
						var src = '/data/researchResult' + $info[i].pic.split(",")[0]
130
						resIM = '<div class="lefthead patenthead" style="background-image:url('+ src +')"></div>';
103
			}, function () {
104
				$("#" + aimId).parent().find(".js-load-more").attr("disabled", true);
105
				$("#" + aimId).parent().find(".js-load-more").addClass("active");
106
			}, function () {
107
				$("#" + aimId).parent().find(".js-load-more").removeAttr("disabled");
108
				$("#" + aimId).parent().find(".js-load-more").removeClass("active");
109
			})
110
		},
111
		unpatentListVal = function (isbind) {
112
			var aimId = "table-item-1"
113
			oAjax("/ajax/resResult/pq", {
114
				"status": ['1'],
115
				"pageSize": rows,
116
				"pageNo": pageNo
117
			}, "get", function (res) {
118
				var $info = res.data.data;
119
				if ($info.length > 0) {
120
					$("#" + aimId).show()
121
					if (res.data.pageNo !== pageNo) {
122
						$("#" + aimId).parent().find(".js-load-more").unbind("click");
123
						$("#" + aimId).parent().find(".js-load-more").hide();
124
						return
131 125
					}
132
					var itemlist = '<li class="flexCenter">';
133
						itemlist += '<a target="_blank" href="unPatentShow.html?id='+$info[i].id+'" class="linkhref">';
126
					var subject = '',
127
						department = ''
128
					for (var i = 0; i < $info.length; i++) {
129
130
						if ($info[i].subject) {
131
							subject = "应用领域:" + $info[i].subject
132
						} else {
133
							subject = ''
134
						}
135
						if ($info[i].department) {
136
							department = '所属部门:' + $info[i].department
137
						} else {
138
							department = ''
139
						}
140
141
						var resIM = '<div class="lefthead patenthead"></div>'
142
						if ($info[i].pic) {
143
							var src = '/data/researchResult' + $info[i].pic.split(",")[0]
144
							resIM = '<div class="lefthead patenthead" style="background-image:url(' + src + ')"></div>';
145
						}
146
						var itemlist = '<li class="flexCenter">';
147
						itemlist += '<a target="_blank" href="unPatentShow.html?id=' + $info[i].id + '" class="linkhref">';
134 148
						itemlist += resIM
135 149
						itemlist += '<div class="centercon centercon2">';
136
						itemlist += '<p class="h1font ellipsisSty">'+ $info[i].name +'</p>';
137
						itemlist += '<p class="h2font ellipsisSty displayNone">研究者:<span class="researchers"></span></p>';
150
						itemlist += '<p class="h1font ellipsisSty">' + $info[i].name + '</p>';
151
						itemlist += '<p class="h2font ellipsisSty ">' + subject + '<span class="researchers"></span></p>';
152
						itemlist += '<p class="h2font ellipsisSty ">' + department + '<span class="researchers"></span></p>';
153
						// if ($info[i].orgId) {
154
						// 	itemlist += '<p class="h2font ellipsisSty">所属机构:<span class="resOrgName"></span></p>';
155
						// }
156
						itemlist += '</div></a></li>';
157
						var $itemlist = $(itemlist);
158
						$("#" + aimId).append($itemlist)
159
						queryResearcher($info[i].id, $itemlist)
138 160
						if ($info[i].orgId) {
139
							itemlist += '<p class="h2font ellipsisSty">所属机构:<span class="resOrgName"></span></p>';
161
							queryReseOrgName($info[i].orgId, $itemlist)
140 162
						}
141
						itemlist += '</div></a></li>';
142
					var $itemlist = $(itemlist);
143
					$("#"+aimId).append($itemlist)
144
					queryResearcher($info[i].id, $itemlist)
145
					if ($info[i].orgId) {
146
						queryReseOrgName($info[i].orgId, $itemlist)
147 163
					}
148 164
				}
149
			}
150
			var liLen=document.getElementById(aimId).querySelectorAll("li").length;
151
			removeNodata(aimId);
152
			if($info.length == 0 && liLen == 0 ){
153
				$("#"+aimId).hide()
154
				insertNodata(aimId);
155
			}
156
			if(isbind){
157
				$("#"+aimId).parent().find(".js-load-more").unbind("click").on("click",function(){
158
					pageNo++
159
					 unpatentListVal(false)
160
				})
161
			}
162
			if ($info.length < rows) {
163
				$("#"+aimId).parent().find(".js-load-more").unbind("click");
164
				$("#"+aimId).parent().find(".js-load-more").hide();
165
			}
166
		},function(){
167
			$("#"+aimId).parent().find(".js-load-more").attr("disabled",true);
168
			   $("#"+aimId).parent().find(".js-load-more").addClass("active");
169
		},function(){
170
			$("#"+aimId).parent().find(".js-load-more").removeAttr("disabled");
171
			$("#"+aimId).parent().find(".js-load-more").removeClass("active");
172
		})
173
	},
174
	recommendUnpatent = function(){
175
		var aimId="table-item-0"
176
		oAjax("/ajax/resResult/pq",{
177
			"status": ['1'],
178
			"pageSize": 5,
179
			"pageNo": 1
180
		}, "get", function(res){
181
			var $info = res.data.data;
182
			if($info.length > 0) {
183
				$("#"+aimId).show()
184
				for(var i = 0; i < $info.length; i++) {
185
					var resIM='<div class="lefthead patenthead"></div>'
186
					if ($info[i].pic) {
187
						var src = '/data/researchResult' + $info[i].pic.split(",")[0]
188
						resIM = '<div class="lefthead patenthead" style="background-image:url('+ src +')"></div>';
189
					}
190
					var itemlist = '<li class="flexCenter">';
191
						itemlist += '<a target="_blank" href="unPatentShow.html?id='+$info[i].id+'" class="linkhref">';
165
				var liLen = document.getElementById(aimId).querySelectorAll("li").length;
166
				removeNodata(aimId);
167
				if ($info.length == 0 && liLen == 0) {
168
					$("#" + aimId).hide()
169
					insertNodata(aimId);
170
				}
171
				if (isbind) {
172
					$("#" + aimId).parent().find(".js-load-more").unbind("click").on("click", function () {
173
						pageNo++
174
						unpatentListVal(false)
175
					})
176
				}
177
				if ($info.length < rows) {
178
					$("#" + aimId).parent().find(".js-load-more").unbind("click");
179
					$("#" + aimId).parent().find(".js-load-more").hide();
180
				}
181
			}, function () {
182
				$("#" + aimId).parent().find(".js-load-more").attr("disabled", true);
183
				$("#" + aimId).parent().find(".js-load-more").addClass("active");
184
			}, function () {
185
				$("#" + aimId).parent().find(".js-load-more").removeAttr("disabled");
186
				$("#" + aimId).parent().find(".js-load-more").removeClass("active");
187
			})
188
		},
189
		recommendUnpatent = function () {
190
			var aimId = "table-item-0"
191
			oAjax("/ajax/resResult/pq", {
192
				"status": ['1'],
193
				"pageSize": 5,
194
				"pageNo": 1
195
			}, "get", function (res) {
196
				var $info = res.data.data;
197
				if ($info.length > 0) {
198
					$("#" + aimId).show()
199
					for (var i = 0; i < $info.length; i++) {
200
						var subject = '',
201
							department = ''
202
						if ($info[i].subject) {
203
							subject = "应用领域:" + $info[i].subject
204
						} else {
205
							subject = ''
206
						}
207
						if ($info[i].department) {
208
							department = '所属部门:' + $info[i].department
209
						} else {
210
							department = ''
211
						}
212
213
						var resIM = '<div class="lefthead patenthead"></div>'
214
						if ($info[i].pic) {
215
							var src = '/data/researchResult' + $info[i].pic.split(",")[0]
216
							resIM = '<div class="lefthead patenthead" style="background-image:url(' + src + ')"></div>';
217
						}
218
						var itemlist = '<li class="flexCenter">';
219
						itemlist += '<a target="_blank" href="unPatentShow.html?id=' + $info[i].id + '" class="linkhref">';
192 220
						itemlist += resIM
193 221
						itemlist += '<div class="centercon centercon2">';
194
						itemlist += '<p class="h1font ellipsisSty">'+ $info[i].name +'</p>';
195
						itemlist += '<p class="h2font ellipsisSty displayNone">研究者:<span class="researchers"></span></p>';
222
						itemlist += '<p class="h1font ellipsisSty">' + $info[i].name + '</p>';
223
						itemlist += '<p class="h2font ellipsisSty ">' + subject + '<span class="researchers"></span></p>';
196 224
						if ($info[i].orgId) {
197
							itemlist += '<p class="h2font ellipsisSty">所属机构:<span class="resOrgName"></span></p>';
225
							itemlist += '<p class="h2font ellipsisSty">' + department + '<span class="resOrgName"></span></p>';
198 226
						}
199 227
						itemlist += '</div></a></li>';
200
					var $itemlist = $(itemlist);
201
					$("#"+aimId).append($itemlist)
202
					queryResearcher($info[i].id, $itemlist)
203
					if ($info[i].orgId) {
204
						queryReseOrgName($info[i].orgId, $itemlist)
228
						var $itemlist = $(itemlist);
229
						$("#" + aimId).append($itemlist)
230
						// queryResearcher($info[i].id, $itemlist)
231
						if ($info[i].orgId) {
232
							queryReseOrgName($info[i].orgId, $itemlist)
233
						}
205 234
					}
206 235
				}
207
			}
208
		})
209
	},
236
			})
237
		},
210 238
211 239
212
	hotUnpatentList = function() {
213
		var aimId="hotNews"
214
		oAjax("/ajax/resResult/pq",{
215
			"status": ['1'],
216
			"pageSize": 10,
217
			"pageNo": 1
218
		}, "get", function(res){
219
			var $data = res.data.data;
220
			if($data.length > 0) {
221
				$("#"+aimId).parents(".conItem").removeClass("displayNone");
222
				var oLeng=$data.length<10?$data.length:10;
223
				for(var i=0;i<oLeng;i++) {
224
					var listLi=$('<li class="flexCenter"></li>').appendTo($("#hotNews"));
225
					var str='<a target="_blank" href="unPatentShow.html?id='+$data[i].id+'"><p class="h2Font ellipsisSty-2">'+$data[i].name+'</p></a>'
226
					$(str).appendTo(listLi);
227
				}
228
			}
229
		})
230
	},
231
	navmenu=function(){
232
		$(document).bind("click",function(e){ 
233
			var target = $(e.target); 
234
			if(target.closest(".table-tab-item").length == 0){ 
235
				$(".table-drop").hide(); 
236
				$(".rightbtn").find("em").removeClass("unfoldtr").addClass("foldtr");
237
			} 
238
		})
239
		$(".table-tab-item").on("mouseenter","li.rightbtn",function(){
240
			$(this).find(".table-drop").show();
241
			$(this).find("em").removeClass("foldtr").addClass("unfoldtr");
242
		}).on("mouseleave","li.rightbtn",function(){
243
			$(this).find("em").removeClass("unfoldtr").addClass("foldtr");
244
			$(this).find(".table-drop").hide();
245
		})
246
		
247
		$(".table-drop").on("click","li",function(){
248
			$(".rightbtn").find("span").html($(this).text());
249
		})
250
		$(".table-tab-item").on("click","li",function(){
251
			if($(this).is('.table-tab-slide')){
252
                linkNum = $(this).index(".table-tab-slide");
253
                $(".haveData").find("ul").each(function () {
254
                    $(this).html("");
255
                    $(this).parent().find(".js-load-more").unbind("click");
256
                    $(this).parent().find(".js-load-more").show();
257
                });
258
                $("#table-item-"+linkNum).html("");
259
                dataColNum=$(this).attr('data-col');
260
				$(".table-tab-slide").removeClass("table-tab-slide-active");
261
				$(this).addClass("table-tab-slide-active");
262
				$(".table-drop").fadeOut(1000);
263
				$(".rightbtn").find("em").removeClass("unfoldtr").addClass("foldtr");
264
				$(".table-item-list").eq(linkNum).show().siblings().hide();
265
				if($(".rightbtn").find("li").is(".table-tab-slide-active")){
266
					$(".rightbtn").addClass("table-tab-slide-active");
267
				}else{
268
					$(".rightbtn").removeClass("table-tab-slide-active");
269
				}
270
				dataO = {
271
					patSortNum:"",
272
					patCreateTime:"",
273
					patId:""
240
		hotUnpatentList = function () {
241
			var aimId = "hotNews"
242
			oAjax("/ajax/resResult/pq", {
243
				"status": ['1'],
244
				"pageSize": 10,
245
				"pageNo": 1
246
			}, "get", function (res) {
247
				var $data = res.data.data;
248
				if ($data.length > 0) {
249
					$("#" + aimId).parents(".conItem").removeClass("displayNone");
250
					var oLeng = $data.length < 10 ? $data.length : 10;
251
					for (var i = 0; i < oLeng; i++) {
252
						var listLi = $('<li class="flexCenter"></li>').appendTo($("#hotNews"));
253
						var str = '<a target="_blank" href="unPatentShow.html?id=' + $data[i].id + '"><p class="h2Font ellipsisSty-2">' + $data[i].name + '</p></a>'
254
						$(str).appendTo(listLi);
255
					}
274 256
				}
275
				pageNo=1
276
				if(linkNum==0){
277
					recommendUnpatent()
278
					patentListVal(true, true)
279
				}else if(linkNum == 1){
280
					unpatentListVal(true)
281
				}else if(linkNum == 2){
282
					patentListVal(true)
257
			})
258
		},
259
		navmenu = function () {
260
			$(document).bind("click", function (e) {
261
				var target = $(e.target);
262
				if (target.closest(".table-tab-item").length == 0) {
263
					$(".table-drop").hide();
264
					$(".rightbtn").find("em").removeClass("unfoldtr").addClass("foldtr");
283 265
				}
284
			}else{
266
			})
267
			$(".table-tab-item").on("mouseenter", "li.rightbtn", function () {
285 268
				$(this).find(".table-drop").show();
286
			}
287
		})
288
	},
289
	queryResearcher = function (id, $list) {
290
		if (id) {
291
			oAjax("/ajax/resResult/researcher",{
292
				"id": id
293
			}, 'get', function($data) {
294
				var arr = []
295
				if($data.data.length) {
296
					$list.find('.researchers').parent().removeClass('displayNone')
297
					for (var i = 0; i < $data.data.length;i++) {
298
						arr.push($data.data[i].name)
299
					}
300
					$list.find('.researchers').html(arr.join(','))
301
				}			
269
				$(this).find("em").removeClass("foldtr").addClass("unfoldtr");
270
			}).on("mouseleave", "li.rightbtn", function () {
271
				$(this).find("em").removeClass("unfoldtr").addClass("foldtr");
272
				$(this).find(".table-drop").hide();
302 273
			})
303
		}
304
	},
305
	queryReseOrgName = function (id, $list) {
306
		if (id) {
307
			cacheModel.getCompany(id,function(sc,value){
308
				if(sc){
309
					if(value.forShort){
310
						$list.find(".resOrgName").html(value.forShort)
311
					}else{
312
						$list.find(".resOrgName").html(value.name)
274
275
			$(".table-drop").on("click", "li", function () {
276
				$(".rightbtn").find("span").html($(this).text());
277
			})
278
			$(".table-tab-item").on("click", "li", function () {
279
				if ($(this).is('.table-tab-slide')) {
280
					linkNum = $(this).index(".table-tab-slide");
281
					$(".haveData").find("ul").each(function () {
282
						$(this).html("");
283
						$(this).parent().find(".js-load-more").unbind("click");
284
						$(this).parent().find(".js-load-more").show();
285
					});
286
					$("#table-item-" + linkNum).html("");
287
					dataColNum = $(this).attr('data-col');
288
					$(".table-tab-slide").removeClass("table-tab-slide-active");
289
					$(this).addClass("table-tab-slide-active");
290
					$(".table-drop").fadeOut(1000);
291
					$(".rightbtn").find("em").removeClass("unfoldtr").addClass("foldtr");
292
					$(".table-item-list").eq(linkNum).show().siblings().hide();
293
					if ($(".rightbtn").find("li").is(".table-tab-slide-active")) {
294
						$(".rightbtn").addClass("table-tab-slide-active");
295
					} else {
296
						$(".rightbtn").removeClass("table-tab-slide-active");
297
					}
298
					dataO = {
299
						patSortNum: "",
300
						patCreateTime: "",
301
						patId: ""
313 302
					}
303
					pageNo = 1
304
					if (linkNum == 0) {
305
						recommendUnpatent()
306
						patentListVal(true, true)
307
					} else if (linkNum == 1) {
308
						unpatentListVal(true)
309
					} else if (linkNum == 2) {
310
						patentListVal(true)
311
					}
312
				} else {
313
					$(this).find(".table-drop").show();
314 314
				}
315 315
			})
316
		}
317
	},
318
	rightAllCon=function(){
319
		$.ajax({
320
			type:"get",
321
			url:"/ajax/professor/editBaseInfo/"+userid,
322
			success:function(data){
323
				if(data.success){
324
					var dataStr=data.data
325
					var userType = autho(dataStr.authType, dataStr.orgAuth, dataStr.authStatus);
326
					var baImg = "../images/default-photo.jpg";
327
					if(dataStr.hasHeadImage == 1) {
328
						baImg = "/images/head/" + dataStr.id + "_l.jpg";
316
		},
317
		queryResearcher = function (id, $list) {
318
			if (id) {
319
				oAjax("/ajax/resResult/researcher", {
320
					"id": id
321
				}, 'get', function ($data) {
322
					var arr = []
323
					if ($data.data.length) {
324
						$list.find('.researchers').parent().removeClass('displayNone')
325
						for (var i = 0; i < $data.data.length; i++) {
326
							arr.push($data.data[i].name)
327
						}
328
						$list.find('.researchers').html(arr.join(','))
329 329
					}
330
					var str='<div class="madiaHead useHead" style="background-image:url('+baImg+')"></div>'+
331
							'<div class="h2Font">'+dataStr.name+'<span class="authiconNew ' + userType.sty + '" title="' + userType.title + '"></span></div>'
332
					$(".onlogined .owener-info").html(str)
333
				}
330
				})
334 331
			}
335
		});
336
		$.ajax({
337
			url: "/ajax/article/pqProPublish",
338
			dataType: 'json',
339
			type: 'GET', 
340
			data: {
341
				"ownerId": userid,
342
			},
343
			success:function(data){
344
				if(data.success){
345
					$("#myPubedArt").html(data.data.total)
346
				}
332
		},
333
		queryReseOrgName = function (id, $list) {
334
			if (id) {
335
				cacheModel.getCompany(id, function (sc, value) {
336
					if (sc) {
337
						if (value.forShort) {
338
							$list.find(".resOrgName").html(value.forShort)
339
						} else {
340
							$list.find(".resOrgName").html(value.name)
341
						}
342
					}
343
				})
347 344
			}
348
		});
349
		$.ajax({//回答数
350
			type:"get",
351
			url:"/ajax/question/answer/count",
352
			data: {
353
				uid: userid
354
			},
355
			async:true,
356
			success:function(data){
357
				if(data.success){
358
					$("#myPubedAnswer").html(data.data)
345
		},
346
		rightAllCon = function () {
347
			$.ajax({
348
				type: "get",
349
				url: "/ajax/professor/editBaseInfo/" + userid,
350
				success: function (data) {
351
					if (data.success) {
352
						var dataStr = data.data
353
						var userType = autho(dataStr.authType, dataStr.orgAuth, dataStr.authStatus);
354
						var baImg = "../images/default-photo.jpg";
355
						if (dataStr.hasHeadImage == 1) {
356
							baImg = "/images/head/" + dataStr.id + "_l.jpg";
357
						}
358
						var str = '<div class="madiaHead useHead" style="background-image:url(' + baImg + ')"></div>' +
359
							'<div class="h2Font">' + dataStr.name + '<span class="authiconNew ' + userType.sty + '" title="' + userType.title + '"></span></div>'
360
						$(".onlogined .owener-info").html(str)
361
					}
359 362
				}
360
			}
361
		});
362
		$.ajax({//总获赞
363
			type:"get",
364
			url:"/ajax/professor/agree/sum",
365
			data: {
366
				id: userid,
367
			},
368
			async:true,
369
			success:function(data){
370
				if(data.success){
371
					$("#agreeMecount").html(data.data)
363
			});
364
			$.ajax({
365
				url: "/ajax/article/pqProPublish",
366
				dataType: 'json',
367
				type: 'GET',
368
				data: {
369
					"ownerId": userid,
370
				},
371
				success: function (data) {
372
					if (data.success) {
373
						$("#myPubedArt").html(data.data.total)
374
					}
372 375
				}
373
			}
374
		});
375
	}
376
			});
377
			$.ajax({ //回答数
378
				type: "get",
379
				url: "/ajax/question/answer/count",
380
				data: {
381
					uid: userid
382
				},
383
				async: true,
384
				success: function (data) {
385
					if (data.success) {
386
						$("#myPubedAnswer").html(data.data)
387
					}
388
				}
389
			});
390
			$.ajax({ //总获赞
391
				type: "get",
392
				url: "/ajax/professor/agree/sum",
393
				data: {
394
					id: userid,
395
				},
396
				async: true,
397
				success: function (data) {
398
					if (data.success) {
399
						$("#agreeMecount").html(data.data)
400
					}
401
				}
402
			});
403
		}
376 404
377 405
	recommendUnpatent()
378 406
	patentListVal(true, true)
379 407
	navmenu();
380
	hotUnpatentList();
408
	// hotUnpatentList();
381 409
382
	if(userid && userid != null && userid != "null") {
410
	if (userid && userid != null && userid != "null") {
383 411
		$(".privateInfo .onlogined").removeClass("displayNone")
384 412
		$(".privateInfo .unlogined").addClass("displayNone")
385 413
		rightAllCon()
386
		$(".pubArt").on("click",function(){
414
		$(".pubArt").on("click", function () {
387 415
			window.open('../articalIssue.html')
388 416
		})
389
		$(".pubQuestion").on("click",function(){
417
		$(".pubQuestion").on("click", function () {
390 418
			$(".questionCover").fadeIn();
391 419
			$("body").css("position", "fixed");
392 420
		})
393
		$(".goarrow").on("click",function(){
394
			window.open('../userInforShow.html?professorId='+ userid +'&iLike=1')
421
		$(".goarrow").on("click", function () {
422
			window.open('../userInforShow.html?professorId=' + userid + '&iLike=1')
395 423
		})
396
		$("#workclose").on("click",function(){
424
		$("#workclose").on("click", function () {
397 425
			$(".questionCover").fadeOut();
398
		    $("body").css("position", "");
426
			$("body").css("position", "");
399 427
		})
400 428
		hotKey(".oinput");
401 429
		//校验关键字
402 430
		$("#KeyWord").on({
403
			focus: function() {
431
			focus: function () {
404 432
				$("#keyPrompt").text("最多可添加5个关键词,每个关键词15字以内");
405 433
			},
406
			blur: function() {
434
			blur: function () {
407 435
				$("#keyPrompt").text("");
408 436
			}
409 437
		})
410
		$("#keyWordlist").on("click", ".closeThis", function() {
438
		$("#keyWordlist").on("click", ".closeThis", function () {
411 439
			$(this).parent().remove();
412 440
			var liNum = $("#keyWordlist").find("li").length;
413
			if(liNum < 5) {
441
			if (liNum < 5) {
414 442
				$("#keyWordlist").parents(".keyResult").siblings("div.col-w-12").show();
415 443
			}
416 444
		})
417
		limitObj("#queTit",50)
445
		limitObj("#queTit", 50)
418 446
		$("#queTit").on({
419
			focus: function() {
447
			focus: function () {
420 448
				$(this).parents("li").find(".frmconmsg").text("提问不得少于5个字,不可超过50个字");
421 449
			},
422
			blur: function() {
450
			blur: function () {
423 451
				$(this).parents("li").find(".frmconmsg").text("");
424 452
			}
425 453
		})
426
		limitObj("#queCnt",500)
454
		limitObj("#queCnt", 500)
427 455
		$("#queCnt").on({
428
			focus: function() {
456
			focus: function () {
429 457
				$(this).parents("li").find(".frmconmsg").text("提问描述不可超过500个字");
430 458
			},
431
			blur: function() {
459
			blur: function () {
432 460
				$(this).parents("li").find(".frmconmsg").text("");
433 461
			}
434 462
		})
435
		
436
		var imgStr=[];
437
		var uploader =new WebUploader.create({
463
464
		var imgStr = [];
465
		var uploader = new WebUploader.create({
438 466
			auto: true,
439 467
			fileNumLimit: 3,
440 468
			swf: '../js/webuploader/Uploader.swf',
@ -449,22 +477,22 @@ $(function() {
449 477
				extensions: 'jpg,jpeg,png',
450 478
				mimeTypes: 'image/jpg,image/jpeg,image/png'
451 479
			}
452
	
480
453 481
		});
454
	
482
455 483
		// 当有文件添加进来的时候
456
		uploader.on('fileQueued', function(file) {
484
		uploader.on('fileQueued', function (file) {
457 485
			fileId = file.id;
458 486
			var $len = $("#fileList").find("img").length;
459
			if($len == 0 || $len == 1) {
487
			if ($len == 0 || $len == 1) {
460 488
				var oRemove = $("#fileList").find("dd");
461 489
				oRemove.eq(oRemove.length - 1).remove();
462
			} 
490
			}
463 491
			var $li = $(
464 492
					'<dd>' +
465
						'<div class="imgItem" id="' + file.id + '">'+
466
							'<img />' +
467
						'</div>'+
493
					'<div class="imgItem" id="' + file.id + '">' +
494
					'<img />' +
495
					'</div>' +
468 496
					'</dd>'
469 497
				),
470 498
				$btns = $('<div class="file-panel">' +
@ -472,141 +500,141 @@ $(function() {
472 500
					'</div>').appendTo($li),
473 501
				$img = $li.find('img');
474 502
			var $list = $("#fileList");
475
			if($len == 1) {
503
			if ($len == 1) {
476 504
				$list.find("dd").eq(0).after($li)
477
			} else if($len == 2) {
505
			} else if ($len == 2) {
478 506
				$list.find("dd").eq(1).after($li)
479 507
			} else {
480 508
				$list.prepend($li);
481 509
			}
482
	
510
483 511
			// 创建缩略图
484 512
			// 如果为非图片文件,可以不用调用此方法。
485 513
			// thumbnailWidth x thumbnailHeight 为 100 x 100
486
			uploader.makeThumb(file, function(error, src) {
487
				if(error) {
514
			uploader.makeThumb(file, function (error, src) {
515
				if (error) {
488 516
					$img.replaceWith('<span>不能预览</span>');
489 517
					return;
490 518
				}
491 519
				$img.attr('src', src);
492 520
			}, 1, 1);
493 521
		});
494
		uploader.onError = function(code) {
495
			if(code=="F_EXCEED_SIZE"){
496
				$.MsgBox.Alert('提示', '请上传jpg、jpeg、png格式的图片,大小不超过2M')	
522
		uploader.onError = function (code) {
523
			if (code == "F_EXCEED_SIZE") {
524
				$.MsgBox.Alert('提示', '请上传jpg、jpeg、png格式的图片,大小不超过2M')
497 525
			}
498 526
		};
499
		uploader.on('uploadSuccess', function(file, data) {
500
			if(data.success) {
501
					uploader.removeFile(fileId);
502
					//console.log(data)
503
					var orldUrl = imgStr.push(data.data[0].uri);
504
					
505
			}else{
527
		uploader.on('uploadSuccess', function (file, data) {
528
			if (data.success) {
529
				uploader.removeFile(fileId);
530
				//console.log(data)
531
				var orldUrl = imgStr.push(data.data[0].uri);
532
533
			} else {
506 534
				$.MsgBox.Alert('提示', '只支持jpeg/jpg/png格式的图片');
507 535
			}
508 536
		});
509 537
		/*删除图片*/
510
		$("#fileList").on("click", ".cancel", function() {
511
			var flag=$(this).attr("flag");
512
			var oNum=$(this).parents("dd").index();
513
			if(flag==1) {
514
				array.splice(oNum,1);
515
			}else{
516
				imgStr.splice(oNum,1);
538
		$("#fileList").on("click", ".cancel", function () {
539
			var flag = $(this).attr("flag");
540
			var oNum = $(this).parents("dd").index();
541
			if (flag == 1) {
542
				array.splice(oNum, 1);
543
			} else {
544
				imgStr.splice(oNum, 1);
517 545
			}
518 546
			$(this).parent().parent().remove();
519
			
547
520 548
			var $len = $("#fileList").find("img").length;
521
			if($len != 2) {
549
			if ($len != 2) {
522 550
				$("#fileList").append("<dd></dd>")
523 551
			}
524
			
552
525 553
		});
526
		
554
527 555
		//提问下一步
528
		$("#nextSte").on("click",function(){
529
			if($("#queTit").val().length>50) {
556
		$("#nextSte").on("click", function () {
557
			if ($("#queTit").val().length > 50) {
530 558
				$("#queTit").parents("li").find(".frmconmsg").text("提问不可超过50个字");
531
				$("#queTit").parent().css("border-color","#e03b43");
559
				$("#queTit").parent().css("border-color", "#e03b43");
532 560
				return;
533 561
			}
534
			if($("#queTit").val().length<5 || $("#queTit").val().length==0) {
562
			if ($("#queTit").val().length < 5 || $("#queTit").val().length == 0) {
535 563
				$("#queTit").parents("li").find(".frmconmsg").text("提问不得少于5个字");
536
				$("#queTit").parent().css("border-color","#e03b43");
564
				$("#queTit").parent().css("border-color", "#e03b43");
537 565
				return;
538 566
			}
539
			if($("#keyWordlist>li").length==0){
567
			if ($("#keyWordlist>li").length == 0) {
540 568
				$("#keyPrompt").text("请至少添加1个关键词");
541
				$("#KeyWord").css("border-color","#e03b43");
569
				$("#KeyWord").css("border-color", "#e03b43");
542 570
				return;
543 571
			}
544
			
572
545 573
			$(".queStep01").addClass("displayNone")
546 574
			$(".queStep02").removeClass("displayNone")
547 575
548 576
		})
549 577
		//提问上一步
550
		$("#preSte").on("click",function(){
578
		$("#preSte").on("click", function () {
551 579
			$(".queStep01").removeClass("displayNone")
552 580
			$(".queStep02").addClass("displayNone")
553 581
		})
554 582
		//提问发布
555
		$("#pubSte").on("click",function(){
556
			var title=$("#queTit").val();
557
			var cnt=$("#queCnt").val();
583
		$("#pubSte").on("click", function () {
584
			var title = $("#queTit").val();
585
			var cnt = $("#queCnt").val();
558 586
			var subjects = $("#keyWordlist>li");
559 587
			var subjectAll = "";
560
			if(subjects.length > 0) {
561
				for(var i = 0; i < subjects.length; i++) {
588
			if (subjects.length > 0) {
589
				for (var i = 0; i < subjects.length; i++) {
562 590
					subjectAll += subjects[i].innerText.replace(/删除/, "");
563 591
					subjectAll += ',';
564 592
				};
565 593
				subjectAll = subjectAll.substring(0, subjectAll.length - 1);
566 594
			}
567
			console.log(cnt+"++++++"+imgStr);
568
			
569
			var dataSt={
570
					"title": title,
571
					"cnt": cnt,
572
					"img": imgStr.join(","),
573
					"keys": subjectAll,
574
					"uid": userid
575
				}
595
			console.log(cnt + "++++++" + imgStr);
596
597
			var dataSt = {
598
				"title": title,
599
				"cnt": cnt,
600
				"img": imgStr.join(","),
601
				"keys": subjectAll,
602
				"uid": userid
603
			}
576 604
			$.ajax({
577
				url:'/ajax/question', 
605
				url: '/ajax/question',
578 606
				data: dataSt,
579 607
				dataType: 'json',
580 608
				traditional: true,
581
				type: 'POST', 
582
				success: function(data) {
583
					if(data.success) {
609
				type: 'POST',
610
				success: function (data) {
611
					if (data.success) {
584 612
						console.log(data)
585 613
						$(".questionCover").fadeOut();
586 614
						$("body").css("position", "");
587 615
						$(".queStep").find("textarea").val("")
588 616
						$("#keyWordlist").html("")
589 617
						var $len = $("#fileList").find("img").length;
590
						for(var i=0;i<$len;i++) {
618
						for (var i = 0; i < $len; i++) {
591 619
							$("#fileList").find(".imgItem").parent().remove()
592 620
							$("#fileList").append("<dd></dd>")
593 621
						}
594
						
622
595 623
						$(".queStep").find("input").val("")
596 624
						$(".queStep01").removeClass("displayNone")
597 625
						$(".queStep02").addClass("displayNone")
598
						$.MsgBox.Alert("提示","问题发布成功");
626
						$.MsgBox.Alert("提示", "问题发布成功");
599 627
						$("#mb_msgicon").css("background", 'url("images/sign_icon_chenggong_nor.png") 0% 0% / contain');
600
						
628
601 629
					}
602 630
				}
603 631
			});
604
			
632
605 633
		})
606
	}else{
634
	} else {
607 635
		$(".privateInfo .unlogined").removeClass("displayNone")
608 636
		$(".privateInfo .onlogined").addClass("displayNone")
609
		$(".unlogined").on("click",function(){
637
		$(".unlogined").on("click", function () {
610 638
			quickLog();
611 639
			operatTab();
612 640
			closeLog();

+ 4 - 4
js/search_h5.js

@ -285,8 +285,8 @@ $(function () {
285 285
					if ($info[i].pic) {
286 286
						var src = '/data/researchResult' + $info[i].pic.split(",")[0]
287 287
					}
288
					var orgId = $info[i].orgId == undefined ? '' : '所属机构: ' + $info[i].orgId
289
					var applyDescp = $info[i].applyDescp == undefined ? '' : '应用介绍: ' + $info[i].applyDescp
288
					var department = $info[i].department == undefined ? '' : '所属部门: ' + $info[i].department
289
					var subject = $info[i].subject == undefined ? '' : '应用介绍: ' + $info[i].subject
290 290
					var liItem = document.createElement("li");
291 291
					liItem.setAttribute("data-id", $info[i].id);
292 292
					liItem.className = "mui-table-view-cell"
@ -294,8 +294,8 @@ $(function () {
294 294
					itemlist += '<div class="madiaHead resouseHead " style="background-image:url(' + src + ')"></div>';
295 295
					itemlist += '<div class="madiaInfo OmadiaInfo">';
296 296
					itemlist += '<p class="ellipsisSty-2 h1Font">' + $info[i].name + '</p>';
297
					itemlist += '<p class="h2Font ellipsisSty"><span class="ownerName">' + applyDescp + '</span><em class="authiconNew ownerSty"></em></p>'
298
					itemlist += '<p class="h2Font ellipsisSty">' + orgId + '</p>'
297
					itemlist += '<p class="h2Font ellipsisSty"><span class="ownerName">' + subject + '</span><em class="authiconNew ownerSty"></em></p>'
298
					itemlist += '<p class="h2Font ellipsisSty">' + department + '</p>'
299 299
					itemlist += '</div>'
300 300
					itemlist += '</div>';
301 301
					liItem.innerHTML = itemlist;

+ 363 - 340
js/teamInforShow.js

@ -20,7 +20,7 @@ var qrcode = new QRCode(document.getElementById("qrcode"), {
20 20
21 21
function makeCode() {
22 22
	var hurl = window.location.host;
23
	var elurl = "http://" + hurl + "/e/2.html?id=" + tId; 
23
	var elurl = "http://" + hurl + "/e/2.html?id=" + tId;
24 24
	qrcode.makeCode(elurl);
25 25
}
26 26
makeCode();
@ -28,29 +28,31 @@ makeCode();
28 28
29 29
30 30
//分享关注按钮
31
$('.shareWeixin').hover(function(){$('.shareCode').stop(true,false).fadeToggle();});
31
$('.shareWeixin').hover(function () {
32
	$('.shareCode').stop(true, false).fadeToggle();
33
});
32 34
33
$(function() {
34
	loginStatus();//判断个人是否登录
35
$(function () {
36
	loginStatus(); //判断个人是否登录
35 37
	// if(navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)){
36 38
	//  	location.href="http://" + window.location.host + "/e/p.html?id="+tId;
37 39
	// }
38 40
	function subjectShow(data) {
39
		if(data != undefined && data.length != 0) {
40
			var subs=strToAry(data)
41
			if(subs.length > 0) {
42
				for(var i = 0; i < subs.length; i++) {
41
		if (data != undefined && data.length != 0) {
42
			var subs = strToAry(data)
43
			if (subs.length > 0) {
44
				for (var i = 0; i < subs.length; i++) {
43 45
					$("#subjectShow").append("<li>" + subs[i] + "</li>");
44 46
				};
45 47
			}
46 48
		}
47 49
	}
48
	
50
49 51
	function industryShow(data) {
50
		if(data != undefined && data.length != 0) {
51
			var subs=strToAry(data)
52
			if(subs.length > 0) {
53
				for(var i = 0; i < subs.length; i++) {
52
		if (data != undefined && data.length != 0) {
53
			var subs = strToAry(data)
54
			if (subs.length > 0) {
55
				for (var i = 0; i < subs.length; i++) {
54 56
					$("#industryShow").append("<li><div class='h4tit'>" + subs[i] + "</div></li>");
55 57
				};
56 58
			}
@ -63,97 +65,100 @@ $(function() {
63 65
		rowsTen = 10,
64 66
		secretaryId = '',
65 67
		chiefId = ''
66
	var memberArr = {}, paperArr = [], patentArr = [], unpatentArr=[]
67
	var oAjax = function(url, dataS, otype, oFun,beforeFun,completeFun,async) {
68
	var memberArr = {},
69
		paperArr = [],
70
		patentArr = [],
71
		unpatentArr = []
72
	var oAjax = function (url, dataS, otype, oFun, beforeFun, completeFun, async) {
68 73
			$.ajax({
69
				async:async==null?true:async,
70
				url:url,
74
				async: async ==null ? true : async,
75
				url: url,
71 76
				dataType: 'json',
72 77
				type: otype,
73 78
				data: dataS,
74 79
				traditional: true,
75 80
				beforeSend: beforeFun,
76
				success: function(res) {
81
				success: function (res) {
77 82
					oFun(res)
78 83
				},
79
				complete:completeFun
80
	            
84
				complete: completeFun
85
81 86
			});
82
		},	
83
		insertNodata = function (targetE,newStr) {
84
            var parent = document.getElementById(targetE).parentNode;
85
            var kong = document.createElement("div");
86
            kong.className = "con-kong";
87
            kong.innerHTML ='<div class="picbox picNull"></div>'+
88
			            '<div class="txtbox">暂时没有符合该搜索条件的内容</div>'
89
            if(newStr){
90
            	kong.querySelector(".txtbox").innerHTML = newStr;
91
            }
92
            if (parent.firstChild.className == "con-kong") {
93
                return
94
            } else {
95
                parent.insertBefore(kong,parent.firstChild);
96
            }
87
		},
88
		insertNodata = function (targetE, newStr) {
89
			var parent = document.getElementById(targetE).parentNode;
90
			var kong = document.createElement("div");
91
			kong.className = "con-kong";
92
			kong.innerHTML = '<div class="picbox picNull"></div>' +
93
				'<div class="txtbox">暂时没有符合该搜索条件的内容</div>'
94
			if (newStr) {
95
				kong.querySelector(".txtbox").innerHTML = newStr;
96
			}
97
			if (parent.firstChild.className == "con-kong") {
98
				return
99
			} else {
100
				parent.insertBefore(kong, parent.firstChild);
101
			}
97 102
98
        },
99
        removeNodata = function (targetE) {
100
            var parent = document.getElementById(targetE).parentNode;
101
            if (parent.firstChild.className == "con-kong") {
102
                parent.removeChild(parent.firstChild);
103
            } else {
104
                return
105
            }
106
        },
107
       	getUserInfo=function() {
108
       		oAjax("/ajax/team/qo", {
109
				   id: tId
110
			   }, "get", function(data){
103
		},
104
		removeNodata = function (targetE) {
105
			var parent = document.getElementById(targetE).parentNode;
106
			if (parent.firstChild.className == "con-kong") {
107
				parent.removeChild(parent.firstChild);
108
			} else {
109
				return
110
			}
111
		},
112
		getUserInfo = function () {
113
			oAjax("/ajax/team/qo", {
114
				id: tId
115
			}, "get", function (data) {
111 116
				var $info = data.data;
112 117
				$("#proName").text($info.name);
113
				if($info.city){
118
				if ($info.city) {
114 119
					$("#proAddress").html($info.city + "<span style='margin-right:10px;'></span>");
115 120
				}
116 121
				$("#proOther").text($info.orgName);
117 122
				document.title = $info.name + "-科袖网"
118
				
123
119 124
				//简介
120
				if($info.descp) {
125
				if ($info.descp) {
121 126
					$("#descpS").parents(".coninfobox").removeClass("displayNone");
122 127
					$("#item1user>.nodatabox").addClass("displayNone");
123 128
					$("#descpS").text($info.descp);
124 129
				}
125 130
				//学术领域					
126
				if($info.subject) {
131
				if ($info.subject) {
127 132
					$("#subjectShow").parents(".coninfobox").removeClass("displayNone");
128 133
					$("#item1user>.nodatabox").addClass("displayNone");
129 134
					subjectShow($info.subject);
130 135
				}
131 136
				//行业领域	
132
				if($info.industry) {
137
				if ($info.industry) {
133 138
					$("#industryShow").parents(".coninfobox").removeClass("displayNone");
134 139
					$("#item1user>.nodatabox").addClass("displayNone");
135 140
					industryShow($info.industry);
136 141
				}
137
				
142
138 143
				var weibotitle = $info.name;
139 144
				var weibourl = window.location.href;
140
				var weibopic ="";
141
				$("#weibo").attr("href","http://service.weibo.com/share/share.php?appkey=3677230589&title="+weibotitle+"&url="+weibourl+"&pic="+weibopic+"&ralateUid=6242830109&searchPic=false&style=simple");
145
				var weibopic = "";
146
				$("#weibo").attr("href", "http://service.weibo.com/share/share.php?appkey=3677230589&title=" + weibotitle + "&url=" + weibourl + "&pic=" + weibopic + "&ralateUid=6242830109&searchPic=false&style=simple");
142 147
			});
143 148
		},
144
		professorListVal=function(isbind){
145
			var aimId="expertli"
146
			oAjax("/ajax/team/pro",{
147
				id:tId,
148
				pageSize:rowsTen,
149
		professorListVal = function (isbind) {
150
			var aimId = "expertli"
151
			oAjax("/ajax/team/pro", {
152
				id: tId,
153
				pageSize: rowsTen,
149 154
				pageNo: pageNo,
150
			}, "get", function(res){
155
			}, "get", function (res) {
151 156
				var $info = res.data.data;
152
				if($info.length > 0) {
153
					$("#"+aimId).show()
154
					for(var i = 0; i < $info.length; i++) {
157
				if ($info.length > 0) {
158
					$("#" + aimId).show()
159
					for (var i = 0; i < $info.length; i++) {
155 160
						var item = $info[i].professor;
156
						memberArr[item]={};
161
						memberArr[item] = {};
157 162
						if ($info[i].secretary) {
158 163
							secretaryId = $info[i].professor
159 164
						}
@ -163,227 +168,244 @@ $(function() {
163 168
					}
164 169
					if (userid in memberArr) {
165 170
						$('.memberShow').show()
166
					} else{
171
					} else {
167 172
						$('.normalShow').show()
168 173
					}
169 174
					detailPro(aimId)
170 175
				}
171
                if(isbind){
172
                	$("#"+aimId).parent().find(".js-load-more").unbind("click").on("click",function(){
176
				if (isbind) {
177
					$("#" + aimId).parent().find(".js-load-more").unbind("click").on("click", function () {
173 178
						pageNo++
174 179
						professorListVal(false)
175 180
					})
176
                }
181
				}
177 182
				if ($info.length < rowsTen) {
178
                    $("#"+aimId).parent().find(".js-load-more").unbind("click");
179
                    $("#"+aimId).parent().find(".js-load-more").hide();
180
                }
181
			},function(){
182
				$("#"+aimId).parent().find(".js-load-more").attr("disabled",true);
183
	       		$("#"+aimId).parent().find(".js-load-more").addClass("active");
184
			},function(){
185
				$("#"+aimId).parent().find(".js-load-more").removeAttr("disabled");
186
	        	$("#"+aimId).parent().find(".js-load-more").removeClass("active");
183
					$("#" + aimId).parent().find(".js-load-more").unbind("click");
184
					$("#" + aimId).parent().find(".js-load-more").hide();
185
				}
186
			}, function () {
187
				$("#" + aimId).parent().find(".js-load-more").attr("disabled", true);
188
				$("#" + aimId).parent().find(".js-load-more").addClass("active");
189
			}, function () {
190
				$("#" + aimId).parent().find(".js-load-more").removeAttr("disabled");
191
				$("#" + aimId).parent().find(".js-load-more").removeClass("active");
187 192
			})
188 193
		},
189 194
190 195
		//专利
191
		patentListVal=function(isbind){
192
			var aimId="proPatent",newStr="尚未关联任何专利成果"
193
			oAjax("/ajax/team/patent",{
194
				id:tId,
195
				pageSize:rows,
196
		patentListVal = function (isbind) {
197
			var aimId = "proPatent",
198
				newStr = "尚未关联任何专利成果"
199
			oAjax("/ajax/team/patent", {
200
				id: tId,
201
				pageSize: rows,
196 202
				pageNo: pageNo,
197
			}, "get", function(res){
198
				
203
			}, "get", function (res) {
204
199 205
				var $info = res.data.data;
200 206
				console.log($info);
201 207
202 208
				$("#showPatent").html("")
203
				if($info.length > 0) {
204
					if(res.data.total>0 && res.data.total<99){
209
				if ($info.length > 0) {
210
					if (res.data.total > 0 && res.data.total < 99) {
205 211
						$("#patCount").text(res.data.total);
206 212
					}
207
					if(res.data.total>99){
213
					if (res.data.total > 99) {
208 214
						$("#patCount").text("99+");
209 215
					}
210
					$("#"+aimId).show()
211
					for(var i = 0; i < $info.length; i++) {
216
					$("#" + aimId).show()
217
					for (var i = 0; i < $info.length; i++) {
212 218
						patentArr.push($info[i].patent)
213 219
					}
214 220
					detailPat(aimId)
215 221
				} else {
216 222
					$("#showPatent").parents('.otherShow').hide()
217 223
				}
218
				var liLen=document.getElementById(aimId).querySelectorAll("li").length;
219
                removeNodata(aimId);
220
                if($info.length == 0 && liLen == 0 ){
221
                	$("#"+aimId).hide()
222
                    insertNodata(aimId,newStr);
223
                }
224
                if(isbind){
225
                	$("#"+aimId).parent().find(".js-load-more").unbind("click").on("click",function(){
224
				var liLen = document.getElementById(aimId).querySelectorAll("li").length;
225
				removeNodata(aimId);
226
				if ($info.length == 0 && liLen == 0) {
227
					$("#" + aimId).hide()
228
					insertNodata(aimId, newStr);
229
				}
230
				if (isbind) {
231
					$("#" + aimId).parent().find(".js-load-more").unbind("click").on("click", function () {
226 232
						pageNo++
227
					 	patentListVal(false)
233
						patentListVal(false)
228 234
					})
229
                }
235
				}
230 236
				if ($info.length < rows) {
231
                    $("#"+aimId).parent().find(".js-load-more").unbind("click");
232
                    $("#"+aimId).parent().find(".js-load-more").hide();
233
                }
234
			},function(){
235
				$("#"+aimId).parent().find(".js-load-more").attr("disabled",true);
236
	       		$("#"+aimId).parent().find(".js-load-more").addClass("active");
237
			},function(){
238
				$("#"+aimId).parent().find(".js-load-more").removeAttr("disabled");
239
	        	$("#"+aimId).parent().find(".js-load-more").removeClass("active");
237
					$("#" + aimId).parent().find(".js-load-more").unbind("click");
238
					$("#" + aimId).parent().find(".js-load-more").hide();
239
				}
240
			}, function () {
241
				$("#" + aimId).parent().find(".js-load-more").attr("disabled", true);
242
				$("#" + aimId).parent().find(".js-load-more").addClass("active");
243
			}, function () {
244
				$("#" + aimId).parent().find(".js-load-more").removeAttr("disabled");
245
				$("#" + aimId).parent().find(".js-load-more").removeClass("active");
240 246
			})
241 247
		},
242 248
		//非专
243
		unpatentListVal=function(isbind){
244
			var aimId="proUnPatent",aimIdF="showUnPatent",newStr="尚未关联任何非专利成果"
245
			oAjax("/ajax/team/resResult",{
246
				id:tId,
247
				pageSize:rows,
249
		unpatentListVal = function (isbind) {
250
			var aimId = "proUnPatent",
251
				aimIdF = "showUnPatent",
252
				newStr = "尚未关联任何非专利成果"
253
			oAjax("/ajax/team/resResult", {
254
				id: tId,
255
				pageSize: rows,
248 256
				pageNo: pageNo,
249
			}, "get", function(res){
257
			}, "get", function (res) {
250 258
				var $info = res.data.data;
251 259
				$("#showUnPatent").html("")
252
				if($info.length > 0) {
253
					if(res.data.total>0 && res.data.total<99){
260
				if ($info.length > 0) {
261
					if (res.data.total > 0 && res.data.total < 99) {
254 262
						$("#unpatCount").text(res.data.total);
255 263
					}
256
					if(res.data.total>99){
264
					if (res.data.total > 99) {
257 265
						$("#unpatCount").text("99+");
258 266
					}
259
					$("#"+aimId).show()
260
					$("#"+aimIdF).parents(".leftconItem").find(".nodatabox").hide()
261
					$("#"+aimIdF).parents(".form-item").removeClass("displayNone");
262
					$("#"+aimIdF).parents(".coninfobox").show();
263
					for(var i = 0; i < $info.length; i++) {
267
					$("#" + aimId).show()
268
					$("#" + aimIdF).parents(".leftconItem").find(".nodatabox").hide()
269
					$("#" + aimIdF).parents(".form-item").removeClass("displayNone");
270
					$("#" + aimIdF).parents(".coninfobox").show();
271
					for (var i = 0; i < $info.length; i++) {
264 272
						unpatentArr.push($info[i].researchResult)
265 273
					}
266 274
					detailUnPat(aimId)
267
				}else {
275
				} else {
268 276
					$("#showUnPatent").parents('.otherShow').hide()
269 277
				}
270
				var liLen=document.getElementById(aimId).querySelectorAll("li").length;
271
                removeNodata(aimId);
272
                if($info.length == 0 && liLen == 0 ){
273
                	$("#"+aimId).hide()
274
                    insertNodata(aimId,newStr);
275
                }
276
                if(isbind){
277
                	$("#"+aimId).parent().find(".js-load-more").unbind("click").on("click",function(){
278
				var liLen = document.getElementById(aimId).querySelectorAll("li").length;
279
				removeNodata(aimId);
280
				if ($info.length == 0 && liLen == 0) {
281
					$("#" + aimId).hide()
282
					insertNodata(aimId, newStr);
283
				}
284
				if (isbind) {
285
					$("#" + aimId).parent().find(".js-load-more").unbind("click").on("click", function () {
278 286
						pageNo++
279
					 	unpatentListVal(false)
287
						unpatentListVal(false)
280 288
					})
281
                }
289
				}
282 290
				if ($info.length < rows) {
283
                    $("#"+aimId).parent().find(".js-load-more").unbind("click");
284
                    $("#"+aimId).parent().find(".js-load-more").hide();
285
                }
286
			},function(){
287
				$("#"+aimId).parent().find(".js-load-more").attr("disabled",true);
288
	       		$("#"+aimId).parent().find(".js-load-more").addClass("active");
289
			},function(){
290
				$("#"+aimId).parent().find(".js-load-more").removeAttr("disabled");
291
	        	$("#"+aimId).parent().find(".js-load-more").removeClass("active");
291
					$("#" + aimId).parent().find(".js-load-more").unbind("click");
292
					$("#" + aimId).parent().find(".js-load-more").hide();
293
				}
294
			}, function () {
295
				$("#" + aimId).parent().find(".js-load-more").attr("disabled", true);
296
				$("#" + aimId).parent().find(".js-load-more").addClass("active");
297
			}, function () {
298
				$("#" + aimId).parent().find(".js-load-more").removeAttr("disabled");
299
				$("#" + aimId).parent().find(".js-load-more").removeClass("active");
292 300
			})
293 301
		},
294
		paperListVal=function(isbind){
295
			var aimId="proPaper",newStr="尚未关联任何论文"
296
			oAjax("/ajax/team/paper",{
297
				id:tId,
298
				pageSize:rows,
302
		paperListVal = function (isbind) {
303
			var aimId = "proPaper",
304
				newStr = "尚未关联任何论文"
305
			oAjax("/ajax/team/paper", {
306
				id: tId,
307
				pageSize: rows,
299 308
				pageNo: pageNo,
300
			}, "get", function(res){
309
			}, "get", function (res) {
301 310
				var $info = res.data.data;
302 311
				$("#showPaper").html("")
303
				if($info.length > 0) {
304
					if(res.data.total>0 && res.data.total<99){
312
				if ($info.length > 0) {
313
					if (res.data.total > 0 && res.data.total < 99) {
305 314
						$("#parCount").text(res.data.total);
306 315
					}
307
					if(res.data.total>99){
316
					if (res.data.total > 99) {
308 317
						$("#parCount").text("99+");
309 318
					}
310
					$("#"+aimId).show()
311
					for(var i = 0; i < $info.length; i++) {
319
					$("#" + aimId).show()
320
					for (var i = 0; i < $info.length; i++) {
312 321
						paperArr.push($info[i].paper)
313 322
					}
314 323
					detailPer(aimId)
315
				}else {
324
				} else {
316 325
					$("#showPaper").parents(".otherShow").hide()
317 326
				}
318
                if(isbind){
319
                	$("#"+aimId).parent().find(".js-load-more").unbind("click").on("click",function(){
327
				if (isbind) {
328
					$("#" + aimId).parent().find(".js-load-more").unbind("click").on("click", function () {
320 329
						pageNo++
321
					 	paperListVal(false)
330
						paperListVal(false)
322 331
					})
323
                }
332
				}
324 333
				if ($info.length < rows) {
325
                    $("#"+aimId).parent().find(".js-load-more").unbind("click");
326
                    $("#"+aimId).parent().find(".js-load-more").hide();
327
                }
328
			},function(){
329
				$("#"+aimId).parent().find(".js-load-more").attr("disabled",true);
330
	       		$("#"+aimId).parent().find(".js-load-more").addClass("active");
331
			},function(){
332
				$("#"+aimId).parent().find(".js-load-more").removeAttr("disabled");
333
	        	$("#"+aimId).parent().find(".js-load-more").removeClass("active");
334
					$("#" + aimId).parent().find(".js-load-more").unbind("click");
335
					$("#" + aimId).parent().find(".js-load-more").hide();
336
				}
337
			}, function () {
338
				$("#" + aimId).parent().find(".js-load-more").attr("disabled", true);
339
				$("#" + aimId).parent().find(".js-load-more").addClass("active");
340
			}, function () {
341
				$("#" + aimId).parent().find(".js-load-more").removeAttr("disabled");
342
				$("#" + aimId).parent().find(".js-load-more").removeClass("active");
334 343
			})
335 344
		},
336
		detailPat=function(obj) {
337
			oAjax("/ajax/ppatent/qm",{
338
				id:patentArr,
339
			},"get",function(data){
340
				var dataStr=data.data;
341
				for(var i = 0; i < dataStr.length; i++) {
342
					
345
		detailPat = function (obj) {
346
			oAjax("/ajax/ppatent/qm", {
347
				id: patentArr,
348
			}, "get", function (data) {
349
				var dataStr = data.data;
350
				for (var i = 0; i < dataStr.length; i++) {
351
343 352
					var strAdd = '';
344
						strAdd += '<li class="mui-table-view-cell"><a  target="_blank" href="/'+ pageUrl("pt",dataStr[i]) +'" class="flexCenter urlgo">';
345
						strAdd += '<div class="madiaHead patentHead"></div>';
346
						strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty">'+ dataStr[i].name +'</p>';
347
						strAdd += '<p class="h2Font ellipsisSty">发明人:'+ dataStr[i].authors.substring(0, dataStr[i].authors.length - 1) +'</p>';
348
						strAdd += '<p class="h2Font ellipsisSty">申请人:'+ dataStr[i].reqPerson +'</p>';
349
						strAdd += '</div>';
350
						strAdd += '</a></li>';
351
						$("#"+obj).append(strAdd)
352
						if (i < 3) {
353
							$("#showPatent").append(strAdd);
354
						}
353
					strAdd += '<li class="mui-table-view-cell"><a  target="_blank" href="/' + pageUrl("pt", dataStr[i]) + '" class="flexCenter urlgo">';
354
					strAdd += '<div class="madiaHead patentHead"></div>';
355
					strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty">' + dataStr[i].name + '</p>';
356
					strAdd += '<p class="h2Font ellipsisSty">发明人:' + dataStr[i].authors.substring(0, dataStr[i].authors.length - 1) + '</p>';
357
					strAdd += '<p class="h2Font ellipsisSty">申请人:' + dataStr[i].reqPerson + '</p>';
358
					strAdd += '</div>';
359
					strAdd += '</a></li>';
360
					$("#" + obj).append(strAdd)
361
					if (i < 3) {
362
						$("#showPatent").append(strAdd);
363
					}
355 364
				}
356 365
			});
357 366
		},
358
		detailUnPat=function(obj) {
359
			oAjax("/ajax/resResult/qm",{
360
				id:unpatentArr,
361
			},"get",function(data){
362
				var dataStr=data.data;
363
				for(var i = 0; i < dataStr.length; i++) {
364
					
365
					var resIM='<div class="madiaHead patentHead"></div>'
367
		detailUnPat = function (obj) {
368
			oAjax("/ajax/resResult/qm", {
369
				id: unpatentArr,
370
			}, "get", function (data) {
371
				var dataStr = data.data;
372
373
				var subject = '',
374
					department = ''
375
				for (var i = 0; i < dataStr.length; i++) {
376
					if (dataStr[i].subject) {
377
						subject = "应用领域:" + dataStr[i].subject
378
					} else {
379
						subject = ''
380
					}
381
					if (dataStr[i].department) {
382
						department = '所属部门:' + dataStr[i].department
383
					} else {
384
						department = ''
385
					}
386
					var resIM = '<div class="madiaHead patentHead"></div>'
366 387
					if (dataStr[i].pic) {
367 388
						var src = '/data/researchResult' + dataStr[i].pic.split(",")[0]
368
						resIM = '<div class="madiaHead patentHead" style="background-image:url('+ src +')"></div>';
389
						resIM = '<div class="madiaHead patentHead" style="background-image:url(' + src + ')"></div>';
369 390
					}
370 391
					var strAdd = '';
371
						strAdd += '<li class="mui-table-view-cell"><a  target="_blank" href="unPatentShow.html?id='+dataStr[i].id+'" class="flexCenter urlgo">';
372
						strAdd += resIM
373
						strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty">'+ dataStr[i].name +'</p>';
374
						strAdd += '<p class="h2Font ellipsisSty displayNone">研究者:<span class="researchers"></span></p>';
375
						if (dataStr[i].orgId) {
376
							strAdd += '<p class="h2Font ellipsisSty">所属机构:<span class="resOrgName"></span></p>';
377
						}
378
						strAdd += '</div>';
379
						strAdd += '</a></li>';
380
			
381
						$("#"+obj).append(strAdd);
382
						if (i < 3) {
383
							$("#showUnPatent").append(strAdd)
384
						}
392
					strAdd += '<li class="mui-table-view-cell"><a  target="_blank" href="unPatentShow.html?id=' + dataStr[i].id + '" class="flexCenter urlgo">';
393
					strAdd += resIM
394
					strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty">' + dataStr[i].name + '</p>';
395
					strAdd += '<p class="h2Font ellipsisSty ">'+ subject+ '<span class="researchers"></span></p>';
396
					strAdd += '<p class="h2Font ellipsisSty ">'+ department+ '<span class="researchers"></span></p>';
397
					// if (dataStr[i].orgId) {
398
					// 	strAdd += '<p class="h2Font ellipsisSty">所属机构:<span class="resOrgName"></span></p>';
399
					// }
400
					strAdd += '</div>';
401
					strAdd += '</a></li>';
402
403
					$("#" + obj).append(strAdd);
404
					if (i < 3) {
405
						$("#showUnPatent").append(strAdd)
406
					}
385 407
					var $itemlist = $(strAdd);
386
					queryResearcher(dataStr[i].id, $itemlist)
408
					// queryResearcher(dataStr[i].id, $itemlist)
387 409
					if (dataStr[i].orgId) {
388 410
						queryReseOrgName(dataStr[i].orgId, $itemlist)
389 411
					}
@ -392,145 +414,147 @@ $(function() {
392 414
		},
393 415
		queryResearcher = function (id, $list) {
394 416
			if (id) {
395
				oAjax("/ajax/resResult/researcher",{
417
				oAjax("/ajax/resResult/researcher", {
396 418
					"id": id
397
				}, 'get', function($data) {
419
				}, 'get', function ($data) {
398 420
					var arr = []
399
					if($data.data.length) {
421
					if ($data.data.length) {
400 422
						$list.find('.researchers').parent().removeClass('displayNone')
401
						for (var i = 0; i < $data.data.length;i++) {
423
						for (var i = 0; i < $data.data.length; i++) {
402 424
							arr.push($data.data[i].name)
403 425
						}
404 426
						$list.find('.researchers').html(arr.join(','))
405 427
					}
406
				}, function(){},false)
428
				}, function () {}, false)
407 429
			}
408 430
		},
409 431
		queryReseOrgName = function (id, $list) {
410 432
			if (id) {
411
				cacheModel.getCompany(id,function(sc,value){
412
					if(sc){
413
						if(value.forShort){
433
				cacheModel.getCompany(id, function (sc, value) {
434
					if (sc) {
435
						if (value.forShort) {
414 436
							$list.find(".resOrgName").html(value.forShort)
415
						}else{
437
						} else {
416 438
							$list.find(".resOrgName").html(value.name)
417 439
						}
418 440
					}
419 441
				})
420 442
			}
421 443
		},
422
		detailPer=function(obj) {
423
			oAjax("/ajax/ppaper/qm",{
424
				id:paperArr,
425
			},"get",function(data){
426
				var dataStr=data.data;
427
				for(var i = 0; i < dataStr.length; i++) {
428
					var moreInf=""
429
					if(!dataStr[i].cn4periodical){
430
						dataStr[i].cn4periodical="";
444
		detailPer = function (obj) {
445
			oAjax("/ajax/ppaper/qm", {
446
				id: paperArr,
447
			}, "get", function (data) {
448
				var dataStr = data.data;
449
				for (var i = 0; i < dataStr.length; i++) {
450
					var moreInf = ""
451
					if (!dataStr[i].cn4periodical) {
452
						dataStr[i].cn4periodical = "";
431 453
					}
432
					if(!dataStr[i].en4periodical){
433
						dataStr[i].en4periodical="";
454
					if (!dataStr[i].en4periodical) {
455
						dataStr[i].en4periodical = "";
434 456
					}
435
					if(!dataStr[i].pubDay){
436
						dataStr[i].pubDay="";
457
					if (!dataStr[i].pubDay) {
458
						dataStr[i].pubDay = "";
437 459
					}
438
					moreInf = dataStr[i].cn4periodical+ " " +dataStr[i].en4periodical+ " " +dataStr[i].pubDay
439
					
440
					
460
					moreInf = dataStr[i].cn4periodical + " " + dataStr[i].en4periodical + " " + dataStr[i].pubDay
461
462
441 463
					var strAdd = '';
442
						strAdd += '<li class="mui-table-view-cell"><a  target="_blank" href="/'+ pageUrl("pp",dataStr[i]) +'" class="flexCenter urlgo">';
443
						strAdd += '<div class="madiaHead paperHead"></div>';
444
						strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty">'+ dataStr[i].name +'</p>';
445
						strAdd += '<p class="h2Font ellipsisSty">作者:'+ dataStr[i].authors.substring(0, dataStr[i].authors.length - 1) +'</p>';
446
						strAdd += '<p class="h2Font ellipsisSty">期刊:'+ moreInf +'</p>';
447
						strAdd += '</div>';
448
						strAdd += '</a></li>';
449
						if(i < 3) {
450
							$('#showPaper').append(strAdd)
451
						}
452
						$('#'+obj).append(strAdd)
464
					strAdd += '<li class="mui-table-view-cell"><a  target="_blank" href="/' + pageUrl("pp", dataStr[i]) + '" class="flexCenter urlgo">';
465
					strAdd += '<div class="madiaHead paperHead"></div>';
466
					strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty">' + dataStr[i].name + '</p>';
467
					strAdd += '<p class="h2Font ellipsisSty">作者:' + dataStr[i].authors.substring(0, dataStr[i].authors.length - 1) + '</p>';
468
					strAdd += '<p class="h2Font ellipsisSty">期刊:' + moreInf + '</p>';
469
					strAdd += '</div>';
470
					strAdd += '</a></li>';
471
					if (i < 3) {
472
						$('#showPaper').append(strAdd)
473
					}
474
					$('#' + obj).append(strAdd)
453 475
				}
454 476
			});
455 477
		},
456
		detailPro=function(obj) {
457
			document.getElementById(obj).innerHTML=""
478
		detailPro = function (obj) {
479
			document.getElementById(obj).innerHTML = ""
458 480
			var li;
459
			for(item in memberArr){
460
				oAjax("/ajax/professor/info/"+item, null, "get", function(data){memberArr[item]=data.data},function(){},function(){},false)
481
			for (item in memberArr) {
482
				oAjax("/ajax/professor/info/" + item, null, "get", function (data) {
483
					memberArr[item] = data.data
484
				}, function () {}, function () {}, false)
461 485
			}
462
			for(item in memberArr) {
463
				if (item!={}){
486
			for (item in memberArr) {
487
				if (item != {}) {
464 488
					var dataStr = memberArr[item]
465 489
					var dImg = "../images/default-photo.jpg"
466
					if (dataStr.hasHeadImage){
490
					if (dataStr.hasHeadImage) {
467 491
						dImg = "/images/head/" + dataStr.id + "_l.jpg"
468 492
					}
469 493
					var li = document.createElement("li");
470
						li.className = "mui-table-view-cell";
494
					li.className = "mui-table-view-cell";
471 495
					var li2 = ''
472
					if(secretaryId===dataStr.id){
496
					if (secretaryId === dataStr.id) {
473 497
						li2 += '<span>团队秘书</span>'
474 498
					}
475
					if(chiefId===dataStr.id) {
499
					if (chiefId === dataStr.id) {
476 500
						li2 += '<span>首席专家</span>'
477 501
					}
478 502
					var strAdd = '';
479
						strAdd += '<li class="mui-table-view-cell"><a target="_blank" href="userInforShow.html?professorId='+ dataStr.id +'" class="flexCenter urlgo" style="min-height: 60px">';
480
						strAdd += '<div class="madiaHead useHead" style="background-image:url(' + dImg + ')"></div>';
481
						strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty">'+ dataStr.name +'</p>';
482
						strAdd += '<p class="h2Font ellipsisSty">'+ dataStr.title|| dataStr.orgName ||'' +'</p>';
483
						strAdd += '</div>';
484
						strAdd += '<div class="tag-show">'+li2+'</div>'
485
						strAdd += '</a></li>';
486
						if(chiefId===dataStr.id) {
487
							$("#"+obj).prepend(strAdd)
488
						} else {
489
							$("#"+obj).append(strAdd)
490
						}
503
					strAdd += '<li class="mui-table-view-cell"><a target="_blank" href="userInforShow.html?professorId=' + dataStr.id + '" class="flexCenter urlgo" style="min-height: 60px">';
504
					strAdd += '<div class="madiaHead useHead" style="background-image:url(' + dImg + ')"></div>';
505
					strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty">' + dataStr.name + '</p>';
506
					strAdd += '<p class="h2Font ellipsisSty">' + dataStr.title || dataStr.orgName || '' + '</p>';
507
					strAdd += '</div>';
508
					strAdd += '<div class="tag-show">' + li2 + '</div>'
509
					strAdd += '</a></li>';
510
					if (chiefId === dataStr.id) {
511
						$("#" + obj).prepend(strAdd)
512
					} else {
513
						$("#" + obj).append(strAdd)
514
					}
491 515
				}
492 516
			}
493
	    },
494
		bindClickFun=function(){
495
			$("#tab6user").unbind("click").on("click",function(){
496
				var pa=$(".moreNavUl.wendaUl>li.liNow").attr("rel")
497
				$("#"+pa).find("ul").html("")
498
				$("#"+pa).find(".js-load-more").show();
499
				
517
		},
518
		bindClickFun = function () {
519
			$("#tab6user").unbind("click").on("click", function () {
520
				var pa = $(".moreNavUl.wendaUl>li.liNow").attr("rel")
521
				$("#" + pa).find("ul").html("")
522
				$("#" + pa).find(".js-load-more").show();
523
500 524
				$(".wendaNav li").eq(0).addClass("liNow").siblings().removeClass("liNow");
501 525
				$("#item6drop1").show().siblings().hide();
502 526
				unpatentListVal(true);
503 527
			})
504
			$(".moreNavUl.wendaUl").on("click","li",function(){
505
				var pa=$(this).attr("rel")
506
				$("#"+pa).find("ul").html("")
507
				$("#"+pa).find(".js-load-more").show();
508
				var sortN=$(this).attr("data-num");
509
				if(sortN==1){
528
			$(".moreNavUl.wendaUl").on("click", "li", function () {
529
				var pa = $(this).attr("rel")
530
				$("#" + pa).find("ul").html("")
531
				$("#" + pa).find(".js-load-more").show();
532
				var sortN = $(this).attr("data-num");
533
				if (sortN == 1) {
510 534
					unpatentListVal(true);
511
				}else if(sortN==2){
535
				} else if (sortN == 2) {
512 536
					patentListVal(true);
513 537
				}
514 538
			})
515
			
539
516 540
			//点击关注按钮
517
			$("#attentBtn").on('click', function() {
518
				if(userid && userid != null && userid != "null") {
519
					if($(this).is('.attenedSpan')){
520
						cancelCollectionAbout(tId,$(this),12)
541
			$("#attentBtn").on('click', function () {
542
				if (userid && userid != null && userid != "null") {
543
					if ($(this).is('.attenedSpan')) {
544
						cancelCollectionAbout(tId, $(this), 12)
521 545
					} else {
522
						collectionAbout(tId,$(this),12);
546
						collectionAbout(tId, $(this), 12);
523 547
					}
524
				}else{
548
				} else {
525 549
					quickLog();
526 550
					operatTab();
527 551
					closeLog();
528 552
				}
529
			});	
553
			});
530 554
			//点击联系按钮
531
			$("#conbtn").on('click', function(){
532
				if(userid && userid != null && userid != 'null' && userid != undefined && userid != 'undefined') {
533
					location.href="tidings.html?id="+secretaryId
555
			$("#conbtn").on('click', function () {
556
				if (userid && userid != null && userid != 'null' && userid != undefined && userid != 'undefined') {
557
					location.href = "tidings.html?id=" + secretaryId
534 558
				} else {
535 559
					quickLog();
536 560
					operatTab();
@ -539,14 +563,14 @@ $(function() {
539 563
			});
540 564
541 565
			//退出团队
542
			$("#quitTeam").on('click', function(){
543
				if(userid && userid != null && userid != 'null' && userid != undefined && userid != 'undefined') {
544
					$.MsgBox.Confirm("提示", "确定要退出该团队?", function(){
566
			$("#quitTeam").on('click', function () {
567
				if (userid && userid != null && userid != 'null' && userid != undefined && userid != 'undefined') {
568
					$.MsgBox.Confirm("提示", "确定要退出该团队?", function () {
545 569
						oAjax("/ajax/team/quit", {
546 570
							id: tId,
547 571
							professor: userid
548
						}, "post", function(data){
549
							if (data.code===801) {
572
						}, "post", function (data) {
573
							if (data.code === 801) {
550 574
								$.MsgBox.Alert('提示', '团队秘书不能退出团队');
551 575
								return
552 576
							}
@ -559,60 +583,59 @@ $(function() {
559 583
					closeLog();
560 584
				}
561 585
			});
562
			
586
563 587
			//纠错反馈
564
			$(".correctSubmit").on("click",function(){
565
				var cntCon=$(this).siblings(".correctCon").val();
566
				var cntUser="";
567
				if(userid && userid != null && userid != "null") {
588
			$(".correctSubmit").on("click", function () {
589
				var cntCon = $(this).siblings(".correctCon").val();
590
				var cntUser = "";
591
				if (userid && userid != null && userid != "null") {
568 592
					cntUser = userid;
569 593
				}
570
				if(cntCon.length>500){
594
				if (cntCon.length > 500) {
571 595
					$.MsgBox.Alert('提示', '纠错反馈内容不得超过500个字');
572 596
					return;
573
				}else{
574
					oAjax("/ajax/feedback/error/team",{
597
				} else {
598
					oAjax("/ajax/feedback/error/team", {
575 599
						"id": tId,
576
						"cnt":cntCon,
577
						"user":cntUser
578
					}, "POST", function(data){
600
						"cnt": cntCon,
601
						"user": cntUser
602
					}, "POST", function (data) {
579 603
						backSuccessed();
580 604
					});
581 605
				}
582 606
			})
583
	
607
584 608
		}
585
		$('#seeMoreF,#seeMoreZ').unbind("click").on("click",function(){
586
			$(".leftconItem").hide();
587
			var activeTab = $('#item6user').attr("rel");
588
			$("#item6user").show()
589
			$("ul.mainNavUl li").removeClass("liNow");
590
			$('#tab6user').addClass("liNow");
591
			$(".moreNav").hide();
592
			
593
			var pa=$(".moreNavUl.wendaUl>li.liNow").attr("rel")
594
			$("#"+pa).find("ul").html("")
595
			$("#"+pa).find(".js-load-more").show();
596
			
597
			$(".wendaNav li").eq(0).addClass("liNow").siblings().removeClass("liNow");
598
			$("#item6drop1").show()
599
			$("#item6more").show()
600
			unpatentListVal(true);
601
		})
602
		$('#seeMoreL').unbind("click").on("click",function(){
603
			$(".leftconItem").hide();
604
			var activeTab = $('#item5user').attr("rel");
605
			$("#item5user").show()
606
			$("ul.mainNavUl li").removeClass("liNow");
607
			$('#tab5user').addClass("liNow");
608
			$(".moreNav").hide();
609
		})
610
	ifcollectionAbout(tId,$(".goSpan").find(".attenSpan"), 12)
609
	$('#seeMoreF,#seeMoreZ').unbind("click").on("click", function () {
610
		$(".leftconItem").hide();
611
		var activeTab = $('#item6user').attr("rel");
612
		$("#item6user").show()
613
		$("ul.mainNavUl li").removeClass("liNow");
614
		$('#tab6user').addClass("liNow");
615
		$(".moreNav").hide();
616
617
		var pa = $(".moreNavUl.wendaUl>li.liNow").attr("rel")
618
		$("#" + pa).find("ul").html("")
619
		$("#" + pa).find(".js-load-more").show();
620
621
		$(".wendaNav li").eq(0).addClass("liNow").siblings().removeClass("liNow");
622
		$("#item6drop1").show()
623
		$("#item6more").show()
624
		unpatentListVal(true);
625
	})
626
	$('#seeMoreL').unbind("click").on("click", function () {
627
		$(".leftconItem").hide();
628
		var activeTab = $('#item5user').attr("rel");
629
		$("#item5user").show()
630
		$("ul.mainNavUl li").removeClass("liNow");
631
		$('#tab5user').addClass("liNow");
632
		$(".moreNav").hide();
633
	})
634
	ifcollectionAbout(tId, $(".goSpan").find(".attenSpan"), 12)
611 635
	getUserInfo(); //获取详细信息
612 636
	professorListVal(true);
613 637
	patentListVal(true);
614 638
	paperListVal(true);
615 639
	unpatentListVal(true);
616
	bindClickFun();	
617
})
618
640
	bindClickFun();
641
})

+ 0 - 1
js/unPatentShow.js

@ -176,7 +176,6 @@ $(document).ready(function() {
176 176
			closeLog();
177 177
		}
178 178
	})
179
180 179
	//点击产品收藏
181 180
	$('#attention em').click(function() {
182 181
		if(userid && userid != "null" && userid != null) {

+ 42 - 12
js/userInforShow.js

@ -780,7 +780,22 @@ $(function () {
780 780
				var $info = res.data.data;
781 781
				if ($info.length > 0) {
782 782
					$("#" + aimId).show()
783
					
784
					var subject = '',
785
					department = ''
786
783 787
					for (var i = 0; i < $info.length; i++) {
788
						if ($info[i].subject) {
789
							subject = "应用领域:" + $info[i].subject
790
						} else {
791
							subject = ''
792
						}
793
						if ($info[i].department) {
794
							department = '所属部门:' + $info[i].department
795
						} else {
796
							department = ''
797
						}
798
784 799
						var resIM = '<div class="madiaHead patentHead"></div>'
785 800
						if ($info[i].pic) {
786 801
							var src = '/data/researchResult' + $info[i].pic.split(",")[0]
@ -790,17 +805,18 @@ $(function () {
790 805
						itemlist += '<a target="_blank" href="unPatentShow.html?id=' + $info[i].id + '" class="flexCenter urlgo">';
791 806
						itemlist += resIM
792 807
						itemlist += '<div class="madiaInfo"><p class="h1Font ellipsisSty">' + $info[i].name + '</p>';
793
						itemlist += '<p class="h2Font ellipsisSty displayNone">研究者:<span class="researchers"></span></p>';
794
						if ($info[i].orgId) {
795
							itemlist += '<p class="h2Font ellipsisSty">所属机构:<span class="resOrgName"></span></p>';
796
						}
808
						itemlist += '<p class="h2Font ellipsisSty ">'+ subject+'<span class="researchers"></span></p>';
809
						itemlist += '<p class="h2Font ellipsisSty ">'+ department+'<span class="researchers"></span></p>';
810
						// if ($info[i].orgId) {
811
						// 	itemlist += '<p class="h2Font ellipsisSty">所属机构:<span class="resOrgName"></span></p>';
812
						// }
797 813
						itemlist += '</div>';
798 814
						itemlist += '</a></li>';
799 815
						var $itemlist = $(itemlist);
800 816
						$("#" + aimId).append($itemlist)
801
						queryResearcher($info[i].id, $itemlist)
817
						// queryResearcher($info[i].id, $itemlist)
802 818
						if ($info[i].orgId) {
803
							queryReseOrgName($info[i].orgId, $itemlist)
819
							// queryReseOrgName($info[i].orgId, $itemlist)
804 820
						}
805 821
					}
806 822
				}
@ -1678,7 +1694,20 @@ $(function () {
1678 1694
				id: arr,
1679 1695
			}, "get", function (data) {
1680 1696
				var dataStr = data.data;
1697
				var subject = '',
1698
					department = ''
1681 1699
				for (var i = 0; i < dataStr.length; i++) {
1700
1701
					if (dataStr[i].subject) {
1702
						subject = "应用领域:" + dataStr[i].subject
1703
					} else {
1704
						subject = ''
1705
					}
1706
					if (dataStr[i].department) {
1707
						department = '所属部门:' + dataStr[i].department
1708
					} else {
1709
						department = ''
1710
					}
1682 1711
					var li = document.createElement("li");
1683 1712
					li.className = "mui-table-view-cell";
1684 1713
					var resIM = '<div class="madiaHead patentHead"></div>'
@ -1690,18 +1719,19 @@ $(function () {
1690 1719
					strAdd += '<a  target="_blank" href="unPatentShow.html?id=' + dataStr[i].id + '" class="flexCenter urlgo">';
1691 1720
					strAdd += resIM
1692 1721
					strAdd += '<div class="madiaInfo"><p class="h1Font ellipsisSty">' + dataStr[i].name + '</p>';
1693
					strAdd += '<p class="h2Font ellipsisSty displayNone">研究者:<span class="researchers"></span></p>';
1694
					if (dataStr[i].orgId) {
1695
						strAdd += '<p class="h2Font ellipsisSty">所属机构:<span class="resOrgName"></span></p>';
1696
					}
1722
					strAdd += '<p class="h2Font ellipsisSty ">'+ subject+'<span class="researchers"></span></p>';
1723
					strAdd += '<p class="h2Font ellipsisSty ">'+ department+'<span class="researchers"></span></p>';
1724
					// if (dataStr[i].orgId) {
1725
					// 	strAdd += '<p class="h2Font ellipsisSty">所属机构:<span class="resOrgName"></span></p>';
1726
					// }
1697 1727
					strAdd += '</div>';
1698 1728
					strAdd += '</a>';
1699 1729
					li.innerHTML = strAdd
1700 1730
					document.getElementById(obj).appendChild(li);
1701 1731
					var $itemlist = $(li);
1702
					queryResearcher(dataStr[i].id, $itemlist)
1732
					// queryResearcher(dataStr[i].id, $itemlist)
1703 1733
					if (dataStr[i].orgId) {
1704
						queryReseOrgName(dataStr[i].orgId, $itemlist)
1734
						// queryReseOrgName(dataStr[i].orgId, $itemlist)
1705 1735
					}
1706 1736
				}
1707 1737
			});