Sfoglia il codice sorgente

数据少于指定数量时,不可刷新

luyanan 7 anni fa
parent
commit
bd3b7fecc5

+ 6 - 2
app/js/cmpInforShow-article.js

@ -12,7 +12,7 @@ mui.init({
12 12
var Num=1;
13 13
function pullupRefresh() {
14 14
	setTimeout(function() {
15
		++Num;
15
		Num++;
16 16
		getArtice(10,Num);
17 17
	}, 1000);
18 18

@ -50,9 +50,13 @@ function getArtice(pageSize,pageNo) {
50 50
				"pageNo": pageNo
51 51
			},
52 52
			success: function(data) {
53
				console.log(JSON.stringify(data));
53 54
				plus.nativeUI.closeWaiting();
54 55
				plus.webview.currentWebview().show("slide-in-right", 150);
55 56
				if(data.success) {
57
					if(pageNo!=data.data.pageNo) {
58
						data.data.data=[];
59
					}
56 60
					var obj = data.data.data;
57 61
					if(obj.length>0){
58 62
						for(var i = 0; i < obj.length; i++) {
@ -75,7 +79,7 @@ function getArtice(pageSize,pageNo) {
75 79
							mui("#pullrefresh").pullRefresh().endPullupToRefresh(true);
76 80
						}
77 81
					}
78
					if(pageNo < Math.ceil(data.total / data.pageSize)) {
82
					if(pageNo < Math.ceil(data.data.total / data.data.pageSize)) {
79 83
						mui('#pullrefresh').pullRefresh().endPullupToRefresh(false); /*能上拉*/
80 84
					} else {
81 85
						mui('#pullrefresh').pullRefresh().endPullupToRefresh(true); /*不能上拉*/

+ 4 - 1
app/js/cmpInforShow-resources.js

@ -50,6 +50,9 @@ function getResource(pageSize,pageNo) {
50 50
				plus.nativeUI.closeWaiting();
51 51
				plus.webview.currentWebview().show("slide-in-right", 150);
52 52
				if(data.success) {
53
					if(pageNo!=data.data.pageNo) {
54
						data.data.data=[];
55
					}
53 56
					var obj = data.data.data;
54 57
					if(obj.length>0){
55 58
						for(var i = 0; i < obj.length; i++) {
@ -72,7 +75,7 @@ function getResource(pageSize,pageNo) {
72 75
						}
73 76
					}
74 77
					
75
					if(pageNo < Math.ceil(data.total / data.pageSize)) {
78
					if(pageNo < Math.ceil(data.data.total / data.data.pageSize)) {
76 79
						mui('#pullrefresh').pullRefresh().endPullupToRefresh(false); /*能上拉*/
77 80
					} else {
78 81
						mui('#pullrefresh').pullRefresh().endPullupToRefresh(true); /*不能上拉*/

+ 3 - 0
app/js/userEvaluate.js

@ -46,6 +46,9 @@ function historyEvaluate(pageSize,pageNo){
46 46
				plus.webview.currentWebview().show("slide-in-right", 150);
47 47
				if(response.success) {
48 48
					console.log(JSON.stringify(response))
49
					if(pageNo!=response.data.pageNo) {
50
						response.data.data=[];
51
					}
49 52
					var $data = response.data.data;
50 53
					if($data.length>0){
51 54
						for(var i = 0; i < $data.length; i++) {

+ 4 - 2
app/js/userarticleList.js

@ -51,9 +51,11 @@ function getArticel(pageSize,pageNo) {
51 51
				plus.webview.currentWebview().show("slide-in-right", 150);
52 52
				console.log(JSON.stringify(data))
53 53
				if(data.success) {
54
					if(pageNo!=data.data.pageNo) {
55
						data.data.data=[];
56
					}
54 57
					var obj = data.data.data;
55 58
					if(obj.length > 0) {
56
						
57 59
						for(var i = 0; i < obj.length; i++) {
58 60
							var liItem = document.createElement("li");
59 61
							liItem.setAttribute("data-id", obj[i].articleId);
@ -71,7 +73,7 @@ function getArticel(pageSize,pageNo) {
71 73
							document.getElementById("articelShow").appendChild(liItem);
72 74
						}
73 75
					}
74
					if(pageNo < Math.ceil(data.total / data.pageSize)) {
76
					if(pageNo < Math.ceil(data.data.total / data.data.pageSize)) {
75 77
						mui('#pullrefresh').pullRefresh().endPullupToRefresh(false); /*能上拉*/
76 78
					} else {
77 79
						mui('#pullrefresh').pullRefresh().endPullupToRefresh(true); /*不能上拉*/

+ 3 - 0
app/js/userpaperList.js

@ -44,6 +44,9 @@ function getPaper(pageSize,pageNo) {
44 44
				plus.nativeUI.closeWaiting();
45 45
				plus.webview.currentWebview().show("slide-in-right", 150);
46 46
				if(data.success) {
47
					if(pageNo!=data.data.pageNo) {
48
						data.data.data=[];
49
					}
47 50
					var obj = data.data.data;
48 51
					if(obj.length > 0) {
49 52
						for(var i = 0; i < obj.length; i++) {

+ 3 - 0
app/js/userpatentList.js

@ -46,6 +46,9 @@ function getPatent(pageSize,pageNo) {
46 46
				plus.nativeUI.closeWaiting();
47 47
				plus.webview.currentWebview().show("slide-in-right", 150);
48 48
				if(data.success) {
49
					if(pageNo!=data.data.pageNo) {
50
						data.data.data=[];
51
					}
49 52
					var obj = data.data.data;
50 53
					if(obj.length > 0) {
51 54
						for(var i = 0; i < obj.length; i++) {

+ 3 - 0
app/js/userresourceList.js

@ -50,6 +50,9 @@ function getResource(pageSize,pageNo) {
50 50
				plus.nativeUI.closeWaiting();
51 51
				plus.webview.currentWebview().show("slide-in-right", 150);
52 52
				if(data.success) {
53
					if(pageNo!=data.data.pageNo) {
54
						data.data.data=[];
55
					}
53 56
					var obj = data.data.data;
54 57
					if(obj.length > 0) {
55 58
						for(var i = 0; i < obj.length; i++) {