From 54c081ee2ca3e5e937dfcc780f7e8b944cff04b3 Mon Sep 17 00:00:00 2001 From: chenJinxu <2183691628@qq.com> Date: Thu, 11 Apr 2024 14:19:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20=E8=BA=AB=E9=AB=98?= =?UTF-8?q?=E4=BD=93=E9=87=8D=E5=BD=95=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/filters/filter.js | 8 +- src/views/insight/index.vue | 134 ++++++++++++++++++++---------- src/views/insight/signsReport.vue | 18 ++-- 3 files changed, 106 insertions(+), 54 deletions(-) diff --git a/src/filters/filter.js b/src/filters/filter.js index a4d895d..2f977eb 100644 --- a/src/filters/filter.js +++ b/src/filters/filter.js @@ -46,15 +46,19 @@ export function calcBMI(height, weight) { const bmiObj = {}; // 计算 BMI 指数 const bmi = weight / (realHeight * realHeight); - bmiObj.bmi = bmi; + bmiObj.bmi = bmi.toFixed(1); if (bmi < 18.5) { bmiObj.result = '体重过轻'; + bmiObj.color = '#2ea7e0'; } else if (bmi >= 18.5 && bmi < 24.9) { bmiObj.result = '正常体重'; + bmiObj.color = '#189b3b'; } else if (bmi >= 25 && bmi < 29.9) { bmiObj.result = '超重'; + bmiObj.color = '#ff5f8b'; } else { - bmiObj.result = '肥胖'; + bmiObj.color = '#189b3b'; + bmiObj.result = '暂无数据'; } return bmiObj; } diff --git a/src/views/insight/index.vue b/src/views/insight/index.vue index 7dc94f4..ff9c419 100644 --- a/src/views/insight/index.vue +++ b/src/views/insight/index.vue @@ -64,8 +64,8 @@
{{ bmi.result }}