luyanan лет назад: 7
Родитель
Сommit
17b5dc87b0
3 измененных файлов с 65 добавлено и 13 удалено
  1. 11 5
      app/html/discoverNew.html
  2. 53 7
      app/js/discoverNew.js
  3. 1 1
      app/js/public/mui.pullToRefresh1.js

+ 11 - 5
app/html/discoverNew.html

@ -20,21 +20,27 @@
20 20
				height: 100%;
21 21
				overflow: auto;
22 22
			}
23
			.mui-pull-down-cap{
24
				margin-left:7px;
25
			}
26
			.mui-bar~.mui-pull-top-tips {
27
				top: 20px;
28
			}
23 29
			.mui-pull-top-wrapper {
24 30
				width: 100%;
25
				height: 44px;
31
				height: 32px;
26 32
				display: block;
27 33
				text-align: center;
28 34
				overflow: hidden;
29 35
			}
30 36
			.mui-pull-top-tips.mui-transitioning {
31
				-webkit-transition-duration: 800ms;
32
				transition-duration: 800ms;
37
				-webkit-transition-duration: 2000ms;
38
				transition-duration: 2000ms;
33 39
			}
34 40
			.mui-pull-top-tips .mui-pull-loading {
35 41
				-webkit-backface-visibility: hidden;
36
				-webkit-transition-duration: 600ms;
37
				transition-duration: 600ms;
42
				/*-webkit-transition-duration: 100ms;
43
				transition-duration: 100ms;*/
38 44
				margin: 0;
39 45
			}
40 46
			.mui-pull-top-wrapper .mui-icon.mui-reverse {

+ 53 - 7
app/js/discoverNew.js

@ -9,6 +9,15 @@
9 9
		indicators: true, //是否显示滚动条
10 10
		deceleration: deceleration
11 11
	});
12
	var pullObj={
13
		"0":0,
14
		"1":0,
15
		"2":0,
16
		"3":0,
17
		"4":0,
18
		"5":0,
19
		"6":0
20
	}
12 21
	$.ready(function() {
13 22
		$.plusReady(function() {
14 23
			var columnType = {
@ -98,7 +107,7 @@
98 107
						type: "get", //HTTP请求类型
99 108
						timeout: 10000, //超时时间设置为10秒;
100 109
						traditional: true,
101
						async: false,
110
						async: true,
102 111
						success: function(data) {
103 112
							if(obj.sele) {
104 113
								obj.fun.call(obj.sele, data);
@ -118,7 +127,7 @@
118 127
						key1[index] = $(pullRefreshEl).pullToRefresh({
119 128
							down: {
120 129
								callback: function() {
121
									
130
									console.log(new Date().getTime() +"a")
122 131
									var self = this;
123 132
									//self.refresh(true);
124 133
									setTimeout(function() {
@ -126,8 +135,31 @@
126 135
										ul.innerHTML = "";
127 136
										key1[m].endPullUpToRefresh(true);
128 137
										if(index == 0) {
138
											pullObj["0"]=1;
129 139
											_this.pageNo.a = 1;
130
											_this.colum.a = ""
140
											_this.colum.a = "";
141
											$.ajax(baseUrl + "/data/inc/col_bannerApp.html?ttt=" + new Date().getTime(), {
142
				dataType: 'html', //服务器返回json格式数据
143
				type: "get", //HTTP请求类型
144
				timeout: 10000, //超时时间设置为10秒;
145
				traditional: true,
146
				async: false,
147
				success: function(data) {
148
					document.getElementById("slider1").innerHTML = data;
149
					for(var i=1;i<6;i++) {
150
						arr=[];
151
						arr.push(document.getElementById("slider1").getElementsByClassName("mui-slider-item")[i].getAttribute("data-id"));
152
					var slider = $("#slider1");
153
					slider.slider({
154
						interval: 5000
155
					});
156
					}
157
					
158
				},
159
				error: function(xhr, type, errorThrown) {
160
					//plus.nativeUI.toast("服务器链接超时", toastStyle);
161
				}
162
			});
131 163
											$D({
132 164
												"fun": ob.createFragment,
133 165
												data: {
@ -138,21 +170,24 @@
138 170
												url: "/ajax/article/find"
139 171
											});
140 172
										} else {
173
											pullObj[index]=1;
141 174
											_this.pageNo[index] = 1;
142 175
											_this.colum[index + 2] = index + 2;
143 176
										}
144
177
									console.log(new Date().getTime() +"b")
145 178
										$D({
146 179
											"fun": _this.createFragment,
147 180
											data: {
148 181
												col: index ? _this.colum[index + 2] : _this.colum.a,
149 182
												pageNo: 1,
150
												exclude:arr
183
												exclude:arr,
151 184
											},
152 185
											url: "/ajax/article/find"
153 186
										});
154 187
									}, 1000);
155
									self.endPullDownToRefresh();
188
									
189
190
									console.log(new Date().getTime() +"c")
156 191
								}
157 192
158 193
							},
@ -235,8 +270,9 @@
235 270
							} else { of = 2;
236 271
							}
237 272
							var arImg = "../images/default-artical.jpg";
273
							
238 274
							if($data[i].articleImg) {
239
								arImg = baseUrl + "/data/article/" + $data[i].articleImg
275
								arImg = baseUrl + "/data/article/" + $data[i].articleImg.replace(".","_s.")
240 276
							}
241 277
							var title = $data[i].articleTitle;
242 278
							var colSpan = "";
@ -244,10 +280,20 @@
244 280
								if(arguments[1]) {
245 281
									colSpan = '<span class="column">置顶</span>'
246 282
								} else {
283
									if(pullObj["0"]==1) {
284
										
285
										key1[m].endPullDownToRefresh();
286
										pullObj[m]=0;
287
									} 									
247 288
									if($data[i].colNum != 0){	
248 289
											colSpan = "<span class='column columnOther'>" + columnType[$data[i].colNum].shortName + "</span>"
249 290
									}
250 291
								}
292
							}else{
293
								if(pullObj[m]==1) {
294
										key1[m].endPullDownToRefresh();
295
										pullObj[m]=0;
296
									} 
251 297
							}
252 298
							var li = document.createElement("li");
253 299
							li.setAttribute("data-id", $data[i].articleId);

+ 1 - 1
app/js/public/mui.pullToRefresh1.js

@ -25,7 +25,7 @@
25 25
			this.element = element;
26 26
			this.options = $.extend(true, {
27 27
				down: {
28
					height: 45,
28
					height: 30,
29 29
					callback: false,
30 30
				},
31 31
				up: {