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

24

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

45

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

57

234

234

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

372

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

418

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