修改部分会议提到的bug
This commit is contained in:
@@ -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) {
|
||||
<el-input @change="handlerChange" placeholder="请输入课程价格" type="number" v-model="form.price" />
|
||||
</el-form-item>
|
||||
<el-form-item label="课程简介">
|
||||
<el-input @change="handlerChange" v-model="form.intro" type="textarea" />
|
||||
</el-form-item>
|
||||
<el-form-item label="包含试听">
|
||||
<el-switch @change="handlerChange" v-model="form.is_audition" active-text="是" inactive-text="否" :active-value="1" :inactive-value="-1" />
|
||||
<!-- <el-input @change="handlerChange" v-model="form.intro" type="textarea" />-->
|
||||
<el-upload
|
||||
class="avatar-uploader"
|
||||
:action="`${path}/fileUploadAndDownload/upload`"
|
||||
:headers="{ 'x-token': userStore.token }"
|
||||
:show-file-list="false"
|
||||
:on-success="handleIntroSuccess"
|
||||
:before-upload="beforeAvatarUpload"
|
||||
>
|
||||
<img v-if="form.intro" :src="form.intro" class="avatar" />
|
||||
<el-icon v-else class="avatar-uploader-icon"><Plus /></el-icon>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="包含试听">-->
|
||||
<!-- <el-switch @change="handlerChange" v-model="form.is_audition" active-text="是" inactive-text="否" :active-value="1" :inactive-value="-1" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="设置精品">
|
||||
<el-switch @change="handlerChange" v-model="form.is_boutique" active-text="是" inactive-text="否" :active-value="1" :inactive-value="-1" />
|
||||
</el-form-item>
|
||||
|
Reference in New Issue
Block a user