<template>
  <div class="page_allEducation">
    <van-sticky>
      <div class="allEducationTitle">
        <i class="iconfont icon-zuojiantou jiantou" @click="toReturn"></i>
        <span class="titleName">{{ education.name }}的宣教信息</span>
      </div>
    </van-sticky>
    <div class="courseBox">
      <div class="courseOne">
        <div class="statOrder">
          <p class="time">{{ getTime(education.assessment_date) }}</p>
          <div class="orderContent">
            <p>
              {{ education.mission }}
            </p>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { getEducationDetail } from '@/api/patient/patient'
import { uParseTime } from '@/utils/tools'
import { setRem, setHeight } from '@/libs/functionRem'
import '../../../styles/resetStyle.scss'
export default {
  data () {
    return {
      patientid: 0,
      active: 0,
      education: {},
      date: 0,
      patient_name: ''
    }
  },
  methods: {
    toReturn () {
      this.$router.push(
        '/details?patient_id=' + this.patientid + '&date=' + this.date + '&patient_name=' + this.patient_name + '&active1=' + 1 + '&active2=' + 8
      )
    },
    getEducationDetail (id) {
      getEducationDetail(id).then(response => {
        if (response.data.state === 1) {
          var education = response.data.data.education
          this.education = education
        }
      })
    },
    getTime (time) {
      // return uParseTime(time, "{y}-{m}-{d} {h}:{i}:{s}");
      return uParseTime(time, '{y}-{m}-{d}')
    }
  },
  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.getEducationDetail(id)
    this.date = this.$route.query.date
    this.patient_name = this.$route.query.patient_name
  }
}
</script>
<style lang="scss" scoped>
.page_allEducation {
  height: 100%;
  overflow-y: auto;
  .allEducationTitle {
    background: #fff;
    padding: 0 1.125rem;
    height: 3.125rem;
    display: flex;
    align-items: center;
  }
  .jiantou {
    font-size: 1.5rem;
    font-weight: 600;
    margin-right: 5.5rem;
  }
  .titleName {
    font-size: 1.125rem;
    font-weight: 600;
  }
  .courseBox {
    padding: 0 1.125rem;
    margin-bottom: 3.125rem;
  }
  .courseOne {
    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;
    }
  }
  .statOrderTitle {
    color: #5b98ff;
    font-size: 0.8125rem;
    font-weight: bold;
    margin: 0.625rem 0;
  }
  .orderContent {
    font-size: 0.875rem;
    color: rgba(49, 50, 52, 1);
    p {
      line-height: 1.125rem;
    }
  }
  .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>
