;(function () {
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
    try {
      var info = gen[key](arg)
      var value = info.value
    } catch (error) {
      reject(error)
      return
    }
    if (info.done) {
      resolve(value)
    } else {
      Promise.resolve(value).then(_next, _throw)
    }
  }
  function _asyncToGenerator(fn) {
    return function () {
      var self = this,
        args = arguments
      return new Promise(function (resolve, reject) {
        var gen = fn.apply(self, args)
        function _next(value) {
          asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'next', value)
        }
        function _throw(err) {
          asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'throw', err)
        }
        _next(undefined)
      })
    }
  }
  System.register(
    [
      './index-legacy.595c24c3.js',
      './index-legacy.53480b15.js',
      './vendor-legacy.09f20d09.js',
      './cert-three-legacy.bdeeaeea.js',
      './teacherState-legacy.d0f9c7b7.js',
      './index-legacy.c1757005.js',
      './index-legacy.637f35563.js',
      './index-legacy.8feab2fc.js',
      './index-legacy.f25f109a2.js',
      './index-legacy.637f3556.js',
      './index-legacy.f25f109a15.js',
      './index-legacy.f25f109a.js',
      './index-legacy.f25f109a5.js'
    ],
    function (exports) {
      'use strict'
      var state,
        request,
        ColResult,
        ColSticky,
        defineComponent,
        Dialog,
        Toast,
        createVNode,
        Fragment,
        Button,
        CertThree,
        teacherState
      return {
        setters: [
          function (module) {
            state = module.s
            request = module.r
            ColResult = module.C
          },
          function (module) {
            ColSticky = module.C
          },
          function (module) {
            defineComponent = module.d
            Dialog = module.D
            Toast = module.T
            createVNode = module.a
            Fragment = module.F
            Button = module.B
          },
          function (module) {
            CertThree = module.C
          },
          function (module) {
            teacherState = module.t
          },
          function () {},
          function () {},
          function () {},
          function () {},
          function () {},
          function () {},
          function () {},
          function () {}
        ],
        execute: function execute() {
          var index = exports(
            'default',
            defineComponent({
              name: 'teacher-cert-update',
              data: function data() {
                return { authStatus: false }
              },
              mounted: function mounted() {
                var _this = this
                return _asyncToGenerator(
                  /*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
                    var _state$user$data, teacherInfo, info, entryStatus
                    return regeneratorRuntime.wrap(
                      function _callee$(_context) {
                        while (1) {
                          switch ((_context.prev = _context.next)) {
                            case 0:
                              _context.prev = 0
                              if (
                                (_state$user$data = state.user.data) !== null &&
                                _state$user$data !== void 0 &&
                                _state$user$data.entryFlag
                              ) {
                                _context.next = 4
                                break
                              }
                              Dialog.alert({
                                message:
                                  '您尚未完成达人认证，达人认证后才可更新资料哦！',
                                confirmButtonColor: '#01C1B5'
                              }).then(function () {
                                _this.$router.replace('/teacherCert')
                              })
                              return _context.abrupt('return')
                            case 4:
                              _context.next = 6
                              return request.get(
                                '/api-teacher/teacherAuthEntryRecord/getLastRecordByUserId'
                              )
                            case 6:
                              teacherInfo = _context.sent
                              info = teacherInfo.data || {} // 老师入驻状态 0、未申请 UNPAALY、未申请 DOING、审核中 PASS、通过 UNPASS、不通过
                              entryStatus = info.teacherAuthStatus || 0
                              _this.authStatus =
                                entryStatus === 'DOING' ? true : false
                              teacherState.teacherCert.graduateSchool =
                                info.graduateSchool
                              teacherState.teacherCert.subject = info.subject
                              teacherState.teacherCert.subjectId =
                                info.subjectId
                              teacherState.teacherCert.introduction =
                                info.introduction
                              teacherState.teacherCert.styleVideoJson =
                                info.styleVideoJson
                              teacherState.teacherCert.gradCertificate =
                                info.gradCertificate
                              teacherState.teacherCert.degreeCertificate =
                                info.degreeCertificate
                              teacherState.teacherCert.teacherCertificate =
                                info.teacherCertificate
                              _context.next = 22
                              break
                            case 20:
                              _context.prev = 20
                              _context.t0 = _context['catch'](0)
                            case 22:
                            case 'end':
                              return _context.stop()
                          }
                        }
                      },
                      _callee,
                      null,
                      [[0, 20]]
                    )
                  })
                )()
              },
              methods: {
                onSubmit: function onSubmit() {
                  var _this2 = this
                  return _asyncToGenerator(
                    /*#__PURE__*/ regeneratorRuntime.mark(function _callee2() {
                      var teacherCert
                      return regeneratorRuntime.wrap(function _callee2$(
                        _context2
                      ) {
                        while (1) {
                          switch ((_context2.prev = _context2.next)) {
                            case 0:
                              teacherCert = teacherState.teacherCert
                              if (teacherCert.graduateSchool) {
                                _context2.next = 4
                                break
                              }
                              Toast('请输入您的毕业院校')
                              return _context2.abrupt('return')
                            case 4:
                              if (teacherCert.subject) {
                                _context2.next = 7
                                break
                              }
                              Toast('请输入您的专业')
                              return _context2.abrupt('return')
                            case 7:
                              _context2.next = 9
                              return request.post(
                                '/api-teacher/teacherAuthEntryRecord/doApply',
                                {
                                  data: {
                                    graduateSchool: teacherCert.graduateSchool,
                                    subject: teacherCert.subject,
                                    subjectId: teacherCert.subjectId,
                                    introduction: teacherCert.introduction,
                                    styleVideoJson: teacherCert.styleVideoJson,
                                    gradCertificate:
                                      teacherCert.gradCertificate,
                                    degreeCertificate:
                                      teacherCert.degreeCertificate,
                                    teacherCertificate:
                                      teacherCert.teacherCertificate
                                  }
                                }
                              )
                            case 9:
                              Toast('提交成功')
                              _this2.authStatus = true
                            case 11:
                            case 'end':
                              return _context2.stop()
                          }
                        }
                      },
                      _callee2)
                    })
                  )()
                }
              },
              render: function render() {
                var _this3 = this
                return createVNode(Fragment, null, [
                  this.authStatus
                    ? createVNode(
                        ColResult,
                        {
                          type: 'teacherCert',
                          style: { paddingTop: '60px' },
                          classImgSize: 'CERT',
                          tips: '感谢您的申请，小酷将在24小时内完成审核，请留意APP消息及短信获取审核结果。'
                        },
                        null
                      )
                    : createVNode('div', { style: { paddingTop: '12px' } }, [
                        createVNode(CertThree, null, null),
                        createVNode(
                          ColSticky,
                          { position: 'bottom' },
                          {
                            default: function _default() {
                              return [
                                createVNode(
                                  'div',
                                  {
                                    class: ['btnGroup'],
                                    style: { paddingTop: '12px' }
                                  },
                                  [
                                    createVNode(
                                      Button,
                                      {
                                        block: true,
                                        round: true,
                                        onClick: _this3.onSubmit,
                                        type: 'primary',
                                        text: '提交审核'
                                      },
                                      null
                                    )
                                  ]
                                )
                              ]
                            }
                          }
                        )
                      ])
                ])
              }
            })
          )
        }
      }
    }
  )
})()
