my_healthData.html
6.0 KB
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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
<script src="../../assets/js/fontsize.js"></script>
<link rel="stylesheet" href="../../assets/css/api.css"/>
<link rel="stylesheet" href="../../assets/css/my_f.css"/>
<link rel="stylesheet" href="../../assets/icon/iconfont.css">
<title></title>
<style>
body, html {
background-color: #f4f4f4;
height: 100%;
}
.data_item {
display: flex;
align-items: center;
justify-content: space-between;
margin: 0 0.55rem 0 0.37rem;
background-color: #fff;
padding: 0.2rem 0.27rem;
font-size: 16px;
color: #A09F9F;
border-bottom: 1px solid #fafafa;
}
.data_item:active {
background-color: rgba(0, 0, 0, 0.1);
}
.data_item_right {
font-size: 13px;
color: #424242;
}
.data_box {
background-color: #fff;
}
.icon-xiangyou {
color: #C0C0C0;
margin-left: 0.16rem;
}
</style>
</head>
<body>
<div id="loadStart"></div>
<div id="app" v-cloak>
<div class="data_box">
<div class="data_item" @click="openSugar"><span>血糖</span>
<div class="data_item_right"><span>{{sugar_data}}mmol/L</span><span class="iconfont icon-xiangyou"></span>
</div>
</div>
<div class="data_item" @click="openPress"><span>血压</span>
<div class="data_item_right"><span>{{puser_data}}mmHg</span><span class="iconfont icon-xiangyou"></span>
</div>
</div>
<div class="data_item" @click="open_des('病历材料','病例日期','疾病类别','医院名称',1)"><span>增加病历材料</span>
<div class="data_item_right"><span>专家帮您简析病因</span><span class="iconfont icon-xiangyou"></span></div>
</div>
<div class="data_item" @click="open_des('体检报告','体检日期','体检名称','体检机构',2)"><span>增加体检报告</span>
<div class="data_item_right"><span>专家帮您解析体检报告</span><span class="iconfont icon-xiangyou"></span></div>
</div>
<div class="data_item" @click="open_des('检验报告','检验日期','检验名称','检验机构',3)"><span>增加检验报告</span>
<div class="data_item_right"><span>专家帮您解析检验报告</span><span class="iconfont icon-xiangyou"></span></div>
</div>
</div>
</div>
</body>
</html>
<script type="text/javascript" src="../../assets/js/api.js"></script>
<script type="text/javascript" src="../../assets/js/public.js"></script>
<script type="text/javascript" src="../../assets/js/fastclick.js"></script>
<script>
new FastClick(document.body);
</script>
<script type="text/javascript" src="../../assets/js/vue.min.js"></script>
<script type="text/javascript" src="../../assets/js/axios.min.js"></script>
<script type="text/javascript" src="../../assets/icon/iconfont.js"></script>
<script>
var app = new Vue({
el: '#app',
data: {
type: '',
value: 0,
high: '0',
low: '0',
sugar_data: '0',
puser_data: '0/0',
rid: ''
},
created: function () {
// apiready = function () {
// var app = this;
// app.rid = api.pageParam.rid;
this.rid = localStorage.getItem('rid');
this.healthData();
// api.addEventListener({
// name: 'sugar'
// }, function (ret, err) {
// app.healthData();
// });
// api.addEventListener({
// name: 'pressure'
// }, function (ret, err) {
// app.healthData();
// });
// }
},
methods: {
// 记录血压
openPress: function () {
var app = this;
openView('my_pressure', '../my/my_pressure', '手动血压记录', 'my_pressure', false, {rid: app.rid})
},
// 记录血糖
openSugar: function () {
var app = this;
openView('my_sugar', '../my/my_sugar', '记血糖', 'my_sugar', false, {rid: app.rid})
},
// 增加报告
open_des: function (name, date_type, type_name, type_home, type_id) {
var app = this;
openView('my_report', '../my/my_report', name, 'my_report', false, {
date_type: date_type,
type_name: type_name,
type_home: type_home,
type_id: type_id,
rid: app.rid
})
},
// 获取血糖,血压
healthData: function () {
var app = this;
var post = {
rid: app.rid
};
var header = {
"XX-Device-Type": getDevice(),
'XX-Token': getToken()
};
getRequest('post', 'user/index/healthData', post, header).then(function (res) {
loadEnd();
if (res.data.code == 1) {
var puser_data = res.data.data.puser.data;
var suger_data = res.data.data.suger.data;
app.sugar_data = !isNaN(suger_data) ? res.data.data.suger.data : 0;
app.puser_data = !isNaN(puser_data) ? res.data.data.puser.data : 0/0;
}
})
}
}
})