...
|
...
|
@@ -95,34 +95,41 @@ |
|
|
rid: ''
|
|
|
},
|
|
|
created: function () {
|
|
|
apiready = function () {
|
|
|
app.rid = api.pageParam.rid;
|
|
|
|
|
|
// apiready = function () {
|
|
|
// var app = this;
|
|
|
// app.rid = api.pageParam.rid;
|
|
|
this.rid = localStorage.getItem('rid');
|
|
|
|
|
|
// alert(app.rid);
|
|
|
app.healthData();
|
|
|
api.addEventListener({
|
|
|
name: 'sugar'
|
|
|
}, function (ret, err) {
|
|
|
app.healthData();
|
|
|
});
|
|
|
api.addEventListener({
|
|
|
name: 'pressure'
|
|
|
}, function (ret, err) {
|
|
|
app.healthData();
|
|
|
});
|
|
|
}
|
|
|
this.healthData();
|
|
|
// api.addEventListener({
|
|
|
// name: 'sugar'
|
|
|
// }, function (ret, err) {
|
|
|
// app.healthData();
|
|
|
// });
|
|
|
// api.addEventListener({
|
|
|
// name: 'pressure'
|
|
|
// }, function (ret, err) {
|
|
|
// app.healthData();
|
|
|
// });
|
|
|
// }
|
|
|
},
|
|
|
methods: {
|
|
|
// 记录血压
|
|
|
openPress: function () {
|
|
|
openView('my_pressure', 'my/my_pressure', '手动血压记录', 'my_pressure', false, {rid: app.rid})
|
|
|
var app = this;
|
|
|
openView('my_pressure', '../my/my_pressure', '手动血压记录', 'my_pressure', false, {rid: app.rid})
|
|
|
},
|
|
|
// 记录血糖
|
|
|
openSugar: function () {
|
|
|
openView('my_sugar', 'my/my_sugar', '记血糖', 'my_sugar', false, {rid: app.rid})
|
|
|
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) {
|
|
|
openView('my_report', 'my/my_report', name, 'my_report', false, {
|
|
|
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,
|
...
|
...
|
@@ -132,6 +139,7 @@ |
|
|
},
|
|
|
// 获取血糖,血压
|
|
|
healthData: function () {
|
|
|
var app = this;
|
|
|
var post = {
|
|
|
rid: app.rid
|
|
|
};
|
...
|
...
|
@@ -141,6 +149,7 @@ |
|
|
};
|
|
|
getRequest('post', 'user/index/healthData', post, header).then(function (res) {
|
|
|
loadEnd();
|
|
|
console.log(res)
|
|
|
if (res.data.code == 1) {
|
|
|
app.sugar_data = res.data.data.suger.data ? res.data.data.suger.data : 0;
|
|
|
app.puser_data = res.data.data.puser.data ? res.data.data.puser.data : 0/0;
|
...
|
...
|
|