Browse Source

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

luyanan 7 years ago
parent
commit
bd3b7fecc5

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

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

18

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

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

50
				plus.nativeUI.closeWaiting();
50
				plus.nativeUI.closeWaiting();
51
				plus.webview.currentWebview().show("slide-in-right", 150);
51
				plus.webview.currentWebview().show("slide-in-right", 150);
52
				if(data.success) {
52
				if(data.success) {
53
					if(pageNo!=data.data.pageNo) {
54
						data.data.data=[];
55
					}
53
					var obj = data.data.data;
56
					var obj = data.data.data;
54
					if(obj.length>0){
57
					if(obj.length>0){
55
						for(var i = 0; i < obj.length; i++) {
58
						for(var i = 0; i < obj.length; i++) {
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
						mui('#pullrefresh').pullRefresh().endPullupToRefresh(false); /*能上拉*/
79
						mui('#pullrefresh').pullRefresh().endPullupToRefresh(false); /*能上拉*/
77
					} else {
80
					} else {
78
						mui('#pullrefresh').pullRefresh().endPullupToRefresh(true); /*不能上拉*/
81
						mui('#pullrefresh').pullRefresh().endPullupToRefresh(true); /*不能上拉*/

+ 3 - 0
app/js/userEvaluate.js

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

+ 4 - 2
app/js/userarticleList.js

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

+ 3 - 0
app/js/userpaperList.js

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

+ 3 - 0
app/js/userpatentList.js

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

+ 3 - 0
app/js/userresourceList.js

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