|
@@ -4,12 +4,12 @@
|
|
|
<div>
|
|
<div>
|
|
|
<div class="flex_1 bg_color_fff padding16 border_radius_16 box_shadow_card fit_content">
|
|
<div class="flex_1 bg_color_fff padding16 border_radius_16 box_shadow_card fit_content">
|
|
|
<div class="gap10">
|
|
<div class="gap10">
|
|
|
- <el-button type="primary">标签</el-button>
|
|
|
|
|
- <div class="bold font_size30">UI设计求职实战班(第1期)</div>
|
|
|
|
|
|
|
+ <el-button type="primary">{{info.skillTagName}}</el-button>
|
|
|
|
|
+ <div class="bold font_size30">{{info.courseCategoryName}}(第1期)</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="gap5 mt10">
|
|
<div class="gap5 mt10">
|
|
|
<img :src="riliIcon" alt="" style="width: 16px; height: 16px;">
|
|
<img :src="riliIcon" alt="" style="width: 16px; height: 16px;">
|
|
|
- <span class="font_size14">2023-10-10 00:00:00</span>
|
|
|
|
|
|
|
+ <span class="font_size14">{{info.createTime}}</span>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="flex-between mt20">
|
|
<div class="flex-between mt20">
|
|
@@ -33,26 +33,29 @@
|
|
|
<div class="bg_color_fff padding16 border_radius_16 box_shadow_card mt20">
|
|
<div class="bg_color_fff padding16 border_radius_16 box_shadow_card mt20">
|
|
|
<div class="flex-center-between border_bottom">
|
|
<div class="flex-center-between border_bottom">
|
|
|
<div class="gap10">
|
|
<div class="gap10">
|
|
|
- <div class="gap5">
|
|
|
|
|
|
|
+ <div class="gap5 cursor-pointer" @click="collectFn">
|
|
|
<img :src="weishoucangIcon" alt="" style="width: 24px; height: 24px;">
|
|
<img :src="weishoucangIcon" alt="" style="width: 24px; height: 24px;">
|
|
|
- <span class="bold font_size14">未收藏</span>
|
|
|
|
|
|
|
+ <span class="bold font_size14">{{$t('common.collect')}}</span>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="gap5">
|
|
|
|
|
|
|
+ <div class="gap5 cursor-pointer" @click="collectFn">
|
|
|
<img :src="shoucangIcon" alt="" style="width: 24px; height: 24px;">
|
|
<img :src="shoucangIcon" alt="" style="width: 24px; height: 24px;">
|
|
|
- <span class="bold font_size14">已收藏</span>
|
|
|
|
|
|
|
+ <span class="bold font_size14">{{$t('common.unCollect')}}</span>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="gap5">
|
|
|
|
|
|
|
+ <div class="gap5 cursor-pointer" @click="copyCurrentUrl">
|
|
|
<img :src="fenxiangIcon" alt="" style="width: 24px; height: 24px;">
|
|
<img :src="fenxiangIcon" alt="" style="width: 24px; height: 24px;">
|
|
|
- <span class="bold font_size14">分享</span>
|
|
|
|
|
|
|
+ <span class="bold font_size14">{{$t('common.share')}}</span>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="addBtn flex-center gradient border_radius_10">
|
|
<div class="addBtn flex-center gradient border_radius_10">
|
|
|
<div class="gap10" @click="toAddNote">
|
|
<div class="gap10" @click="toAddNote">
|
|
|
<img :src="addIcon" alt="" style="width:30px;height:30px">
|
|
<img :src="addIcon" alt="" style="width:30px;height:30px">
|
|
|
- <span class="font_size18">120篇笔记</span>
|
|
|
|
|
|
|
+ <span class="font_size18">120{{$t('common.notes')}}</span>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <div class="gray font_size16 mt10 line2" :title="info.courseIntro">
|
|
|
|
|
+ {{info.courseIntro}}
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="bg_color_fff padding16 border_radius_16 box_shadow_card mt20">
|
|
<div class="bg_color_fff padding16 border_radius_16 box_shadow_card mt20">
|
|
|
<Pinglun :info="info"/>
|
|
<Pinglun :info="info"/>
|
|
@@ -90,9 +93,10 @@ import VideoPlayer from '@/components/VideoPlayer.vue'
|
|
|
import Pinglun from './components/pinglun.vue'
|
|
import Pinglun from './components/pinglun.vue'
|
|
|
import Xuxibiji from './components/Xuxibiji.vue'
|
|
import Xuxibiji from './components/Xuxibiji.vue'
|
|
|
import DGTMessage from '@/utils/message'
|
|
import DGTMessage from '@/utils/message'
|
|
|
|
|
+import { copyText } from '@/utils/util'
|
|
|
|
|
|
|
|
// 引入api
|
|
// 引入api
|
|
|
-import { getCourseDetail } from '@/api/course.js'
|
|
|
|
|
|
|
+import { getCourseDetail,collect } from '@/api/course.js'
|
|
|
|
|
|
|
|
import { useRouter, useRoute } from 'vue-router'
|
|
import { useRouter, useRoute } from 'vue-router'
|
|
|
const router = useRouter()
|
|
const router = useRouter()
|
|
@@ -102,6 +106,9 @@ import { ref, computed, reactive, onMounted } from 'vue'
|
|
|
import { useAppStore } from '@/pinia/appStore'
|
|
import { useAppStore } from '@/pinia/appStore'
|
|
|
const appStore = useAppStore()
|
|
const appStore = useAppStore()
|
|
|
|
|
|
|
|
|
|
+import { useI18n } from 'vue-i18n'
|
|
|
|
|
+const { t } = useI18n()
|
|
|
|
|
+
|
|
|
//获取参数
|
|
//获取参数
|
|
|
const query = route.query;
|
|
const query = route.query;
|
|
|
const courseId = ref(route.params.courseId || '');
|
|
const courseId = ref(route.params.courseId || '');
|
|
@@ -109,8 +116,10 @@ const info = ref({})
|
|
|
|
|
|
|
|
// 视频相关
|
|
// 视频相关
|
|
|
// const currentVideoUrl = ref('http://baomiai.oss-cn-shanghai.aliyuncs.com/video/2025/12/30/123_20251226133117A047_20251230095248A001.mp4?response-content-disposition=inline&x-oss-date=20251230T015720Z&x-oss-expires=7199&x-oss-signature-version=OSS4-HMAC-SHA256&x-oss-credential=LTAI5tG5dEtkqwDGcU6AtaYE%2F20251230%2Fcn-shanghai%2Foss%2Faliyun_v4_request&x-oss-signature=f93c20421dcfdc6822cd03d42ae66f8a28acd2c4d25c79ce16e2312537eabaa5')
|
|
// const currentVideoUrl = ref('http://baomiai.oss-cn-shanghai.aliyuncs.com/video/2025/12/30/123_20251226133117A047_20251230095248A001.mp4?response-content-disposition=inline&x-oss-date=20251230T015720Z&x-oss-expires=7199&x-oss-signature-version=OSS4-HMAC-SHA256&x-oss-credential=LTAI5tG5dEtkqwDGcU6AtaYE%2F20251230%2Fcn-shanghai%2Foss%2Faliyun_v4_request&x-oss-signature=f93c20421dcfdc6822cd03d42ae66f8a28acd2c4d25c79ce16e2312537eabaa5')
|
|
|
-const currentVideoUrl = ref('http://jcxxpt.oss-cn-beijing.aliyuncs.com/common/2025/12/19/actmOvmq0xOBc8448561c73a066a523821c6f7ae4868_20251219094240A008.mp4')
|
|
|
|
|
-const currentCourseCover = ref('http://jcxxpt.oss-cn-beijing.aliyuncs.com/common/2025/12/15/3120938e-8205-416e-aedc-8b25ea23cc94_20251125142306A001_20251215110507A001.png')
|
|
|
|
|
|
|
+// const currentVideoUrl = ref('http://jcxxpt.oss-cn-beijing.aliyuncs.com/common/2025/12/19/actmOvmq0xOBc8448561c73a066a523821c6f7ae4868_20251219094240A008.mp4')
|
|
|
|
|
+const currentVideoUrl = ref('')
|
|
|
|
|
+// const currentCourseCover = ref('http://jcxxpt.oss-cn-beijing.aliyuncs.com/common/2025/12/15/3120938e-8205-416e-aedc-8b25ea23cc94_20251125142306A001_20251215110507A001.png')
|
|
|
|
|
+const currentCourseCover = ref('')
|
|
|
const currentPlayingVideoId = ref(null)
|
|
const currentPlayingVideoId = ref(null)
|
|
|
const currentVideoDuration = ref(0)
|
|
const currentVideoDuration = ref(0)
|
|
|
const currentPlayTime = ref(0)
|
|
const currentPlayTime = ref(0)
|
|
@@ -124,6 +133,7 @@ const getDetail = async () => {
|
|
|
if(res.code === 200){
|
|
if(res.code === 200){
|
|
|
console.log(res)
|
|
console.log(res)
|
|
|
info.value = res.data || {};
|
|
info.value = res.data || {};
|
|
|
|
|
+ currentCourseCover.value = info.value.coverImageUrl || ''
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
};
|
|
};
|
|
@@ -143,10 +153,10 @@ const playVideo = (video) => {
|
|
|
|
|
|
|
|
// 这里可以根据video.id从API获取实际的视频地址
|
|
// 这里可以根据video.id从API获取实际的视频地址
|
|
|
// 暂时使用模拟地址
|
|
// 暂时使用模拟地址
|
|
|
- const videoUrl = `https://example.com/videos/${video.id}.mp4`
|
|
|
|
|
|
|
+ // const videoUrl = `https://example.com/videos/${video.id}.mp4`
|
|
|
|
|
|
|
|
// 更新视频源
|
|
// 更新视频源
|
|
|
- currentVideoUrl.value = videoUrl
|
|
|
|
|
|
|
+ // currentVideoUrl.value = videoUrl
|
|
|
|
|
|
|
|
// 播放视频
|
|
// 播放视频
|
|
|
if (videoPlayer.value) {
|
|
if (videoPlayer.value) {
|
|
@@ -183,7 +193,7 @@ const onPlayerLoadedmetadata = (duration) => {
|
|
|
|
|
|
|
|
const onPlayerError = (error) => {
|
|
const onPlayerError = (error) => {
|
|
|
console.error('视频播放错误:', error)
|
|
console.error('视频播放错误:', error)
|
|
|
- DGTMessage.error('视频播放失败,请稍后再试')
|
|
|
|
|
|
|
+ // DGTMessage.error('视频播放失败,请稍后再试')
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const onPlayerReady = (player) => {
|
|
const onPlayerReady = (player) => {
|
|
@@ -224,6 +234,21 @@ const playNextVideo = () => {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
+const collectFn = () => {
|
|
|
|
|
+ collect({objectId: courseId.value}).then(res => {
|
|
|
|
|
+ if(res.code === 200){
|
|
|
|
|
+ info.value.isCollect = !info.value.isCollect
|
|
|
|
|
+ let msg = info.value.isCollect ? t('common.unCollect') : t('common.collect')
|
|
|
|
|
+ DGTMessage.success(msg+t('common.success'))
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+};
|
|
|
|
|
+//负责当前页面地址
|
|
|
|
|
+// 复制当前页面地址
|
|
|
|
|
+const copyCurrentUrl = () => {
|
|
|
|
|
+ copyText(window.location.href, t)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
</script>
|