-
Notifications
You must be signed in to change notification settings - Fork 0
/
disease.html
133 lines (125 loc) · 4.31 KB
/
disease.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>
<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();
function fillpart() {
var mc = document.getElementById("main-content");
mui.ajax('http://115.28.74.83/pycrawl/disease.php', {
data: {
'con': 'dbody',
'class': 'body'
},
dataType: 'json',
type: 'GET',
timeout: 10000,
success: function(data) {
var finallist = '';
for (var i = data.length - 1; i >= 0; i--) {
var inner = '';
for (var j = data[i].subpart.length - 1; j >= 0; j--) {
inner = inner + '<ul class="mui-table-view my"><li class="mui-table-view-cell" mdata-id="' + i + '" data-id="' + j + '"><a class="mui-navigate-right">' + data[i].subpart[j].name + '</a></li></ul>';
}
finallist = finallist + '<ul class="mui-table-view" ><li class="mui-table-view-cell mui-collapse"><a class="mui-navigate-right" href="#">' + data[i].name +
'</a><div class="mui-collapse-content">' + inner + '</div></li></ul>';
}
mc.innerHTML = finallist;
mui('.my').on('tap', 'li', function() {
mui.openWindow({
url: 'diseaselist.html',
id: 'diseaselist1',
extras: {
'part': data[this.getAttribute('mdata-id')].subpart[this.getAttribute('data-id')].part,
'name': data[this.getAttribute('mdata-id')].subpart[this.getAttribute('data-id')].name
}
})
})
},
error: function() {
plus.ui.toast('网络错误了吧...');
}
})
}
function filldepart() {
var mc = document.getElementById("main-content");
mui.ajax('http://115.28.74.83/pycrawl/disease.php', {
data: {
'con': 'department',
'class': 'body'
},
dataType: 'json',
type: 'GET',
timeout: 10000,
success: function(data) {
var finallist = '';
for (var i = data.length - 1; i >= 0; i--) {
var inner = '';
for (var j = data[i].subdepart.length - 1; j >= 0; j--) {
inner = inner + '<ul class="mui-table-view my"><li class="mui-table-view-cell" mdata-id="' + i + '" data-id="' + j + '"><a class="mui-navigate-right">' + data[i].subdepart[j].name + '</a></li></ul>';
}
finallist = finallist + '<ul class="mui-table-view" ><li class="mui-table-view-cell mui-collapse"><a class="mui-navigate-right" href="#">' + data[i].name +
'</a><div class="mui-collapse-content">' + inner + '</div></li></ul>';
}
mc.innerHTML = finallist;
mui('.my').on('tap', 'li', function() {
mui.openWindow({
url: 'diseaselist.html',
id: 'diseaselist2',
extras: {
'part': data[this.getAttribute('mdata-id')].subdepart[this.getAttribute('data-id')].depart,
'name': data[this.getAttribute('mdata-id')].subdepart[this.getAttribute('data-id')].name
}
})
})
},
error: function() {
plus.ui.toast('网络错误了吧...');
}
})
}
function fillnormal() {
mui.openWindow({
url: 'diseaselist.html',
id: 'diseaselist3',
extras: {
'part': '',
'name': '1'
}
})
}
mui.plusReady(function() {
fillpart();
mui('#pop').on('tap', 'li#poppart', function() {
fillpart();
})
mui('#pop').on('tap', 'li#popdepart', function() {
filldepart();
})
mui('#pop').on('tap', 'li#popnormal', function() {
fillnormal();
})
});
</script>
</head>
<body>
<header class="mui-bar mui-bar-nav">
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
<h1 class="mui-title">疾病库</h1>
<a href="#popover" class="mui-icon mui-icon-bars mui-pull-right"></a>
</header>
<div class="mui-content" id="main-content">
</div>
<div id="popover" class="mui-popover mui-popover-bottom mui-popover-action ">
<ul class="mui-table-view" id="pop">
<li class="mui-table-view-cell" id="poppart"><a href="#">按部位</a></li>
<li class="mui-table-view-cell" id="popdepart"><a href="#">按科室</a></li>
<li class="mui-table-view-cell" id="popnormal"><a href="#">急救常识</a></li>
</ul>
</div>
</body>
</html>