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}} - + + + 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) { // 查看课程 - + + +