import request from '@/helpers/request'
import { state } from '@/state'
import { defineComponent, onMounted, ref } from 'vue'
import { useRoute } from 'vue-router'
import styles from '../information-detail.module.less'

export default defineComponent({
  name: 'notice-detail',
  setup() {
    const route = useRoute()
    const detail = ref<any>({})

    const getDetails = async () => {
      try {
        const { data } = await request.get(
          state.platformApi + '/helpCenterContent/detail/' + route.query.id
        )
        detail.value = data
      } catch {
        //
      }
    }

    onMounted(() => {
      getDetails()
    })
    return () => (
      <div class={styles.detail}>
        <div class={styles.title}>{detail.value.title}</div>
        <div class={styles.who}>
          <span>管乐团</span>
          {detail.value.createTime}
        </div>

        <div class={styles.content} v-html={detail.value.content}></div>
      </div>
    )
  }
})
