Browse Source

搜索和企业加载更多
回答点赞排序

luyanan 7 years ago
parent
commit
a915cf4ca6
7 changed files with 188 additions and 252 deletions
  1. 4 8
      cmpInforShow.html
  2. 2 1
      css/genindex.css
  3. 38 29
      js/cmpInforShow.js
  4. 1 29
      js/common.js
  5. 19 12
      js/qa-show.js
  6. 118 166
      js/searchNew.js
  7. 6 7
      searchNew.html

+ 4 - 8
cmpInforShow.html

@ -124,10 +124,8 @@
124 124
									
125 125
								</ul>
126 126
								<!--无搜索结果-->
127
								 <div class="tcdPageCode resoucePageCode">
128
							       	
129
							      </div>
130
							      <div class="nodatabox displayNone">
127
								<button class="js-load-more resoucePageCode"></button>
128
						      	<div class="nodatabox displayNone">
131 129
							        <div class="nodata">
132 130
							            <div class="picbox picNull"></div>
133 131
							            <div class="txtbox">
@ -144,10 +142,8 @@
144 142
								<ul id="proArticel">
145 143
									
146 144
								</ul>
147
								<!--无搜索结果-->							
148
							    <div class="tcdPageCode expertPageCode">
149
							       	
150
							    </div>
145
								<!--无搜索结果-->	
146
								<button class="js-load-more expertPageCode"></button>
151 147
							    <div class="nodatabox displayNone">
152 148
							        <div class="nodata">
153 149
							            <div class="picbox picNull"></div>

+ 2 - 1
css/genindex.css

@ -717,7 +717,8 @@ div.zoomMask{position:absolute;background:url("../images/g-resource-mask.png") r
717 717
.navconBox .moreNav .table-drop>li.liNow{color: #000;}
718 718
.navconBox .moreNav .moreNavUl .rightbtn .foldtr{right:24px;}
719 719
/*统计数据*/
720
.statisticsBox{overflow: hidden;margin:10px 0}
720
.statisticsBox{overflow: hidden;}
721
.privateInfo .statisticsBox{margin:10px 0}
721 722
.statisticsBox.last_meg{height:150px;}
722 723
.statisticsBox span{font-size: 26px;color:#333;line-height: 28px;}
723 724
.statisticsBox p{font-size: 14px;color:#999;margin-bottom:4px;}

+ 38 - 29
js/cmpInforShow.js

@ -7,12 +7,13 @@ $(function() {
7 7
	}
8 8
	var oName = "";
9 9
	var watchType=0;
10
	var pageSize=10;
10 11

11 12
	if(orgId) {
12 13
		getCmpInfo(orgId); //获取详细信息
13
		getResource( 10,1, true); //获取发布的资源
14
		getArticle(10, 1, true); //获取发布的文章
15
		getDemands(10,1,true)//获取发布的需求
14
		getResource(1, true); //获取发布的资源
15
		getArticle(1, true); //获取发布的文章
16
		getDemands(1,true)//获取发布的需求
16 17
		relevantarticalList();//相关文章
17 18
		likeExperts();//感兴趣专家
18 19
		attentMy();
@ -220,7 +221,7 @@ $(function() {
220 221
		});
221 222
	}
222 223
	//获取资源
223
	function getResource(pageSize, pageNo, isbind) {
224
	function getResource( pageNo, isbind) {
224 225
		$.ajax({
225 226
			"url": "/ajax/resource/pqOrgPublish",
226 227
			"type": "get",
@ -230,10 +231,14 @@ $(function() {
230 231
				"pageSize": pageSize,
231 232
				"pageNo": pageNo
232 233
			},
234
			beforeSend: function() {
235
				$(".resourcePageCode").addClass("active").attr("disabled",true)
236
            },
237
            complete:function () {
238
            	$(".resourcePageCode").removeClass("active").removeAttr("disabled")
239
            },
233 240
			"success": function(data) {
234
				//console.log(data);
235 241
				if(data.success) {
236
					$("#proResource").html("");
237 242
					if(data.data.total>0){
238 243
						$("#resCount").html(data.data.total)
239 244
					}else if(data.data.total>99){
@ -263,18 +268,18 @@ $(function() {
263 268
								$("#showResource").append($strAddO);
264 269
							}
265 270
						}
266
						if(isbind == true) {
267
							$(".resoucePageCode").off("click").createPage({
268
								pageCount: Math.ceil(data.data.total / 10),
269
								current: data.data.pageNo,
270
								backFn: function(p) {
271
									$("#proResource").html("");
272
									getResource(10, p, false);
273
									//document.body.scrollTop = document.documentElement.scrollTop = 0;
274
								}
275
							});
271
						if(isbind){
272
							$(".resoucePageCode").on("click", function () {
273
								getResource(++pageNo,false);
274
                            });
276 275
						}
276
						if (pageNo >= Math.ceil(data.data.total /pageSize)) {
277
                            $(".resoucePageCode").unbind("click");
278
                            $(".resoucePageCode").hide();
279
                        }
280
						
277 281
					} else {
282
						$(".resoucePageCode").hide();
278 283
						$("#item2user .nodatabox").show();
279 284
						$("#item2user .nodatabox").find(".noContip").text("企业尚未发布任何资源");
280 285
					}
@ -286,7 +291,7 @@ $(function() {
286 291
		});
287 292
	}
288 293
	//获取文章
289
	function getArticle(pageSize, pageNo, isbind) {
294
	function getArticle(pageNo, isbind) {
290 295
		$.ajax({
291 296
			url: "/ajax/article/pqOrgPublish",
292 297
			dataType: 'json', //数据格式类型
@ -297,9 +302,14 @@ $(function() {
297 302
				"pageNo": pageNo
298 303
			},
299 304
			timeout: 10000, //超时设置
305
			beforeSend: function() {
306
				$(".expertPageCode").addClass("active").attr("disabled",true)
307
            },
308
            complete:function () {
309
            	$(".expertPageCode").removeClass("active").removeAttr("disabled")
310
            },
300 311
			success: function(data) {
301 312
				if(data.success) {
302
					$("#proArticel").html("");
303 313
					if(data.data.total>0){
304 314
						$("#artCount").html(data.data.total)
305 315
					}else if(data.data.total>99){
@ -343,18 +353,17 @@ $(function() {
343 353
							}
344 354

345 355
						}
346
						if(isbind == true) {
347
							$(".expertPageCode").off("click").createPage({
348
								pageCount: Math.ceil(data.data.total / 10),
349
								current: data.data.pageNo,
350
								backFn: function(p) {
351
									$("#proArticel").html("");
352
									getArticle(10, p, false);
353
									//document.body.scrollTop = document.documentElement.scrollTop = 0;
354
								}
355
							});
356
						if(isbind){
357
							$(".expertPageCode").on("click", function () {
358
								getArticle(++pageNo,false);
359
                            });
356 360
						}
361
						if (pageNo >= Math.ceil(data.data.total / pageSize)) {
362
                            $(".expertPageCode").unbind("click");
363
                            $(".expertPageCode").hide();
364
                        }
357 365
					} else {
366
						$(".expertPageCode").hide();
358 367
						$("#item3user  .nodatabox").show();
359 368
						$("#item3user  .nodatabox").find(".noContip").text("企业尚未发布任何文章");
360 369
						var i = 0;
@ -586,7 +595,7 @@ $(function() {
586 595
		});
587 596
	}
588 597
	//获取需求
589
	function getDemands(pageSize, pageNo,isbind) {
598
	function getDemands(pageNo,isbind) {
590 599
		$.ajax({
591 600
			url: "/ajax/demand/pq",
592 601
			type: "GET",

+ 1 - 29
js/common.js

@ -1305,35 +1305,7 @@ $(document).ready(function(){
1305 1305
		var adId = this.getAttribute('data-id');
1306 1306
		console.log(adId)
1307 1307
		wlog("ad", adId ,"1");
1308
		return true;	
1308
		return true;
1309 1309
	})
1310 1310
})
1311 1311

1312
function adScroll(){
1313
	//不随滚动条滚动的固定层广告代码
1314
	function thisS() {
1315
		var scrollHeight = $(document).height();
1316
		var windowHeight = $(window).innerHeight();
1317
		var footerHeight = $("footer").outerHeight(true);
1318
		var containH = $("#container").outerHeight(true)-footerHeight
1319
		var objHeight= $("#scroll-fixed-ad").outerHeight();
1320
		var scroTop = document.body.scrollTop || document.documentElement.scrollTop;
1321
		(scroTop-objHeight+offTop) < containH ? (scroTop > offTop ? 
1322
			(scroObj.attr('class',"div1 div2"), c && (scroObj.style.top = scroTop - offTop + "px")) :scroObj.attr('class',"div1")):
1323
					(scroObj.attr('class',"div1 div3"),scroObj.css("bottom",windowHeight + scroTop + footerHeight+ 10 - scrollHeight))
1324
//	console.log(containH+"***"+(scroTop+offTop-objHeight))
1325
	console.log(scroTop+"&&&&&"+offTop+"&&&"+objHeight)
1326
	}
1327
	var scroObj = $("#scroll-fixed-ad");
1328
	var offTop= scroObj.offset().top + 40;
1329
	if(scroObj == undefined) return !1;
1330
	var c;
1331
	c = window.ActiveXObject && !window.XMLHttpRequest;
1332
	if(!c || !0) window.onscroll =function(){
1333
		var d;
1334
		if(d) return;
1335
		d = setTimeout(function() {
1336
			thisS.call(this), d = undefined
1337
		}, 150)
1338
	}
1339
}

+ 19 - 12
js/qa-show.js

@ -32,13 +32,14 @@ $(function() {
32 32
			location.href="http://" + hurl + "/e/wen.html?id="+questionId;
33 33
		}
34 34
	}
35
	var rows = 10,
35
	var rows = 1,
36 36
		dataO = {
37 37
			time: "",
38 38
			id: "",
39
			score:""
39
			score:"",
40
			agree:""
40 41
		};
41
	var	rowsR = 10,
42
	var	rowsR = 1,
42 43
		pageNum=1,
43 44
		dataC = {
44 45
			count: "",
@ -46,7 +47,8 @@ $(function() {
46 47
		}
47 48
	var dataT={
48 49
			id: "",
49
			score:""
50
			score:"",
51
			agree:""
50 52
		}
51 53
	var oAjax = function(url, dataS, otype, oFun,beforeFun,completeFun) {
52 54
			$.ajax({
@ -182,7 +184,7 @@ $(function() {
182 184
				}
183 185
			})
184 186
		},
185
		answerList = function() {
187
		answerList = function(isbind) {
186 188
			wlog("question",questionId,"1");
187 189
			var byway = document.querySelector('.list-hold-count>ul').querySelector("li.active").getAttribute("data-type");
188 190
			var typeurl,dataStr={};
@ -191,6 +193,7 @@ $(function() {
191 193
				dataStr={
192 194
					"qid": questionId,
193 195
					"score": dataO.score,
196
					"agree":dataO.agree,
194 197
					"id": dataO.id,
195 198
					"rows": rows
196 199
				}
@ -209,6 +212,7 @@ $(function() {
209 212
				if($info.length > 0) {
210 213
					if(byway == 1) {
211 214
						dataO.score = $info[$info.length - 1].score;
215
						dataO.agree = $info[$info.length - 1].agree;
212 216
						dataO.id = $info[$info.length - 1].id;
213 217
					}else if(byway == 2) {
214 218
						dataO.time = $info[$info.length - 1].createTime;
@ -226,10 +230,11 @@ $(function() {
226 230
                if($info.length == 0 && liLen == 0 ){
227 231
                    insertAfter(newStr,aimId);
228 232
                }
229
                
230
                $("#curAnswers").parent().find(".js-load-more").on("click",function(){
231
				 	answerList()
232
				})
233
                if(isbind){
234
                	$("#curAnswers").parent().find(".js-load-more").on("click",function(){
235
					 	answerList(false)
236
					})
237
                }
233 238
				if ($info.length < rows) {
234 239
                    $("#curAnswers").parent().find(".js-load-more").unbind("click");
235 240
                    $("#curAnswers").parent().find(".js-load-more").hide();
@ -272,6 +277,7 @@ $(function() {
272 277
					"qid": questionId,
273 278
					"score": dataT.score,
274 279
					"id": dataT.id,
280
					"agree":dataT.agree,
275 281
					"rows": rows
276 282
				}
277 283
			oAjax(typeurl,dataStr, "get", function(res){
@ -282,6 +288,7 @@ $(function() {
282 288
						$(".otherAn").removeClass("displayNone")
283 289
					}
284 290
					dataT.score = $info[$info.length - 1].score;
291
					dataT.agree = $info[$info.length - 1].agree;
285 292
					dataT.id = $info[$info.length - 1].id;
286 293
					for(var i = 0; i < $info.length; i++) {
287 294
						if($info[i].id==topAnswerId){
@ -817,7 +824,7 @@ $(function() {
817 824
	}else{
818 825
		$(".show-list-allAn").removeClass("displayNone")
819 826
		$(".show-list-thisAn").addClass("displayNone")
820
		answerList();
827
		answerList(true);
821 828
	}
822 829
823 830
	if(userid && userid != null && userid != "null") {
@ -834,8 +841,8 @@ $(function() {
834 841
		document.getElementById("curAnswers").innerHTML = "";
835 842
		$("#curAnswers").parent().find(".js-load-more").unbind("click");
836 843
		$("#curAnswers").parent().find(".js-load-more").show();
837
		dataO = {time: "",id: "",score:""}
838
		answerList()
844
		dataO = {time: "",id: "",score:"",agree:""}
845
		answerList(true)
839 846
	});	
840 847
	$("#attention").on('click', function() {
841 848
		if(userid && userid != null && userid != "null") {

+ 118 - 166
js/searchNew.js

@ -6,6 +6,7 @@ $(function() {
6 6
	loginStatus();//判断个人是否登录
7 7
	var userid = $.cookie("userid");
8 8
	var num;
9
	var pageSize=20;
9 10
	var keyt,subject,industry,address;
10 11
	var authType = 1;
11 12
	var searchContent = $.trim(GetQueryString("searchContent"));
@ -14,7 +15,7 @@ $(function() {
14 15
	if(tagnum==""){
15 16
		num = 1;
16 17
		keyt=searchContent;
17
		expertListVal(keyt,subject,industry,address,authType,20,1,true);
18
		expertListVal(keyt,subject,industry,address,authType,1,true);
18 19
	}else{
19 20
		num = tagnum;
20 21
		keyt=searchContent;
@ -22,32 +23,32 @@ $(function() {
22 23
			$(".choosediv.filterdiv li").eq(0).addClass("liactive").siblings().removeClass("liactive");
23 24
			$(".listdiv .listbox").eq(0).show().siblings().hide();
24 25
			$(".searchsome").attr("placeholder","请输入专家姓名、机构、研究方向或相关关键词");
25
			expertListVal(keyt,subject,industry,address,authType,20,1,true);
26
			expertListVal(keyt,subject,industry,address,authType,1,true);
26 27
		}else if(num==2){
27 28
			$(".choosediv.filterdiv li").eq(2).addClass("liactive").siblings().removeClass("liactive");
28 29
			$(".listdiv .listbox").eq(2).show().siblings().hide();
29 30
			$(".searchsome").attr("placeholder","请输入资源名称、用途、发布者或相关关键词");
30
			resourceListVal(keyt,20, 1,true);
31
			resourceListVal(keyt, 1,true);
31 32
		}else if(num==3){
32 33
			$(".choosediv.filterdiv li").eq(5).addClass("liactive").siblings().removeClass("liactive");
33 34
			$(".listdiv .listbox").eq(5).show().siblings().hide();
34 35
			$(".searchsome").attr("placeholder","请输入文章标题、作者或相关关键词");
35
			articalListVal(keyt,20, 1,true);
36
			articalListVal(keyt, 1,true);
36 37
		}else if(num==4){
37 38
			$(".choosediv.filterdiv li").eq(1).addClass("liactive").siblings().removeClass("liactive");
38 39
			$(".listdiv .listbox").eq(1).show().siblings().hide();
39 40
			$(".searchsome").attr("placeholder","请输入企业名称、产品名称或相关关键词");
40
			companyListVal(keyt,20,1,true);
41
			companyListVal(keyt,1,true);
41 42
		}else if(num==5){
42 43
			$(".choosediv.filterdiv li").eq(3).addClass("liactive").siblings().removeClass("liactive");
43 44
			$(".listdiv .listbox").eq(3).show().siblings().hide();
44 45
			$(".searchsome").attr("placeholder","请输入专利名称、发明人或相关关键词");
45
			patentListVal(keyt,20, 1,true);
46
			patentListVal(keyt,1,true);
46 47
		}else if(num==6){
47 48
			$(".choosediv.filterdiv li").eq(4).addClass("liactive").siblings().removeClass("liactive");
48 49
			$(".listdiv .listbox").eq(4).show().siblings().hide();
49 50
			$(".searchsome").attr("placeholder","请输入论文题目、作者或相关关键词");
50
			paperListVal(keyt,20, 1,true);
51
			paperListVal(keyt, 1,true);
51 52
		}
52 53
	}
53 54
	
@ -62,12 +63,6 @@ $(function() {
62 63
		keyt=searchContent;
63 64
		$(".searchsome").val(searchContent);
64 65
	}
65
//	expertListVal(keyt,subject,industry,address,authType,20,1,true);
66
//	companyListVal(20,1,true);
67
//	articalListVal(20, 1,true);
68
//	resourceListVal(20, 1,true);
69
//	patentListVal(20, 1,true);
70
//	paperListVal(20, 1,true);
71 66
	
72 67
	academicFieldVal(subjectText);
73 68
	applicationIndustryVal();
@ -110,15 +105,15 @@ $(function() {
110 105
			if(num==1){
111 106
				expertBox();
112 107
			}else if(num==2){
113
				resourceListVal(keyt,20, 1,true);
108
				resourceListVal(keyt, 1,true);
114 109
			}else if(num==3){
115
				articalListVal(keyt,20, 1,true);
110
				articalListVal(keyt, 1,true);
116 111
			}else if(num==4){
117
				companyListVal(keyt,20, 1,true);
112
				companyListVal(keyt, 1,true);
118 113
			}else if(num==5){
119
				patentListVal(keyt,20, 1,true);
114
				patentListVal(keyt,1,true);
120 115
			}else if(num==6){
121
				paperListVal(keyt,20, 1,true);
116
				paperListVal(keyt, 1,true);
122 117
			}
123 118
		}
124 119
	})
@ -130,15 +125,15 @@ $(function() {
130 125
		if(num==1){
131 126
			expertBox();
132 127
		}else if(num==2){
133
			resourceListVal(keyt,20, 1,true);
128
			resourceListVal(keyt, 1,true);
134 129
		}else if(num==3){
135
			articalListVal(keyt,20, 1,true);
130
			articalListVal(keyt, 1,true);
136 131
		}else if(num==4){
137
			companyListVal(keyt,20, 1,true);
132
			companyListVal(keyt, 1,true);
138 133
		}else if(num==5){
139
			patentListVal(keyt,20, 1,true);
134
			patentListVal(keyt, 1,true);
140 135
		}else if(num==6){
141
			paperListVal(keyt,20, 1,true);
136
			paperListVal(keyt, 1,true);
142 137
		}
143 138
	})
144 139
	
@ -167,7 +162,7 @@ $(function() {
167 162
		}else{
168 163
			address = addressVal;
169 164
		}
170
		expertListVal(keyt,subject,industry,address,authType,20,1,true);
165
		expertListVal(keyt,subject,industry,address,authType,1,true);
171 166
	}
172 167
			
173 168
	
@ -185,19 +180,19 @@ $(function() {
185 180
				expertBox();
186 181
				$(".searchsome").attr("placeholder","请输入专家姓名、机构、研究方向或相关关键词");
187 182
			}else if(index==1){
188
				companyListVal(keyt,20, 1,true);
183
				companyListVal(keyt, 1,true);
189 184
				$(".searchsome").attr("placeholder","请输入企业名称、产品名称或相关关键词");
190 185
			}else if(index==2){
191
				resourceListVal(keyt,20, 1,true);
186
				resourceListVal(keyt, 1,true);
192 187
				$(".searchsome").attr("placeholder","请输入资源名称、用途、发布者或相关关键词");
193 188
			}else if(index==3){
194
				patentListVal(keyt,20, 1,true);
189
				patentListVal(keyt, 1,true);
195 190
				$(".searchsome").attr("placeholder","请输入专利名称、发明人或相关关键词");
196 191
			}else if(index==4){
197
				paperListVal(keyt,20, 1,true);
192
				paperListVal(keyt, 1,true);
198 193
				$(".searchsome").attr("placeholder","请输入论文题目、作者或相关关键词");
199 194
			}else if(index==5){
200
				articalListVal(keyt,20, 1,true);
195
				articalListVal(keyt, 1,true);
201 196
				$(".searchsome").attr("placeholder","请输入文章标题、作者或相关关键词");
202 197
			}
203 198
	   });
@ -291,35 +286,8 @@ $(function() {
291 286
		});
292 287
	}
293 288
	
294
//	//专家点击咨询
295
//	$('#expertList').on("click",".rightop",function(){
296
//		if (userid && userid != "null" && userid != null) {
297
//			var professorId = $(this).attr("id");
298
//				ConsultApply();
299
//				//点击的发送
300
//				$("#sendConsultBtn").click(function() {
301
//					sendConsultHandler($(this).attr("proId"))
302
//				});
303
//				concultProInfo(professorId);
304
//		}else{
305
//			$.MsgBox.Alert('提示',"请先登录再进行咨询");
306
//			$("#mb_btn_ok").val("去登录");
307
//			var aele = document.createElement('a');
308
//			$("#mb_btnbox").append(aele);
309
//			$("#mb_btnbox a").css({
310
//				'display': "block",
311
//				'width': '100%',
312
//				'height': '40px',
313
//				'position': 'absolute',
314
//				'bottom': '-6px',
315
//				'left': '0'
316
//			});
317
//			aele.setAttribute('href', '../login.html');
318
//		}
319
//	})
320
	
321 289
	//专家
322
	function expertListVal(keyt,subject,industry,address,authType,pageSize,pageNo,isexpert) {
290
	function expertListVal(keyt,subject,industry,address,authType,pageNo,isexpert) {
323 291
		$.ajax({
324 292
			"url": "/ajax/professor/pqBaseInfo",
325 293
			"type": "get",
@ -332,16 +300,18 @@ $(function() {
332 300
				"pageSize": pageSize,
333 301
				"pageNo": pageNo
334 302
			},
335
			"beforeSend": function() {
336
				$("#expertList").append('<img src="../images/loading.gif" class="loading" />');
337
			},
303
			beforeSend: function() {
304
				$(".expertPageCode").addClass("active").attr("disabled",true)
305
            },
306
            complete:function () {
307
            	$(".expertPageCode").removeClass("active").removeAttr("disabled")
308
            },
338 309
			"success": function(data) {
339 310
				console.log(data);
340 311
				if(data.success) {
341 312
					if(data.data.data.length > 0){
342 313
						$("#expertList,.expertPageCode").show();
343 314
						$(".expertPage").hide();
344
						$("#expertList").html("");
345 315
						var itemlist = '';
346 316
						for(var i = 0; i < data.data.data.length; i++) {
347 317
							var itemlist = '<li class="flexCenter">';
@ -359,9 +329,9 @@ $(function() {
359 329
							var datalist = data.data.data[i];
360 330
							$itemlist.find(".expertUrl").attr("href", "userInforShow.html?professorId=" + datalist.id );
361 331
							$itemlist.find("#Name").text(datalist.name);
362
//							$itemlist.find(".rightop").attr("id",datalist.id);
363
//							if(datalist.id != userid){
364
//								$itemlist.find(".rightop").show();
332
//							$itemlist.find(".rightop").attr("id",datalist.id);
333
//							if(datalist.id != userid){
334
//								$itemlist.find(".rightop").show();
365 335
//							}
366 336
							var userType = autho(datalist.authType, datalist.orgAuth, datalist.authStatus);
367 337
							$itemlist.find(".authiconNew").attr("title", userType.title);
@ -400,24 +370,20 @@ $(function() {
400 370
								$itemlist.find("#researchAreas").text(rlist);
401 371
							}
402 372
						}
403
						//分页
404
						if(isexpert==true){
405
							$(".expertPageCode").off("click").createPage({
406
								pageCount: Math.ceil(data.data.total / 20),
407
								current: data.data.pageNo,
408
								backFn: function(p) {
409
									$("#expertList").html("");
410
									expertListVal(keyt,subject,industry,address,authType,20,p,false);
411
									document.body.scrollTop = document.documentElement.scrollTop = 0;
412
								}
413
							});
373
						if(isexpert){
374
							$(".expertPageCode").on("click", function () {
375
								expertListVal(keyt,subject,industry,address,authType,++pageNo,false);
376
                            });
414 377
						}
378
						if (pageNo >= Math.ceil(data.data.total / pageSize)) {
379
                            $(".expertPageCode").unbind("click");
380
                            $(".expertPageCode").hide();
381
                        }
415 382
						window.setTimeout(function() {
416 383
							//不随滚动条滚动的固定层广告代码
417 384
					        $('#scroll-fixed-ad').scrollFix({
418 385
					        	oflag:true,
419 386
					        	startTop:'#scroll-fixed-ad',
420
					        	startBottom:"header",
421 387
					            distanceTop: $("header").outerHeight(true) + 20,
422 388
					            endPos: 'footer',
423 389
					            zIndex: 998
@ -428,7 +394,6 @@ $(function() {
428 394
						$("#expertList,.expertPageCode").hide();
429 395
						$(".expertPage").show();
430 396
					}
431
					$(".loading").remove();
432 397
				}
433 398
	
434 399
			},
@ -438,19 +403,22 @@ $(function() {
438 403
		});
439 404
	}
440 405
	//企业
441
	function companyListVal(keyt,pageSize,pageNo,isbind) {
406
	function companyListVal(keyt,pageNo,isbind) {
442 407
		$.ajax({
443 408
			"url": "/ajax/org/find/pq",
444 409
			"type": "get",
445 410
			"async": true,
446 411
			"data": {
447 412
				"kw":keyt,
448
				"pageSize": pageSize,
413
				"pageSize": pageSize,
449 414
				"pageNo": pageNo
450 415
			},
451
			"beforeSend": function() {
452
				$("#companyList").append('<img src="../images/loading.gif" class="loading" />');
453
			},
416
			beforeSend: function() {
417
				$(".companyPageCode").addClass("active").attr("disabled",true)
418
            },
419
            complete:function () {
420
            	$(".companyPageCode").removeClass("active").removeAttr("disabled")
421
            },
454 422
			"success": function(data) {
455 423
				console.log(data);
456 424
				if(data.success) {
@ -458,7 +426,6 @@ $(function() {
458 426
						$("#companyList,.companyPageCode").show();
459 427
						$(".companyPage").hide();
460 428
						var itemlist = '';
461
						$("#companyList").html("");
462 429
						for(var i = 0; i < data.data.data.length; i++) {
463 430
							var itemlist = '<li class="flexCenter">';
464 431
							itemlist += '<a target="_blank" href="" class="companyUrl linkhref"><div class="lefthead companyhead">';
@ -496,24 +463,19 @@ $(function() {
496 463
								$("#orgTit").html(orgTypeShow[datalist.orgType] + "<span style='margin-right:10px;'></span>");
497 464
							}
498 465
						}
499
						//分页
500
						if(isbind==true){
501
							$(".companyPageCode").off("click").createPage({
502
								pageCount: Math.ceil(data.data.total / 20),
503
								current: data.data.pageNo,
504
								backFn: function(p) {
505
									$("#companyList").html("");
506
									companyListVal(keyt,20, p,false);
507
									document.body.scrollTop = document.documentElement.scrollTop = 0;
508
								}
509
							});
466
						if(isbind){
467
							$(".companyPageCode").on("click", function () {
468
								companyListVal(keyt,++pageNo,false);
469
                            });
510 470
						}
511
						
471
						if (pageNo >= Math.ceil(data.data.total / pageSize)) {
472
                            $(".companyPageCode").unbind("click");
473
                            $(".companyPageCode").hide();
474
                        }
512 475
					}else{
513 476
						$("#companyList,.companyPageCode").hide();
514 477
						$(".companyPage").show();
515 478
					}
516
					$(".loading").remove();
517 479
				}
518 480
	
519 481
			},
@ -523,7 +485,7 @@ $(function() {
523 485
		});
524 486
	}
525 487
	//文章
526
	function articalListVal(keyt,pageSize, pageNo,isbind) {
488
	function articalListVal(keyt, pageNo,isbind) {
527 489
		$.ajax({
528 490
			"url": "/ajax/article/firstpq",
529 491
			"type": "get",
@ -533,9 +495,12 @@ $(function() {
533 495
				"pageSize": pageSize,
534 496
				"pageNo": pageNo
535 497
			},
536
			"beforeSend": function() {
537
				$("#articalList").append('<img src="../images/loading.gif" class="loading" />');
538
			},
498
			beforeSend: function() {
499
				$(".articalPageCode").addClass("active").attr("disabled",true)
500
            },
501
            complete:function () {
502
            	$(".articalPageCode").removeClass("active").removeAttr("disabled")
503
            },
539 504
			"success": function(data) {
540 505
				console.log(data);
541 506
				if(data.success) {
@ -543,7 +508,6 @@ $(function() {
543 508
						$("#articalList,.articalPageCode").show();
544 509
						$(".articalPage").hide();
545 510
						var itemlist = '';
546
						$("#articalList").html("");
547 511
						for(var i = 0; i < data.data.data.length; i++) {
548 512
							var datalist = data.data.data[i];
549 513
							var sowU=""
@ -587,24 +551,20 @@ $(function() {
587 551
							}
588 552
							
589 553
						}
590
						//分页
591
						if(isbind==true){
592
							$(".articalPageCode").off("click").createPage({
593
								pageCount: Math.ceil(data.data.total / 20),
594
								current: data.data.pageNo,
595
								backFn: function(p) {
596
									$("#articalList").html("");
597
									articalListVal(keyt,20, p,false);
598
									document.body.scrollTop = document.documentElement.scrollTop = 0;
599
								}
600
							});
554
						if(isbind){
555
							$(".articalPageCode").on("click", function () {
556
								articalListVal(keyt,++pageNo,false);
557
                            });
601 558
						}
559
						if (pageNo >= Math.ceil(data.data.total / pageSize)) {
560
                            $(".articalPageCode").unbind("click");
561
                            $(".articalPageCode").hide();
562
                        }
602 563
						
603 564
					}else{
604 565
						$("#articalList,.articalPageCode").hide();
605 566
						$(".articalPage").show();
606 567
					}
607
					$(".loading").remove();
608 568
				}
609 569
	
610 570
			},
@ -615,7 +575,7 @@ $(function() {
615 575
	}
616 576
	
617 577
	//资源
618
	function resourceListVal(keyt,pageSize, pageNo,isresource) {
578
	function resourceListVal(keyt,pageNo,isresource) {
619 579
		$.ajax({
620 580
			"url": "/ajax/resource/firstpq",
621 581
			"type": "get",
@ -625,9 +585,12 @@ $(function() {
625 585
				"pageSize": pageSize,
626 586
				"pageNo": pageNo
627 587
			},
628
			"beforeSend": function() {
629
				$("#resourceList").append('<img src="../images/loading.gif" class="loading" />');
630
			},
588
			beforeSend: function() {
589
				$(".resourcePageCode").addClass("active").attr("disabled",true)
590
            },
591
            complete:function () {
592
            	$(".resourcePageCode").removeClass("active").removeAttr("disabled")
593
            },
631 594
			"success": function(data) {
632 595
				console.log(data);
633 596
				if(data.success) {
@ -635,7 +598,6 @@ $(function() {
635 598
						$("#resourceList,.resourcePageCode").show();
636 599
						$(".resourcePage").hide();
637 600
						var itemlist = '';
638
						$("#resourceList").html("");
639 601
						for(var i = 0; i < data.data.data.length; i++) {
640 602
							var itemlist = '<li class="flexCenter">';
641 603
							itemlist += '<a href="" target="_blank" class="resourceUrl linkhref"><div class="lefthead resouhead" id="resourceImg"></div>';
@ -673,24 +635,20 @@ $(function() {
673 635
								}
674 636
							}
675 637
						}
676
						//分页
677
						if(isresource==true){
678
							$(".resourcePageCode").off("click").createPage({
679
								pageCount: Math.ceil(data.data.total / 20),
680
								current: data.data.pageNo,
681
								backFn: function(p) {
682
									$("#resourceList").html("");
683
									resourceListVal(keyt,20, p,false);
684
									document.body.scrollTop = document.documentElement.scrollTop = 0;
685
								}
686
							});
638
						if(isresource){
639
							$(".resourcePageCode").on("click", function () {
640
								resourceListVal(keyt,++pageNo,false);
641
                            });
687 642
						}
643
						if (pageNo >= Math.ceil(data.data.total / pageSize)) {
644
                            $(".resourcePageCode").unbind("click");
645
                            $(".resourcePageCode").hide();
646
                        }
688 647
						
689 648
					}else{
690 649
						$("#resourceList,.resourcePageCode").hide();
691 650
						$(".resourcePage").show();
692 651
					}
693
					$(".loading").remove();
694 652
				}
695 653
	
696 654
			},
@ -700,7 +658,7 @@ $(function() {
700 658
		});
701 659
	}
702 660
	//专利
703
	function patentListVal(keyt,pageSize, pageNo,isbind) {
661
	function patentListVal(keyt,pageNo,isbind) {
704 662
		$.ajax({
705 663
			"url": "/ajax/ppatent/pq",
706 664
			"type": "get",
@ -710,9 +668,12 @@ $(function() {
710 668
				"pageSize": pageSize,
711 669
				"pageNo": pageNo
712 670
			},
713
			"beforeSend": function() {
714
				$("#patentList").append('<img src="../images/loading.gif" class="loading" />');
715
			},
671
			beforeSend: function() {
672
				$(".patentPageCode").addClass("active").attr("disabled",true)
673
            },
674
            complete:function () {
675
            	$(".patentPageCode").removeClass("active").removeAttr("disabled")
676
            },
716 677
			"success": function(data) {
717 678
				console.log(data);
718 679
				if(data.success) {
@ -721,7 +682,6 @@ $(function() {
721 682
						$("#patentList,.patentPageCode").show();
722 683
						$(".patentPage").hide();
723 684
						var itemlist = '';
724
						$("#patentList").html("");
725 685
						for(var i = 0; i < dataStr.length; i++) {
726 686
							var itemlist = '<li class="flexCenter">';
727 687
							itemlist += '<a target="_blank" href="/' + pageUrl("pt",dataStr[i]) +'" class="linkhref"><div class="lefthead patenthead"></div>';
@ -733,24 +693,19 @@ $(function() {
733 693
							$itemlist = $(itemlist);
734 694
							$("#patentList").append($itemlist);
735 695
						}
736
						//分页
737
						if(isbind==true){
738
							$(".patentPageCode").off("click").createPage({
739
								pageCount: Math.ceil(data.data.total / 20),
740
								current: data.data.pageNo,
741
								backFn: function(p) {
742
									$("#patentList").html("");
743
									patentListVal(keyt,20, p,false);
744
									document.body.scrollTop = document.documentElement.scrollTop = 0;
745
								}
746
							});
696
						if(isbind){
697
							$(".patentPageCode").on("click", function () {
698
								patentListVal(keyt,++pageNo,false);
699
                            });
747 700
						}
748
						
701
						if (pageNo >= Math.ceil(data.data.total /pageSize)) {
702
                            $(".patentPageCode").unbind("click");
703
                            $(".patentPageCode").hide();
704
                        }
749 705
					}else{
750 706
						$("#patentList,.patentPageCode").hide();
751 707
						$(".patentPage").show();
752 708
					}
753
					$(".loading").remove();
754 709
				}
755 710
	
756 711
			},
@ -760,7 +715,7 @@ $(function() {
760 715
		});
761 716
	}
762 717
	//论文
763
	function paperListVal(keyt,pageSize, pageNo,isbind) {
718
	function paperListVal(keyt, pageNo,isbind) {
764 719
		$.ajax({
765 720
			"url": "/ajax/ppaper/pq",
766 721
			"type": "get",
@ -770,9 +725,12 @@ $(function() {
770 725
				"pageSize": pageSize,
771 726
				"pageNo": pageNo
772 727
			},
773
			"beforeSend": function() {
774
				$("#paperList").append('<img src="../images/loading.gif" class="loading" />');
775
			},
728
			beforeSend: function() {
729
				$(".paperPageCode").addClass("active").attr("disabled",true)
730
            },
731
            complete:function () {
732
            	$(".paperPageCode").removeClass("active").removeAttr("disabled")
733
            },
776 734
			"success": function(data) {
777 735
				console.log(data);
778 736
				if(data.success) {
@ -781,7 +739,6 @@ $(function() {
781 739
						$("#paperList,.paperPageCode").show();
782 740
						$(".paperPage").hide();
783 741
						var itemlist = '';
784
						$("#paperList").html("");
785 742
						for(var i = 0; i < dataStr.length; i++) {
786 743
							var moreInf=""
787 744
							if(!dataStr[i].cn4periodical){
@ -805,24 +762,19 @@ $(function() {
805 762
							$itemlist = $(itemlist);
806 763
							$("#paperList").append($itemlist);
807 764
						}
808
						//分页
809
						if(isbind==true){
810
							$(".paperPageCode").off("click").createPage({
811
								pageCount: Math.ceil(data.data.total / 20),
812
								current: data.data.pageNo,
813
								backFn: function(p) {
814
									$("#paperList").html("");
815
									paperListVal(keyt,20, p,false);
816
									document.body.scrollTop = document.documentElement.scrollTop = 0;
817
								}
818
							});
765
						if(isbind){
766
							$(".paperPageCode").on("click", function () {
767
								paperListVal(keyt,++pageNo,false);
768
                            });
819 769
						}
820
						
770
						if (pageNo >= Math.ceil(data.data.total /pageSize)) {
771
                            $(".paperPageCode").unbind("click");
772
                            $(".paperPageCode").hide();
773
                        }
821 774
					}else{
822 775
						$("#paperList,.paperPageCode").hide();
823 776
						$(".paperPage").show();
824 777
					}
825
					$(".loading").remove();
826 778
				}
827 779
	
828 780
			},

+ 6 - 7
searchNew.html

@ -63,8 +63,7 @@
63 63
						</ul>
64 64
						<div class="searchCon">
65 65
							<ul class="listitemdiv" id="expertList"></ul>
66
								
67
							<div class="tcdPageCode expertPageCode"></div>
66
							<button class="js-load-more expertPageCode"></button>	
68 67
							<!--无搜索结果-->
69 68
							<div class="nodatabox expertPage" style="display: none;">
70 69
						        <div class="nodata">
@ -80,7 +79,7 @@
80 79
					<div class="listbox" style="display: none;">
81 80
						<div class="searchCon">
82 81
							<ul class="listitemdiv listmorediv" id="companyList"></ul>
83
							<div class="tcdPageCode companyPageCode"></div>
82
							<button class="js-load-more companyPageCode"></button>
84 83
							<!--无搜索结果-->
85 84
							<div class="nodatabox companyPage" style="display: none;">
86 85
						        <div class="nodata">
@ -96,7 +95,7 @@
96 95
					<div class="listbox" style="display: none;">
97 96
						<div class="searchCon">
98 97
							<ul class="listitemdiv listmorediv" id="resourceList"></ul>
99
							<div class="tcdPageCode resourcePageCode"></div>
98
							<button class="js-load-more resourcePageCode"></button>
100 99
							<!--无搜索结果-->
101 100
							<div class="nodatabox resourcePage" style="display: none;">
102 101
						        <div class="nodata">
@ -112,7 +111,7 @@
112 111
					<div class="listbox" style="display: none;">
113 112
						<div class="searchCon">
114 113
							<ul class="listitemdiv listmorediv" id="patentList"></ul>
115
							<div class="tcdPageCode patentPageCode"></div>
114
							<button class="js-load-more patentPageCode"></button>
116 115
							<!--无搜索结果-->
117 116
							<div class="nodatabox patentPage" style="display: none;">
118 117
						        <div class="nodata">
@ -128,7 +127,7 @@
128 127
					<div class="listbox" style="display: none;">
129 128
						<div class="searchCon">
130 129
							<ul class="listitemdiv listmorediv" id="paperList"></ul>
131
							<div class="tcdPageCode paperPageCode"></div>
130
							<button class="js-load-more paperPageCode"></button>
132 131
							<!--无搜索结果-->
133 132
							<div class="nodatabox paperPage" style="display: none;">
134 133
						        <div class="nodata">
@ -144,7 +143,7 @@
144 143
					<div class="listbox" style="display: none;">
145 144
						<div class="searchCon">
146 145
							<ul class="listitemdiv listmorediv" id="articalList"></ul>
147
							<div class="tcdPageCode articalPageCode"></div>
146
							<button class="js-load-more articalPageCode"></button>
148 147
							<!--无搜索结果-->
149 148
							<div class="nodatabox articalPage" style="display: none;">
150 149
						        <div class="nodata">