index.tsx 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import { state } from '@/state'
  2. import { defineComponent } from 'vue'
  3. import Auth from './components/auth'
  4. import CertBrief from './components/cert-brief'
  5. import { teacherState } from './teacherState'
  6. export const getAssetsHomeFile = (fileName: string) => {
  7. const path = `../images/${fileName}`
  8. const modules = import.meta.globEager('../images/*')
  9. return modules[path].default
  10. }
  11. export default defineComponent({
  12. name: 'teacherAuth',
  13. async mounted() {
  14. try {
  15. // 判断是否登录
  16. if (state.user.status !== 'login') {
  17. return
  18. }
  19. // 老师入驻状态 0、未申请 UNPAALY、未申请 DOING、审核中 PASS、通过 UNPASS、不通过
  20. const entryStatus = state.user.data?.entryStatus || 0
  21. teacherState.authStatus =
  22. entryStatus === 'DOING' || entryStatus === 'PASS' ? true : false
  23. // 如果已经认证,则不用获取声部信息
  24. // if (teacherState.authStatus) {
  25. // teacherState.active = teacherState.authStatus ? 4 : 1
  26. // return
  27. // }
  28. // console.log(teacherState.authStatus, 'teacherState.authStatus')
  29. } catch {
  30. //
  31. }
  32. },
  33. computed: {
  34. authStatus(): Boolean {
  35. const entryStatus = state.user.data?.entryStatus || 0
  36. return entryStatus === 'DOING' || entryStatus === 'PASS' ? true : false
  37. },
  38. userAuth() {
  39. // 判断是否实名过
  40. const users = state.user.data || {}
  41. return !!(users.idCardNo && users.realName)
  42. }
  43. },
  44. render() {
  45. return (
  46. <div class="mt-[62px] bg-white min-h-full m-auto text-[#333]">
  47. {this.authStatus || !teacherState.nextStatus ? <CertBrief /> : <Auth />}
  48. {/* <Auth /> */}
  49. </div>
  50. )
  51. }
  52. })