-
Notifications
You must be signed in to change notification settings - Fork 0
/
index_content.html
133 lines (114 loc) · 5.49 KB
/
index_content.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8">
<meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<link rel="stylesheet" href="css/ui-base.css">
<link rel="stylesheet" href="css/ui-box.css">
<link rel="stylesheet" href="css/ui-color.css">
<link rel="stylesheet" href="css/ui-res.css">
<link rel="stylesheet" href="css/ui-365.css">
<script src="js/zy_control.js"></script>
<script src="js/zy_tmpl.js"></script>
<script src="js/beihai365_comman.js"></script>
<script src="js/zy_click.js"></script>
<script src="js/beihai365_global.js"></script>
</head>
<body class="um-vp c-wh" ontouchstart>
<div id="content" class="ub-f1 tx-l t-bla ub-img6"> </div>
<!--content结束-->
</body>
<script src="js/zepto.min.js"></script>
<script>
//var $winName = ("list" + localStorage.listWindowId);
window.uexOnload=function(type)
{
localStorage.listOrder = 1;
//板块id
var fid = 1;
//向上滑动加载
Thread.touch_load(1);
//打开加载
Thread.onload_threads(1);
}
function $id(id) {
return document.getElementById(id);
}
//帖子类
var Thread = {
record : 0, //分页记录
thread_list_url : ("http://www.beihai365.com/phone/index.php?jsoncallback=?&c=threads&m=list"),
__load_treads : function(forums_id,success_call,fail_call){
var _this = this;
var iftopped = "no"; //默认排序
var order = "0"; //默认排序
$.getJSON(Thread.thread_list_url + "&record=" + Thread.record + "&order=" + order + "&fid=" + forums_id + "&iftopped=" + iftopped + "&version=15",function(data){
//alert("dd")
var keyth = ""
//循环显示列表
var thread_tpl_data = "";
for(var i=0; i<data.thread.length;i++){
var re = data.thread[i];
thread_tpl_data += '<div style="height:5rem; border-bottom:1px solid #ccc">列表</div>';
}
if(data.thread == "fail") thread_tpl_data = '<div class="ub ub-ac ub-pc" style="height:10rem">没有帖子</div>'; //如果没有记录
if(thread_tpl_data == "") thread_tpl_data = ""; //如果没有记录
if(data.thread == "lastpage") {
success_call('');
}else{
success_call(thread_tpl_data);
}
})
},
//滑动加载
touch_load : function(forums_id){
uexWindow.setBounce(1);
uexWindow.notifyBounceEvent(0,1);
uexWindow.notifyBounceEvent(1,1);
//var json='{"textColor":"#333","imagePath":"","levelText":"刚刚","pullToReloadText":"继续拖动更新","releaseToReloadText":"松手更新","loadingText":"更新中..."}';
//uexWindow.setBounceParams(0, json);
uexWindow.showBounceView("0","#FFFFFF", 1);
//var json2 ='{"textColor":"#333","imagePath":"","levelText":"","pullToReloadText":"继续上拉加载","releaseToReloadText":"松手加载下一页","loadingText":"加载中..."}';
//uexWindow.setBounceParams(1, json2);
uexWindow.showBounceView("1","#FFFFFF", 1);
uexWindow.onBounceStateChange=function(t,s){
if(t=="1"){
if(s=="2"){
Thread.record += 50; //分页
Thread.__load_treads(forums_id,function(thread_tpl_data){
var d=document.createElement("DIV");
d.innerHTML = thread_tpl_data;
$id("content").appendChild(d);
uexWindow.resetBounceView(t);
});
}
}
if(t == "0"){
if(s=="2"){
Thread.record = 0;
Thread.__load_treads(forums_id,function(thread_tpl_data){
$id("content").innerHTML = "<div>" + thread_tpl_data + "</div>";
uexWindow.resetBounceView(t);
});
}
}
}
},
//加载某板块的帖子列表
onload_threads : function(forums_id){
this.__load_treads(forums_id,function(thread_tpl_data){
var d=document.createElement("DIV");
d.innerHTML = thread_tpl_data;
$id("content").appendChild(d);
});
},
//刷新帖子列表
flush_threads : function(forums_id){
this.__load_treads(forums_id,function(thread_tpl_data){
$id("content").innerHTML = "<div>"+thread_tpl_data+"</div>";
});
},
}
</script>
</html>