import { Popup } from 'vant'
import { defineComponent, reactive } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import NoticeStart from '../model/notice-start'
import styles from './index.module.less'

export default defineComponent({
  name: 'unit-detail',
  setup() {
    const route = useRoute()
    const router = useRouter()
    const state = reactive({
      visiableNotice: false
    })
    return () => (
      <div class={styles.unitDetail}>
        详情
        {/* 测验须知 */}
        <Popup
          v-model:show={state.visiableNotice}
          round
          style={{ width: '90%' }}
          closeOnClickOverlay={false}
        >
          <NoticeStart
            onClose={() => {
              state.visiableNotice = false
              router.back()
            }}
            onConfirm={() => {
              console.log('start')
            }}
          />
        </Popup>
      </div>
    )
  }
})
