帮助了 AmazingCounters.com 位小伙伴

BMI

 

 

 

      getBMI(){
        let userInfo = uni.getStorageSync("userInfo");
        let { weight,height,gender} = {...userInfo};
        this.gender = gender; // 获取用户的性别信息
        if(weight && height){
          let bmi = weight * 10000 / (height * height);
          if(18.5< bmi <= 24){
            this.bmiType = 1;
          }else {
            this.bmiType = 2;
            this.bmiMsk = '多多注意!'
          }
          this.bmi = parseInt(bmi);
        }else {
          this.bmiType = 3;
        }
      },

 

posted on 2022-06-28 15:28  云的旋律  阅读(36)  评论(0编辑  收藏  举报

导航

前端攻城狮分享群