-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
414 lines (365 loc) · 15.6 KB
/
index.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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
<!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-tab.css">
<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/beihai365_comman.js"></script>
<script src="js/beihai365_global.js"></script>
<script src="js/zepto.min.js"></script>
</head>
<body class="um-vp c-wh" ontouchstart>
<div id="page_0" class="up ub ub-ver" tabindex="0">
<!--header开始-->
<div id="header">
<div id="header_top" class="uh t-wh ub header-for-index color-m1">
<div id="left_btn" style="display: none;"></div>
<h1 id="form_name" class="ub-f1 ulev5 ut-s tx-c" layerkey="pindaolist"><span class="indexSo" onclick="openSearch()"></span></h1>
<div id="right_btn" class="saoyisao" fn="index" onclick="topbar_right(this);"></div>
</div>
</div>
<!--header结束-->
<!--content开始-->
<div id="content" class="ub-f1 tx-l t-bla ub-img100"></div>
<!--content结束-->
<!--footer开始-->
<div id="footer" class="uf c-m14 t-wh">
<div class="footer_365">
<!--工具栏开始-->
<div class="ub tool_icon">
<div class="ub-f1 tx-c hti-7-0 cur_bg_btn cur_color" iconsn="0" style="background-image: url(css/img/new201501/icon_0_hover.png)" ontouchstart="zy_touch('click_opacity')" onclick="index_btn(this,'11');">
<span class="f12 tool_text cur">首页</span>
</div>
<div class="ub-f1 tx-c hti-7-1 cur_bg_btn pr" iconsn="1" ontouchstart="zy_touch('click_opacity')" onclick="index_btn(this,'10');">
<span class="f12 tool_text cur">看帖</span>
<span class="redDian" id="redDian"></span>
</div>
<div class="ub-f1 tx-c hti-7-2 cur_bg_btn" iconsn="2" ontouchstart="zy_touch('click_opacity')" onclick="index_btn(this,'6');">
<span class="f12 tool_text cur">论坛</span>
</div>
<div class="ub-f1 tx-c hti-7-3 cur_bg_btn" iconsn="3" ontouchstart="zy_touch('click_opacity')" onclick="index_btn(this,'7');">
<span class="f12 tool_text cur">我的</span>
</div>
<div class="ub-f1 tx-c hti-7-4 cur_bg_btn" iconsn="4" ontouchstart="zy_touch('click_opacity')" onclick="index_btn(this,'2');">
<span class="f12 tool_text cur">更多</span>
</div>
</div>
<!--工具栏结束-->
</div>
</div>
<!--footer结束-->
</div>
</body>
<script src="js/zepto.min.js"></script>
<script>
zy_init();
var isTimer = null;
var isTimerData = "0";
var $winWidth,
$winHeight,
$headHeight,
$footHeight;
var $x,
$y,
$w,
$h;
window.uexOnload = function(type) {
uexScanner.cbOpen = ScannerSuccessCallBack;
if (!type) {
//初始化窗口自增ID
localStorage.detailWindowId = 0;
localStorage.listWindowId = 0;
localStorage.pindaoWindowId = 0;
localStorage.tiedanWindowId = 0;
localStorage.tiedanDecWindowId = 0;
$(function() {
init();
});
//禁止滚动
uexWindow.setBounce("0");
app_update(false);
//自升级
//第一次启动
if (!localStorage.pattern || !localStorage.myIndex) {
localStorage.pattern = 'small_pic';
}
//启动给小红点
redDian("1");
getInfo(); //获取手机信息
//本地没有的内容放在最后加载
//isEnd();
}
window.onorientationchange = window.onresize = function() {
$winWidth = $(window).width();
$winHeight = $(window).height();
$headHeight = $("#header").height();
$footHeight = $("#footer").height();
}
}
function init() {
if (uexWidgetOne.iOS7Style) {
uexWindow.setStatusBarTitleColor(1);
$("#header").prepend('<div id="iPhoneBar" class="iPhoneBar iPhoneBarpindaolist"></div>');
}
localStorage.returnType = 'index';
//来路,登陆使用
//获取宽度
$winWidth = $(window).width();
$winHeight = $(window).height();
$headHeight = $("#header").height();
$footHeight = $("#footer").height();
//xywh
$x = 0,
$y = parseInt($headHeight),
$w = 0,
$h = parseInt($winHeight - $headHeight - $footHeight);
//定义ID
localStorage.urlType = 15;
loadView();
//启动广告
if ( localStorage.v15 ) {
//uexWindow.openPopover("start", 0, "start.html", '', 0, 0, 0, 0, '', 0, 0);
} else {
//alert(localStorage.getItem("adData"))
if (JSON.parse(localStorage.getItem("adData"))) {
if (JSON.parse(localStorage.getItem("adData")).msg == "yes") {
uexWindow.openPopover("adHome", 0, "adHome.html", "", 0, 0, '', '', '', 0, 0);
}
}
}
loadAd();
//加载广告
}
function motaiYindao() {
uexWindow.openPopover("start_mt", 0, "start_mt.html", '', 0, 0, 0, 0, '', 0, 0);
}
function loadAd() {
$.getJSON("http://tools.beihai365.com/beihai365_app_ad/index.php?c=ad_get&m=get_ad&group=0&jsoncallback=?" + "&version=" + version, function(data) {
if (data) {
localStorage.setItem("adData", JSON.stringify(data));
}
})
}
function loadEnd() {
}
function loadView() {
zy_con("content", "pindaolist.html", 0, $$("header").offsetHeight);
}
/*********看帖页面处理*******/
//全局定时器
var TipsTimer = null;
//存储的时间,第一次给它一个非常大的值为的是获取数据为0
if (!localStorage.NewTipsTime) {
localStorage.NewTipsTime = '314159265358979323846';
//就在一千年以后
}
function setNewTips() {
$.getJSON(reLink("/index.php?jsoncallback=?&version=13&c=threads&m=newthreads&refreshtime=" + localStorage.NewTipsTime), function(data) {
if (data.resutlt.num == 0) {
redDian("0");
isTimerData = 0;
} else {
redDian("1");
clearInterval(TipsTimer);
// 有数据了就关闭定时器
isTimerData = 1;
};
})
}
function OpenNewTips() {
TipsTimer = setInterval("setNewTips()", 1000 * 10);
//1000为1秒钟,设置为1分钟。
}
function redDian(a) {
var rd = $("#redDian");
if (a == 1) {
rd.show();
} else {
rd.hide();
}
}
function colseNewTips() {
clearInterval(TipsTimer);
}
/**************/
var $layerKey;
//根据来路拼装TOP
function index_btn(t, key) {
if (isTimer) {
colseNewTips();
OpenNewTips();
//alert();
//关闭模态层
localStorage.KantieOpenBox = "1";
}
var name = '';
var lb = $("#left_btn");
var rb = $("#right_btn");
lb.removeClass().html('').show();
rb.removeClass().html('').show();
lb.removeAttr('fn');
rb.removeAttr('fn');
$header_top = $("#header_top");
btnView(t);
if (uexWidgetOne.iOS7Style) {
}
if (key == 2) {
$header_top.removeClass("color-m1");
$header_top.addClass("color-m2");
name = "更多";
$layerKey = "more";
//uexWindow.setSelectedPopOverInMultiWindow('all',4);
} else if (key == 6) {
$header_top.removeClass("color-m1");
$header_top.addClass("color-m2");
name = "论坛"
$layerKey = "bbs_list";
//uexWindow.setSelectedPopOverInMultiWindow('all',2);
} else if (key == 7) {
$header_top.removeClass("color-m1");
$header_top.addClass("color-m2");
uexWindow.bringPopoverToFront("me_index");
name = '我的365';
$layerKey = "me_index";
//uexWindow.setSelectedPopOverInMultiWindow('all',3);
} else if (key == 10) {
$header_top.removeClass("color-m1");
$header_top.addClass("color-m2");
name = "看帖";
$layerKey = "kantie";
//打开小红点提示
colseNewTips();
//点击进去频道就关了定时器
isTimer = true;
//消灭小红点
redDian("0");
//有数据给它拉数据
localStorage.TimerLoad = isTimerData;
localStorage.isloadpost = "1" //点击加载回复和缓冲数据
//uexWindow.setSelectedPopOverInMultiWindow('all',1);
} else if (key == 11) {
localStorage.urlType = 15;
if (uexWidgetOne.iOS7Style) {
}
$layerKey = "pindaolist";
$header_top.removeClass("color-m2");
$header_top.addClass("color-m1");
lb.hide();
name = '<span style="color: #fff;margin:.5rem .5rem 0 .625rem; display: block" onclick="openSearch()" title="北海365网"><img src="css/img/seach/soPic.png" width="100%"></span>';
rb.attr({
"fn" : "index"
})
rb.addClass('saoyisao');
//uexWindow.setSelectedPopOverInMultiWindow('all',0);
}
$("#iPhoneBar").removeClass();
$("#iPhoneBar").addClass("iPhoneBar iPhoneBar" + $layerKey);
localStorage.indexLayerKey = $layerKey;
//使用getLayer预防返回undefined
zy_con("content", localStorage.indexLayerKey + ".html", 0, $$("header").offsetHeight);
$("#form_name").html(name).attr({
"layerKey" : $layerKey
});
}
function getLayer(key) {
var item = localStorage.getItem(key);
if (item == '' || item == null || typeof (item) == "undefined") {
return "pindaolist";
} else {
return item;
}
}
function login(s) {
if (s == "more") {
zy_con("content", "more.html", 0, $$("header").offsetHeight);
} else if( s == 'bbs_list'){
zy_con("content", "bbs_list.html", 0, $$("header").offsetHeight);
}else{
zy_con("content", "me_index.html", 0, $$("header").offsetHeight);
}
}
function topbar_right(t) {
var isif = $(t).attr("fn");
if (isif == "index") {
//var ScannerJSON = '{"lineImg":"res://scannerLine.png","pickBgImg":"res://scannerBg.png","tipLabel":"将方框对准二维码/条形码,即可自动扫描","title":"扫描二维码/条形码"}';
uexScanner.open();
//uexScanner.setJsonData(ScannerJSON);
}
}
function btnView(t) {
var isn = $(t).attr("iconsn");
$(".cur_bg_btn").attr("style", "");
$(t).css({
"background-image" : "url(css/img/new201501/icon_" + isn + "_hover.png)"
});
$(".cur_bg_btn").removeClass("cur_color");
$(t).addClass("cur_color");
}
/*
跳转到搜索
* */
function openSearch(){
openWindow.select('4','','');
}
function ScannerSuccessCallBack(opCode, dataType, data) {
var obj = eval('(' + data + ')');
var reCode = obj.code;
if (isHttp(reCode)) {
if (isTaobeihai(reCode).length <= 6) {
openUrl("http://taobeihai.com/baobei.php?id=" + isTaobeihai(reCode))
} else if (is365(reCode).length <= 8) {
openWindow.select('3', is365(reCode));
} else {
openbrower(reCode);
}
}
}
function isHttp(obj) {
if (obj.indexOf("http://") == 0 || obj.indexOf("https://") == 0) {
return true;
}
return false;
}
function isTaobeihai(obj) {
if (obj.indexOf("taobeihai.com") > 0) {
if (obj.indexOf("baobei") > 0) {
return obj.replace(/([^?]+)taobeihai.com([^?]+)\?([^=]+)=([^?]+)/gi, '$4');
} else if (obj.indexOf("item") > 0) {
return obj.replace(/([^?]+)taobeihai.com([^?]+)\/([^?]+)\.html/gi, '$3');
} else {
return false;
}
}
return false;
}
function is365(obj) {
if (obj.indexOf("beihai365.com") > 0) {
if (obj.indexOf("read") > 0) {
return obj.replace(/([^?]+)beihai365.com([^?]+)\?([^=]+)=([^?]+)/gi, '$4');
} else if (obj.indexOf("/t/") > 0) {
return obj.replace(/([^?]+)beihai365.com([^?]+)\/([^?]+)/gi, '$3');
} else {
return false;
}
}
return false;
}
function loginCallback(){
uexWindow.evaluateScript("login", 0, "colse();");
console.log(localStorage.rootType)
if( localStorage.rootType == 'bbs_list'){
login('bbs_list');
localStorage.removeItem('rootType');
}else{
login('me_index');
}
}
</script>
</html>