|
|
|
@ -9,6 +9,7 @@ const route = useRoute()
|
|
|
|
|
// 变量
|
|
|
|
|
const course_id = ref(0)
|
|
|
|
|
const courseData = ref({})
|
|
|
|
|
const baseInfo = ref({})
|
|
|
|
|
// 生命周期
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
course_id.value = route.params.course_id
|
|
|
|
@ -19,10 +20,12 @@ async function getCourse() { // 获取课程信息
|
|
|
|
|
const res = await api.getCourse({id:course_id.value})
|
|
|
|
|
if(res.code === 0) {
|
|
|
|
|
courseData.value = res.data
|
|
|
|
|
baseInfo.value = res.data.course
|
|
|
|
|
// console.log(res.data.course)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
function downloadChapterChildFunc(item) { // 点击下载
|
|
|
|
|
console.log(item)
|
|
|
|
|
// console.log(item)
|
|
|
|
|
|
|
|
|
|
window.open(row.url)
|
|
|
|
|
}
|
|
|
|
@ -38,19 +41,19 @@ function downloadChapterChildFunc(item) { // 点击下载
|
|
|
|
|
</div>
|
|
|
|
|
<div class="base-card">
|
|
|
|
|
<div class="bc-left">课程名称:</div>
|
|
|
|
|
<div class="bc-right">{{courseData.name}}</div>
|
|
|
|
|
<div class="bc-right">{{baseInfo.name}}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="base-card">
|
|
|
|
|
<div class="bc-left">课程科目:</div>
|
|
|
|
|
<div class="bc-right">{{courseData.subject}}</div>
|
|
|
|
|
<div class="bc-right">{{baseInfo.subject}}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="base-card">
|
|
|
|
|
<div class="bc-left">课程状态:</div>
|
|
|
|
|
<div class="bc-right">{{courseData.status === 1?'上架':'下架'}}</div>
|
|
|
|
|
<div class="bc-right">{{baseInfo.status === 1?'上架':'下架'}}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="base-card">
|
|
|
|
|
<div class="bc-left">课程价格:</div>
|
|
|
|
|
<div class="bc-right">{{courseData.price}}</div>
|
|
|
|
|
<div class="bc-right">{{baseInfo.price}}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="base-card">
|
|
|
|
|
<div class="bc-left">教师姓名:</div>
|
|
|
|
@ -58,11 +61,11 @@ function downloadChapterChildFunc(item) { // 点击下载
|
|
|
|
|
</div>
|
|
|
|
|
<div class="base-card">
|
|
|
|
|
<div class="bc-left">创建时间:</div>
|
|
|
|
|
<div class="bc-right">{{courseData.CreatedAt}}</div>
|
|
|
|
|
<div class="bc-right">{{baseInfo.CreatedAt}}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="base-card">
|
|
|
|
|
<div class="bc-left">课程简介:</div>
|
|
|
|
|
<div class="bc-right">{{courseData.introduction}}</div>
|
|
|
|
|
<div class="bc-right">{{baseInfo.intro}}</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|