Files
dvcp_v2_webapp/project/qujing/app/AppCurriculumManage/components/Detail.vue

104 lines
3.1 KiB
Vue
Raw Normal View History

2023-02-07 13:36:02 +08:00
<template>
2023-02-07 15:46:45 +08:00
<ai-detail>
2023-02-07 13:36:02 +08:00
<template slot="title">
2023-02-07 15:46:45 +08:00
<ai-title title="课程详情" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
2023-02-07 13:36:02 +08:00
</ai-title>
</template>
<template slot="content">
2023-02-07 15:46:45 +08:00
<ai-card title="基本信息">
<template #content>
<ai-wrapper
label-width="120px">
2023-02-14 11:48:49 +08:00
<ai-info-item label="课程名称" isLine :value="info.title"></ai-info-item>
<ai-info-item label="排序" :value="info.showIndex"></ai-info-item>
<ai-info-item label="状态" :value="dict.getLabel('qjExamineStatus', info.examineStatus)"></ai-info-item>
<ai-info-item label="已学习人数" :value="info.learnerNumber"></ai-info-item>
2023-02-14 15:37:49 +08:00
<ai-info-item label="评论数" :value="info.msgCount">
<el-link type="primary" @click="toComment">{{ info.msgCount }}</el-link>
</ai-info-item>
2023-02-14 11:48:49 +08:00
<ai-info-item label="课程类型" :value="dict.getLabel('qjCourseType', info.courseType)"></ai-info-item>
<ai-info-item label="正文" v-if="info.courseType === '0'" isLine>
2023-02-07 15:46:45 +08:00
<AiArticle :value="info.content"></AiArticle>
</ai-info-item>
2023-02-14 11:48:49 +08:00
<ai-info-item v-if="info.courseType === '0'" isLine label="封面">
2023-02-07 15:46:45 +08:00
<ai-uploader
disabled
2023-02-14 11:48:49 +08:00
:value="[{
url: info.pictureUrl
}]"
:limit="1">
2023-02-07 15:46:45 +08:00
</ai-uploader>
</ai-info-item>
2023-02-14 11:48:49 +08:00
<ai-info-item v-if="info.courseType === '1'" label="视频时长" :value="info.videoDuration"></ai-info-item>
<ai-info-item v-if="info.courseType === '1'" isLine label="视频">
<video style="width:100%; height:100%; object-fit: fill;" :src="info.videoUrl" controls></video>
2023-02-07 15:46:45 +08:00
</ai-info-item>
2023-02-14 11:48:49 +08:00
<ai-info-item v-if="info.courseType === '1'" isLine label="视频封面">
2023-02-07 15:46:45 +08:00
<ai-uploader
disabled
2023-02-14 11:48:49 +08:00
:value="[{
url: info.pictureUrl
}]"
2023-02-07 15:46:45 +08:00
:limit="1">
</ai-uploader>
</ai-info-item>
</ai-wrapper>
</template>
</ai-card>
2023-02-07 13:36:02 +08:00
</template>
</ai-detail>
</template>
<script>
export default {
name: 'Detail',
props: {
instance: Function,
dict: Object,
2023-02-14 11:48:49 +08:00
params: Object
2023-02-07 13:36:02 +08:00
},
data () {
return {
2023-02-14 15:37:49 +08:00
info: {}
2023-02-07 13:36:02 +08:00
}
},
created () {
2023-02-07 15:46:45 +08:00
if (this.params && this.params.id) {
this.getInfo(this.params.id)
}
2023-02-07 13:36:02 +08:00
},
methods: {
2023-02-07 15:46:45 +08:00
getInfo (id) {
2023-02-14 11:48:49 +08:00
this.instance.post(`/app/appcourseinfo/queryDetailById?id=${id}`).then(res => {
2023-02-07 15:46:45 +08:00
if (res.code === 0) {
this.info = res.data
2023-02-07 13:36:02 +08:00
}
})
},
2023-02-14 15:37:49 +08:00
toComment () {
this.$emit('change', {
type: 'Comment',
params: {
id: this.params.id
}
})
},
2023-02-07 15:46:45 +08:00
cancel (isRefresh) {
2023-02-07 13:36:02 +08:00
this.$emit('change', {
type: 'List',
2023-02-07 15:46:45 +08:00
isRefresh: !!isRefresh
2023-02-07 13:36:02 +08:00
})
}
}
}
</script>
<style scoped lang="scss">
</style>