Browse Source

搜索修改

xuchunyang 8 years ago
parent
commit
9ece823c16
1 changed files with 24 additions and 24 deletions
  1. 24 24
      app/js/searchhome.js

+ 24 - 24
app/js/searchhome.js

@ -24,7 +24,7 @@ var industryid = document.getElementById("industryid");
24 24

25 25
mui.init({
26 26
		pullRefresh: {
27
			container: '#pullrefresh',
27
			container: '#pullrefresh3',
28 28
			up: {
29 29
				contentrefresh: '正在加载...',
30 30
				callback: pullupRefresh,
@ -40,18 +40,18 @@ function pullupRefresh() {
40 40
	setTimeout(function() {
41 41
		expert2(key, subject, industry, province, address, authentication, 10, pageNo)
42 42
	}, 1000);
43
	mui('#pullrefresh').pullRefresh().refresh(true);
43
	mui('#pullrefresh3').pullRefresh().refresh(true);
44 44
}
45 45

46 46
if(mui.os.plus) {
47 47
	mui.plusReady(function() {
48 48
		setTimeout(function() {
49
			mui('#pullrefresh').pullRefresh().pulldownLoading();
49
			mui('#pullrefresh3').pullRefresh().pulldownLoading();
50 50
		}, 500);
51 51
	});
52 52
} else {
53 53
	mui.ready(function() {
54
		mui('#pullrefresh').pullRefresh().pulldownLoading();
54
		mui('#pullrefresh3').pullRefresh().pulldownLoading();
55 55
	});
56 56
}
57 57

@ -234,7 +234,7 @@ mui(".xsly").on('tap', 'a', function() {
234 234

235 235
/*初始化数据*/
236 236
function expert(key, subject, industry, province, address, authentication, pageSize, pageNo) {
237
		console.log(bigClass)
237
		//console.log(bigClass)
238 238
	if(bigClass == 1) {
239 239
		mui.ajax(baseUrl + '/ajax/professor/pqAPP', {
240 240
			data: {
@ -264,14 +264,14 @@ function expert(key, subject, industry, province, address, authentication, pageS
264 264
					var datalist = data.data.data;
265 265
					console.log(data.data.total)
266 266
					datalistEach(datalist);
267
					mui('#pullrefresh').pullRefresh().refresh(true);
268
	                mui('#pullrefresh').pullRefresh().scrollTo(0,0);
267
					mui('#pullrefresh3').pullRefresh().refresh(true);
268
	                mui('#pullrefresh3').pullRefresh().scrollTo(0,0);
269 269
	                if(data.data.total<data.data.pageSize){
270
	                	mui('#pullrefresh').pullRefresh().disablePullupToRefresh(); //没有数据禁止上拉刷新	
270
	                	mui('#pullrefresh3').pullRefresh().disablePullupToRefresh(); //没有数据禁止上拉刷新	
271 271
	                }
272 272
				} else {
273 273
					plus.nativeUI.toast("抱歉,没有找到对应的搜索", toastStyle);
274
					mui('#pullrefresh').pullRefresh().disablePullupToRefresh(); //没有数据禁止上拉刷新
274
					mui('#pullrefresh3').pullRefresh().disablePullupToRefresh(); //没有数据禁止上拉刷新
275 275
				}
276 276
				
277 277
			},
@ -307,14 +307,14 @@ function expert(key, subject, industry, province, address, authentication, pageS
307 307
				if(data.success && data.data.data != '') {
308 308
					var datalist = data.data.data;
309 309
					resourcesEach(datalist);
310
					mui('#pullrefresh').pullRefresh().refresh(true);
311
	                mui('#pullrefresh').pullRefresh().scrollTo(0,0,0);
310
					mui('#pullrefresh3').pullRefresh().refresh(true);
311
	                mui('#pullrefresh3').pullRefresh().scrollTo(0,0,0);
312 312
	                if(data.data.total<data.data.pageSize){
313
	                	mui('#pullrefresh').pullRefresh().disablePullupToRefresh(); //没有数据禁止上拉刷新	
313
	                	mui('#pullrefresh3').pullRefresh().disablePullupToRefresh(); //没有数据禁止上拉刷新	
314 314
	                }
315 315
				} else {
316 316
					plus.nativeUI.toast("抱歉,没有找到对应的搜索", toastStyle);
317
					mui('#pullrefresh').pullRefresh().disablePullupToRefresh(); //没有数据禁止上拉刷新
317
					mui('#pullrefresh3').pullRefresh().disablePullupToRefresh(); //没有数据禁止上拉刷新
318 318
				}
319 319
			},
320 320
			error: function() {
@ -350,7 +350,7 @@ function expert2(key, subject, industry, province, address, authentication, page
350 350
			success: function(data) {
351 351
				plus.nativeUI.closeWaiting();
352 352
				if(data.success && data.data.data != '') {
353
					mui('#pullrefresh').pullRefresh().enablePullupToRefresh(); //启用上拉刷新
353
					mui('#pullrefresh3').pullRefresh().enablePullupToRefresh(); //启用上拉刷新
354 354
					var datalist = data.data.data;
355 355
					var dice1 = data.data.total; //总条数
356 356
					var dice2 = data.data.pageSize; //每页条数
@ -363,22 +363,22 @@ function expert2(key, subject, industry, province, address, authentication, page
363 363
					console.log(allPages);
364 364
					var datalist = data.data.data;
365 365
					datalistEach(datalist);
366
					mui('#pullrefresh').pullRefresh().refresh(true);//重置上拉加载
366
					mui('#pullrefresh3').pullRefresh().refresh(true);//重置上拉加载
367 367
					if(pageNo < allPages) {
368
						mui('#pullrefresh').pullRefresh().endPullupToRefresh(false); //能上拉
368
						mui('#pullrefresh3').pullRefresh().endPullupToRefresh(false); //能上拉
369 369
					} else {
370
						mui('#pullrefresh').pullRefresh().endPullupToRefresh(true); //不能上拉
370
						mui('#pullrefresh3').pullRefresh().endPullupToRefresh(true); //不能上拉
371 371
					}
372 372

373 373
				} else {
374
					mui('#pullrefresh').pullRefresh().disablePullupToRefresh(); //没有数据禁止上拉刷新
374
					mui('#pullrefresh3').pullRefresh().disablePullupToRefresh(); //没有数据禁止上拉刷新
375 375
					table.innerHTML = '';
376 376
					plus.nativeUI.toast("抱歉,没有找到对应的搜索", toastStyle);
377 377
				}
378 378
			},
379 379
			error: function() {
380 380
				plus.nativeUI.toast("服务器链接超时", toastStyle);
381
				mui('#pullrefresh').pullRefresh().endPullupToRefresh(true);
381
				mui('#pullrefresh3').pullRefresh().endPullupToRefresh(true);
382 382
			}
383 383
		});
384 384
	} else {
@ -399,7 +399,7 @@ function expert2(key, subject, industry, province, address, authentication, page
399 399
			success: function(data) {
400 400
				plus.nativeUI.closeWaiting();
401 401
				if(data.success && data.data.data != '') {
402
					mui('#pullrefresh').pullRefresh().enablePullupToRefresh(); //启用上拉刷新
402
					mui('#pullrefresh3').pullRefresh().enablePullupToRefresh(); //启用上拉刷新
403 403
					var datalist = data.data.data;
404 404
					var dice1 = data.data.total; //总条数
405 405
					var dice2 = data.data.pageSize; //每页条数
@ -409,22 +409,22 @@ function expert2(key, subject, industry, province, address, authentication, page
409 409
					}
410 410
					var datalist = data.data.data;
411 411
					resourcesEach(datalist);
412
					mui('#pullrefresh').pullRefresh().refresh(true);
412
					mui('#pullrefresh3').pullRefresh().refresh(true);
413 413
					if(pageNo < allPages) {
414
						mui('#pullrefresh').pullRefresh().endPullupToRefresh(false); //能上拉
414
						mui('#pullrefresh3').pullRefresh().endPullupToRefresh(false); //能上拉
415 415
					} else {
416 416
						mui('#pullrefresh').pullRefresh().endPullupToRefresh(true); //不能上拉
417 417
					}
418 418

419 419
				} else {
420
					mui('#pullrefresh').pullRefresh().disablePullupToRefresh(); //没有数据禁止上拉刷新
420
					mui('#pullrefresh3').pullRefresh().disablePullupToRefresh(); //没有数据禁止上拉刷新
421 421
					table.innerHTML = '';
422 422
					plus.nativeUI.toast("抱歉,没有找到对应的搜索", toastStyle);
423 423
				}
424 424
			},
425 425
			error: function() {
426 426
				plus.nativeUI.toast("服务器链接超时", toastStyle);
427
				mui('#pullrefresh').pullRefresh().endPullupToRefresh(true);
427
				mui('#pullrefresh3').pullRefresh().endPullupToRefresh(true);
428 428
			}
429 429
		});
430 430
	}