<template>
  <div class="inform-content">
    <EventBasicInfo from="通知" />
  
    <button
      class="uploadBtn"
      v-if="hidebuttonCondition()"
      @click="gotoTargetPage()"
    >
      {{$t('studentWeb.view')}} →
    </button>
     <div v-if="this.$store.getters.getItemTitle.eventType == '公告'">
         <BillBoarfandLightBox/>
     </div>
      <div v-if="this.$store.getters.getItemTitle.eventType == '教師私訊'">
          <br/>
        <div class='dec'>
            {{this.$store.getters.getItemTitle.teacherMessage.teacherMessage}}
        </div>
        <div class='isRead'>
            <svg-icon icon-class="isDone" class="isDone-Icon" /> {{$t('studentWeb.read')}}
        </div>
     </div>
  </div>
</template>

<script>
import EventBasicInfo from "../EventBasicInfo";
import BillBoarfandLightBox from "../EventView/BillBoardandLightBox"
export default {
  name: "InformContent",
   components: {
    EventBasicInfo,BillBoarfandLightBox
  },
  data() {
    return {
      eventPageType: ["課前預習", "評量", "作業", "投票","問卷"], //本頁出現的類型
    };
  },
  methods: {
    hidebuttonCondition() {
      if (
        this.$store.getters.getItemTitle.eventType == "公告" ||
        this.$store.getters.getItemTitle.eventType == "教師私訊"
      )
        return false;
      else return true;
    },
    gotoTargetPage() {
        if(this.eventPageType.includes(this.$store.getters.getItemTitle.eventType)){
            this.$router.push("/studentWeb/eventView#" +  this.$store.getters.getItemTitle.eventID);}
        if(this.$store.getters.getItemTitle.eventType=='Hiteach電子筆記'){
            this.$router.push("/studentWeb/hiteachView" );
        }
    },
  },
 
};
</script>

<style scoped>
@import '~@/assets/student-web/component_styles/inform-content.css';
</style>
