import {
  d as p,
  D as A,
  T as d,
  a as e,
  F as m,
  C as _,
  J as h,
  j as a,
  I as c,
  K as F,
  S as v,
  B as f
} from './vendor.3506a68e.js'
/* empty css              */ /* empty css               */ /* empty css               */ /* empty css               */ import { C as g } from './index.9a4c80cd.js'
import { s as r, r as l, p as E, C as B } from './index.9e4b607f.js'
import { I as C } from './icon_teacher.cb128c00.js'
/* empty css               */ const D = '_openBtn_asp60_12',
  x = '_userLogo_asp60_22',
  N = '_level_asp60_50',
  b = '_cert_asp60_53',
  y = '_teacherItem_asp60_64',
  j = '_title_asp60_75',
  I = '_content_asp60_81'
var t = {
    'open-live': '_open-live_asp60_1',
    'header-content': '_header-content_asp60_6',
    openBtn: D,
    'open-teacher-info': '_open-teacher-info_asp60_16',
    userLogo: x,
    'teacher-info': '_teacher-info_asp60_33',
    'teacher-name': '_teacher-name_asp60_40',
    level: N,
    cert: b,
    'teacher-desc': '_teacher-desc_asp60_60',
    teacherItem: y,
    title: j,
    content: I,
    'open-tips': '_open-tips_asp60_88',
    'open-content': '_open-content_asp60_103',
    'cert-text': '_cert-text_asp60_117',
    'cert-img': '_cert-img_asp60_123'
  },
  L =
    'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAAXNSR0IArs4c6QAAALRQTFRFAAAA/5kz/6px/5lN/5lm/5ZI/5tX/6Rk/7eC/5VJ/5NI/6hr/51Y/7qL/7qM/51Z/6hq/5NI/6Ji/7yM/5RI/5dN/7aE/7eE/7yO/5RJ/5RJ/7yP/72P/55a/6ls/76R/5RJ/5ZN/51a/55b/59d/6Jj/6Nj/6lt/6lu/6pu/6tx/6ty/611/7N+/7iI/7uN/76R/8ij/86s/9m//97H/+PP/+zf/+3g/+3h/+/l//37////uo7UtgAAACB0Uk5TAAUJCgouODg5k5Wen6CgoaG7xsbX1+Li4/j9/f3+/v77Ap2qAAAAo0lEQVQY0yWLQW6DMBQFh29jQYnaJvtKvf/ZsklEgsDmvSy8HM3MADCVr+y2th0YIJbbFVS1PddGJq5/gKqY53icics/oHE5jKa2x3QDVMdISHyXGPtvkKCUWPoPFuA5cmfTADtnd1/VwDa59v5J5xovATpjwja8o21g8fuTbDhqOoeLBEkvA/c90c4J2DcDj5WEjpaTbTjuqxkASpkz9V0r8AG2xm36KYuxVQAAAABJRU5ErkJggg==',
  T = './assets/2.d60d5fe9.png',
  k = './assets/3.a6301a1a.png',
  w = p({
    name: 'live-cert',
    computed: {
      users() {
        return r.user.data
      },
      btnStatus() {
        const s = this.users,
          u = this.fansNum,
          n = this.overClassNum
        return (
          (s == null ? void 0 : s.fansNum) >= u &&
          (s == null ? void 0 : s.expTime) >= n
        )
      }
    },
    data() {
      return { fansNum: 0, overClassNum: 0 }
    },
    async mounted() {
      var u, n
      const s = (u = r.user.data) == null ? void 0 : u.liveFlag
      r.openLiveStatus = s === 1
      try {
        ;(
          await l.get('/api-teacher/sysConfig/queryByParamNameList', {
            params: { paramNames: 'open_live_fans_num,open_list_over_class' }
          })
        ).data.forEach(o => {
          o.paramName === 'open_live_fans_num'
            ? (this.fansNum = Number(o.paramValue))
            : o.paramName === 'open_list_over_class' &&
              (this.overClassNum = Number(o.paramValue))
        }),
          ((n = r.user.data) == null ? void 0 : n.entryFlag) ||
            A.alert({
              message:
                '\u60A8\u5C1A\u672A\u5B8C\u6210\u8FBE\u4EBA\u8BA4\u8BC1\uFF0C\u8FBE\u4EBA\u8BA4\u8BC1\u540E\u624D\u53EF\u5F00\u901A\u76F4\u64AD\u6743\u9650\u54E6\uFF01',
              confirmButtonColor: '#01C1B5'
            }).then(() => {
              this.$router.replace('/teacherCert')
            })
      } catch {}
    },
    methods: {
      async onOpenLive() {
        try {
          await l.get('/api-teacher/teacher/openLive', {}),
            d('\u5F00\u901A\u6210\u529F'),
            setTimeout(() => {
              E({ api: 'back' })
            }, 1e3)
        } catch {}
      }
    },
    render() {
      return e(m, null, [
        r.openLiveStatus
          ? e(
              B,
              {
                classImgSize: 'CERT',
                type: 'liveCert',
                style: { paddingTop: '60px' },
                tips: '\u5F00\u901A\u6210\u529F\uFF0C\u5FEB\u53BB\u5F00\u542F\u76F4\u64AD\u6216\u521B\u5EFA\u76F4\u64AD\u8BFE\u5427'
              },
              null
            )
          : e('div', { class: t['open-live'] }, [
              e(g, { background: 'transparent', border: !1, title: ' ' }, null),
              e(
                _,
                { class: t['open-teacher-info'], border: !1 },
                {
                  default: () => {
                    var s, u, n, i
                    return [
                      e('div', { class: t['teacher-info'] }, [
                        e('div', { class: t['teacher-name'] }, [
                          ((s = this.users) == null ? void 0 : s.username) ||
                            `\u6E38\u5BA2${
                              (u = this.users) == null ? void 0 : u.userId
                            }`
                        ]),
                        e('div', { class: t.level }, [
                          ((n = this.users) == null ? void 0 : n.starGrade)
                            ? e(
                                h,
                                {
                                  modelValue:
                                    (i = this.users) == null
                                      ? void 0
                                      : i.starGrade,
                                  iconPrefix: 'iconfont',
                                  color: '#FFC459',
                                  'void-icon': 'star_default',
                                  icon: 'star_active',
                                  size: 15
                                },
                                null
                              )
                            : e(
                                'span',
                                {
                                  style: { fontSize: '12px', color: '#999999' }
                                },
                                [a('\u6682\u65E0\u8BC4\u5206')]
                              )
                        ])
                      ])
                    ]
                  },
                  icon: () => {
                    var s
                    return e(
                      c,
                      {
                        class: t.userLogo,
                        src:
                          ((s = this.users) == null ? void 0 : s.headUrl) || C,
                        fit: 'cover'
                      },
                      null
                    )
                  }
                }
              ),
              e('div', { class: t['teacher-desc'] }, [
                e('div', { class: [t.teacherItem] }, [
                  e('div', { class: t.content }, [a('\u7C89\u4E1D')]),
                  e('div', { class: t.title }, [this.fansNum])
                ]),
                e(
                  'div',
                  { class: t.teacherItem, style: { textAlign: 'right' } },
                  [
                    e('div', { class: t.content }, [
                      a('\u5DF2\u4E0A\u8BFE\u65F6')
                    ]),
                    e('div', { class: t.title }, [this.overClassNum])
                  ]
                )
              ]),
              this.btnStatus
                ? null
                : e('div', { class: t['open-tips'] }, [
                    e(F, { name: L, size: '16' }, null),
                    e('p', null, [
                      a(
                        '\u4F60\u5C1A\u672A\u8FBE\u5230\u5F00\u901A\u76F4\u64AD\u7684\u6761\u4EF6'
                      )
                    ])
                  ]),
              e('div', { class: t['open-content'] }, [
                e('h2', null, [a('\u76F4\u64AD')]),
                e('p', { class: t['cert-text'] }, [
                  a(
                    '\u5F00\u901A\u76F4\u64AD\u529F\u80FD\u540E\uFF0C\u60A8\u53EF\u4EE5\u521B\u5EFA\u81EA\u5DF1\u7684\u76F4\u64AD\u95F4\u5F00\u542F\u76F4\u64AD\u3002'
                  )
                ]),
                e('p', { class: t['cert-img'] }, [
                  e(
                    c,
                    { src: T, width: '100%', height: '150px', fit: 'contain' },
                    null
                  )
                ]),
                e('h2', null, [a('\u76F4\u64AD\u8BFE')]),
                e('p', { class: t['cert-text'] }, [
                  a(
                    '\u60A8\u53EF\u5236\u5B9A\u6559\u5B66\u65B9\u6848\u8BBE\u7F6E\u76F4\u64AD\u8BFE\u7A0B\uFF0C\u5B66\u5458\u8D2D\u4E70\u540E\uFF0C\u60A8\u53EF\u5728\u76F4\u64AD\u95F4\u5BF9\u8D2D\u4E70\u76F4\u64AD\u8BFE\u7684\u5B66\u5458\u8FDB\u884C\u76F4\u64AD\u6559\u5B66\uFF0C\u76F4\u64AD\u8BFE\u7A0B\u65E0\u4EBA\u6570\u4E0A\u9650\uFF0C\u53EF\u6781\u5927\u7684\u63D0\u9AD8\u8BFE\u7A0B\u6536\u5165\u3002'
                  )
                ]),
                e('p', { class: t['cert-img'] }, [
                  e(
                    c,
                    { src: k, width: '100%', height: '150px', fit: 'contain' },
                    null
                  )
                ])
              ]),
              e(
                v,
                { offsetBottom: 0, position: 'bottom' },
                {
                  default: () => [
                    e('div', { class: [t['header-content'], 'btnGroup'] }, [
                      e(
                        f,
                        {
                          round: !0,
                          plain: !0,
                          block: !0,
                          disabled: !this.btnStatus,
                          class: t.openBtn,
                          onClick: this.onOpenLive
                        },
                        null
                      )
                    ])
                  ]
                }
              )
            ])
      ])
    }
  })
export { w as default }
