修改
This commit is contained in:
parent
66241d94f6
commit
f1bef99151
37
api/examinationapi/add.js
Normal file
37
api/examinationapi/add.js
Normal file
@ -0,0 +1,37 @@
|
||||
import request from "../request.js"
|
||||
|
||||
//上传血糖
|
||||
export function savebg(data) {
|
||||
return request({
|
||||
url: `/fd/ps/bg/save`,
|
||||
method: 'post',
|
||||
data,
|
||||
header: {
|
||||
Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//上传血压
|
||||
export function savebp(data) {
|
||||
return request({
|
||||
url: `/fd/ps/bp/save`,
|
||||
method: 'post',
|
||||
data,
|
||||
header: {
|
||||
Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//上传体温
|
||||
export function savetemp(data) {
|
||||
return request({
|
||||
url: `/fd/ps/temp/save`,
|
||||
method: 'post',
|
||||
data,
|
||||
header: {
|
||||
Authorization: 'Bearer' + ' ' + uni.getStorageSync('token')
|
||||
}
|
||||
})
|
||||
}
|
||||
13
api/pagesC/healthdata/index.js
Normal file
13
api/pagesC/healthdata/index.js
Normal file
@ -0,0 +1,13 @@
|
||||
import request from "@/api/request.js"
|
||||
|
||||
//获取体征记录
|
||||
export function record(data) {
|
||||
return request({
|
||||
url: `/fd/ps/record`,
|
||||
data,
|
||||
method: 'get',
|
||||
header: {
|
||||
// region: uni.getStorageSync('region'),
|
||||
}
|
||||
})
|
||||
}
|
||||
445
components/BloodPressure/BloodPressure.vue
Normal file
445
components/BloodPressure/BloodPressure.vue
Normal file
@ -0,0 +1,445 @@
|
||||
<template>
|
||||
<view class="app" v-if="current == 1">
|
||||
<view class="titletexts">
|
||||
<view class="title">
|
||||
— 正常范围 —
|
||||
</view>
|
||||
<view class="add" @click="addPressure">
|
||||
+ 添加数据
|
||||
</view>
|
||||
<view class="texts">
|
||||
<view class="text">
|
||||
<view class="p">
|
||||
收缩压
|
||||
</view>
|
||||
<view class="ptwo">
|
||||
90-140mmHg
|
||||
</view>
|
||||
</view>
|
||||
<view class="text">
|
||||
<view class="p">
|
||||
舒张压
|
||||
</view>
|
||||
<view class="ptwo">
|
||||
60-90mmHg
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottomlist">
|
||||
<view class="timelist">
|
||||
<view class="item" v-for="(item,index) in timelist" :class="timeindex == index?'timeitem':''"
|
||||
@tap='taptimeindex(index)'>
|
||||
{{item.name}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="text">
|
||||
注:全部视图主要展示全部血压数值的趋势曲线 单位:mmHg
|
||||
</view>
|
||||
<qiun-data-charts type="line" loadingType="0" :opts="line_opts" :ontouch="true" :chartData="datalist" />
|
||||
</view>
|
||||
<view class="bottomtexts">
|
||||
<view class="lefttext">
|
||||
<view class="pone">
|
||||
平均值
|
||||
</view>
|
||||
<view class="ptwo">
|
||||
{{echartData.calc.avgVal?echartData.calc.avgVal:'暂无'}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="lefttext">
|
||||
<view class="pone">
|
||||
最大
|
||||
</view>
|
||||
<view class="ptwo">
|
||||
<view class="">
|
||||
{{echartData.calc.maxDbpVal?echartData.calc.maxDbpVal:'暂无'}}
|
||||
</view>
|
||||
{{echartData.calc.maxSbpVal?echartData.calc.maxSbpVal:'暂无'}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="righttext">
|
||||
<view class="pone">
|
||||
最小
|
||||
</view>
|
||||
<view class="ptwo">
|
||||
<view class="">
|
||||
{{echartData.calc.minDbpVal?echartData.calc.minDbpVal:'暂无'}}
|
||||
</view>
|
||||
{{echartData.calc.minSbpVal?echartData.calc.minSbpVal:'暂无'}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="charts-box">
|
||||
<qiun-data-charts type="pie" :opts="pie_opts" :chartData="datalisttwo" />
|
||||
</view>
|
||||
<!-- <qiun-data-charts type="pie" :opts="opts" :chartData="chartData" /> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
current: {
|
||||
type: Number,
|
||||
require: true
|
||||
},
|
||||
echartData: {
|
||||
type: Object,
|
||||
require: true
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
data() {
|
||||
return {
|
||||
timelist: [{
|
||||
name: '全部',
|
||||
id: 0
|
||||
},
|
||||
{
|
||||
name: '周',
|
||||
id: 1
|
||||
}, {
|
||||
name: '月',
|
||||
id: 2
|
||||
}, {
|
||||
name: '年',
|
||||
id: 3
|
||||
},
|
||||
],
|
||||
timeindex: 0,
|
||||
socketOpen: false,
|
||||
timer: null,
|
||||
datalist: null,
|
||||
datalisttwo: null,
|
||||
pie_opts: {
|
||||
color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
|
||||
"#ea7ccc"
|
||||
],
|
||||
padding: [5, 5, 5, 5],
|
||||
enableScroll: false,
|
||||
extra: {
|
||||
pie: {
|
||||
activeOpacity: 0.5,
|
||||
activeRadius: 10,
|
||||
offsetAngle: 0,
|
||||
labelWidth: 15,
|
||||
border: false,
|
||||
borderWidth: 3,
|
||||
borderColor: "#FFFFFF"
|
||||
},
|
||||
},
|
||||
},
|
||||
line_opts: {
|
||||
color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
|
||||
"#ea7ccc"
|
||||
],
|
||||
dataLabel: false,
|
||||
enableScroll: true,
|
||||
touchMoveLimit: 24,
|
||||
padding: [15, 10, 0, 15],
|
||||
xAxis: {
|
||||
lineHeight: 40,
|
||||
disableGrid: true,
|
||||
boundaryGap: "center",
|
||||
fontSize: 12,
|
||||
type: 'grid',
|
||||
gridType: 'dash',
|
||||
itemCount: 4, //x轴单屏显示数据的数量,默认为5个
|
||||
scrollShow: true, //新增是否显示滚动条,默认false
|
||||
scrollAlign: 'left', //滚动条初始位置
|
||||
},
|
||||
yAxis: {
|
||||
gridType: "dash",
|
||||
dashLength: 2
|
||||
},
|
||||
extra: {
|
||||
line: {
|
||||
type: "straight",
|
||||
width: 2,
|
||||
activeType: "hollow"
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
created() {},
|
||||
mounted() {
|
||||
// if (this.current == 1) {
|
||||
// this.scoket()
|
||||
// }
|
||||
this.getServerData()
|
||||
},
|
||||
destroyed() {
|
||||
clearInterval(this.timer);
|
||||
if (this.socketOpen == true) {
|
||||
uni.closeSocket();
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
echartData: {
|
||||
handler() {
|
||||
this.getServerData()
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
current(newValue, oldValue) {
|
||||
if (newValue != 1) {
|
||||
clearInterval(this.timer);
|
||||
if (this.socketOpen == true) {
|
||||
uni.closeSocket();
|
||||
}
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
this.scoket()
|
||||
}, 800)
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
taptimeindex(index) {
|
||||
this.timeindex = index
|
||||
this.$emit('taptimeindex', index);
|
||||
},
|
||||
addPressure() {
|
||||
uni.navigateTo({
|
||||
url: "/pagesC/addPressure/addPressure"
|
||||
})
|
||||
},
|
||||
getServerData() {
|
||||
if (this.echartData) {
|
||||
setTimeout(() => {
|
||||
let res = {
|
||||
categories: [],
|
||||
series: [{
|
||||
name: "舒张压",
|
||||
data: []
|
||||
},
|
||||
{
|
||||
name: "收缩压",
|
||||
data: []
|
||||
}
|
||||
]
|
||||
};
|
||||
res.series[0].data = this.echartData.list.map(e => e.dbp)
|
||||
res.series[1].data = this.echartData.list.map(e => e.sbp)
|
||||
res.categories = this.echartData.list.map(e => e.measureTime)
|
||||
this.datalist = res
|
||||
let restwo = {
|
||||
series: [{
|
||||
data: [{
|
||||
"name": "正常" + this.echartData.calc.normalNum + "次",
|
||||
"value": this.echartData.calc.normalNum
|
||||
}, {
|
||||
"name": "超标" + this.echartData.calc.overNum + "次",
|
||||
"value": this.echartData.calc.overNum
|
||||
}]
|
||||
}]
|
||||
};
|
||||
this.datalisttwo = restwo
|
||||
}, 500)
|
||||
}
|
||||
},
|
||||
scoket() {
|
||||
var SOCKETURL = 'ws://112.7.50.34:9002/webSocket/' + uni.getStorageSync('userInfo').cardNo
|
||||
const that = this
|
||||
uni.closeSocket()
|
||||
this.socketOpen = false
|
||||
try {
|
||||
uni.connectSocket({
|
||||
url: SOCKETURL
|
||||
})
|
||||
uni.onSocketOpen(res => {
|
||||
console.log('webScoket连接已打开', res);
|
||||
that.socketOpen = true
|
||||
that.reset()
|
||||
})
|
||||
|
||||
uni.onSocketError(err => {
|
||||
console.log('webScoket连接打开失败', err);
|
||||
if (err && err.code != 1000) {
|
||||
setTimeout(() => {
|
||||
that.socketOpen = true
|
||||
uni.connectSocket({
|
||||
url: SOCKETURL
|
||||
})
|
||||
}, 3 * 1000)
|
||||
}
|
||||
})
|
||||
|
||||
uni.onSocketClose(err => {
|
||||
console.log('webScoket连接关闭', err);
|
||||
if (err && err.code !== 1000) {
|
||||
setTimeout(() => {
|
||||
that.socketOpen = true
|
||||
uni.connectSocket({
|
||||
url: SOCKETURL
|
||||
})
|
||||
}, 3 * 1000)
|
||||
}
|
||||
})
|
||||
uni.onSocketMessage(res => {
|
||||
console.log("webScoket监听收到的信息", res);
|
||||
// that.newsList.push({
|
||||
// senderName: that.currentItem.senderName,
|
||||
// content: JSON.parse(res.data).message
|
||||
// })
|
||||
this.$emit('websocket-message');
|
||||
this.$forceUpdate()
|
||||
})
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
},
|
||||
// 心跳响应
|
||||
reset() {
|
||||
let that = this
|
||||
var SOCKETURL = 'ws://112.7.50.34:9002/webSocket/' + uni.getStorageSync('userInfo').cardNo
|
||||
clearInterval(that.timer);
|
||||
that.timer = setInterval(() => {
|
||||
uni.sendSocketMessage({
|
||||
data: 'ping',
|
||||
success(res) {
|
||||
console.log('正在发送心跳');
|
||||
},
|
||||
fail(err) {
|
||||
console.log('心跳发送失败,重新连接...');
|
||||
_socketOpen = true
|
||||
uni.connectSocket({
|
||||
url: SOCKETURL
|
||||
})
|
||||
}
|
||||
})
|
||||
}, 60000)
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #F7F5F5;
|
||||
}
|
||||
|
||||
.app {
|
||||
width: 96%;
|
||||
margin: 0 auto;
|
||||
padding-bottom: 60rpx;
|
||||
|
||||
/* 请根据实际需求修改父元素尺寸,组件自动识别宽高 */
|
||||
.charts-box {
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.bottomtexts {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
background-color: #fff;
|
||||
padding: 20rpx 0 40rpx;
|
||||
|
||||
.lefttext,
|
||||
.righttext {
|
||||
width: 50%;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.bottomlist {
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
margin-top: 17rpx;
|
||||
|
||||
.text {
|
||||
width: 90%;
|
||||
margin: 20rpx auto 30rpx;
|
||||
font-size: 18rpx;
|
||||
font-weight: 400;
|
||||
color: #595959;
|
||||
}
|
||||
|
||||
.timelist {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
display: flex;
|
||||
padding-top: 25rpx;
|
||||
|
||||
.item {
|
||||
width: 25%;
|
||||
height: 56rpx;
|
||||
border-radius: 5rpx 0rpx 0rpx 5rpx;
|
||||
text-align: center;
|
||||
line-height: 56rpx;
|
||||
background: #FFFFFF;
|
||||
border: 2rpx solid #26A888;
|
||||
border-radius: 0rpx 5rpx 5rpx 0rpx;
|
||||
color: #26A888;
|
||||
}
|
||||
|
||||
.timeitem {
|
||||
background: #26A888;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.titletexts {
|
||||
width: 100%;
|
||||
height: 250rpx;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0rpx 9rpx 31rpx 9rpx rgba(0, 0, 0, 0.03);
|
||||
border-radius: 5rpx;
|
||||
position: relative;
|
||||
|
||||
.texts {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
position: absolute;
|
||||
top: 130rpx;
|
||||
|
||||
.text {
|
||||
width: 50%;
|
||||
|
||||
.p {
|
||||
text-align: center;
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.ptwo {
|
||||
font-size: 30rpx;
|
||||
font-weight: 500;
|
||||
color: #26A888;
|
||||
text-align: center;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.add {
|
||||
width: 205rpx;
|
||||
height: 64rpx;
|
||||
background: #26A888;
|
||||
border-radius: 32rpx 0rpx 0rpx 32rpx;
|
||||
line-height: 64rpx;
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
right: 0%;
|
||||
color: #fff;
|
||||
top: 25rpx;
|
||||
}
|
||||
|
||||
.title {
|
||||
text-align: center;
|
||||
font-size: 24rpx;
|
||||
font-weight: 400;
|
||||
color: #26A888;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
top: 46rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
438
components/BloodSugar/BloodSugar.vue
Normal file
438
components/BloodSugar/BloodSugar.vue
Normal file
@ -0,0 +1,438 @@
|
||||
<template>
|
||||
<view class="app" v-if="current==0">
|
||||
<view class="titletexts">
|
||||
<view class="title">
|
||||
— 正常范围 —
|
||||
</view>
|
||||
<view class="add" @click="addSuger">
|
||||
+ 添加数据
|
||||
</view>
|
||||
<view class="texts">
|
||||
<view class="text">
|
||||
<view class="p">
|
||||
餐前血糖
|
||||
</view>
|
||||
<view class="ptwo">
|
||||
4.4-7.0mmol/L
|
||||
</view>
|
||||
</view>
|
||||
<view class="text">
|
||||
<view class="p">
|
||||
餐后/凌晨/睡前/随机
|
||||
</view>
|
||||
<view class="ptwo">
|
||||
4.4-10.0mmol/L
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottomlist">
|
||||
<view class="timelist">
|
||||
<view class="item" v-for="(item,index) in timelist" :class="timeindex == index?'timeitem':''"
|
||||
@tap='taptimeindex(index)'>
|
||||
{{item.name}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="text">
|
||||
注:全部视图主要展示全部血糖数值的趋势曲线 单位:mmol/L
|
||||
</view>
|
||||
<qiun-data-charts type="line" loadingType="0" :opts="line_opts" :ontouch="true" :chartData="datalist" />
|
||||
</view>
|
||||
<view class="bottomtexts">
|
||||
<view class="lefttext">
|
||||
<view class="pone">
|
||||
最大
|
||||
</view>
|
||||
<view class="ptwo">
|
||||
{{echartData.calc.maxVal?echartData.calc.maxVal:'暂无'}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="righttext">
|
||||
<view class="pone">
|
||||
最小
|
||||
</view>
|
||||
<view class="ptwo">
|
||||
{{echartData.calc.minVal?echartData.calc.minVal:'暂无'}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="charts-box">
|
||||
<qiun-data-charts type="pie" :opts="pie_opts" :chartData="datalisttwo" />
|
||||
</view>
|
||||
<!-- <qiun-data-charts type="pie" :opts="opts" :chartData="chartData" /> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
current: {
|
||||
type: Number,
|
||||
require: true
|
||||
},
|
||||
echartData: {
|
||||
type: Object,
|
||||
require: true
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
data() {
|
||||
return {
|
||||
timelist: [{
|
||||
name: '全部',
|
||||
id: 0
|
||||
},
|
||||
{
|
||||
name: '周',
|
||||
id: 1
|
||||
}, {
|
||||
name: '月',
|
||||
id: 2
|
||||
}, {
|
||||
name: '年',
|
||||
id: 3
|
||||
},
|
||||
],
|
||||
timeindex: 0,
|
||||
socketOpen: false,
|
||||
timer: null,
|
||||
datalist: null,
|
||||
datalisttwo: null,
|
||||
pie_opts: {
|
||||
color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
|
||||
"#ea7ccc"
|
||||
],
|
||||
padding: [5, 5, 5, 5],
|
||||
enableScroll: false,
|
||||
extra: {
|
||||
pie: {
|
||||
activeOpacity: 0.5,
|
||||
activeRadius: 10,
|
||||
offsetAngle: 0,
|
||||
labelWidth: 15,
|
||||
border: false,
|
||||
borderWidth: 3,
|
||||
borderColor: "#FFFFFF"
|
||||
},
|
||||
},
|
||||
},
|
||||
line_opts: {
|
||||
color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
|
||||
"#ea7ccc"
|
||||
],
|
||||
dataLabel: false,
|
||||
enableScroll: true,
|
||||
touchMoveLimit: 24,
|
||||
padding: [15, 10, 0, 15],
|
||||
xAxis: {
|
||||
lineHeight: 40,
|
||||
disableGrid: true,
|
||||
boundaryGap: "center",
|
||||
fontSize: 12,
|
||||
type: 'grid',
|
||||
gridType: 'dash',
|
||||
itemCount: 4, //x轴单屏显示数据的数量,默认为5个
|
||||
scrollShow: true, //新增是否显示滚动条,默认false
|
||||
scrollAlign: 'left', //滚动条初始位置
|
||||
},
|
||||
yAxis: {
|
||||
gridType: "dash",
|
||||
dashLength: 2
|
||||
},
|
||||
extra: {
|
||||
line: {
|
||||
type: "straight",
|
||||
width: 2,
|
||||
activeType: "hollow"
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
created() {},
|
||||
mounted() {
|
||||
// if (this.current == 0) {
|
||||
// this.scoket()
|
||||
// }
|
||||
this.getServerData()
|
||||
},
|
||||
destroyed() {
|
||||
clearInterval(this.timer);
|
||||
if (this.socketOpen == true) {
|
||||
uni.closeSocket();
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
echartData: {
|
||||
handler() {
|
||||
this.getServerData()
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
current(newValue, oldValue) {
|
||||
if (newValue != 0) {
|
||||
clearInterval(this.timer);
|
||||
if (this.socketOpen == true) {
|
||||
uni.closeSocket();
|
||||
}
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
this.scoket()
|
||||
}, 800)
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
taptimeindex(index) {
|
||||
this.timeindex = index
|
||||
this.$emit('taptimeindex', index);
|
||||
},
|
||||
addSuger() {
|
||||
uni.navigateTo({
|
||||
url: "/pagesC/addsugar/addsugar"
|
||||
})
|
||||
},
|
||||
getServerData() {
|
||||
if (this.echartData) {
|
||||
setTimeout(() => {
|
||||
this.echartData.list.forEach(e => {
|
||||
e.bucket == '1' ? e.timename = '凌晨' : ''
|
||||
e.bucket == '2' ? e.timename = '早餐前' : ''
|
||||
e.bucket == '3' ? e.timename = '早晨后' : ''
|
||||
e.bucket == '4' ? e.timename = '午餐前' : ''
|
||||
e.bucket == '5' ? e.timename = '午餐后' : ''
|
||||
e.bucket == '6' ? e.timename = '晚餐前' : ''
|
||||
e.bucket == '7' ? e.timename = '晚餐后' : ''
|
||||
e.bucket == '8' ? e.timename = '睡前' : ''
|
||||
})
|
||||
let res = {
|
||||
categories: [],
|
||||
series: [{
|
||||
name: "血糖值",
|
||||
data: []
|
||||
}]
|
||||
}
|
||||
res.series[0].data = this.echartData.list.map(e => e.bg)
|
||||
res.categories = this.echartData.list.map(e => e.timename + e.measureTime)
|
||||
this.datalist = res
|
||||
let restwo = {
|
||||
series: [{
|
||||
data: [{
|
||||
"name": "偏低" + this.echartData.calc.lowerNum + "次",
|
||||
"value": this.echartData.calc.lowerNum
|
||||
}, {
|
||||
"name": "正常" + this.echartData.calc.normalNum + "次",
|
||||
"value": this.echartData.calc.normalNum
|
||||
}, {
|
||||
"name": "偏高" + this.echartData.calc.higherNum + "次",
|
||||
"value": this.echartData.calc.higherNum
|
||||
}]
|
||||
}]
|
||||
};
|
||||
this.datalisttwo = restwo
|
||||
}, 500)
|
||||
}
|
||||
},
|
||||
scoket() {
|
||||
var SOCKETURL = 'ws://112.7.50.34:9002/webSocket/' + uni.getStorageSync('userInfo').cardNo
|
||||
const that = this
|
||||
uni.closeSocket()
|
||||
this.socketOpen = false
|
||||
try {
|
||||
uni.connectSocket({
|
||||
url: SOCKETURL
|
||||
})
|
||||
uni.onSocketOpen(res => {
|
||||
console.log('webScoket连接已打开', res);
|
||||
that.socketOpen = true
|
||||
that.reset()
|
||||
})
|
||||
|
||||
uni.onSocketError(err => {
|
||||
console.log('webScoket连接打开失败', err);
|
||||
if (err && err.code != 1000) {
|
||||
setTimeout(() => {
|
||||
that.socketOpen = true
|
||||
uni.connectSocket({
|
||||
url: SOCKETURL
|
||||
})
|
||||
}, 3 * 1000)
|
||||
}
|
||||
})
|
||||
|
||||
uni.onSocketClose(err => {
|
||||
console.log('webScoket连接关闭', err);
|
||||
if (err && err.code !== 1000) {
|
||||
setTimeout(() => {
|
||||
that.socketOpen = true
|
||||
uni.connectSocket({
|
||||
url: SOCKETURL
|
||||
})
|
||||
}, 3 * 1000)
|
||||
}
|
||||
})
|
||||
uni.onSocketMessage(res => {
|
||||
console.log("webScoket监听收到的信息", res);
|
||||
// that.newsList.push({
|
||||
// senderName: that.currentItem.senderName,
|
||||
// content: JSON.parse(res.data).message
|
||||
// })
|
||||
this.$emit('websocket-message');
|
||||
this.$forceUpdate()
|
||||
})
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
},
|
||||
// 心跳响应
|
||||
reset() {
|
||||
let that = this
|
||||
var SOCKETURL = 'ws://112.7.50.34:9002/webSocket/' + uni.getStorageSync('userInfo').cardNo
|
||||
clearInterval(that.timer);
|
||||
that.timer = setInterval(() => {
|
||||
uni.sendSocketMessage({
|
||||
data: 'ping',
|
||||
success(res) {
|
||||
console.log('正在发送心跳');
|
||||
},
|
||||
fail(err) {
|
||||
console.log('心跳发送失败,重新连接...');
|
||||
_socketOpen = true
|
||||
uni.connectSocket({
|
||||
url: SOCKETURL
|
||||
})
|
||||
}
|
||||
})
|
||||
}, 60000)
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #F7F5F5;
|
||||
}
|
||||
|
||||
.app {
|
||||
width: 96%;
|
||||
margin: 0 auto;
|
||||
padding-bottom: 60rpx;
|
||||
|
||||
/* 请根据实际需求修改父元素尺寸,组件自动识别宽高 */
|
||||
.charts-box {
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.bottomtexts {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
background-color: #fff;
|
||||
padding: 20rpx 0 40rpx;
|
||||
|
||||
.lefttext,
|
||||
.righttext {
|
||||
width: 50%;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.bottomlist {
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
margin-top: 17rpx;
|
||||
|
||||
.text {
|
||||
width: 90%;
|
||||
margin: 20rpx auto 30rpx;
|
||||
font-size: 18rpx;
|
||||
font-weight: 400;
|
||||
color: #595959;
|
||||
}
|
||||
|
||||
.timelist {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
display: flex;
|
||||
padding-top: 25rpx;
|
||||
|
||||
.item {
|
||||
width: 25%;
|
||||
height: 56rpx;
|
||||
border-radius: 5rpx 0rpx 0rpx 5rpx;
|
||||
text-align: center;
|
||||
line-height: 56rpx;
|
||||
background: #FFFFFF;
|
||||
border: 2rpx solid #26A888;
|
||||
border-radius: 0rpx 5rpx 5rpx 0rpx;
|
||||
color: #26A888;
|
||||
}
|
||||
|
||||
.timeitem {
|
||||
background: #26A888;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.titletexts {
|
||||
width: 100%;
|
||||
height: 250rpx;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0rpx 9rpx 31rpx 9rpx rgba(0, 0, 0, 0.03);
|
||||
border-radius: 5rpx;
|
||||
position: relative;
|
||||
|
||||
.texts {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
position: absolute;
|
||||
top: 130rpx;
|
||||
|
||||
.text {
|
||||
width: 50%;
|
||||
|
||||
.p {
|
||||
text-align: center;
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.ptwo {
|
||||
font-size: 30rpx;
|
||||
font-weight: 500;
|
||||
color: #26A888;
|
||||
text-align: center;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.add {
|
||||
width: 205rpx;
|
||||
height: 64rpx;
|
||||
background: #26A888;
|
||||
border-radius: 32rpx 0rpx 0rpx 32rpx;
|
||||
line-height: 64rpx;
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
right: 0%;
|
||||
color: #fff;
|
||||
top: 25rpx;
|
||||
}
|
||||
|
||||
.title {
|
||||
text-align: center;
|
||||
font-size: 24rpx;
|
||||
font-weight: 400;
|
||||
color: #26A888;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
top: 46rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
425
components/Bloodtemperature/Bloodtemperature.vue
Normal file
425
components/Bloodtemperature/Bloodtemperature.vue
Normal file
@ -0,0 +1,425 @@
|
||||
<template>
|
||||
<view class="app" v-if="current == 6">
|
||||
<view class="titletexts">
|
||||
<view class="title">
|
||||
— 正常范围 —
|
||||
</view>
|
||||
<view class="add" @click="addTemperature">
|
||||
+ 添加数据
|
||||
</view>
|
||||
<view class="texts">
|
||||
<view class="text">
|
||||
<view class="p">
|
||||
体温
|
||||
</view>
|
||||
<view class="ptwo">
|
||||
36—37摄氏度
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottomlist">
|
||||
<view class="timelist">
|
||||
<view class="item" v-for="(item,index) in timelist" :class="timeindex == index?'timeitem':''"
|
||||
@tap='taptimeindex(index)'>
|
||||
{{item.name}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="text">
|
||||
注:全部视图主要展示全部体温数值的趋势曲线
|
||||
</view>
|
||||
<qiun-data-charts type="line" loadingType="0" :opts="line_opts" :ontouch="true" :chartData="datalist" />
|
||||
</view>
|
||||
<view class="bottomtexts">
|
||||
<view class="lefttext">
|
||||
<view class="pone">
|
||||
平均值
|
||||
</view>
|
||||
<view class="ptwo">
|
||||
{{echartData.calc.avgVal?echartData.calc.avgVal:'暂无'}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="lefttext">
|
||||
<view class="pone">
|
||||
最大
|
||||
</view>
|
||||
<view class="ptwo">
|
||||
{{echartData.calc.maxVal?echartData.calc.maxVal:'暂无'}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="righttext">
|
||||
<view class="pone">
|
||||
最小
|
||||
</view>
|
||||
<view class="ptwo">
|
||||
{{echartData.calc.minVal?echartData.calc.minVal:'暂无'}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="charts-box">
|
||||
<qiun-data-charts type="pie" :opts="pie_opts" :chartData="datalisttwo" />
|
||||
</view>
|
||||
<!-- <qiun-data-charts type="pie" :opts="opts" :chartData="chartData" /> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
current: {
|
||||
type: Number,
|
||||
require: true
|
||||
},
|
||||
echartData: {
|
||||
type: Object,
|
||||
require: true
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
data() {
|
||||
return {
|
||||
timelist: [{
|
||||
name: '全部',
|
||||
id: 0
|
||||
},
|
||||
{
|
||||
name: '周',
|
||||
id: 1
|
||||
}, {
|
||||
name: '月',
|
||||
id: 2
|
||||
}, {
|
||||
name: '年',
|
||||
id: 3
|
||||
},
|
||||
],
|
||||
timeindex: 0,
|
||||
socketOpen: false,
|
||||
timer: null,
|
||||
datalist: null,
|
||||
datalisttwo: null,
|
||||
pie_opts: {
|
||||
color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
|
||||
"#ea7ccc"
|
||||
],
|
||||
padding: [5, 5, 5, 5],
|
||||
enableScroll: false,
|
||||
extra: {
|
||||
pie: {
|
||||
activeOpacity: 0.5,
|
||||
activeRadius: 10,
|
||||
offsetAngle: 0,
|
||||
labelWidth: 15,
|
||||
border: false,
|
||||
borderWidth: 3,
|
||||
borderColor: "#FFFFFF"
|
||||
},
|
||||
},
|
||||
},
|
||||
line_opts: {
|
||||
color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
|
||||
"#ea7ccc"
|
||||
],
|
||||
dataLabel: false,
|
||||
enableScroll: true,
|
||||
touchMoveLimit: 24,
|
||||
padding: [15, 10, 0, 15],
|
||||
xAxis: {
|
||||
lineHeight: 40,
|
||||
disableGrid: true,
|
||||
boundaryGap: "center",
|
||||
fontSize: 12,
|
||||
type: 'grid',
|
||||
gridType: 'dash',
|
||||
itemCount: 4, //x轴单屏显示数据的数量,默认为5个
|
||||
scrollShow: true, //新增是否显示滚动条,默认false
|
||||
scrollAlign: 'left', //滚动条初始位置
|
||||
},
|
||||
yAxis: {
|
||||
gridType: "dash",
|
||||
dashLength: 2
|
||||
},
|
||||
extra: {
|
||||
line: {
|
||||
type: "straight",
|
||||
width: 2,
|
||||
activeType: "hollow"
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
created() {},
|
||||
mounted() {
|
||||
// if (this.current == 6) {
|
||||
// this.scoket()
|
||||
// }
|
||||
this.getServerData()
|
||||
},
|
||||
destroyed() {
|
||||
clearInterval(this.timer);
|
||||
if (this.socketOpen == true) {
|
||||
uni.closeSocket();
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
echartData: {
|
||||
handler() {
|
||||
this.getServerData()
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
current(newValue, oldValue) {
|
||||
if (newValue != 6) {
|
||||
clearInterval(this.timer);
|
||||
if (this.socketOpen == true) {
|
||||
uni.closeSocket();
|
||||
}
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
this.scoket()
|
||||
}, 800)
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
taptimeindex(index) {
|
||||
this.timeindex = index
|
||||
this.$emit('taptimeindex', index);
|
||||
},
|
||||
addTemperature() {
|
||||
uni.navigateTo({
|
||||
url: "/pagesC/addTemperature/addTemperature"
|
||||
})
|
||||
},
|
||||
getServerData() {
|
||||
if (this.echartData) {
|
||||
setTimeout(() => {
|
||||
let res = {
|
||||
categories: [],
|
||||
series: [{
|
||||
name: "体温",
|
||||
data: []
|
||||
}]
|
||||
};
|
||||
res.series[0].data = this.echartData.list.map(e => e.temp)
|
||||
res.categories = this.echartData.list.map(e => e.measureTime)
|
||||
this.datalist = res
|
||||
let restwo = {
|
||||
series: [{
|
||||
data: [{
|
||||
"name": "正常" + this.echartData.calc.normalNum + "次",
|
||||
"value": this.echartData.calc.normalNum
|
||||
}, {
|
||||
"name": "超标" + this.echartData.calc.overNum + "次",
|
||||
"value": this.echartData.calc.overNum
|
||||
}]
|
||||
}]
|
||||
};
|
||||
this.datalisttwo = restwo
|
||||
}, 500)
|
||||
}
|
||||
},
|
||||
scoket() {
|
||||
var SOCKETURL = 'ws://112.7.50.34:9002/webSocket/' + uni.getStorageSync('userInfo').cardNo
|
||||
const that = this
|
||||
uni.closeSocket()
|
||||
this.socketOpen = false
|
||||
try {
|
||||
uni.connectSocket({
|
||||
url: SOCKETURL
|
||||
})
|
||||
uni.onSocketOpen(res => {
|
||||
console.log('webScoket连接已打开', res);
|
||||
that.socketOpen = true
|
||||
that.reset()
|
||||
})
|
||||
|
||||
uni.onSocketError(err => {
|
||||
console.log('webScoket连接打开失败', err);
|
||||
if (err && err.code != 1000) {
|
||||
setTimeout(() => {
|
||||
that.socketOpen = true
|
||||
uni.connectSocket({
|
||||
url: SOCKETURL
|
||||
})
|
||||
}, 3 * 1000)
|
||||
}
|
||||
})
|
||||
|
||||
uni.onSocketClose(err => {
|
||||
console.log('webScoket连接关闭', err);
|
||||
if (err && err.code !== 1000) {
|
||||
setTimeout(() => {
|
||||
that.socketOpen = true
|
||||
uni.connectSocket({
|
||||
url: SOCKETURL
|
||||
})
|
||||
}, 3 * 1000)
|
||||
}
|
||||
})
|
||||
uni.onSocketMessage(res => {
|
||||
console.log("webScoket监听收到的信息", res);
|
||||
// that.newsList.push({
|
||||
// senderName: that.currentItem.senderName,
|
||||
// content: JSON.parse(res.data).message
|
||||
// })
|
||||
this.$emit('websocket-message');
|
||||
this.$forceUpdate()
|
||||
})
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
},
|
||||
// 心跳响应
|
||||
reset() {
|
||||
let that = this
|
||||
var SOCKETURL = 'ws://112.7.50.34:9002/webSocket/' + uni.getStorageSync('userInfo').cardNo
|
||||
clearInterval(that.timer);
|
||||
that.timer = setInterval(() => {
|
||||
uni.sendSocketMessage({
|
||||
data: 'ping',
|
||||
success(res) {
|
||||
console.log('正在发送心跳');
|
||||
},
|
||||
fail(err) {
|
||||
console.log('心跳发送失败,重新连接...');
|
||||
_socketOpen = true
|
||||
uni.connectSocket({
|
||||
url: SOCKETURL
|
||||
})
|
||||
}
|
||||
})
|
||||
}, 60000)
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #F7F5F5;
|
||||
}
|
||||
|
||||
.app {
|
||||
width: 96%;
|
||||
margin: 0 auto;
|
||||
padding-bottom: 60rpx;
|
||||
|
||||
/* 请根据实际需求修改父元素尺寸,组件自动识别宽高 */
|
||||
.charts-box {
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.bottomtexts {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
background-color: #fff;
|
||||
padding: 20rpx 0 40rpx;
|
||||
|
||||
.lefttext,
|
||||
.righttext {
|
||||
width: 50%;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.bottomlist {
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
margin-top: 17rpx;
|
||||
|
||||
.text {
|
||||
width: 90%;
|
||||
margin: 20rpx auto 30rpx;
|
||||
font-size: 18rpx;
|
||||
font-weight: 400;
|
||||
color: #595959;
|
||||
}
|
||||
|
||||
.timelist {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
display: flex;
|
||||
padding-top: 25rpx;
|
||||
|
||||
.item {
|
||||
width: 25%;
|
||||
height: 56rpx;
|
||||
border-radius: 5rpx 0rpx 0rpx 5rpx;
|
||||
text-align: center;
|
||||
line-height: 56rpx;
|
||||
background: #FFFFFF;
|
||||
border: 2rpx solid #26A888;
|
||||
border-radius: 0rpx 5rpx 5rpx 0rpx;
|
||||
color: #26A888;
|
||||
}
|
||||
|
||||
.timeitem {
|
||||
background: #26A888;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.titletexts {
|
||||
width: 100%;
|
||||
height: 250rpx;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0rpx 9rpx 31rpx 9rpx rgba(0, 0, 0, 0.03);
|
||||
border-radius: 5rpx;
|
||||
position: relative;
|
||||
|
||||
.texts {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
position: absolute;
|
||||
top: 130rpx;
|
||||
|
||||
.text {
|
||||
width: 100%;
|
||||
|
||||
.p {
|
||||
text-align: center;
|
||||
font-size: 24rpx;
|
||||
font-weight: 500;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.ptwo {
|
||||
font-size: 30rpx;
|
||||
font-weight: 500;
|
||||
color: #26A888;
|
||||
text-align: center;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.add {
|
||||
width: 205rpx;
|
||||
height: 64rpx;
|
||||
background: #26A888;
|
||||
border-radius: 32rpx 0rpx 0rpx 32rpx;
|
||||
line-height: 64rpx;
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
right: 0%;
|
||||
color: #fff;
|
||||
top: 25rpx;
|
||||
}
|
||||
|
||||
.title {
|
||||
text-align: center;
|
||||
font-size: 24rpx;
|
||||
font-weight: 400;
|
||||
color: #26A888;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
top: 46rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
38
pages.json
38
pages.json
@ -32,6 +32,12 @@
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}, {
|
||||
"path": "pages/startup/startup",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/medicalservice/medicalservice",
|
||||
@ -532,6 +538,38 @@
|
||||
"navigationBarTitleText": "签约协议",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
}, {
|
||||
"path": "addequipment/addequipment",
|
||||
"style": {
|
||||
"navigationBarTitleText": "设备绑定",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
|
||||
}, {
|
||||
"path": "healthdata/healthdata",
|
||||
"style": {
|
||||
"navigationBarTitleText": "体征检测",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
|
||||
}, {
|
||||
"path": "addsugar/addsugar",
|
||||
"style": {
|
||||
"navigationBarTitleText": "记录血糖",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
}, {
|
||||
"path": "addPressure/addPressure",
|
||||
"style": {
|
||||
"navigationBarTitleText": "记录血压",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
}, {
|
||||
"path": "addTemperature/addTemperature",
|
||||
"style": {
|
||||
"navigationBarTitleText": "记录体温",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
}
|
||||
// {
|
||||
// "path": "contractsigningprotocol/contractsigningprotocol",
|
||||
|
||||
@ -191,13 +191,16 @@
|
||||
},
|
||||
// 体征检测
|
||||
sign() {
|
||||
if (!this.userinfo) {
|
||||
this.gologin();
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: "/pagesC/Physicalexamination/Physicalexamination"
|
||||
})
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: "/pagesC/Physicalexamination/Physicalexamination"
|
||||
})
|
||||
// if (!this.userinfo) {
|
||||
// this.gologin();
|
||||
// } else {
|
||||
// uni.navigateTo({
|
||||
// url: "/pagesC/Physicalexamination/Physicalexamination"
|
||||
// })
|
||||
// }
|
||||
},
|
||||
// 服务预约
|
||||
goappoint() {
|
||||
|
||||
@ -7,7 +7,6 @@
|
||||
<view class="itemdata">
|
||||
绑定设备,关注健康
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="device">
|
||||
<image src="../../static/pageC/report.png" mode=""></image>
|
||||
@ -18,7 +17,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="body">
|
||||
<view class="item">
|
||||
<view class="item" @tap='gohealthdata(0)'>
|
||||
<view class="itemtitle">
|
||||
血糖
|
||||
</view>
|
||||
@ -30,7 +29,7 @@
|
||||
</view>
|
||||
<image src="../../static/pageC/sugar.png" mode=""></image>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="item" @tap='gohealthdata(1)'>
|
||||
<view class="itemtitle">
|
||||
血压
|
||||
</view>
|
||||
@ -41,45 +40,8 @@
|
||||
快来测量吧~
|
||||
</view>
|
||||
<image src="../../static/pageC/bloodpressure.png" mode=""></image>
|
||||
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="itemtitle">
|
||||
体温
|
||||
</view>
|
||||
<view class="itemtext">
|
||||
您30天未测量
|
||||
</view>
|
||||
<view class="itemtext two">
|
||||
快来测量吧~
|
||||
</view>
|
||||
<image src="../../static/pageC/temperature.png" mode=""></image>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="itemtitle">
|
||||
BMI
|
||||
</view>
|
||||
<view class="itemtext">
|
||||
您30天未测量
|
||||
</view>
|
||||
<view class="itemtext two">
|
||||
快来测量吧~
|
||||
</view>
|
||||
<image src="../../static/pageC/dkw.png" mode=""></image>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="itemtitle">
|
||||
心率
|
||||
</view>
|
||||
<view class="itemtext">
|
||||
您30天未测量
|
||||
</view>
|
||||
<view class="itemtext two">
|
||||
快来测量吧~
|
||||
</view>
|
||||
<image src="../../static/pageC/heartrate.png" mode=""></image>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="item" @tap='gohealthdata(2)'>
|
||||
<view class="itemtitle">
|
||||
血脂
|
||||
</view>
|
||||
@ -91,7 +53,19 @@
|
||||
</view>
|
||||
<image src="../../static/pageC/bloodfat.png" mode=""></image>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="item" @tap='gohealthdata(3)'>
|
||||
<view class="itemtitle">
|
||||
BMI
|
||||
</view>
|
||||
<view class="itemtext">
|
||||
您30天未测量
|
||||
</view>
|
||||
<view class="itemtext two">
|
||||
快来测量吧~
|
||||
</view>
|
||||
<image src="../../static/pageC/dkw.png" mode=""></image>
|
||||
</view>
|
||||
<view class="item" @tap='gohealthdata(4)'>
|
||||
<view class="itemtitle">
|
||||
血氧
|
||||
</view>
|
||||
@ -103,13 +77,37 @@
|
||||
</view>
|
||||
<image src="../../static/pageC/oxygen.png" mode=""></image>
|
||||
</view>
|
||||
<view class="item" @tap='gohealthdata(5)'>
|
||||
<view class="itemtitle">
|
||||
心率
|
||||
</view>
|
||||
<view class="itemtext">
|
||||
您30天未测量
|
||||
</view>
|
||||
<view class="itemtext two">
|
||||
快来测量吧~
|
||||
</view>
|
||||
<image src="../../static/pageC/heartrate.png" mode=""></image>
|
||||
</view>
|
||||
<view class="item" @tap='gohealthdata(6)'>
|
||||
<view class="itemtitle">
|
||||
体温
|
||||
</view>
|
||||
<view class="itemtext">
|
||||
您30天未测量
|
||||
</view>
|
||||
<view class="itemtext two">
|
||||
快来测量吧~
|
||||
</view>
|
||||
<image src="../../static/pageC/temperature.png" mode=""></image>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
@ -118,7 +116,11 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
gohealthdata(index) {
|
||||
uni.navigateTo({
|
||||
url: `/pagesC/healthdata/healthdata?index=${index}`
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
229
pagesC/addPressure/addPressure.vue
Normal file
229
pagesC/addPressure/addPressure.vue
Normal file
@ -0,0 +1,229 @@
|
||||
<template>
|
||||
<view class="app">
|
||||
<view class="uptext">
|
||||
<view class="pressureg">
|
||||
舒张压
|
||||
</view>
|
||||
<input placeholder="请输入数值" border="bottom" v-model="dbp" fontSize='50rpx' inputAlign='center'></input>
|
||||
<view class="text">
|
||||
mmHg
|
||||
</view>
|
||||
</view>
|
||||
<view class="uptext">
|
||||
<view class="pressured">
|
||||
收缩压
|
||||
</view>
|
||||
<input placeholder="请输入数值" border="bottom" v-model="sbp" fontSize='50rpx' inputAlign='center'></input>
|
||||
<view class="text">
|
||||
mmHg
|
||||
</view>
|
||||
</view>
|
||||
<view class="uptext">
|
||||
<view class="heart">
|
||||
心率
|
||||
</view>
|
||||
<input placeholder="请输入心率值" border="bottom" v-model="hr" fontSize='50rpx' inputAlign='center'></input>
|
||||
<view class="text">
|
||||
次/分钟
|
||||
</view>
|
||||
</view>
|
||||
<view class="time">
|
||||
<view style="display: flex;align-items: center;">
|
||||
<text style="margin-left: 50rpx">记录时间:</text>
|
||||
<view style="display: flex;margin: 0 auto; color: #999;">
|
||||
<uni-datetime-picker v-model="measureTime" @change="timeconfirm">{{measureTime}}
|
||||
<image style="margin-right: 40rpx;" src="../../static/huijiantou.png" mode="widthFix" />
|
||||
</uni-datetime-picker>
|
||||
</uni-datetime-picker>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="submit" @tap="submit">
|
||||
保存
|
||||
</view>
|
||||
<u-toast ref="uToast" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
savebp
|
||||
} from '@/api/examinationapi/add.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dbp: '',
|
||||
sbp: '',
|
||||
hr: '',
|
||||
timetext: this.formatDate(Date.now()),
|
||||
measureTime: this.formatDate(Date.now()),
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
formatDate(timestamp) {
|
||||
const now = new Date(parseInt(timestamp))
|
||||
const year = now.getFullYear();
|
||||
const month = now.getMonth() + 1;
|
||||
const date = now.getDate();
|
||||
const hour = now.getHours();
|
||||
const minute = now.getMinutes();
|
||||
const second = now.getSeconds();
|
||||
return year + "-" + ((month < 10) ? '0' + month : month) + "-" + ((date < 10) ? '0' + date : date) + " " +
|
||||
((hour < 10) ? '0' + hour : hour) + ":" + ((minute < 10) ? '0' + minute : minute) + ":" + ((second <
|
||||
10) ? '0' + second : second);
|
||||
},
|
||||
timeconfirm(time) {
|
||||
this.timetext = time
|
||||
},
|
||||
submit() {
|
||||
if (this.ruls(this.dbp) && this.ruls(this.sbp) && this.ruls(this.hr)) {
|
||||
let data = {
|
||||
dbp: this.dbp,
|
||||
sbp: this.sbp,
|
||||
hr: this.hr,
|
||||
// identity: uni.getStorageSync('userinfo').cardNo
|
||||
identity: '370882199909092123',
|
||||
measureTime: this.timetext,
|
||||
uploadType: 1,
|
||||
}
|
||||
savebp(data).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.$refs.uToast.show({
|
||||
title: '保存成功',
|
||||
type: 'success',
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
}, 1000)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$refs.uToast.show({
|
||||
title: '各项格式为正整数,请重新输入',
|
||||
type: 'error',
|
||||
})
|
||||
}
|
||||
},
|
||||
ruls(num) {
|
||||
let reg = /^((?!0)\d{1,9})$/;
|
||||
if (!num.match(reg)) {
|
||||
return false
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.app {
|
||||
.submit {
|
||||
width: 60%;
|
||||
height: 98rpx;
|
||||
margin: 60rpx auto;
|
||||
background-color: #55d0df;
|
||||
border-radius: 10rpx;
|
||||
border: solid 0rpx #0c0c0c;
|
||||
color: #ffffff;
|
||||
text-align: center;
|
||||
line-height: 98rpx;
|
||||
}
|
||||
|
||||
.time {
|
||||
margin-top: 100rpx;
|
||||
position: relative;
|
||||
border-bottom: 1rpx solid #f0f1f6;
|
||||
height: 80rpx;
|
||||
line-height: 65rpx;
|
||||
|
||||
image {
|
||||
width: 20rpx;
|
||||
height: 20rpx;
|
||||
position: absolute;
|
||||
right: 10rpx;
|
||||
top: 20%;
|
||||
}
|
||||
|
||||
// text:nth-child(1) {
|
||||
// margin-left: 50rpx;
|
||||
// }
|
||||
|
||||
text:nth-child(2) {
|
||||
float: right;
|
||||
margin-right: 100rpx;
|
||||
color: #999999;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.uptext:nth-child(2) {
|
||||
margin-top: 80rpx;
|
||||
}
|
||||
|
||||
.uptext:nth-child(1) {
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
|
||||
.uptext {
|
||||
width: 100%;
|
||||
height: 300rpx;
|
||||
position: relative;
|
||||
border-bottom: 1rpx solid #f0f1f6;
|
||||
|
||||
.pressured {
|
||||
margin-left: 20rpx;
|
||||
font-size: 32rpx;
|
||||
line-height: 34rpx;
|
||||
letter-spacing: 2rpx;
|
||||
color: #d34141;
|
||||
}
|
||||
|
||||
.pressureg {
|
||||
margin-left: 20rpx;
|
||||
font-size: 32rpx;
|
||||
line-height: 34rpx;
|
||||
letter-spacing: 2rpx;
|
||||
color: #41d36d;
|
||||
}
|
||||
|
||||
.heart {
|
||||
margin-left: 20rpx;
|
||||
font-size: 32rpx;
|
||||
line-height: 34rpx;
|
||||
letter-spacing: 2rpx;
|
||||
color: #00aaff;
|
||||
}
|
||||
|
||||
.text {
|
||||
position: absolute;
|
||||
top: 75%;
|
||||
width: 20%;
|
||||
text-align: center;
|
||||
left: 40%;
|
||||
font-size: 30rpx;
|
||||
line-height: 34rpx;
|
||||
letter-spacing: 1rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
/deep/ input {
|
||||
text-align: center;
|
||||
font-size: 40rpx;
|
||||
border-bottom: 2rpx solid #f0f1f6;
|
||||
position: absolute;
|
||||
width: 40%;
|
||||
height: 10%;
|
||||
top: 50%;
|
||||
left: 30%;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
206
pagesC/addTemperature/addTemperature.vue
Normal file
206
pagesC/addTemperature/addTemperature.vue
Normal file
@ -0,0 +1,206 @@
|
||||
<template>
|
||||
<view class="app">
|
||||
<view class="uptext">
|
||||
<view class="pressureg">
|
||||
体温
|
||||
</view>
|
||||
<input placeholder="请输入数值" border="bottom" v-model="temp" fontSize='50rpx' inputAlign='center'></input>
|
||||
<view class="text">
|
||||
℃
|
||||
</view>
|
||||
</view>
|
||||
<view class="time">
|
||||
<view style="display: flex;align-items: center;">
|
||||
<text style="margin-left: 50rpx">记录时间:</text>
|
||||
<view style="display: flex;margin: 0 auto; color: #999;">
|
||||
<uni-datetime-picker v-model="measureTime" @change="timeconfirm">{{measureTime}}
|
||||
<image style="margin-right: 40rpx;" src="../../static/huijiantou.png" mode="widthFix" />
|
||||
</uni-datetime-picker>
|
||||
</uni-datetime-picker>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="submit" @tap="submit">
|
||||
保存
|
||||
</view>
|
||||
<u-toast ref="uToast" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
savetemp
|
||||
} from '@/api/examinationapi/add.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
temp: '',
|
||||
timetext: this.formatDate(Date.now()),
|
||||
measureTime: this.formatDate(Date.now()),
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
formatDate(timestamp) {
|
||||
const now = new Date(parseInt(timestamp))
|
||||
const year = now.getFullYear();
|
||||
const month = now.getMonth() + 1;
|
||||
const date = now.getDate();
|
||||
const hour = now.getHours();
|
||||
const minute = now.getMinutes();
|
||||
const second = now.getSeconds();
|
||||
return year + "-" + ((month < 10) ? '0' + month : month) + "-" + ((date < 10) ? '0' + date : date) + " " +
|
||||
((hour < 10) ? '0' + hour : hour) + ":" + ((minute < 10) ? '0' + minute : minute) + ":" + ((second <
|
||||
10) ? '0' + second : second);
|
||||
},
|
||||
timeconfirm(time) {
|
||||
this.timetext = time
|
||||
},
|
||||
submit() {
|
||||
if (this.timetext && this.temp) {
|
||||
let data = {
|
||||
// identity: uni.getStorageSync('userinfo').cardNo
|
||||
identity: '370882199909092123',
|
||||
measureTime: this.timetext,
|
||||
temp: this.temp,
|
||||
}
|
||||
savetemp(data).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.$refs.uToast.show({
|
||||
title: '保存成功',
|
||||
type: 'success',
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
}, 1000)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$refs.uToast.show({
|
||||
title: '各项格式为正整数,请重新输入',
|
||||
type: 'error',
|
||||
})
|
||||
}
|
||||
},
|
||||
ruls(num) {
|
||||
let reg = /^((?!0)\d{1,9})$/;
|
||||
if (!num.match(reg)) {
|
||||
return false
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.app {
|
||||
.submit {
|
||||
width: 60%;
|
||||
height: 98rpx;
|
||||
margin: 60rpx auto;
|
||||
background-color: #55d0df;
|
||||
border-radius: 10rpx;
|
||||
border: solid 0rpx #0c0c0c;
|
||||
color: #ffffff;
|
||||
text-align: center;
|
||||
line-height: 98rpx;
|
||||
}
|
||||
|
||||
.time {
|
||||
margin-top: 100rpx;
|
||||
position: relative;
|
||||
border-bottom: 1rpx solid #f0f1f6;
|
||||
height: 80rpx;
|
||||
line-height: 65rpx;
|
||||
|
||||
image {
|
||||
width: 20rpx;
|
||||
height: 20rpx;
|
||||
position: absolute;
|
||||
right: 10rpx;
|
||||
top: 20%;
|
||||
}
|
||||
|
||||
// text:nth-child(1) {
|
||||
// margin-left: 50rpx;
|
||||
// }
|
||||
|
||||
text:nth-child(2) {
|
||||
float: right;
|
||||
margin-right: 100rpx;
|
||||
color: #999999;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.uptext:nth-child(2) {
|
||||
margin-top: 80rpx;
|
||||
}
|
||||
|
||||
.uptext:nth-child(1) {
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
|
||||
.uptext {
|
||||
width: 100%;
|
||||
height: 300rpx;
|
||||
position: relative;
|
||||
border-bottom: 1rpx solid #f0f1f6;
|
||||
|
||||
.pressured {
|
||||
margin-left: 20rpx;
|
||||
font-size: 32rpx;
|
||||
line-height: 34rpx;
|
||||
letter-spacing: 2rpx;
|
||||
color: #d34141;
|
||||
}
|
||||
|
||||
.pressureg {
|
||||
margin-left: 20rpx;
|
||||
font-size: 32rpx;
|
||||
line-height: 34rpx;
|
||||
letter-spacing: 2rpx;
|
||||
color: #41d36d;
|
||||
}
|
||||
|
||||
.heart {
|
||||
margin-left: 20rpx;
|
||||
font-size: 32rpx;
|
||||
line-height: 34rpx;
|
||||
letter-spacing: 2rpx;
|
||||
color: #00aaff;
|
||||
}
|
||||
|
||||
.text {
|
||||
position: absolute;
|
||||
top: 75%;
|
||||
width: 20%;
|
||||
text-align: center;
|
||||
left: 40%;
|
||||
font-size: 30rpx;
|
||||
line-height: 34rpx;
|
||||
letter-spacing: 1rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
/deep/ input {
|
||||
text-align: center;
|
||||
font-size: 40rpx;
|
||||
border-bottom: 2rpx solid #f0f1f6;
|
||||
position: absolute;
|
||||
width: 40%;
|
||||
height: 10%;
|
||||
top: 50%;
|
||||
left: 30%;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
162
pagesC/addequipment/addequipment.vue
Normal file
162
pagesC/addequipment/addequipment.vue
Normal file
@ -0,0 +1,162 @@
|
||||
<template>
|
||||
<view class="app">
|
||||
<view class="title">
|
||||
<view class="left">
|
||||
</view>
|
||||
<view class="right">
|
||||
设备序列号
|
||||
</view>
|
||||
<image src="../../static/pageC/ScanAdd.png" mode="" @click="scanning"></image>
|
||||
</view>
|
||||
<view class="uptext">
|
||||
<input placeholder="请输入设备序列号" v-model="data.sn"></input>
|
||||
</view>
|
||||
<view class="title">
|
||||
<view class="left">
|
||||
</view>
|
||||
<view class="right">
|
||||
设备类型
|
||||
</view>
|
||||
</view>
|
||||
<view class="types">
|
||||
<view @tap='data.deviceType=0' :class="data.deviceType==0?'type':'type2'">血压计</view>
|
||||
<view @tap='data.deviceType=1' :class="data.deviceType==1?'type':'type2'">血糖仪</view>
|
||||
</view>
|
||||
<view class="submit" @click="submit">
|
||||
保存
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// import { bindDevice } from '@/service/api/api.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
type: 1,
|
||||
data: {
|
||||
deviceType: 0,
|
||||
identity: uni.getStorageSync('userInfo').identity,
|
||||
signNo: uni.getStorageSync('signInfo').signNo,
|
||||
sn: ''
|
||||
}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
scanning() {
|
||||
const that = this
|
||||
uni.scanCode({
|
||||
onlyFromCamera: true,
|
||||
success(res) {
|
||||
that.data.sn = res.result
|
||||
}
|
||||
})
|
||||
},
|
||||
submit() {
|
||||
// bindDevice(this.data).then(res => {
|
||||
// if(res.data.code == '1') {
|
||||
// uni.showToast({
|
||||
// title: '绑定成功',
|
||||
// duration: 1000
|
||||
// })
|
||||
// setTimeout(function() {
|
||||
// uni.navigateBack({
|
||||
// delta: 1
|
||||
// })
|
||||
// }, 1000);
|
||||
// }
|
||||
// })
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.app {
|
||||
margin-top: 40rpx;
|
||||
|
||||
.submit {
|
||||
width: 60%;
|
||||
height: 98rpx;
|
||||
margin: 60rpx auto;
|
||||
background-color: #55d0df;
|
||||
border-radius: 10rpx;
|
||||
border: solid 0rpx #0c0c0c;
|
||||
color: #ffffff;
|
||||
text-align: center;
|
||||
line-height: 98rpx;
|
||||
}
|
||||
|
||||
.types {
|
||||
text-align: center;
|
||||
line-height: 60rpx;
|
||||
font-size: 28rpx;
|
||||
margin-top: 30rpx;
|
||||
display: flex;
|
||||
padding-bottom: 50rpx;
|
||||
border-bottom: 1rpx solid #f0f1f6;
|
||||
;
|
||||
|
||||
.type2 {
|
||||
margin-left: 50rpx;
|
||||
color: #999999;
|
||||
width: 144rpx;
|
||||
height: 60rpx;
|
||||
background-color: #ffffff;
|
||||
border-radius: 10rpx;
|
||||
border: solid 1rpx #d0d0d0;
|
||||
}
|
||||
|
||||
.type {
|
||||
margin-left: 50rpx;
|
||||
width: 144rpx;
|
||||
height: 60rpx;
|
||||
background-color: #ffffff;
|
||||
border-radius: 10rpx;
|
||||
border: solid 1rpx #55d0df;
|
||||
color: #55d0df;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.uptext {
|
||||
width: 100%;
|
||||
|
||||
input {
|
||||
width: 580rpx;
|
||||
height: 88rpx;
|
||||
background-color: #ffffff;
|
||||
border-radius: 10rpx;
|
||||
border: solid 1rpx #d0d0d0;
|
||||
text-align: center;
|
||||
font-size: 40rpx;
|
||||
margin: 40rpx auto;
|
||||
}
|
||||
}
|
||||
|
||||
.title {
|
||||
display: flex;
|
||||
padding: 30rpx 0 30rpx 30rpx;
|
||||
font-size: 30rpx;
|
||||
|
||||
image {
|
||||
width: 160rpx;
|
||||
height: 40rpx;
|
||||
margin-left: 40%;
|
||||
}
|
||||
|
||||
.right {
|
||||
line-height: 34rpx;
|
||||
padding-left: 20rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.left {
|
||||
width: 8rpx;
|
||||
height: 32rpx;
|
||||
background-color: #55d0df;
|
||||
border-radius: 4rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
228
pagesC/addsugar/addsugar.vue
Normal file
228
pagesC/addsugar/addsugar.vue
Normal file
@ -0,0 +1,228 @@
|
||||
<template>
|
||||
<view class="app">
|
||||
<view class="uptext">
|
||||
<input placeholder="请输入血糖值" border="bottom" v-model="number" fontSize='50rpx' inputAlign='center'>
|
||||
</input>
|
||||
<view class="text">
|
||||
mmol/L
|
||||
</view>
|
||||
</view>
|
||||
<view class="time">
|
||||
<view style="display: flex;align-items: center;">
|
||||
<text style="margin-left: 50rpx">记录时间:</text>
|
||||
<view style="display: flex;margin: 0 auto; color: #999;">
|
||||
<uni-datetime-picker v-model="measureTime" @change="timeconfirm">{{measureTime}}
|
||||
<image style="margin-right: 40rpx;" src="../../static/huijiantou.png" mode="widthFix" />
|
||||
</uni-datetime-picker>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="scene">
|
||||
<view class="title">
|
||||
测量场景
|
||||
</view>
|
||||
<view class="choices">
|
||||
<view @tap='bucketchoice=1' :class="bucketchoice==1?'choice':'choice2'">凌晨</view>
|
||||
<view @tap='bucketchoice=2' :class="bucketchoice==2?'choice':'choice2'">早餐前</view>
|
||||
<view @tap='bucketchoice=3' :class="bucketchoice==3?'choice':'choice2'">早晨后</view>
|
||||
<view @tap='bucketchoice=4' :class="bucketchoice==4?'choice':'choice2'">午餐前</view>
|
||||
<view @tap='bucketchoice=5' :class="bucketchoice==5?'choice':'choice2'">午餐后</view>
|
||||
<view @tap='bucketchoice=6' :class="bucketchoice==6?'choice':'choice2'">晚餐前</view>
|
||||
<view @tap='bucketchoice=7' :class="bucketchoice==7?'choice':'choice2'">晚餐后</view>
|
||||
<view @tap='bucketchoice=8' :class="bucketchoice==8?'choice':'choice2'">睡前2小时</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="btn">
|
||||
<view class="submit" @tap="submit">
|
||||
添加
|
||||
</view>
|
||||
</view>
|
||||
<u-toast ref="uToast" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
savebg
|
||||
} from '@/api/examinationapi/add.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
number: '',
|
||||
timetext: this.formatDate(Date.now()),
|
||||
measureTime: this.formatDate(Date.now()),
|
||||
bucketchoice: 1,
|
||||
};
|
||||
},
|
||||
onLoad(options) {},
|
||||
methods: {
|
||||
timeconfirm(time) {
|
||||
this.timetext = time
|
||||
},
|
||||
formatDate(timestamp) {
|
||||
const now = new Date(parseInt(timestamp))
|
||||
const year = now.getFullYear();
|
||||
const month = now.getMonth() + 1;
|
||||
const date = now.getDate();
|
||||
const hour = now.getHours();
|
||||
const minute = now.getMinutes();
|
||||
const second = now.getSeconds();
|
||||
return year + "-" + ((month < 10) ? '0' + month : month) + "-" + ((date < 10) ? '0' + date : date) + " " +
|
||||
((hour < 10) ? '0' + hour : hour) + ":" + ((minute < 10) ? '0' + minute : minute) + ":" + ((second <
|
||||
10) ? '0' + second : second);
|
||||
},
|
||||
submit() {
|
||||
if (!this.number || this.timetext == "请选择时间") {
|
||||
this.$refs.uToast.show({
|
||||
title: '请填写完整后提交',
|
||||
type: 'error',
|
||||
})
|
||||
return
|
||||
}
|
||||
let data = {
|
||||
bg: this.number,
|
||||
bucket: this.bucketchoice,
|
||||
measureTime: this.measureTime,
|
||||
uploadType: 1,
|
||||
// identity: uni.getStorageSync('userinfo').cardNo
|
||||
identity: '370882199909092123'
|
||||
}
|
||||
savebg(data).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.$refs.uToast.show({
|
||||
title: '保存成功',
|
||||
type: 'success',
|
||||
})
|
||||
setTimeout(() => {
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
})
|
||||
}, 1000)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.app {
|
||||
|
||||
.btn {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
|
||||
.submit {
|
||||
width: 90%;
|
||||
height: 80rpx;
|
||||
margin: 60rpx auto;
|
||||
background-color: #4AC4AB;
|
||||
border-radius: 10rpx;
|
||||
color: #ffffff;
|
||||
text-align: center;
|
||||
line-height: 80rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.scene {
|
||||
margin-top: 50rpx;
|
||||
width: 100%;
|
||||
|
||||
.choices {
|
||||
text-align: center;
|
||||
line-height: 60rpx;
|
||||
font-size: 28rpx;
|
||||
margin-top: 50rpx;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-evenly;
|
||||
|
||||
.choice2 {
|
||||
margin: 0 10rpx 30rpx;
|
||||
color: #a3a3a3;
|
||||
width: 20%;
|
||||
height: 60rpx;
|
||||
background-color: #ffffff;
|
||||
border-radius: 10rpx;
|
||||
border: solid 1rpx #ccc;
|
||||
}
|
||||
|
||||
.choice {
|
||||
margin: 0 10rpx 30rpx;
|
||||
width: 20%;
|
||||
height: 60rpx;
|
||||
background-color: #ffffff;
|
||||
border-radius: 10rpx;
|
||||
border: solid 1rpx #4AC4AB;
|
||||
color: #4AC4AB;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.title {
|
||||
font-size: 34rpx;
|
||||
margin-left: 50rpx;
|
||||
line-height: 34rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
|
||||
.time {
|
||||
margin-top: 100rpx;
|
||||
position: relative;
|
||||
border-bottom: 1rpx solid #f0f1f6;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
|
||||
image {
|
||||
width: 20rpx;
|
||||
height: 20rpx;
|
||||
position: absolute;
|
||||
right: 10rpx;
|
||||
top: 30%;
|
||||
}
|
||||
|
||||
text:nth-child(2) {
|
||||
float: right;
|
||||
margin-right: 100rpx;
|
||||
color: #999999;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.uptext {
|
||||
width: 100%;
|
||||
height: 500rpx;
|
||||
position: relative;
|
||||
|
||||
.text {
|
||||
position: absolute;
|
||||
top: 85%;
|
||||
width: 20%;
|
||||
text-align: center;
|
||||
left: 40%;
|
||||
font-size: 30rpx;
|
||||
line-height: 34rpx;
|
||||
letter-spacing: 1rpx;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
/deep/ input {
|
||||
text-align: center;
|
||||
font-size: 40rpx;
|
||||
border-bottom: 2rpx solid #f0f1f6;
|
||||
position: absolute;
|
||||
width: 40%;
|
||||
height: 10%;
|
||||
top: 50%;
|
||||
left: 30%;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
99
pagesC/healthdata/healthdata.vue
Normal file
99
pagesC/healthdata/healthdata.vue
Normal file
@ -0,0 +1,99 @@
|
||||
<template>
|
||||
<view class="app">
|
||||
<u-tabs :list="tabList" :current="tabindex" @change="tabchange" active-color='#26A888'
|
||||
:show-bar='false'></u-tabs>
|
||||
<view class="content">
|
||||
<view v-if="tabindex == 0">
|
||||
<blood-sugar :current="tabindex" :echartData="list" @taptimeindex='taptimeindex'
|
||||
v-on:websocket-message="handleWebSocketMessage"></blood-sugar>
|
||||
</view>
|
||||
<view v-if="tabindex == 1">
|
||||
<blood-pressure :current="tabindex" :echartData="list" @taptimeindex='taptimeindex'
|
||||
v-on:websocket-message="handleWebSocketMessage"></blood-pressure>
|
||||
</view>
|
||||
<view v-if="tabindex == 6">
|
||||
<Bloodtemperature :current="tabindex" :echartData="list" @taptimeindex='taptimeindex'
|
||||
v-on:websocket-message="handleWebSocketMessage"></Bloodtemperature>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
record
|
||||
} from '@/api/pagesC/healthdata/index.js'
|
||||
import BloodPressure from '../../components/BloodPressure/BloodPressure.vue'
|
||||
import BloodSugar from '../../components/BloodSugar/BloodSugar.vue'
|
||||
import Bloodtemperature from '../../components/Bloodtemperature/Bloodtemperature.vue'
|
||||
export default {
|
||||
components: {
|
||||
BloodPressure,
|
||||
BloodSugar,
|
||||
Bloodtemperature
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tabindex: 0,
|
||||
tabList: [{
|
||||
name: '血糖',
|
||||
}, {
|
||||
name: '血压',
|
||||
}, {
|
||||
name: '血脂',
|
||||
}, {
|
||||
name: 'BMI',
|
||||
}, {
|
||||
name: '血氧',
|
||||
}, {
|
||||
name: '心率',
|
||||
}, {
|
||||
name: '体温',
|
||||
}, ],
|
||||
list: null,
|
||||
type: 0,
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
this.tabindex = options.index
|
||||
},
|
||||
onShow() {
|
||||
this.info();
|
||||
},
|
||||
methods: {
|
||||
taptimeindex(e) {
|
||||
this.type = e
|
||||
this.info()
|
||||
},
|
||||
info() {
|
||||
let userinfo = uni.getStorageSync('userinfo');
|
||||
var obj = {
|
||||
label: Number(this.tabindex) + 1,
|
||||
// identity: userinfo.cardNo,
|
||||
identity: '370882199909092123',
|
||||
type: this.type,
|
||||
}
|
||||
record(obj).then(res => {
|
||||
this.list = res.data
|
||||
})
|
||||
},
|
||||
tabchange(e) {
|
||||
this.list = null
|
||||
this.tabindex = e
|
||||
setTimeout(() => {
|
||||
this.info();
|
||||
}, 1000)
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #F7F5F5;
|
||||
}
|
||||
|
||||
::v-deep .u-tabs {
|
||||
background-color: #F7F5F5 !important;
|
||||
}
|
||||
</style>
|
||||
BIN
static/pageC/BindDevice.png
Normal file
BIN
static/pageC/BindDevice.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.7 KiB |
BIN
static/pageC/ScanAdd.png
Normal file
BIN
static/pageC/ScanAdd.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.0 KiB |
Loading…
Reference in New Issue
Block a user