|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
<template> |
|
|
|
|
<a :href="com_edu_url + '/v2'" class="til f16 fw600" v-if="form.status === 1" target="_blank"> |
|
|
|
|
<a :href="com_edu_url + '/v2'" class="til f16 fw600" v-if="isTeacher" target="_blank"> |
|
|
|
|
<div class="item-nav apply_trigger_btn"> |
|
|
|
|
<i class="iconfont icon-icon_icon-37" /> |
|
|
|
|
讲师工作台 |
|
|
|
@ -68,13 +68,17 @@
|
|
|
|
|
import {defineComponent, reactive, ref} from 'vue' |
|
|
|
|
import teacherApplyUpload from './Upload/TeacherApplyUpload'; |
|
|
|
|
import { ElMessage } from 'element-plus' |
|
|
|
|
import { addTeacher, getTeacherInfo, editTeacher, getUserInfo } from "../../api/teacher" |
|
|
|
|
import { addTeacher, getTeacherInfo, editTeacher, judgeIsTeacher } from "../../api/teacher" |
|
|
|
|
export default defineComponent({ |
|
|
|
|
name: 'TeacherApplyModal', |
|
|
|
|
props:{ |
|
|
|
|
uid:undefined |
|
|
|
|
}, |
|
|
|
|
components:{ |
|
|
|
|
teacherApplyUpload |
|
|
|
|
}, |
|
|
|
|
setup() { |
|
|
|
|
setup(props) { |
|
|
|
|
const isTeacher = ref(false); |
|
|
|
|
const dialogVisible = ref(false); |
|
|
|
|
const qrDialogVisible = ref(false); |
|
|
|
|
const submitLoading = ref(false); |
|
|
|
@ -87,29 +91,31 @@ export default defineComponent({
|
|
|
|
|
introduction: '', |
|
|
|
|
avatar:'', |
|
|
|
|
}) |
|
|
|
|
const showModal = () => { |
|
|
|
|
dialogVisible.value = true |
|
|
|
|
const judgeIfTeacher = async () => { |
|
|
|
|
const judgeRes = await judgeIsTeacher(props.uid) |
|
|
|
|
if (judgeRes.code === 200){ |
|
|
|
|
isTeacher.value = judgeRes.data; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// 获取讲师资料 |
|
|
|
|
judgeIfTeacher(); |
|
|
|
|
const getInfo = async () => { |
|
|
|
|
const userInfoRes = await getUserInfo(); |
|
|
|
|
console.log('获取用户资料'); |
|
|
|
|
const res = await getTeacherInfo(); |
|
|
|
|
if (userInfoRes.code === 200 && userInfoRes.data){ |
|
|
|
|
const {mobile} = userInfoRes.data; |
|
|
|
|
form.phone = mobile; |
|
|
|
|
} |
|
|
|
|
if (res.code === 200 && res.data){ |
|
|
|
|
const {name = '', avatar = '',introduction = '', id= ''} = res.data; |
|
|
|
|
const {name = '', avatar = '',introduction = '', id= '', phone=''} = res.data; |
|
|
|
|
form.phone = phone; |
|
|
|
|
form.name = name; |
|
|
|
|
form.avatar = avatar; |
|
|
|
|
form.introduction = introduction; |
|
|
|
|
form.teacherId = id; |
|
|
|
|
form.status=res.data.approvalState; |
|
|
|
|
} |
|
|
|
|
console.log('讲师资料是'); |
|
|
|
|
console.log(res); |
|
|
|
|
} |
|
|
|
|
getInfo(); |
|
|
|
|
const showModal = () => { |
|
|
|
|
getInfo(); |
|
|
|
|
dialogVisible.value = true |
|
|
|
|
} |
|
|
|
|
// 获取讲师资料 |
|
|
|
|
const rules = reactive({ |
|
|
|
|
name: [ |
|
|
|
|
{ required: true, message: '请输入讲师姓名', trigger: 'blur' }, |
|
|
|
@ -168,6 +174,7 @@ export default defineComponent({
|
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
return { |
|
|
|
|
isTeacher, |
|
|
|
|
dialogVisible, |
|
|
|
|
form, |
|
|
|
|
ruleFormRef, |
|
|
|
|