<template>
  <div class="page" v-loading.body.fullscreen="fullscreenLoading" element-loading-background="rgba(255, 255, 255, 0)">
    <van-sticky class="sticky">
      <div class="header">
        <div class="back">
          <backIcon/>
        </div>
        <!-- 公告详情 -->
        {{ $t('tab.tab12') }}
        <div class="right-box flex">
          <shareIcon />
          <msgIcon />
        </div>
      </div>
    </van-sticky>
    <div v-if="info.id" class="container">
      <div class="title">{{ info.title }}</div>
      <div class="time-box flex">
        <div>{{ info.created_at }}</div>
      </div>
      <div class="content" v-html="info.content || info.title"></div>
    </div>
  </div>
</template>
<script>
import { getFaSupportByID } from "@/api/app";
import { getCmsNewsInfo } from "@/api/notice";
export default {
  data () {
    return {
      info: {},
      list: []
    }
  },
  created () {
    this.getCmsNewsInfo()
    // if (this.$route.params.sign) {
    // } else {
    //   this.getFaSupportByID()
    // }
  },
  methods: {
    getCmsNewsInfo() {
      this.fullscreenLoading = true
      getCmsNewsInfo({
        id: this.$route.params.id
      }).then(res => {
        this.info = res || {}
      }).catch(() => {}).finally(() => {
        this.fullscreenLoading = false;
      })
    },
    getFaSupportByID() {
      this.fullscreenLoading = true
      getFaSupportByID({
        id: this.$route.params.id
      }).then(res => {
        this.info = res || {}
      }).catch(() => {}).finally(() => {
        this.fullscreenLoading = false;
      })
    },
  }
}
</script>
<style lang="less" scoped>
.page {
  background-color: #F6FAFE;
}
.sticky {
  background-color: var(--bg-);
}
.header {
  position: relative;
  font-size: 18px;
  font-weight: 600;
  padding: 15px 9px 17px;
  background-color: var(--bg-);
  text-align: center;
  .back {
    position: absolute;
    top: 11px;
    left: 9px;
  }
  .right-box {
    position: absolute;
    top: 11px;
    right: 14px;
    column-gap: 15px;
  }
}
.container {
  padding: 10px 18px 20px;
  background-color: #fff;
}
.title {
  font-size: 20px;
  color: var(--color-1-);
  line-height: 30px;
  font-weight: 600;
  margin-bottom: 9px;
}
.time-box {
  color: #878787;
  margin-bottom: 22px;
  column-gap: 12px;
}
::v-deep .content {
  word-break: break-all;
  font-size: 18px;
  color: #3D3C3C;
  line-height: 32px;
  P {
    font-size: 18px;
    color: #3D3C3C;
    line-height: 32px;
  }
  img {
    max-width: 100%;
    height: auto !important;
  }
  h1 {
    padding: 10px 0;
    line-height: 1.2em;
  }
}
</style>