<route lang="json5" type="page">
{
  style: {
    navigationStyle: 'custom',
    transparentTitle: 'always',
    navigationBarTitleText: '',
  },
}
</route>

<template>
  <view class="flex flex-col h-screen">
    <Navbar
      class="bg-white"
      :bordered="false"
      left-arrow
      placeholder
      @click-left="navigatorBack"
      title="招生简章"
    />
    <text class="font-semibold text-[28rpx] text-[#1F2329] mx-auto">
      {{ detail?.title }}
    </text>
    <view class="w-full h-[1px] bg-[#E5E5E5] my-[16rpx]"></view>
    <scroll-view class="flex-1 flex justify-center" :scroll-y="true" :scroll-x="true">
      <view class="px-[32rpx]" v-html="detail?.content"></view>
    </scroll-view>
  </view>
</template>

<script lang="ts" setup>
import { getRecruitsDetail } from '@/service/index/api'
import Navbar from '@/pages-sub/components/navbar/Navbar.vue'

const navigatorBack = () => {
  uni.navigateBack()
}

type UniversityEnrollmentBrochure = {
  artsys_url: string
  base_college_id: number
  college_name: string
  content: string
  create_time: number
  id: number
  is_artsys: number
  title: string
  year: string
}

const detail = ref<UniversityEnrollmentBrochure>()

onLoad((options) => {
  const _id = options.id || 0
  getRecruitsDetail({ id: _id }).then((resp) => {
    detail.value = resp.result as UniversityEnrollmentBrochure
  })
})
</script>
