提交 aaf71072 authored 作者: lihuihui's avatar lihuihui

分享海报

上级 e8a45aae
module.exports = {
domain: 'dev.ezijing.com',
url: 'https://learn-api.ezijing.com/api',
url: 'https://paa-learning.ezijing.com',
apiBaseURL: 'https://learn-api.ezijing.com',
others: {
url: '/app/learn/course',
loginUrl: 'https://login.ezijing.com/auth/login/index',
messageBaseURL: 'https://test-microservices-message-service-api.ezijing.com'
messageBaseURL: ''
},
webpack: {
externals: {
......
......@@ -152,3 +152,12 @@ export function submitCourseExam(semesterId, courseId, examId, data) {
export function getCourseExamResult(semesterId, courseId, examId, params) {
return httpRequest.get(`/api/lms-ep/v2/education/${courseId}/examination/${examId}/sheet`, params)
}
/**
* 获取营销数据
* @param {string} courseId 课程ID
* @param {string} chapterId 章节ID
*/
export function getShare(params) {
return httpRequest.get(`/api/lms-ep/v3/activities/share/${params.course_id}/${params.chapter_id}`)
}
......@@ -34,6 +34,9 @@
<em :class="skipClass" @click="toggleSkip">{{ $t('viewerPlayer.skipTitle') }}</em>
<em :class="autoNextClass" @click="toggleAutoNext">{{ $t('viewerPlayer.autoNextTitle') }}</em>
</div>
<el-dialog :visible.sync="dialogVisible" width="600px" top="0">
<iframe :src="sharePageUrl" style="display:block;width:100%;height:720px;border:0;"></iframe>
</el-dialog>
</div>
</template>
......@@ -80,7 +83,8 @@ export default {
},
player: null,
watchedTime: 0,
watchedTimePoint: [] // 视频观看的时间点
watchedTimePoint: [], // 视频观看的时间点
dialogVisible: false // 分享海报弹出
}
},
watch: {
......@@ -143,6 +147,9 @@ export default {
return this.flatChapters[index + 1]
}
return null
},
sharePageUrl() {
return `https://webapp-pub.ezijing.com/website/prod/share/paa/index.html#/share?courseId=${this.cid}&chapterId=${this.chapter.id}`
}
},
methods: {
......@@ -184,9 +191,18 @@ export default {
},
// 播放结束
onEnded() {
if (this.isAutoNext && this.nextChapter) {
this.$router.push({ name: 'viewerCourseChapter', params: { id: this.nextChapter.id } })
// if (this.isAutoNext && this.nextChapter) {
// this.$router.push({ name: 'viewerCourseChapter', params: { id: this.nextChapter.id } })
// }
const params = {
course_id: this.cid,
chapter_id: this.chapter.id
}
api.getShare(params).then(res => {
if (res.code === 0 && res.data.need_share) {
this.dialogVisible = true
}
})
},
// 当前播放时间更新
onTimeupdate(time) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论