-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
66 lines (60 loc) · 2.26 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<title></title>
<script src="js/mui.min.js"></script>
<link href="css/mui.min.css" rel="stylesheet" />
<script type="text/javascript" charset="utf-8">
mui.init();
mui.plusReady(function(){
//生成日期
var currentDate = new Date();
var currentDateObj = document.getElementById("currentDateStr");
var currentWeekObj = document.getElementById("currentWeekStr");
currentDateObj.innerHTML = currentDate.getFullYear()+"年"+(currentDate.getMonth()+1)+"月"+(currentDate.getDate())+"日";
currentWeekObj.innerHTML = "星期"+"日一二三四五六".charAt(currentDate.getDay());
var subPage = plus.webview.create(
"http://api.juheapi.com/japi/toh?key=1aaa05df71455499fa71f48ef7c514a3&v=1.0&month="+(currentDate.getMonth()+1)+"&day="+(currentDate.getDate()),
"embed",
{top:"46px",bottom:"0px"}
);
// plus.webview.currentWebview().append(subPage);
void subPage.setJsFile("_www/js/getJSON.js");
var str = plus.storage.getItem("content");
var json = eval("("+str+")");
// console.log(str);
// console.log("==============================");
var message = "";
mui.each(json.result,function(i,n){
// console.log(json.result[i].des);
message += "<li class=\"mui-table-view-cell\"><h4>"+json.result[i].title+"</h4><span>"+json.result[i].des+"</span></li>";
});
var currentMessageObj = document.getElementById("currentMessage");
currentMessageObj.innerHTML = message;
})
</script>
</head>
<body>
<header class="mui-bar mui-bar-nav">
<h1 class="mui-title">历史上的今天</h1>
<a class="mui-icon mui-icon-info mui-pull-right"></a>
</header>
<div class="mui-content">
<ul class="mui-table-view">
<li class="mui-table-view-divider">
<span>今天是</span>
<span id="currentDateStr" class="mui-badge mui-badge-blue">
</span>
<span style="margin-left: 50px;"></span>
<span>星期:</span>
<span id="currentWeekStr" class="mui-badge mui-badge-red">
</span>
</li>
<ul class="mui-table-view" id="currentMessage">
</ul>
</ul>
</div>
</body>
</html>