jack 8 years ago
parent
commit
b8f14a7229
2 changed files with 35 additions and 35 deletions
  1. 4 4
      app/html/professorArticle.html
  2. 31 31
      app/js/articleShow.js

+ 4 - 4
app/html/professorArticle.html

43
				</div>
43
				</div>
44
			</div>
44
			</div>
45
		</nav>
45
		</nav>
46
		<div class="mui-content mui-scroll-wrapper" id="pullrefresh" style="padding-bottom:50px;">
47
			<div class="mui-scroll">
46
		<div class="mui-content" id="pullrefresh" style="padding-bottom:50px;">
47
			<div class="">
48
			    <div class="showDetail">
48
			    <div class="showDetail">
49
			    		<div class="h1Font hWeight" id="articleName"></div>
49
			    		<div class="h1Font hWeight" id="articleName"></div>
50
			    		<div class="madiaBlock">
50
			    		<div class="madiaBlock">
93
					<!--留言-->
93
					<!--留言-->
94
					<div class="madiaBlock">
94
					<div class="madiaBlock">
95
						<div class="madiaTit" id="olisten">留言</div>
95
						<div class="madiaTit" id="olisten">留言</div>
96
						<ul class="mui-table-view mui-table-view-chevron commentBlock noactiveTab">
96
						<ul class="mui-table-view commentBlock noactiveTab">
97
					       
97
					       
98
					   </ul>
98
					   </ul>
99
					</div>
99
					</div>
126
		<script src="../js/public/jquery-1.11.1.js"></script>
126
		<script src="../js/public/jquery-1.11.1.js"></script>
127
		<script type="text/javascript"> 
127
		<script type="text/javascript"> 
128
			document.getElementById("listenClick").addEventListener("tap",function(){
128
			document.getElementById("listenClick").addEventListener("tap",function(){
129
				$(".mui-content").animate({"scrollTop": document.getElementById("olisten").offsetTop+"px"}, 400); 
129
				$("body,html").animate({"scrollTop": document.getElementById("olisten").offsetTop+"px"}, 400); 
130
			})
130
			})
131
			//处理iOS下弹出软键盘后头部会随页面的滚动条消失问题
131
			//处理iOS下弹出软键盘后头部会随页面的滚动条消失问题
132
		    iosheader();
132
		    iosheader();

+ 31 - 31
app/js/articleShow.js

1
var createTime = "",
2
	orderKey = "";
3
mui.init({
4
	pullRefresh: {
5
		container: '#pullrefresh',
6
		up: {
7
			contentrefresh: '正在加载...',
8
			callback: pullupRefresh
9
		}
10
	}
11
});
12

13
function pullupRefresh() {
14
	setTimeout(function() {
15
		leword(1, 0);
16
	}, 1000);
17
}
18
leword(1, 1);
1
//var createTime = "",
2
//	orderKey = "";
3
//mui.init({
4
//	pullRefresh: {
5
//		container: '#pullrefresh',
6
//		up: {
7
//			contentrefresh: '正在加载...',
8
//			callback: pullupRefresh
9
//		}
10
//	}
11
//});
12
//
13
//function pullupRefresh() {
14
//	setTimeout(function() {
15
//		leword(1, 0);
16
//	}, 1000);
17
//}
18
leword(500, 1);
19

19

20
function leword(row, aa) {
20
function leword(row, aa) {
21
	mui.plusReady(function() {
21
	mui.plusReady(function() {
23
			stt;
23
			stt;
24
		var obj = {};
24
		var obj = {};
25
		obj.articleId = plus.webview.currentWebview().articleId;
25
		obj.articleId = plus.webview.currentWebview().articleId;
26
		obj.createTime = createTime;
27
		obj.orderKey = orderKey;
26
		/*obj.createTime = createTime;
27
		obj.orderKey = orderKey;*/
28
		obj.rows = row;
28
		obj.rows = row;
29
		mui.ajax(baseUrl + "/ajax/leaveWord/ql", {
29
		mui.ajax(baseUrl + "/ajax/leaveWord/ql", {
30
			data: obj,
30
			data: obj,
35
			success: function(data) {
35
			success: function(data) {
36
				console.log(JSON.stringify(data))
36
				console.log(JSON.stringify(data))
37
				if(data.success) {
37
				if(data.success) {
38
					if(af == 1) {
38
					/*if(af == 1) {*/
39
						document.getElementsByClassName('commentBlock')[0].innerHTML = ""
39
						document.getElementsByClassName('commentBlock')[0].innerHTML = ""
40
						if(data.data.length == 0) {
40
						if(data.data.length == 0) {
41
							mui('#pullrefresh').pullRefresh().disablePullupToRefresh(true);
41
							//mui('#pullrefresh').pullRefresh().disablePullupToRefresh(true);
42
							return;
42
							return;
43
						}
43
						}
44
					} else {
44
					/*} else {
45
						if(data.data.length == 0) {
45
						if(data.data.length == 0) {
46
							mui('#pullrefresh').pullRefresh().endPullupToRefresh(true);
46
							mui('#pullrefresh').pullRefresh().endPullupToRefresh(true);
47
							return;
47
							return;
48
						}
48
						}
49
					}
49
					}*/
50
					var id = plus.storage.getItem('userid');
50
					var id = plus.storage.getItem('userid');
51
					createTime = data.data[data.data.length - 1].createTime;
52
					orderKey = data.data[data.data.length - 1].orderKey;
53
					if(data.data.length == row) {
51
					/*createTime = data.data[data.data.length - 1].createTime;
52
					orderKey = data.data[data.data.length - 1].orderKey;*/
53
					/*if(data.data.length == row) {
54
						mui('#pullrefresh').pullRefresh().endPullupToRefresh(false);
54
						mui('#pullrefresh').pullRefresh().endPullupToRefresh(false);
55
					} else {
55
					} else {
56
						mui('#pullrefresh').pullRefresh().endPullupToRefresh(true);
56
						mui('#pullrefresh').pullRefresh().endPullupToRefresh(true);
57
					}
57
					}*/
58
					for(var i = 0; i < data.data.length; i++) {
58
					for(var i = 0; i < data.data.length; i++) {
59
						var oText = ""
59
						var oText = ""
60
						if(id == data.data[i].professor.id) {
60
						if(id == data.data[i].professor.id) {
84
					}
84
					}
85

85

86
				}else{
86
				}else{
87
					mui('#pullrefresh').pullRefresh().endPullupToRefresh(true);
87
					/*mui('#pullrefresh').pullRefresh().endPullupToRefresh(true);*/
88
				}
88
				}
89
			},
89
			},
90
			error: function(xhr, type, errorThrown) {
90
			error: function(xhr, type, errorThrown) {
490
		if(datatype == 1) {
490
		if(datatype == 1) {
491
			mui.openWindow({
491
			mui.openWindow({
492
				url: '../html/professorArticle.html',
492
				url: '../html/professorArticle.html',
493
				id: 'html/professorArticle.html',
493
				id: '../html/professorArticle.html',
494
				show: {
494
				show: {
495
					autoShow: false,
495
					autoShow: false,
496
					aniShow: "slide-in-right",
496
					aniShow: "slide-in-right",
503
		} else if(datatype == 2) {
503
		} else if(datatype == 2) {
504
			mui.openWindow({
504
			mui.openWindow({
505
				url: '../html/professorArticle.html',
505
				url: '../html/professorArticle.html',
506
				id: 'html/professorArticle.html',
506
				id: '../html/professorArticle.html',
507
				show: {
507
				show: {
508
					autoShow: false,
508
					autoShow: false,
509
					aniShow: "slide-in-right",
509
					aniShow: "slide-in-right",