<template>
  <view>
    <view class="box">
      <view class="form lanBox">
        <view class="lan border-bottom" v-for="(item,index) in list" :key="index">
          <view class="left">
            <view class="icon">
              <icon class="t-icon" :class="'t-icon-'+item.key"></icon>
            </view>
            {{item.title}}
          </view>
          <view class="center">
            <view v-if="item.title!='肥胖等级'">
              <text>{{item.fvalue?item.fvalue:"0"}}</text><text v-if="item.dw">{{item.dw}}</text>
            </view>
            <view v-if="item.title=='肥胖等级'"><text>{{item.fevaluation}}</text></view>
          </view>
        </view>
        <!-- <view class="lan border-bottom">
					<view class="left">
						<image src="@/static/weight.png"></image>体重
					</view>
					<view class="right">{{memInfo.weight?memInfo.weight:"-"}}kg</view>
				</view>
				<view class="lan border-bottom">
					<view class="left">
						<image src="@/static/height.png"></image>身高
					</view>
					<view class="right">{{memInfo.height?memInfo.height:"-"}}cm</view>
				</view>
				<view class="lan border-bottom">
					<view class="left">
						<image src="@/static/bmi.png"></image>BMI
					</view>
					<view class="right">{{memInfo.bmi?memInfo.bmi:"-"}}</view>
				</view>
				<view class="lan border-bottom">
					<view class="left">
						<image src="@/static/fat_r.png"></image>体脂率
					</view>
					<view class="right">{{memInfo.fat_r?memInfo.fat_r:"-"}}%</view>
				</view>
				<view class="lan border-bottom">
					<view class="left">
						<image src="@/static/fat_w.png"></image>脂肪量
					</view>
					<view class="right">{{memInfo.fat_w?memInfo.fat_w:"-"}}%</view>
				</view>
				<view class="lan border-bottom">
					<view class="left">
						<image src="@/static/muscle.png"></image>肌肉率
					</view>
					<view class="right">{{memInfo.muscle?memInfo.muscle:"-"}}%</view>
				</view>
				<view class="lan border-bottom">
					<view class="left">
						<image src="@/static/water.png"></image>水分
					</view>
					<view class="right">{{memInfo.water?memInfo.water:"-"}}</view>
				</view>
				<view class="lan border-bottom">
					<view class="left">
						<image src="@/static/bone.png"></image>骨重
					</view>
					<view class="right">{{memInfo.bone?memInfo.bone:"-"}}kg</view>
				</view>
				<view class="lan border-bottom">
					<view class="left">
						<image src="@/static/visceral.png"></image>内脏指数
					</view>
					<view class="right">{{memInfo.visceral?memInfo.visceral:"-"}}</view>
				</view>
				<view class="lan border-bottom">
					<view class="left">
						<image src="@/static/sfr.png"></image>皮下脂肪
					</view>
					<view class="right">{{memInfo.sfr?memInfo.sfr:"-"}}%</view>
				</view>
				<view class="lan border-bottom">
					<view class="left">
						<image src="@/static/protein.png"></image>蛋白率
					</view>
					<view class="right">{{memInfo.protein?memInfo.protein:"-"}}%</view>
				</view>
				<view class="lan border-bottom">
					<view class="left">
						<image src="@/static/bodyage.png"></image>身体年龄
					</view>
					<view class="right">{{memInfo.bodyage?memInfo.bodyage:"-"}}</view>
				</view>
				<view class="lan border-bottom">
					<view class="left">
						<image src="@/static/kcal.png"></image>基础代谢率
					</view>
					<view class="right">{{memInfo.kcal?memInfo.kcal:'0'}}kcal</view>
				</view>
				<view class="lan border-bottom">
					<view class="left">
						<image src="@/static/muscleval.png"></image>肌肉量
					</view>
					<view class="right">{{memInfo.muscleval?memInfo.muscleval:"-"}}kg</view>
				</view>
				<view class="lan border-bottom">
					<view class="left">
						<image src="@/static/lbm.png"></image>去脂体重
					</view>
					<view class="right">{{memInfo.lbm?memInfo.lbm:"-"}}kg</view>
				</view>
				<view class="lan border-bottom">
					<view class="left">
						<image src="@/static/proteinval.png"></image>蛋白量
					</view>
					<view class="right">{{memInfo.proteinval?memInfo.proteinval:'0'}}kg</view>
				</view>
				<view class="lan border-bottom">
					<view class="left">
						<image src="@/static/fat.png"></image>肥胖等级
					</view>
					<view class="right">{{memInfo.fatlevel?memInfo.fatlevel:'0'}}</view>
				</view>
				<view class="lan border-bottom">
					<view class="left">
						<image src="@/static/body.png"></image>体型
					</view>
					<view class="right">{{memInfo.body?memInfo.body:'0'}}</view>
				</view> -->
      </view>
    </view>
  </view>
</template>

<script>
  import {
    mapState
  } from "vuex";
  export default {
    data() {
      return {
        list: {},
      };
    },
    computed: {
      ...mapState(["appTheme"])
    },
    onLoad(options) {
      // 导航栏颜色
      uni.setNavigationBarColor({
        frontColor: '#ffffff',
        backgroundColor: this.appTheme,
      })
      // 
      let info = options.index
      let memInfo = JSON.parse(info)
      this.list = this.weightInfo.infoList(memInfo)
      console.log(this.list)
    }
  };
</script>

<style scoped="scoped" lang="scss">
  .box {
    min-height: 100vh;
    background-color: #fff;
  }

  .lanBox {
    padding: 0px 15px 0;
  }

  .lan {
    display: flex;
    align-items: center;
    font-size: 14px;
    height: 50px;
    line-height: 50px;
    justify-content: space-between;
    border-bottom: 1px solid #f7f7f7;

    .left {
      display: flex;
      align-items: center;
      text-align: left;
      font-size: 14px;
      padding-left: 30px;

      .icon {
        width: 18px;
        height: 18px;
        position: absolute;
        left: 15px;
        padding: 3px;
        background-color: #aaa;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
      }

    }

    .right {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      width: 50%;
      min-height: 38px;
      box-sizing: border-box;
      line-height: 36px;
    }
  }
</style>
