xinelu-applet-ui/pagesB/Healthindex/Healthindex.vue

276 lines
6.5 KiB
Vue
Raw Normal View History

2024-05-08 10:14:53 +08:00
<template>
<view class="app">
2024-05-08 17:27:34 +08:00
<view class="health" v-if="healthdata">
2024-05-08 10:14:53 +08:00
<view class="health_top">
<image image v-if="healthdata.hiEva<650" :src="require('../images/red.png')">
2024-05-10 08:29:51 +08:00
<image image v-if="healthdata.hiEva>=850" :src="require('../images/green.png')" image>
2024-05-08 18:12:17 +08:00
<image v-if="850>healthdata.hiEva >= 650" :src="require('../images/yellow.png')" image>
2024-05-08 10:14:53 +08:00
<view class="count">
<view class="numbers">{{healthdata.hiEva}}</view>
<view class="healths">健康指数</view>
</view>
</view>
<view class="health_body">
<view class="healthitem">
2024-05-08 18:12:17 +08:00
血压mmHg){{healthdata.physicalSign.bp.sbp?healthdata.physicalSign.bp.sbp:''}}/{{healthdata.physicalSign.bp.dbp?healthdata.physicalSign.bp.dbp:''}}
2024-05-08 10:14:53 +08:00
</view>
<view class="healthitem">
2024-05-08 18:12:17 +08:00
空腹血糖mmol/L){{healthdata.physicalSign.bg.bg?healthdata.physicalSign.bg.bg:''}}
2024-05-08 10:14:53 +08:00
</view>
<view class="healthitem">
2024-05-08 18:12:17 +08:00
血脂TC/LDL-C){{healthdata.physicalSign.bf.tc?healthdata.physicalSign.bf.tc:''}}/{{healthdata.physicalSign.bf.ldlc?healthdata.physicalSign.bf.ldlc:''}}
2024-05-08 10:14:53 +08:00
</view>
<view class="healthitem">
2024-05-08 18:12:17 +08:00
体质指数BMI){{healthdata.physicalSign.bmi.bmi?healthdata.physicalSign.bmi.bmi:''}}
2024-05-08 10:14:53 +08:00
</view>
<view class="healthitem">
2024-05-08 18:12:17 +08:00
腰围cm{{healthdata.physicalSign.waist.waist?healthdata.physicalSign.waist.waist:''}}
2024-05-08 10:14:53 +08:00
</view>
</view>
<!-- 折线图 -->
<view class="zx">
2024-05-08 15:44:08 +08:00
<view class="title">
血脂变化趋势
</view>
2024-05-08 10:14:53 +08:00
<qiun-data-charts type="line" loadingType="0" :opts="line_opts" :ontouch="true" :chartData="datalist" />
</view>
2024-05-08 15:44:08 +08:00
<view class="zx">
<view class="title">
空腹血糖变化趋势
</view>
<qiun-data-charts type="line" loadingType="0" :opts="line_opts" :ontouch="true"
:chartData="bloodsugar" />
</view>
<view class="zx">
<view class="title">
体质指数变化趋势
</view>
<qiun-data-charts type="line" loadingType="0" :opts="line_opts" :ontouch="true" :chartData="BMIdata" />
</view>
<view class="zx">
<view class="title">
血脂变化趋势
</view>
<qiun-data-charts type="line" loadingType="0" :opts="line_opts" :ontouch="true"
:chartData="bloodpressure" />
</view>
2024-05-08 10:14:53 +08:00
</view>
</view>
</template>
<script>
import {
healthIndexdata
} from "@/api/pagesB/threeHundredAndSixty/threeHundredAndSixty.js"
export default {
data() {
return {
2024-05-08 15:44:08 +08:00
datalist: null, //血脂
bloodsugar: null, //血糖
BMIdata: null, //体脂
bloodpressure: null, //血压
2024-05-08 10:14:53 +08:00
checked: true,
cardNo: '',
healthdata: {},
line_opts: {
color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
"#ea7ccc"
],
dataLabel: true,
enableScroll: true,
touchMoveLimit: 24,
padding: [15, 10, 0, 15],
xAxis: {
lineHeight: 40,
disableGrid: true,
boundaryGap: "center",
fontSize: 10,
type: 'grid',
gridType: 'dash',
itemCount: 3, //x轴单屏显示数据的数量默认为5个
scrollShow: true, //新增是否显示滚动条默认false
scrollAlign: 'left', //滚动条初始位置
},
yAxis: {
gridType: "dash",
dashLength: 2
},
extra: {
line: {
type: "straight",
width: 2,
activeType: "hollow"
}
}
},
}
},
onShow() {
// 健康指数
},
mounted() {
this.infohealths()
this.getServerData()
},
methods: {
infohealths() {
if (uni.getStorageSync("userinfo").cardNo) {
2024-05-10 08:29:51 +08:00
this.cardNo = uni.getStorageSync("userinfo").cardNo
2024-05-08 10:14:53 +08:00
healthIndexdata(this.cardNo).then(res => {
this.healthdata = res.data
})
}
},
getServerData() {
// if (this.healthdata) {
setTimeout(() => {
let res = {
categories: [],
series: [{
2024-05-08 15:44:08 +08:00
name: "总胆固醇",
data: []
2024-05-08 10:14:53 +08:00
},
{
2024-05-08 15:44:08 +08:00
name: "低密度脂蛋白胆固醇",
data: []
},
]
}
let resbloodsugar = {
categories: [],
series: [{
name: "空腹血糖",
data: []
},
]
}
let resBMI = {
categories: [],
series: [{
name: "体质指数",
data: []
},
]
}
let resbloodpressure = {
categories: [],
series: [{
name: "收缩压",
data: []
2024-05-08 10:14:53 +08:00
},
{
2024-05-08 15:44:08 +08:00
name: "舒张压",
data: []
},
2024-05-08 10:14:53 +08:00
]
}
2024-05-08 15:44:08 +08:00
// bf血脂变化趋势
res.series[0].data = this.healthdata.evaAnalysis.bf.series[0].data
res.series[1].data = this.healthdata.evaAnalysis.bf.series[1].data
res.categories = this.healthdata.evaAnalysis.bf.xValue
//bg血糖
resbloodsugar.series[0].data = this.healthdata.evaAnalysis.bg.series[0].data
resbloodsugar.categories = this.healthdata.evaAnalysis.bg.xValue
//bmi体脂
resBMI.series[0].data = this.healthdata.evaAnalysis.bmi.series[0].data
resBMI.categories = this.healthdata.evaAnalysis.bmi.xValue
//bp血压
resbloodpressure.series[0].data = this.healthdata.evaAnalysis.bp.series[0].data
resbloodpressure.series[1].data = this.healthdata.evaAnalysis.bp.series[1].data
resbloodpressure.categories = this.healthdata.evaAnalysis.bp.xValue
2024-05-08 10:14:53 +08:00
this.datalist = res
2024-05-08 15:44:08 +08:00
this.bloodsugar = resbloodsugar
this.BMIdata = resBMI
this.bloodpressure = resbloodpressure
2024-05-08 10:14:53 +08:00
}, 500)
},
}
}
</script>
<style lang="scss">
.app {
2024-05-10 08:47:57 +08:00
height: 100%;
2024-05-08 10:14:53 +08:00
// padding: 100rpx 40rpx;
text-align: center;
font-size: 36rpx;
2024-05-10 08:29:51 +08:00
2024-05-08 10:14:53 +08:00
// 健康
.health {
width: 100%;
margin: 0 auto;
2024-05-08 15:44:08 +08:00
2024-05-08 10:14:53 +08:00
// background: red;
.health_top {
width: 100%;
2024-05-08 15:44:08 +08:00
2024-05-08 10:14:53 +08:00
// height: 100%;
// background: #FBDA81;
.right {
position: relative;
font-size: 20rpx;
width: 30rpx;
height: 30rpx;
background: red;
top: 30rpx;
line-height: 30rpx;
left: 471rpx;
// left: 288rpx;
2024-05-08 15:44:08 +08:00
2024-05-08 10:14:53 +08:00
}
2024-05-08 15:44:08 +08:00
2024-05-08 10:14:53 +08:00
image {
width: 230rpx;
height: 230rpx;
}
2024-05-08 15:44:08 +08:00
2024-05-08 10:14:53 +08:00
.count {
position: relative;
top: -158rpx;
2024-05-08 15:44:08 +08:00
2024-05-08 10:14:53 +08:00
.numbers {
font-weight: 600;
font-size: 25rpx;
margin-bottom: 10rpx;
}
2024-05-08 15:44:08 +08:00
2024-05-08 10:14:53 +08:00
.healths {
font-size: 22rpx;
}
}
}
2024-05-08 15:44:08 +08:00
2024-05-08 10:14:53 +08:00
.health_body {
width: 100%;
2024-05-08 15:44:08 +08:00
2024-05-08 10:14:53 +08:00
.healthitem {
text-align: left;
padding: 0 0 40rpx 62rpx;
font-size: 29rpx;
2024-05-08 15:44:08 +08:00
2024-05-08 10:14:53 +08:00
// padding-bottom: 40rpx;
// position: relative;
// left: -53rpx;
2024-05-08 15:44:08 +08:00
2024-05-08 10:14:53 +08:00
}
2024-05-08 15:44:08 +08:00
2024-05-08 10:14:53 +08:00
}
2024-05-08 15:44:08 +08:00
2024-05-08 10:14:53 +08:00
.zx {
2024-05-08 15:44:08 +08:00
width: 96%;
margin: 33rpx auto;
height: 400rpx;
.title {
font-size: 25rpx;
text-align: left;
margin-left: 30rpx;
}
2024-05-08 10:14:53 +08:00
}
2024-05-08 15:44:08 +08:00
}
}
2024-05-10 08:29:51 +08:00
</style>