...
|
...
|
@@ -55,6 +55,9 @@ |
|
|
|
|
|
.data_box {
|
|
|
background-color: #fff;
|
|
|
/*display:flex;*/
|
|
|
/*justify-content:space-between;*/
|
|
|
/*align-items: center;*/
|
|
|
}
|
|
|
|
|
|
.icon-xiangyou {
|
...
|
...
|
@@ -64,23 +67,27 @@ |
|
|
#jedate{
|
|
|
left:0.5rem
|
|
|
}
|
|
|
|
|
|
#chosetime{
|
|
|
outline:none;
|
|
|
/*!*height:0.68rem;*!*/
|
|
|
border:none;
|
|
|
}
|
|
|
</style>
|
|
|
</head>
|
|
|
<body>
|
|
|
<div id="loadStart"></div>
|
|
|
<div id="app">
|
|
|
<div class="data_box">
|
|
|
<div class="data_item" @click="dateSelect"><span>测量时间</span>
|
|
|
<div class="data_item"><span>测量时间</span>
|
|
|
<!--<div class="data_item_right"><span>{{date_info?date_info:default_date}}</span>-->
|
|
|
<!--<!–<span class="iconfont icon-xiangyou"></span>–>-->
|
|
|
<!--</div>-->
|
|
|
<div class="data_item_right">
|
|
|
|
|
|
<div class="date_box">
|
|
|
<div class="jeinpbox" style="width:95%"><input type="text" class="jeinput" id="test04" v-model="default_date" placeholder="请选择测量时间" style="width:96%;outline:none;border:none" readonly></div>
|
|
|
<!--<div class="iconfont icon-xiangyou" ></div>-->
|
|
|
<div class="date_box" >
|
|
|
<!--<div class="jeinpbox" style="width:95%"><input type="text" class="jeinput" id="test04" v-model="default_date" placeholder="请选择测量时间" style="width:96%;outline:none;border:none" readonly></div>-->
|
|
|
<input type="datetime-local" id="chosetime" placeholder="请选择测量时间">
|
|
|
</div>
|
|
|
<p class="iconfont icon-xiangyou"></p>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="data_item" @click="choose_high">
|
...
|
...
|
@@ -125,12 +132,204 @@ |
|
|
<script type="text/javascript" src="../../assets/js/index.js"></script>
|
|
|
<script type="text/javascript" src="../../assets/js/datePicker.js"></script>
|
|
|
<script type="text/javascript" src="../../assets/js/jquery-1.10.1.min.js"></script>
|
|
|
<script type="text/javascript" src="../../assets/js/mypressure.js"></script>
|
|
|
<!--<script type="text/javascript" src="../../assets/js/mypressure.js"></script>-->
|
|
|
|
|
|
<script type="text/javascript" src="../../assets/js/jedate.js"></script>
|
|
|
<script type="text/javascript" src="../../assets/js/demo.js"></script>
|
|
|
<!--<script type="text/javascript" src="../../assets/js/demo.js"></script>-->
|
|
|
|
|
|
|
|
|
<script>
|
|
|
var app = new Vue({
|
|
|
el: '#app',
|
|
|
data: {
|
|
|
year: '',
|
|
|
month: '',
|
|
|
day: '',
|
|
|
hour: '',
|
|
|
minute: '',
|
|
|
date_info: '',
|
|
|
default_date: '',
|
|
|
popupVisible: false,
|
|
|
high_list: [],
|
|
|
low_list: [],
|
|
|
high: '请选择高压(mmHg)',
|
|
|
low: '请选择低压(mmHg)',
|
|
|
heart_num: '',
|
|
|
rid: ''
|
|
|
},
|
|
|
created: function () {
|
|
|
// apiready = function () {
|
|
|
// app.rid = api.pageParam.rid;
|
|
|
this.rid=localStorage.getItem("rid");
|
|
|
console.log(this.rid)
|
|
|
this.getPressure();
|
|
|
for (var i = 0; i < 300; i++) {
|
|
|
this.high_list.push({
|
|
|
"label": i,
|
|
|
"value": i,
|
|
|
})
|
|
|
}
|
|
|
// }
|
|
|
},
|
|
|
methods: {
|
|
|
// 日期选择
|
|
|
|
|
|
// dateSelect: function () {
|
|
|
// // if (api.systemType == 'ios') {
|
|
|
// // api.openPicker({
|
|
|
// // type: 'date_time',
|
|
|
// // date: new Date(),
|
|
|
// // maxDate: getTimeDetil(0),
|
|
|
// // title: '测量时间'
|
|
|
// // }, function (ret, err) {
|
|
|
// // if (ret) {
|
|
|
// // app.year = ret.year;
|
|
|
// // app.month = ret.month;
|
|
|
// // app.day = ret.day;
|
|
|
// // app.hour = ret.hour;
|
|
|
// // app.minute = ret.minute;
|
|
|
// // app.date_info = app.year + '-' + add0(app.month) + '-' + add0(app.day) + ' ' + add0(app.hour) + ':' + add0(app.minute);
|
|
|
// // if (checkDate(app.date_info, 2)) {
|
|
|
// // return app.date_info
|
|
|
// // } else {
|
|
|
// // toastMsg('请选择正确的测量时间');
|
|
|
// // return app.date_info = ''
|
|
|
// // }
|
|
|
// // } else {
|
|
|
// // console.log(err)
|
|
|
// // }
|
|
|
// // });
|
|
|
// // }
|
|
|
// // else {
|
|
|
// // api.openPicker({
|
|
|
// // type: 'date',
|
|
|
// // title: '测量时间',
|
|
|
// // }, function (ret, err) {
|
|
|
// // if (ret) {
|
|
|
// // app.year = ret.year;
|
|
|
// // app.month = ret.month;
|
|
|
// // app.day = ret.day;
|
|
|
// // api.openPicker({
|
|
|
// // type: 'time',
|
|
|
// // title: '测量时间'
|
|
|
// // }, function (rets, errs) {
|
|
|
// // if (rets) {
|
|
|
// // app.hour = rets.hour;
|
|
|
// // app.minute = rets.minute;
|
|
|
// // app.date_info = app.year + '-' + add0(app.month) + '-' + add0(app.day) + ' ' + add0(app.hour) + ':' + add0(app.minute);
|
|
|
// // if (checkDate(app.date_info, 2)) {
|
|
|
// // return app.date_info
|
|
|
// // } else {
|
|
|
// // toastMsg('请选择正确的测量时间');
|
|
|
// // return app.date_info = ''
|
|
|
// // }
|
|
|
// // } else {
|
|
|
// // console.log(errs)
|
|
|
// // }
|
|
|
// // });
|
|
|
// // } else {
|
|
|
// // console.log(err)
|
|
|
// // }
|
|
|
// // });
|
|
|
// // }
|
|
|
// },
|
|
|
// 选择高压
|
|
|
choose_high: function () {
|
|
|
var app=this;
|
|
|
weui.picker(app.high_list, {
|
|
|
onChange: function (result) {
|
|
|
|
|
|
},
|
|
|
onConfirm: function (result) {
|
|
|
app.high = result[0].label;
|
|
|
}
|
|
|
});
|
|
|
|
|
|
},
|
|
|
// 选择低压
|
|
|
choose_low: function () {
|
|
|
var app=this;
|
|
|
weui.picker(app.high_list, {
|
|
|
onChange: function (result) {
|
|
|
|
|
|
},
|
|
|
onConfirm: function (result) {
|
|
|
app.low = result[0].label;
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
// 保存数据
|
|
|
save_data: function () {
|
|
|
var app=this;
|
|
|
app.default_date=$("#test04").val();
|
|
|
|
|
|
if (app.default_date == '') {
|
|
|
toastMsg('请选择测量时间')
|
|
|
}
|
|
|
else if (app.high == '请选择高压(mmHg)') {
|
|
|
toastMsg('请选择高压数据')
|
|
|
}
|
|
|
else if (app.low == '请选择低压(mmHg)') {
|
|
|
toastMsg('请选择低压')
|
|
|
} else if (app.heart_num == '') {
|
|
|
toastMsg('请输入心率')
|
|
|
}
|
|
|
else {
|
|
|
var header = {
|
|
|
"XX-Device-Type": getDevice(),
|
|
|
'XX-Token': getToken()
|
|
|
};
|
|
|
var post = {
|
|
|
rid: app.rid,
|
|
|
time: app.date_info,
|
|
|
data: app.high + '/' + app.low,
|
|
|
type: 2,
|
|
|
rate: app.heart_num
|
|
|
};
|
|
|
getRequest('post', 'user/index/setBoolData', post, header).then(function (res) {
|
|
|
|
|
|
// alert(JSON.stringify(res))
|
|
|
if (res.data.code == 1) {
|
|
|
toastMsg('记录成功!');
|
|
|
setTimeout(function () {
|
|
|
api.sendEvent({
|
|
|
name: 'pressure',
|
|
|
});
|
|
|
api.closeWin()
|
|
|
}, 1000);
|
|
|
} else {
|
|
|
toastMsg(res.msg)
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
getPressure: function () {
|
|
|
var app=this;
|
|
|
var rid=localStorage.getItem("rid")
|
|
|
|
|
|
var header = {
|
|
|
"XX-Device-Type": getDevice(),
|
|
|
'XX-Token': getToken()
|
|
|
};
|
|
|
var post = {
|
|
|
rid: rid,
|
|
|
type: 2
|
|
|
};
|
|
|
getRequest('post', 'user/index/getLastBoolData', post, header).then(function (res) {
|
|
|
console.log(res.data.data.high)
|
|
|
// alert(JSON.stringify(res))
|
|
|
if (res.data.code == 1) {
|
|
|
app.date_info = res.data.data.time;
|
|
|
app.high = res.data.data.high;
|
|
|
app.low = res.data.data.low;
|
|
|
app.heart_num = res.data.data.rate;
|
|
|
} else {
|
|
|
toastMsg(res.data.msg)
|
|
|
}
|
|
|
loadEnd()
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
|
|
|
</script> |
...
|
...
|
|