diff --git a/src/api/lbt.js b/src/api/lbt.js index 2ea8b60..3ceb140 100644 --- a/src/api/lbt.js +++ b/src/api/lbt.js @@ -17,7 +17,7 @@ const api = { }, editLbtManage : data => { return service({ - url: '/sys-index-lbt/'+data.ID, + url: '/sys-index-lbt/'+data.banner_id, method: 'put', data }) diff --git a/src/api/market.js b/src/api/market.js new file mode 100644 index 0000000..4a8924e --- /dev/null +++ b/src/api/market.js @@ -0,0 +1,19 @@ +import service from '@/utils/request' +const api = { + /*助教*/ + getAssistantList : data => { // 助教列表 + return service({ + url: '/assistant', + method: 'get', + params:data + }) + }, + getAssistantDetail: data => { // 助教详情 + return service({ + url: '/assistant/'+data.id, + method: 'get', + params:data + }) + }, +} +export default api diff --git a/src/api/teacher.js b/src/api/teacher.js index 82a36a3..cb5f964 100644 --- a/src/api/teacher.js +++ b/src/api/teacher.js @@ -14,12 +14,19 @@ const api = { method: 'get' }) }, - teacherOperator : data => { + teacherOperator : data => {// 审核提交 return service({ url: '/teacher/change', method: 'post', data }) - } + }, + getAssistantList : data => { // 助教列表 + return service({ + url: '/assistant', + method: 'get', + params:data + }) + }, } export default api diff --git a/src/utils/index.js b/src/utils/index.js index 788c509..ed859da 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -414,8 +414,8 @@ export function clients() { let client = {} client = new OSS({ endpoint: 'oss-cn-chengdu.aliyuncs.com', - accessKeyId: 'LTAI5t7K52jxxBCvYtS3CCm3', - accessKeySecret: 'VFLO6JDorP8fFmjZuxsSCxL5zzHMgW', + accessKeyId: 'LTAI5tGUFScGh9qdB8j7vKo1', + accessKeySecret: 'XhBPsJ3fom9sE4yjTQAqwwVEw2nqac', bucket: 'gwjxb', timeout: 10 * 60 * 1000 }) diff --git a/src/view/course/addCourse/index.vue b/src/view/course/addCourse/index.vue index 6fe0592..455039a 100644 --- a/src/view/course/addCourse/index.vue +++ b/src/view/course/addCourse/index.vue @@ -47,6 +47,7 @@ async function getCourseInfo() { // 获取课程信息 const res = await api.getCourse({id:course_id.value}) if(res.code === 0) { chapter_info.value = res.data.course_ware_json + res.data.course.price /=100 form.value = res.data.course } } @@ -83,12 +84,15 @@ const submitForm = async (formEl) => { }) } async function saveStep1() { + form.value.course_category_id = subjectList.value.filter((item,i) => { + return item.name === form.value.subject + })[0].id let params = { step1:{ ...form.value } } - params.step1.price = parseInt(params.step1.price) + params.step1.price = parseFloat(params.step1.price)*100 let func_name ='' if(course_id.value) { // 编辑 params.course_id = parseInt(course_id.value) @@ -153,6 +157,10 @@ function handleAvatarSuccess(res) { form.value.cover = res.data.file.url handlerChange() } +function handleIntroSuccess(res) { + form.value.intro = res.data.file.url + handlerChange() +} function beforeAvatarUpload(file) { const isLt05M = file.size / 1024 / 1024 < 20 const isJPG = file.type.indexOf('image/') === -1 @@ -215,11 +223,22 @@ function handlerChange(e) { - - - - + + + + + + + + diff --git a/src/view/course/components/chapter.vue b/src/view/course/components/chapter.vue index 94852ba..1a03e7b 100644 --- a/src/view/course/components/chapter.vue +++ b/src/view/course/components/chapter.vue @@ -27,6 +27,7 @@ const props = defineProps(['course_id','chapter_info']) const emit = defineEmits(['reload']) import UploadCommon from '@/components/upload/common.vue' // 变量 +const is_sub = ref(-1) const dialogChapterVisible = ref(false) // const dialogChapterTitle = ref('') const chapterForm = ref({pid:0,sort:0}) @@ -61,6 +62,7 @@ function addChapterFunc() { // 添加大章节 dialogChapterTitle.value = '添加大章节' } async function deleteChapterFunc(item) { //删除大章节 + is_sub.value = -1 delFunc(item.course_chapter_id) } function delFunc(id) { @@ -71,7 +73,9 @@ function delFunc(id) { }) .then(async() => { const res = await api.delChapter({ - ids:[id] + ids:[id], + course_id:parseInt(props.course_id), + sub:parseInt(is_sub.value) }) if (res.code === 0) { ElMessage({ @@ -132,14 +136,17 @@ function editChapterChildFunc(item,main_index) { // 打开编辑子章节窗口 // item.exam_ids =item.exam_id?[item.exam_id]: [] item.examination_id = item.exam_id chapterChildForm.value = _.cloneDeep(item) + chapterChildForm.value.price /= 100 dialogChapterChildVisible.value = true } function deleteChapterChildFunc(item) { // 删除子章节 + is_sub.value = 1 delFunc(item.course_subsection_id) } async function enterChapterChildDialog() { // 提交小章节 chapterChildForm.value.sort = parseInt(chapterChildForm.value.sort) - chapterChildForm.value.price = parseInt(chapterChildForm.value.price) + // chapterChildForm.value.price = parseInt(chapterChildForm.value.price*100) + chapterChildForm.value.price = chapterChildForm.value.price*100 const params = { ...chapterChildForm.value } @@ -219,7 +226,9 @@ function addExamFunc(data) { {{scope.row.exam_id === 0?'未添加习题':scope.row.exam_id}} - + + {{scope.row.price/100}} + diff --git a/src/view/course/index.vue b/src/view/course/index.vue index 4d8b2a2..6b3b687 100644 --- a/src/view/course/index.vue +++ b/src/view/course/index.vue @@ -191,7 +191,9 @@ function viewCourseFunc(row) { // 查看课程 - + + {{scope.row.price/100}} + {{scope.row.status == 1?'上架':scope.row.status == 2?'待审核':scope.row.status == 3?'通过':scope.row.status == 4?'未通过':'下架'}} diff --git a/src/view/examinationManage/components/groupPool.vue b/src/view/examinationManage/components/groupPool.vue index 128cfd8..1423f78 100644 --- a/src/view/examinationManage/components/groupPool.vue +++ b/src/view/examinationManage/components/groupPool.vue @@ -22,6 +22,7 @@ import custom from '@/utils/custom' // 监听 watch(props,(val1,val2) => { has_exam_types.value = _.cloneDeep(val1.exam_types) || [] + queryParams.value.examId = val1.exam_id }) // 变量 const has_exam_types = ref(_.cloneDeep(props.exam_types) || []) @@ -49,6 +50,10 @@ async function getExamGroupList() { if(res.code === 0) { type_list.value = res.data.records total.value = res.data.total + console.log('子组件获取行为') + if(type_list.value.length==0) { + type_list.value = _.cloneDeep(has_exam_types.value) + } } } function chooseChapterChildExercises() { @@ -130,11 +135,11 @@ function enterDb() { // 确认新增/编辑 } else{ // 新增 - let f = checkFunc(gform.value) - if(!f) { // 有相同人数且没有过期,无法再次创建 - ElMessage.error('该级别组数已存在!') - return - } + // let f = checkFunc(gform.value) + // if(!f) { // 有相同人数且没有过期,无法再次创建 + // ElMessage.error('该级别组数已存在!') + // return + // } } if(!edit_flag.value) { // 新增 gform.value.term = assigntTermFunc() @@ -327,21 +332,35 @@ function close_draw() { - + + + + + + + - + + + + + + + diff --git a/src/view/examinationManage/index.vue b/src/view/examinationManage/index.vue index 5205fcc..b851794 100644 --- a/src/view/examinationManage/index.vue +++ b/src/view/examinationManage/index.vue @@ -53,7 +53,7 @@ const content = ref(null) // const options = ref([]) // 答案选项数组 const exam_types = ref([]) const exam_ids = ref([]) -const price_props = ['first','second','third'] +const price_props = ['first','second','third','price'] const exam_type_ids = ref([]) // 生命周期 onMounted(() => { @@ -139,6 +139,7 @@ function editCourseFunc(row) { form.value = _.cloneDeep(row.exam) form.value.course_ids = JSON.parse(row.exam.course_ids) form.value.question_ids = JSON.parse(row.exam.question_ids) + form.value.price = Number(form.value.price)/100 exam_types.value = row.exam_types.map((item) => { for(let prop in item) { if(price_props.includes(prop)) { @@ -147,6 +148,7 @@ function editCourseFunc(row) { } return item }) + // console.log(form.value) current_subject.value = form.value.subject openDialog('edit') } @@ -196,6 +198,8 @@ async function enterDialog() { // 提交 } return item }) + // console.log(form.value) + form.value.price = Number(form.value.price )*100 form.value.duration = parseInt(form.value.duration) const params = { ...form.value @@ -267,6 +271,7 @@ function addCourseFunc(data) { form.value.course_ids = data } function addGroupFunc(data) { + console.log("父组件行为") exam_types.value = _.clone(data) } @@ -406,54 +411,18 @@ function addGroupFunc(data) { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - + + + - + @@ -356,7 +356,7 @@ function delet_func(item) { {{item.name}} - + 添加答案 @@ -367,7 +367,7 @@ function delet_func(item) { - + diff --git a/src/view/lbtManage/index.vue b/src/view/lbtManage/index.vue index a776c7f..807b4dd 100644 --- a/src/view/lbtManage/index.vue +++ b/src/view/lbtManage/index.vue @@ -61,7 +61,7 @@ function openDialog(type) { } } async function onDelete() { - const ids = lbt_ids.value.map(item => item.ID) + const ids = lbt_ids.value.map(item => item.banner_id) const res = await api.delLbt({ ids }) if (res.code === 0) { ElMessage({ @@ -111,12 +111,15 @@ const submitForm = async (formEl) => { } async function saveForm() { let func_name = '' - if(form.value.ID){ // 编辑 + if(form.value.banner_id){ // 编辑 func_name = 'editLbtManage' } else{ func_name = 'addLbtManage' } + form.value.status = parseInt(form.value.status) + form.value.lbtSkipUrlType = parseInt(form.value.lbtSkipUrlType) + form.value.lbtType = parseInt(form.value.lbtType) const res = await api[func_name](form.value) if(res.code === 0) { @@ -144,7 +147,7 @@ function delLbtFunc(item) { .then(async() => { console.log(1) const res = await api.delLbt({ - ids:[item.ID] + ids:[item.banner_id] }) if (res.code === 0) { ElMessage({ @@ -199,7 +202,7 @@ function handleSizeChange(val) { - {{scope.row.status === '1'?'启用':'禁用'}} + {{scope.row.status == '1'?'启用':'禁用'}} @@ -268,7 +271,7 @@ function handleSizeChange(val) { - + diff --git a/src/view/marketManage/assistantList/assistantDetail.vue b/src/view/marketManage/assistantList/assistantDetail.vue new file mode 100644 index 0000000..fc8a123 --- /dev/null +++ b/src/view/marketManage/assistantList/assistantDetail.vue @@ -0,0 +1,333 @@ + + + + 助教详情 + + + + + + + + 昵称:{{assistantInfo.nickname}} + + + ID:{{assistantInfo.user_id}} + + + 注册时间:{{assistantInfo.created_at}} + + + 身份:助教 + + + + + + + + + + + + 身份证号码: + {{assistantInfo.id_card}} + + + 手机号码: + {{assistantInfo.phone}} + + + + + 邀请人姓名: + {{assistantInfo.invite_nickname}} + + + 邀请人ID号: + {{assistantInfo.invite_id}} + + + + + 邀请人数: + {{assistantInfo.assistant_info.num}} + + + 有效人数: + {{assistantInfo.student_info.num}} + + + + + 区域: + {{assistantInfo.province}} + + + 提交时间: + {{formatDate(assistantInfo.created_at)}} + + + 就职单位: + 重庆大学 + + + 任职行业: + 金融 + + + + + 余额: + {{assistantInfo.balance}}元 + + + 累计收益: + {{assistantInfo.income}}元 + + + 查看交易明细 + + + + + 上架课程: + {{assistantInfo.publish_course}}门 + + + 查看课程列表 + + + + + 上架测试: + {{assistantInfo.publish_exam}}份 + + + 查看试卷列表 + + + + + 销售次数(课程): + {{assistantInfo.course_sale}}次 + + + 累计金额: + {{assistantInfo.course_income}} + + + 查看学习记录 + + + + + 销售次数(测试): + {{assistantInfo.exam_sale}}次 + + + 累计金额: + {{assistantInfo.exam_income}} + + + 查看测试记录 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{getStateName(assistantInfo.status)}} + + + + {{tip_text}} + + + 取消 + + 确定 + + + + + + + diff --git a/src/view/marketManage/assistantList/index.vue b/src/view/marketManage/assistantList/index.vue new file mode 100644 index 0000000..02e402b --- /dev/null +++ b/src/view/marketManage/assistantList/index.vue @@ -0,0 +1,315 @@ + + + + + + + + + + + + + + + + + 查询 + 重置 + + + + + + + + + 确定要删除吗? + + 取消 + 确定 + + + + + + + + + + + + + + + + {{formatDate(scope.row.created_at)}} + + + + + + {{scope.row.province>-1?cityList[scope.row.province].name:''}} + + + + + + + + + + + + + + + + + + + + + + + + 查看 + 同意 + 拒绝 + + + + + + + + + + + + + + + + + 取消 + + 确定 + + + + + + + diff --git a/src/view/teacherManage/assistantList/index.vue b/src/view/teacherManage/assistantList/index.vue new file mode 100644 index 0000000..1768422 --- /dev/null +++ b/src/view/teacherManage/assistantList/index.vue @@ -0,0 +1,305 @@ + + + + + + + + + + + + + + + + + 查询 + 重置 + + + + + + + + + 确定要删除吗? + + 取消 + 确定 + + + + + + + + + + + + + + + + {{cityList[scope.row.province].name}} + + + + + {{formatDate(scope.row.CreatedAt)}} + + + + + + + + + {{scope.row.status == 1?'审核中':scope.row.status == 2?'已同意':'已拒绝'}} + + + + + + 查看 + 同意 + 拒绝 + + + + + + + + + + + + + + + + + 取消 + + 确定 + + + + + + + diff --git a/src/view/teacherManage/teacherApply/index.vue b/src/view/teacherManage/teacherApply/index.vue index 66c983f..dab5065 100644 --- a/src/view/teacherManage/teacherApply/index.vue +++ b/src/view/teacherManage/teacherApply/index.vue @@ -25,7 +25,7 @@ const queryParams = ref({ page:1, pageSize:10, name:'', - status:'' + status:1 }) const subjectParams = ref({ pageIndex:1, diff --git a/src/view/teacherManage/teacherDetail.vue b/src/view/teacherManage/teacherDetail.vue index 14ecc3f..0292202 100644 --- a/src/view/teacherManage/teacherDetail.vue +++ b/src/view/teacherManage/teacherDetail.vue @@ -207,13 +207,16 @@ function getStateName(state) { - - 同意 - 拒绝 - - - {{getStateName(teacherInfo.status)}} - + + + + + + + + + {{getStateName(teacherInfo.status)}} + // 引入依赖 import api from '@/api/teacher' -import capi from '@/api/course' import custom from '@/utils/custom' import {formatDate} from '@/utils/format' import cityList from '@/utils/city.json' -// import { toSQLLine } from '@/utils/stringFun' -// import WarningBar from '@/components/warningBar/warningBar.vue' -// import coursePool from './components/coursePool.vue' -// import exercisesPool from '@/view/course/components/exercisesPool.vue' import {ref,onMounted,provide } from 'vue' import { ElMessage, ElMessageBox } from 'element-plus' import { useRouter, useRoute } from 'vue-router' @@ -19,18 +14,17 @@ const route = useRoute() import { useUserStore } from '@/pinia/modules/user' const userStore = useUserStore() // 变量 -const path = ref(import.meta.env.VITE_BASE_API) -// const typeList = custom.getExercisesTypeList() +// const path = ref(import.meta.env.VITE_BASE_API) const queryParams = ref({ page:1, pageSize:10, name:'', status:'' }) -const subjectParams = ref({ - pageIndex:1, - pageSize:100, -}) +// const subjectParams = ref({ +// pageIndex:1, +// pageSize:100, +// }) const state_arr = ref([ { name:'申请中', @@ -46,29 +40,23 @@ const state_arr = ref([ } ]) const tableData = ref([]) -const subjectList = ref([]) -const current_subject = ref('') const deleteVisible = ref(false) -const question_ids = ref([]) const total = ref(0) -const dialogFormVisible = ref(false) -const dialogTitle = ref('') -const form =ref({}) -const rules = ref({ - name: [{ required: true, message: '请输入课程名称', trigger: 'blur' }] -}) +// const dialogFormVisible = ref(false) +// const dialogTitle = ref('') +// const form =ref({}) +// const rules = ref({ +// name: [{ required: true, message: '请输入课程名称', trigger: 'blur' }] +// }) const question_id = ref(0) const content = ref(null) -// const options = ref([]) // 答案选项数组 -const exam_types = ref([]) -const exam_ids = ref([]) +const teacher_ids = ref([]) // 生命周期 onMounted(() => { getTeacherList() - // getSubject() }) -provide('subjectList', subjectList) -provide('current_subject', current_subject) +// provide('subjectList', subjectList) +// provide('current_subject', current_subject) // 方法 async function getTeacherList() { const res = await api.getTeacherList(queryParams.value) @@ -77,12 +65,12 @@ async function getTeacherList() { total.value = res.data.total } } -async function getSubject(){ // 获取课程分类 - const res = await capi.getSubjectList(subjectParams.value) - if(res.code === 0) { - subjectList.value = custom.getStdSubject(res.data.records) - } -} +// async function getSubject(){ // 获取课程分类 +// const res = await capi.getSubjectList(subjectParams.value) +// if(res.code === 0) { +// subjectList.value = custom.getStdSubject(res.data.records) +// } +// } function onSubmit() { getTeacherList() } @@ -95,70 +83,21 @@ const onReset = () => { subject:'' } } -function openDialog(type) { - // let params = {} - switch (type){ - case 'add': - dialogTitle.value = '新增试卷' - form.value = {} - break; - case 'edit': - // params.question_id = question_id.value - dialogTitle.value = '编辑试卷' - break; - } - dialogFormVisible.value = true - // router.push({name:'addCourse',params}) -} async function onDelete() { - const ids = exam_ids.value - const res = await api.delExamination({ exam_ids:ids }) + const ids = teacher_ids.value + const res = await api.delExamination({ teacher_ids:ids }) if (res.code === 0) { ElMessage({ type: 'success', message: res.msg }) - // if (tableData.value.length === ids.length && page.value > 1) { - // page.value-- - // } deleteVisible.value = false getTeacherList() } } const handleSelectionChange = (val) => { - exam_ids.value = val.map((item) => { - return item.exam_id - }) -} -function editCourseFunc(row) { - row.course_ids = JSON.parse(row.course_ids) - row.question_ids = JSON.parse(row.question_ids) - - form.value = row.exam - exam_types.value = row.exam_types.map((item) => { - return item.persons - }) - current_subject.value = form.value.subject - openDialog('edit') -} -function deleteExamFunc(row) { - ElMessageBox.confirm('此操作将永久删除该数据, 是否继续?', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }) - .then(async() => { - const res = await api.delExamination({ - exam_ids:[row.exam_id] - }) - if (res.code === 0) { - ElMessage({ - type: 'success', - message: '删除成功!' - }) - getTeacherList() - } - },() => { + teacher_ids.value = val.map((item) => { + return item.teacher_info_id }) } function handleCurrentChange(val) { @@ -169,107 +108,45 @@ function handleSizeChange(val) { queryParams.value.pageSize = val getTeacherList() } -function closeDialog(){ - dialogFormVisible.value = false - exam_types.value = [] - form.value = {} -} -async function enterDialog() { // 提交 - form.value.teacher_id = 0 - form.value.exam_type = exam_types.value.map((item) => { - return item = parseInt(item) - }) - form.value.duration = parseInt(form.value.duration) - // return - const params = { - ...form.value - } - params.question_ids = JSON.stringify(form.value.question_ids) - params.course_ids = JSON.stringify(form.value.course_ids) - let func_name = 'addExamination' - if(form.value.exam_id) { // 编辑 - func_name = 'editExamination' - } - const res = await api[func_name](params) - if(res.code === 0) { - ElMessage({ - type: 'success', - message: res.msg - }) - closeDialog() - getTeacherList() - } -} -function viewTeacherFunc(row) { // 查看订单 - console.log(row) +function viewTeacherFunc(row) { // 查看详情 router.push({name:'teacherDetail',params:{id:row.teacher_info_id}}) } -function getExercisesName(row) { - return JSON.parse(row.question).title -} -// const std_options_title = ref(['A','B','C','D','E','F']) -function addOptionFunc() { - exam_types.value.push('') -} -function delet_func() { - exam_types.value.pop() -} -function getStateName(state) { - let str = '' - switch (state){ - case 1: - str = '未付款' - break; - case 2: - str = '已付款' - break; - case 3: - str = '已过期' - break; +//审核相关 +const p_visible = ref(false) +const pFormRules = ref({ + desc: [{ required: true, message: '请输入说明', trigger: 'blur' }] +}) +const p_type = ref(null); // 审核类型 +const pForm = ref({}) +const teacher_id = ref(0) +const p_title = ref('') +function processFunc(row,state) { // 审核 + p_type.value = state + p_visible.value = true + teacher_id.value = row.user_id + if(state === 3) { //同意 + p_title.value = '审核同意' } - return str -} -function handleAvatarSuccess(res) { - form.value.cover = res.data.file.url - // handlerChange() -} -function beforeAvatarUpload(file) { - const isLt05M = file.size / 1024 / 1024 < 20 - const isJPG = file.type.indexOf('image/') === -1 - if (isJPG) { - ElMessage.error('文件格式错误,请上传图片类型,如:JPG,PNG后缀的文件') + else if(state === 2) { // 拒绝 + p_title.value = '审核拒绝' } - if (!isLt05M) { - ElMessage.error('上传头像图片大小不能超过 2M!') +} +function close_pv(){ + p_visible.value = false +} +async function pOk() { // 审核提交 + const res = await api.teacherOperator({ + teacher_id:teacher_id.value, + status:p_type.value, + desc:pForm.value.desc + }) + ElMessage({ + type: 'success', + message: res.data.msg + }) + if(res.code === 0) { + close_pv() } - return !isJPG && isLt05M -} -function changeSubjectFunc(e) { - current_subject.value = e -} -function addExercisesFunc(data) { - form.value.question_ids = data -} -function addCourseFunc(data) { - form.value.course_ids = data -} -function getTypeName(type) { - let name = "" - switch (type) { - case 1: - name = '课程'; - break; - case 2: - name = '章节'; - break; - case 3: - name = '子章节'; - break; - case 4: - name = '试卷'; - break; - } - return name } @@ -280,16 +157,16 @@ function getTypeName(type) { - - - - - - - - - - + + + + + 查询 重置 @@ -332,11 +209,12 @@ function getTypeName(type) { - - - - - + + + {{scope.row.status == 1?'审核中':scope.row.status == 2?'已同意':'已拒绝'}} + + + 同意 拒绝 @@ -375,6 +253,27 @@ function getTypeName(type) { /> + + + + + + + + + + 取消 + + 确定 + + + +
确定要删除吗?