<template>
  <div class="page_allDryWeight">
    <van-sticky>
      <div class="allDryWeightTitle">
        <i class="iconfont icon-zuojiantou jiantou" @click="$router.go(-1)"></i>
        <span class="titleName">{{ drydetail.name }}的干体重</span>
      </div>
    </van-sticky>
    <div class="dryWeightBox">
      <div class="dryWeightOne">
        <div class="time">{{ getTime(drydetail.ctime) }}</div>
        <div class="weightContent">
          <p>干体重：{{ drydetail.dry_weight }}kg</p>
          <p>上调：{{ drydetail.adjusted_value }}kg</p>
        </div>
        <div class="doctorBox">
          <p>记录医生：{{ drydetail.user_name }}</p>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import "../../styles/resetStyle.scss";
import { getDryWeightDetail } from "@/api/patient/patient";
import { uParseTime } from "@/utils/tools";
import { setRem, setHeight } from "@/libs/functionRem";
export default {
  data() {
    return {
      drydetail: {},
      patientid: 0,
      active: 0
    };
  },
  methods: {
    getDryWeightDetail(id) {
      getDryWeightDetail(id).then(response => {
        if (response.data.state === 1) {
          var drydetail = response.data.data.drydetail;
          this.drydetail = drydetail;
        }
      });
    },
    getTime(time) {
      // return uParseTime(time, "{y}-{m}-{d} {h}:{i}:{s}");
      return uParseTime(time, "{y}-{m}-{d}");
    },
    toReturn() {
      this.$router.push(
        "/patientdetail?patientid=" + this.patientid + "&active=" + this.active
      );
    }
  },
  created() {
    this.active = parseInt(this.$route.query.active);
    setRem();
    setHeight();
    var id = this.$route.query.id;
    var patientid = this.$route.query.patientid;
    this.patientid = patientid;
    this.getDryWeightDetail(id);
  }
};
</script>
<style lang="scss" scoped>
.page_allDryWeight {
  height: 100%;
  overflow-y: auto;
  .allDryWeightTitle {
    background: #fff;
    padding: 0 1.125rem;
    height: 3.125rem;
    display: flex;
    align-items: center;
  }
  .jiantou {
    font-size: 1.5rem;
    font-weight: 600;
    margin-right: 6rem;
  }
  .titleName {
    font-size: 1.125rem;
    font-weight: 600;
  }
  .dryWeightBox {
    padding: 0 1.125rem;
    margin-bottom: 3.125rem;
  }
  .dryWeightOne {
    box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.1);
    padding-bottom: 1.25rem;
    .time {
      font-size: 1.125rem;
      margin-top: 0.625rem;
      font-weight: bold;
    }
  }
  .weightContent {
    font-size: 0.875rem;
    color: rgba(49, 50, 52, 1);
    display: flex;
    p {
      line-height: 1.125rem;
      margin-right: 0.625rem;
      margin-top: 0.375rem;
    }
  }
  .doctorBox {
    font-size: 0.75rem;
    color: rgba(152, 152, 152, 1);
    line-height: 1.125rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.625rem;
  }
}
::-webkit-scrollbar {
  width: 0;
}
</style>
