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

93 lines
2.6 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">
<ai-info-item label="标题" isLine :value="info.title"></ai-info-item>
<ai-info-item label="发布地区" isLine :value="info.areaName"></ai-info-item>
<ai-info-item label="文章类型" isLine :value="info.contentType === '0' ? '图文' : '视频'"></ai-info-item>
<ai-info-item label="正文" v-if="info.contentType === '0'" isLine>
<AiArticle :value="info.content"></AiArticle>
</ai-info-item>
<ai-info-item v-if="info.contentType === '0'" isLine label="封面图片">
<ai-uploader
:instance="instance"
disabled
v-model="info.files"
:limit="9">
</ai-uploader>
</ai-info-item>
<ai-info-item v-if="info.contentType === '1'" isLine label="封面图片">
<video style="width:100%; height:100%; object-fit: fill;" :src="info.files[0].url" controls></video>
</ai-info-item>
<ai-info-item v-if="info.contentType === '1'" isLine label="视频封面">
<ai-uploader
:instance="instance"
disabled
v-model="info.pictureUrl"
: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-07 15:46:45 +08:00
params: Object,
moduleId: String
2023-02-07 13:36:02 +08:00
},
data () {
return {
2023-02-07 15:46:45 +08:00
info: {},
id: ''
2023-02-07 13:36:02 +08:00
}
},
created () {
2023-02-07 15:46:45 +08:00
if (this.params && this.params.id) {
this.id = 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) {
this.instance.post(`/app/appcontentinfo/queryDetailById?id=${id}`).then(res => {
if (res.code === 0) {
this.info = res.data
this.info.pictureUrl = res.data.pictureUrl ? [{
url: res.data.pictureUrl
}] : []
2023-02-07 13:36:02 +08:00
}
})
},
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>