543 lines
14 KiB
Vue
543 lines
14 KiB
Vue
<template>
|
|
<view>
|
|
<view class="content">
|
|
<z-paging ref="paging"refresher-only @onRefresh="onRefresh">
|
|
<view class="content-header">
|
|
<view class="sha-dow"></view>
|
|
<view class="text">
|
|
<view class="left">
|
|
<view class="title">
|
|
家庭健康管理
|
|
</view>
|
|
<view class="desc">
|
|
<text class="">共享健康 · 守护家人</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="content-item row" @click="toPage('/pages/index/echarts?type=step&calorie='+(dataListsNew.stepIndex.data_msg?dataListsNew.stepIndex.data_msg.calorie:0)+'&step='+(dataListsNew.stepIndex.data_msg?dataListsNew.stepIndex.data_msg.step:0)+'&distance='+ (dataListsNew.stepIndex.data_msg?(dataListsNew.stepIndex.data_msg.distance / 1000).toFixed(2):0))">
|
|
<view class="item">
|
|
<view class="title">卡路里</view>
|
|
<view class="row-date">
|
|
<view>{{dataListsNew.stepIndex.data_msg ? dataListsNew.stepIndex.data_msg.calorie / 10 : '--'}}</view>
|
|
<text>千卡</text>
|
|
</view>
|
|
</view>
|
|
<view class="item">
|
|
<view class="title">步数</view>
|
|
<view class="row-date">
|
|
<view>{{dataListsNew.stepIndex.data_msg ? dataListsNew.stepIndex.data_msg.step : '--'}}</view>
|
|
<text>步</text>
|
|
</view>
|
|
</view>
|
|
<view class="item">
|
|
<view class="title">距离</view>
|
|
<view class="row-date">
|
|
<view>{{dataListsNew.stepIndex.data_msg ? (dataListsNew.stepIndex.data_msg.distance / 1000).toFixed(2) : '--'}}</view>
|
|
<text>公里</text>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="row-time" v-if="dataListsNew.stepIndex">
|
|
{{(dataListsNew.stepIndex.device_real_time)}}
|
|
</view>
|
|
<view class="bg">
|
|
<!-- <image src="../../static/icon/血糖.png" mode="widthFix"></image> -->
|
|
</view>
|
|
</view>
|
|
<view class="content-item" @click="toPage('/pages/index/echarts?type=bloodGlucose')">
|
|
<view class="title">
|
|
{{getNameByKey('bloodGlucose')}}
|
|
</view>
|
|
<view class="time">
|
|
{{dataListsNew.bloodGlucose.data_msg? dataListsNew.bloodGlucose.device_real_time + '更新' : '--'}}
|
|
</view>
|
|
<view class="date">
|
|
<view class="flex_data">
|
|
<view class="f_left">
|
|
{{dataListsNew.bloodGlucose.data_msg || '--'}}
|
|
</view>
|
|
<view class="f_right">
|
|
<text class="icon">毫摩尔/升</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="bg">
|
|
<image src="../../static/icon/xuetang.png" mode="widthFix"></image>
|
|
</view>
|
|
</view>
|
|
<view class="content-item" @click="toPage('/pages/index/echarts?type=bloodOxygen')">
|
|
<view class="title">
|
|
{{getNameByKey('bloodOxygen')}}
|
|
</view>
|
|
<view class="time">
|
|
{{dataListsNew.bloodOxygen.data_msg? dataListsNew.bloodOxygen.device_real_time + '更新' : '--'}}
|
|
</view>
|
|
<view class="date">
|
|
<view class="flex_data">
|
|
<view class="f_left">
|
|
{{dataListsNew.bloodOxygen.data_msg? (dataListsNew.bloodOxygen.data_msg[0]) : '--'}}
|
|
</view>
|
|
<view class="f_right">
|
|
<text class="icon">%</text>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
</view>
|
|
<view class="bg">
|
|
<image src="../../static/icon/xueyang.png" mode="widthFix"></image>
|
|
</view>
|
|
</view>
|
|
<view class="content-item" @click="toPage('/pages/index/echarts?type=bloodPressure')">
|
|
<view class="title">
|
|
{{getNameByKey('bloodPressure')}}
|
|
</view>
|
|
<view class="time">
|
|
{{dataListsNew.bloodPressure.data_msg? dataListsNew.bloodPressure.device_real_time + '更新' : '--'}}
|
|
</view>
|
|
<view class="date">
|
|
<view class="flex_data">
|
|
<view class="f_left">
|
|
{{dataListsNew.bloodPressure.data_msg? dataListsNew.bloodPressure.data_msg.bloodPressureHigh + '/' + dataListsNew.bloodPressure.data_msg.bloodPressureLow : '--'}}
|
|
</view>
|
|
<view class="f_right">
|
|
<text class="icon">mmHG</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="bg">
|
|
<image src="../../static/icon/xueya.png" mode="widthFix"></image>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="content-item" @click="toPage('/pages/index/echarts?type=bodyTemperature')">
|
|
<view class="title">
|
|
{{getNameByKey('bodyTemperature')}}
|
|
</view>
|
|
<view class="time">
|
|
{{dataListsNew.bodyTemperature.data_msg? dataListsNew.bodyTemperature.device_real_time + '更新' : '--'}}
|
|
</view>
|
|
<view class="date">
|
|
<view class="flex_data">
|
|
<view class="f_left">
|
|
{{dataListsNew.bodyTemperature.data_msg? (dataListsNew.bodyTemperature.data_msg) : '--'}}
|
|
</view>
|
|
<view class="f_right">
|
|
<text class="icon">℃</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="bg">
|
|
<image src="../../static/icon/wendu.png" mode="widthFix"></image>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="content-item" @click="toPage('/pages/index/echarts?type=pulseReat')">
|
|
<view class="title">
|
|
{{getNameByKey('pulseReat')}}
|
|
</view>
|
|
<view class="time">
|
|
{{dataListsNew.pulseReat.data_msg? dataListsNew.pulseReat.device_real_time + '更新' : '--'}}
|
|
</view>
|
|
<view class="date">
|
|
<view class="flex_data">
|
|
<view class="f_left">
|
|
{{dataListsNew.pulseReat.data_msg? (dataListsNew.pulseReat.data_msg[0]) : '--'}}
|
|
</view>
|
|
<view class="f_right">
|
|
<text class="icon">次/分</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="bg">
|
|
<image src="../../static/icon/mailv.png" mode="widthFix"></image>
|
|
</view>
|
|
</view>
|
|
<view class="content-item" @click="toPage('/pages/index/detail?type=ECGData')">
|
|
<view class="title">
|
|
心电图
|
|
</view>
|
|
<view class="time">
|
|
{{dataListsNew.ECGData.data_msg? dataListsNew.ECGData.device_real_time + '更新' : '--'}}
|
|
</view>
|
|
<view class="date">
|
|
<view class="flex_data">
|
|
<view class="f_left">
|
|
{{dataListsNew.ECGData.data_msg? (dataListsNew.ECGData.data_msg.meanHeartRate ) : '--'}}
|
|
</view>
|
|
<view class="f_right">
|
|
<text class="icon">次/分</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="bg">
|
|
<image src="../../static/icon/xindiantu.png" style="width: 220rpx;" mode="widthFix"></image>
|
|
</view>
|
|
</view>
|
|
<view class="content-item" style="height: 430rpx" @click="toPage('/pages/index/echarts?type=bloodLiquidAll')">
|
|
<view class="title">
|
|
{{getNameByKey('bloodLiquid')}}
|
|
</view>
|
|
<view class="time">
|
|
{{dataListsNew.bloodLiquid.data_msg? dataListsNew.bloodLiquid.device_real_time + '更新' : '--'}}
|
|
</view>
|
|
<view class="gap-content">
|
|
<view class="gap-item">
|
|
<view class="title">
|
|
总胆固醇
|
|
</view>
|
|
<view class="num">
|
|
{{dataListsNew.bloodLiquid.data_msg? (dataListsNew.bloodLiquid.data_msg.cholesterol / 100) : '--'}}
|
|
<text class="icon">微摩尔/升</text>
|
|
</view>
|
|
</view>
|
|
<view class="gap-item">
|
|
<view class="title">
|
|
甘油三脂
|
|
</view>
|
|
<view class="num">
|
|
{{dataListsNew.bloodLiquid.data_msg? (dataListsNew.bloodLiquid.data_msg.triacylglycerol / 100) : '--'}}
|
|
<text class="icon">微摩尔/升</text>
|
|
</view>
|
|
</view>
|
|
<view class="gap-item">
|
|
<view class="title">
|
|
高密度脂蛋白
|
|
</view>
|
|
<view class="num">
|
|
{{dataListsNew.bloodLiquid.data_msg? (dataListsNew.bloodLiquid.data_msg.highDensity / 100) : '--'}}
|
|
<text class="icon">微摩尔/升</text>
|
|
</view>
|
|
</view>
|
|
<view class="gap-item">
|
|
<view class="title">
|
|
低密度脂蛋白
|
|
</view>
|
|
<view class="num">
|
|
{{dataListsNew.bloodLiquid.data_msg? (dataListsNew.bloodLiquid.data_msg.lowDensity / 100) : '--'}}
|
|
<text class="icon">微摩尔/升</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
<!-- <view class="content-item" @click="toPage('/pages/index/detail?type=meiTuo')">
|
|
<view class="title">
|
|
{{getNameByKey('meiTuo')}}
|
|
</view>
|
|
<view class="time">
|
|
{{dataListsNew.meiTuo.data_msg? dataListsNew.meiTuo.device_real_time + '更新' : '--'}}
|
|
</view>
|
|
<view class="date">
|
|
<view class="flex_data">
|
|
<view class="f_left">
|
|
{{dataListsNew.meiTuo.data_msg? (dataListsNew.meiTuo.data_msg[0] / 10) : '--'}}
|
|
</view>
|
|
<view class="f_right">
|
|
<text class="icon">MET</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="bg">
|
|
<image src="../../static/icon/xinlv.png" mode="widthFix"></image>
|
|
</view>
|
|
</view> -->
|
|
|
|
<view class="content-item" @click="toPage('/pages/index/echarts?type=bloodLiquid&desc=uricAcidVal')">
|
|
<view class="title">
|
|
尿酸
|
|
</view>
|
|
<view class="time">
|
|
{{dataListsNew.bloodLiquid.data_msg? dataListsNew.bloodLiquid.device_real_time + '更新' : '--'}}
|
|
</view>
|
|
<view class="date">
|
|
<view class="flex_data">
|
|
<view class="f_left">
|
|
{{dataListsNew.bloodLiquid.data_msg? (dataListsNew.bloodLiquid.data_msg.uricAcidVal / 10) : '--'}}
|
|
</view>
|
|
<view class="f_right">
|
|
<text class="icon">微摩尔/升</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="bg">
|
|
<image src="../../static/icon/niaosuan.png" style="width: 220rpx;" mode="widthFix"></image>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<view style="height: 200rpx"></view>
|
|
</z-paging>
|
|
</view>
|
|
|
|
<navtab :current="0"></navtab>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import { getArrMaxValue } from '@/utils/utils.js'
|
|
import store from "@/store/index.js";
|
|
import { mapGetters } from "vuex";
|
|
|
|
export default {
|
|
data() {
|
|
return {
|
|
keyNameMap: {
|
|
bloodGlucose: "血糖",
|
|
bloodOxygen: "血氧",
|
|
bloodPressure: '血压',
|
|
bloodLiquid: "血脂",
|
|
meiTuo: '梅脱',
|
|
pulseReat: '心率',
|
|
updataDate: '更新时间',
|
|
bodyTemperature: '体温'
|
|
},
|
|
dataLists: {},
|
|
dataListsNew:{
|
|
stepIndex:{},
|
|
pulseReat:{},
|
|
bloodOxygen:{},
|
|
bloodPressure:{},
|
|
bloodGlucose:{},
|
|
meiTuo:{},
|
|
bodyTemperature:{},
|
|
bloodLiquid:{},
|
|
ECGData:{}
|
|
}
|
|
// dataListsNew:{
|
|
// stepIndex:{
|
|
// calorie:'--',
|
|
// distance:'--',
|
|
// step:'--',
|
|
// },
|
|
// pulseReat:[],
|
|
// bloodOxygen:[],
|
|
// bloodPressure:{
|
|
// bloodPressureHigh:'',
|
|
// bloodPressureLow:''
|
|
// },
|
|
// bloodGlucose:'',
|
|
// meiTuo:[],
|
|
// bodyTemperature:'',
|
|
// bloodLiquid:{
|
|
// cholesterol:0,
|
|
// highDensity:0,
|
|
// lowDensity:0,
|
|
// triacylglycerol:0,
|
|
// uricAcidVal:0,
|
|
// }
|
|
// }
|
|
}
|
|
},
|
|
onLoad() {
|
|
this.onRefresh();
|
|
},
|
|
computed: {
|
|
...mapGetters({
|
|
getActiceDevice: "api/getActiceDevice"
|
|
})
|
|
},
|
|
methods: {
|
|
getArrMaxValue,
|
|
onRefresh(pageNo, pageSize) {
|
|
this.$store.dispatch('api/getIndexData', {
|
|
device_id: this.getActiceDevice.device_id ,
|
|
need_arr :[
|
|
'pulseReat',
|
|
'bloodOxygen',
|
|
'bloodPressure',
|
|
'bloodGlucose',
|
|
'meiTuo',
|
|
'bodyTemperature',
|
|
'bloodLiquid',
|
|
'stepIndex',
|
|
'ECGData'
|
|
],
|
|
}).then(res => {
|
|
for(let i = 0;i<res.length;i++){
|
|
// console.log(this.dataListsNew[res[i].type])
|
|
// console.log(res[i].data_msg)
|
|
this.dataListsNew[res[i].type] = res[i]
|
|
}
|
|
// this.dataListsNew = res.data_msg;
|
|
this.$refs.paging.complete();
|
|
});
|
|
},
|
|
toPage(url) {
|
|
uni.navigateTo({
|
|
url
|
|
})
|
|
},
|
|
getNameByKey(key) {
|
|
return this.keyNameMap[key] || "Key not found";
|
|
},
|
|
formatDateTime(dateTimeStr) {
|
|
if (dateTimeStr) {
|
|
return dateTimeStr.replace(/-/g, ' ').replace(' ', ' ', 2).replace(' ', ':');
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.flex_data{
|
|
display: flex;
|
|
.f_left{
|
|
margin-right: 10rpx;
|
|
}
|
|
.f_right{
|
|
padding-top: 16rpx;
|
|
}
|
|
}
|
|
|
|
.content {
|
|
padding: 20rpx 30rpx;
|
|
margin-top:20rpx;
|
|
.content-header {
|
|
margin-bottom: 30rpx;
|
|
padding: 30rpx;
|
|
height: 600rpx;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
margin: 0rpx 0rpx 30rpx 0rpx;
|
|
background-image: url('https://img.agrimedia.cn/watch-app/header-bg.png');
|
|
background-repeat: no-repeat;
|
|
background-size: 100% 100%;
|
|
position: relative;
|
|
.sha-dow {
|
|
width: 100%;
|
|
height: 640rpx;
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
background-color: #fff;
|
|
opacity: .4;
|
|
}
|
|
.text {
|
|
width: 500rpx;
|
|
// height: 300rpx;
|
|
left: 0px;
|
|
top: 0px;
|
|
right:0px;
|
|
bottom:0px;
|
|
margin:auto;
|
|
margin: 0 auto;
|
|
z-index: 999;
|
|
backdrop-filter: blur(6rpx);
|
|
border-radius: 20rpx;
|
|
padding:20rpx;
|
|
margin-top: 60rpx;
|
|
}
|
|
.left {
|
|
.title {
|
|
font-size: 80rpx;
|
|
text-align: center;
|
|
font-weight: 900;
|
|
margin-bottom: 20rpx;
|
|
text-stroke: 10rpx white;
|
|
}
|
|
.desc {
|
|
text-align: center;
|
|
font-size: 34rpx;
|
|
}
|
|
}
|
|
}
|
|
.row {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-around;
|
|
}
|
|
.content-item {
|
|
margin: 30rpx;
|
|
padding: 30rpx;
|
|
border: none;
|
|
border-radius: 30rpx ;
|
|
-webkit-box-shadow: 0 0 60rpx 0 rgba(43,86,112,.1) ;
|
|
box-shadow: 0 0 60rpx 0 rgba(43,86,112,.1) ;
|
|
position: relative;
|
|
height: 200rpx;
|
|
overflow: hidden;
|
|
.title {
|
|
font-size: 38rpx;
|
|
font-weight: 800;
|
|
margin-bottom: 14rpx;
|
|
}
|
|
.row-time {
|
|
position: absolute;
|
|
bottom: 30rpx;
|
|
right: 30rpx;
|
|
font-size: 28rpx;
|
|
color: grey;
|
|
}
|
|
.bg {
|
|
position: absolute;
|
|
bottom: 0rpx;
|
|
right: 50rpx;
|
|
opacity: .4;
|
|
z-index: -1;
|
|
image {
|
|
width: 250rpx;
|
|
}
|
|
}
|
|
.time {
|
|
font-size: 28rpx;
|
|
color: grey;
|
|
padding: 20rpx 0rpx 20rpx 0rpx;
|
|
}
|
|
.row-date {
|
|
font-size: 46rpx;
|
|
font-weight: 800;
|
|
display: flex;
|
|
align-items: baseline;
|
|
justify-content: center;
|
|
text {
|
|
opacity: .5;
|
|
font-size: 24rpx;
|
|
font-weight: 500;
|
|
padding-left: 10rpx;
|
|
}
|
|
}
|
|
|
|
.date {
|
|
font-size: 46rpx;
|
|
font-weight: 800;
|
|
display: flex;
|
|
align-items: baseline;
|
|
.icon {
|
|
font-weight: 100rpx;
|
|
font-size: 28rpx;
|
|
color: grey;
|
|
display: flex;
|
|
flex-direction: column-reverse;
|
|
}
|
|
}
|
|
|
|
.gap-content {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
.gap-item {
|
|
margin-top: 20rpx;
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: center;
|
|
text-align: center;
|
|
width: 50%;
|
|
.title {
|
|
font-size: 36rpx;
|
|
padding-bottom: 10rpx;
|
|
}
|
|
.num {
|
|
font-size: 28rpx;
|
|
font-weight: 600;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|