|
@@ -1,238 +1,249 @@
|
|
|
<template>
|
|
|
- <div class="bg">
|
|
|
- <div class="box">
|
|
|
- <div class="top">
|
|
|
- <div class="content">
|
|
|
- <div class="title">{{ videodetail.detail.title }}</div>
|
|
|
- <div class="info">
|
|
|
- <div class="time" v-if="videodetail.detail.duration_num">
|
|
|
- 课程总量:{{ videodetail.detail.video_num }}课时,共{{
|
|
|
- videodetail.detail.duration_num.slice(0, 2)
|
|
|
- }}小时{{ videodetail.detail.duration_num.slice(3, 5) }}分钟{{
|
|
|
- videodetail.detail.duration_num.slice(6, 8)
|
|
|
- }}秒
|
|
|
+ <div class="scroll-container" @scroll="handleScroll">
|
|
|
+ <div class="bg">
|
|
|
+ <div class="box">
|
|
|
+ <div class="top">
|
|
|
+ <div class="content">
|
|
|
+ <div
|
|
|
+ @click="returna"
|
|
|
+ class="title"
|
|
|
+ style="display: flex; align-items: center"
|
|
|
+ >
|
|
|
+ <el-icon><ArrowLeft /></el-icon>
|
|
|
+ <div>{{ videodetail.detail.title }}</div>
|
|
|
</div>
|
|
|
- <div class="time left">
|
|
|
- 课程成员:{{ videodetail.detail.study_num }}人
|
|
|
+ <div class="info">
|
|
|
+ <div class="time" v-if="videodetail.detail.duration_num">
|
|
|
+ 课程总量:{{ videodetail.detail.video_num }}课时,共{{
|
|
|
+ videodetail.detail.duration_num.slice(0, 2)
|
|
|
+ }}小时{{ videodetail.detail.duration_num.slice(3, 5) }}分钟{{
|
|
|
+ videodetail.detail.duration_num.slice(6, 8)
|
|
|
+ }}秒
|
|
|
+ </div>
|
|
|
+ <div class="time left">
|
|
|
+ 课程成员:{{ videodetail.detail.study_num }}人
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="tabs">
|
|
|
- <div class="content" style="display: flex; align-items: center">
|
|
|
- <div @click="tabs(0)" class="tabit">
|
|
|
- <div :class="active == 0 ? 'active' : ''">课程目录</div>
|
|
|
- <div v-if="active == 0" class="line"></div>
|
|
|
- </div>
|
|
|
- <div @click="tabs(1)" class="tabit left">
|
|
|
- <div :class="active == 1 ? 'active' : ''">课程评论</div>
|
|
|
- <div v-if="active == 1" class="line"></div>
|
|
|
+ <div class="tabs">
|
|
|
+ <div class="content" style="display: flex; align-items: center">
|
|
|
+ <div @click="tabs(0)" class="tabit">
|
|
|
+ <div :class="active == 0 ? 'active' : ''">课程目录</div>
|
|
|
+ <div v-if="active == 0" class="line"></div>
|
|
|
+ </div>
|
|
|
+ <div @click="tabs(1)" class="tabit left">
|
|
|
+ <div :class="active == 1 ? 'active' : ''">课程评论</div>
|
|
|
+ <div v-if="active == 1" class="line"></div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <!-- 内容 -->
|
|
|
- <div class="content">
|
|
|
- <div class="course" v-if="active == 0">
|
|
|
- <div v-for="(item, idx) in videodetail.detail.below_course" :key="idx">
|
|
|
- <div class="bigtitle">
|
|
|
- <div>{{ item.title }}</div>
|
|
|
- <div class="time">
|
|
|
- 共{{ item.video.length }}课时,共{{
|
|
|
- item.duration_num.slice(0, 2)
|
|
|
- }}小时{{ item.duration_num.slice(3, 5) }}分钟{{
|
|
|
- item.duration_num.slice(6, 8)
|
|
|
- }}秒
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <!-- 内容 -->
|
|
|
+ <div class="content">
|
|
|
+ <div class="course" v-if="active == 0">
|
|
|
<div
|
|
|
- class="info actinfo"
|
|
|
- v-for="(child, index) in item.video"
|
|
|
- :key="index"
|
|
|
- @click="videoinfo(child.id)"
|
|
|
+ v-for="(item, idx) in videodetail.detail.below_course"
|
|
|
+ :key="idx"
|
|
|
>
|
|
|
- <div style="display: flex; align-items: center">
|
|
|
- <div class="videotitle">
|
|
|
- 第{{ index + 1 }}课 {{ child.title }}
|
|
|
+ <div class="bigtitle">
|
|
|
+ <div>{{ item.title }}</div>
|
|
|
+ <div class="time">
|
|
|
+ 共{{ item.video.length }}课时,共{{
|
|
|
+ item.duration_num.slice(0, 2)
|
|
|
+ }}小时{{ item.duration_num.slice(3, 5) }}分钟{{
|
|
|
+ item.duration_num.slice(6, 8)
|
|
|
+ }}秒
|
|
|
</div>
|
|
|
- <div class="tim">{{ child.duration }}</div>
|
|
|
</div>
|
|
|
- <div style="display: flex; align-items: center">
|
|
|
- <div
|
|
|
- v-if="child.study_record && child.study_record.is_complete == 0"
|
|
|
- >
|
|
|
- <div
|
|
|
- class="jifen"
|
|
|
- style="
|
|
|
- background: #1fb759;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- "
|
|
|
- >
|
|
|
+
|
|
|
+ <template v-for="(child, index) in item.video" :key="index">
|
|
|
+ <div class="info actinfo" @click="videoinfo(child)">
|
|
|
+ <div style="display: flex; align-items: center">
|
|
|
+ <div class="videotitle">
|
|
|
+ 第{{ index + 1 }}课 {{ child.title }}
|
|
|
+ </div>
|
|
|
+ <div class="tim">{{ child.duration }}</div>
|
|
|
+ </div>
|
|
|
+ <div style="display: flex; align-items: center">
|
|
|
+ <div
|
|
|
+ v-if="
|
|
|
+ child.study_record && child.study_record.is_complete == 0
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <div
|
|
|
+ class="jifen"
|
|
|
+ style="
|
|
|
+ background: #1fb759;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <img
|
|
|
+ class="smallimg"
|
|
|
+ src="../../assets/images/yes.png"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ {{ child.points }}积分
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="jifen" v-else>可获得{{ child.points }}积分</div>
|
|
|
+ <div class="lineab"></div>
|
|
|
+ <div
|
|
|
+ class="late"
|
|
|
+ v-if="
|
|
|
+ child.study_record && child.study_record.is_complete == 0
|
|
|
+ "
|
|
|
+ >
|
|
|
+ 已学习
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ v-else-if="
|
|
|
+ child.study_record &&
|
|
|
+ child.study_record.is_complete == 1 &&
|
|
|
+ child.id == videodetail.detail.new_record.video_id
|
|
|
+ "
|
|
|
+ class="late"
|
|
|
+ >
|
|
|
+ 最近学习
|
|
|
+ </div>
|
|
|
+ <img
|
|
|
+ v-if="
|
|
|
+ child.study_record && child.study_record.is_complete == 0
|
|
|
+ "
|
|
|
+ class="smallimg"
|
|
|
+ src="../../assets/images/complete.png"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
<img
|
|
|
+ v-else-if="
|
|
|
+ child.study_record &&
|
|
|
+ child.study_record.is_complete == 1 &&
|
|
|
+ child.id == videodetail.detail.new_record.video_id
|
|
|
+ "
|
|
|
class="smallimg"
|
|
|
- src="../../assets/images/yes.png"
|
|
|
+ src="../../assets/images/lately.png"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ <img
|
|
|
+ v-else
|
|
|
+ class="smallimg"
|
|
|
+ src="../../assets/images/uncompleted.png"
|
|
|
alt=""
|
|
|
/>
|
|
|
- {{ child.points }}积分
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="jifen" v-else>可获得{{ child.points }}积分</div>
|
|
|
- <div class="lineab"></div>
|
|
|
- <div
|
|
|
- class="late"
|
|
|
- v-if="child.study_record && child.study_record.is_complete == 0"
|
|
|
- >
|
|
|
- 已学习
|
|
|
- </div>
|
|
|
- <div
|
|
|
- v-else-if="
|
|
|
- child.study_record &&
|
|
|
- child.study_record.is_complete == 1 &&
|
|
|
- child.id == videodetail.detail.new_record.video_id
|
|
|
- "
|
|
|
- class="late"
|
|
|
- >
|
|
|
- 最近学习
|
|
|
- </div>
|
|
|
- <img
|
|
|
- v-if="child.study_record && child.study_record.is_complete == 0"
|
|
|
- class="smallimg"
|
|
|
- src="../../assets/images/complete.png"
|
|
|
- alt=""
|
|
|
- />
|
|
|
- <img
|
|
|
- v-else-if="
|
|
|
- child.study_record &&
|
|
|
- child.study_record.is_complete == 1 &&
|
|
|
- child.id == videodetail.detail.new_record.video_id
|
|
|
- "
|
|
|
- class="smallimg"
|
|
|
- src="../../assets/images/lately.png"
|
|
|
- alt=""
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 评论 -->
|
|
|
+ <div class="content">
|
|
|
+ <div class="course" v-if="active == 1">
|
|
|
+ <div v-if="islogin">
|
|
|
+ <!-- <div class="bigtitle">评论</div> -->
|
|
|
+ <div>
|
|
|
+ <el-input
|
|
|
+ v-model="textarea"
|
|
|
+ :rows="4"
|
|
|
+ type="textarea"
|
|
|
+ placeholder="请输入评论内容…"
|
|
|
/>
|
|
|
- <img
|
|
|
- v-else
|
|
|
- class="smallimg"
|
|
|
- src="../../assets/images/uncompleted.png"
|
|
|
- alt=""
|
|
|
+ </div>
|
|
|
+ <div class="bluebtn" @click="comment">发布评论</div>
|
|
|
+ <div class="comment-list">
|
|
|
+ <dl v-for="(item, idx) in commentList.list" :key="idx">
|
|
|
+ <dt>
|
|
|
+ <row
|
|
|
+ :name="item.member.nickname"
|
|
|
+ :key="idx"
|
|
|
+ reply=""
|
|
|
+ :descs="item.content"
|
|
|
+ :time="item.created_at"
|
|
|
+ :course_id="route.query.id"
|
|
|
+ video_id=""
|
|
|
+ :author_id="item.member.id"
|
|
|
+ :avatar="item.member.avatar"
|
|
|
+ @list="comment_list"
|
|
|
+ :reply_id="item.id"
|
|
|
+ :reply_p_id="item.id"
|
|
|
+ ></row>
|
|
|
+ </dt>
|
|
|
+ <dd v-for="(child, index) in item.reply" :key="index">
|
|
|
+ <row
|
|
|
+ :name="child.member.nickname"
|
|
|
+ :reply="child.reply_member.nickname"
|
|
|
+ :descs="child.content"
|
|
|
+ :course_id="route.query.id"
|
|
|
+ video_id=""
|
|
|
+ :author_id="child.member.id"
|
|
|
+ :avatar="child.member.avatar"
|
|
|
+ @list="comment_list"
|
|
|
+ :time="child.created_at"
|
|
|
+ :reply_id="child.id"
|
|
|
+ :reply_p_id="child.reply_p_id"
|
|
|
+ ></row>
|
|
|
+ </dd>
|
|
|
+ </dl>
|
|
|
+ </div>
|
|
|
+ <div v-if="commentList.list.length > 0">
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ layout="prev, pager, next"
|
|
|
+ :total="total"
|
|
|
+ @size-change="handleSizeChange"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ :page-size="5"
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <div v-else>
|
|
|
+ <div class="bigtitle">评论</div>
|
|
|
+ <div
|
|
|
+ style="display: flex; flex-direction: column; align-items: center"
|
|
|
+ >
|
|
|
+ <img class="suo" src="../../assets/images/suo.png" alt="" />
|
|
|
+ <div class="login">登录后才能查看评论</div>
|
|
|
+ <div class="log" @click="tologin">立即登录</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <!-- 评论 -->
|
|
|
- <div class="content">
|
|
|
- <div class="course" v-if="active == 1">
|
|
|
- <div v-if="islogin">
|
|
|
- <!-- <div class="bigtitle">评论</div> -->
|
|
|
- <div>
|
|
|
- <el-input
|
|
|
- v-model="textarea"
|
|
|
- :rows="4"
|
|
|
- type="textarea"
|
|
|
- placeholder="请输入评论内容…"
|
|
|
- />
|
|
|
- </div>
|
|
|
- <div class="bluebtn" @click="comment">发布评论</div>
|
|
|
- <div class="comment-list">
|
|
|
- <dl v-for="(item, idx) in commentList.list" :key="idx">
|
|
|
- <dt>
|
|
|
- <row
|
|
|
- :name="item.member.nickname"
|
|
|
- :key="idx"
|
|
|
- reply=""
|
|
|
- :descs="item.content"
|
|
|
- :time="item.created_at"
|
|
|
- :course_id="route.query.id"
|
|
|
- video_id=""
|
|
|
- :author_id="item.member.id"
|
|
|
- :avatar="item.member.avatar"
|
|
|
- @list="comment_list"
|
|
|
- :reply_id="item.id"
|
|
|
- :reply_p_id="item.id"
|
|
|
- ></row>
|
|
|
- </dt>
|
|
|
- <dd v-for="(child, index) in item.reply" :key="index">
|
|
|
- <row
|
|
|
- :name="child.member.nickname"
|
|
|
- :reply="child.reply_member.nickname"
|
|
|
- :descs="child.content"
|
|
|
- :course_id="route.query.id"
|
|
|
- video_id=""
|
|
|
- :author_id="child.member.id"
|
|
|
- :avatar="child.member.avatar"
|
|
|
- @list="comment_list"
|
|
|
- :time="child.created_at"
|
|
|
- :reply_id="child.id"
|
|
|
- :reply_p_id="child.reply_p_id"
|
|
|
- ></row>
|
|
|
- </dd>
|
|
|
- </dl>
|
|
|
+ <!-- 定位 -->
|
|
|
+ <div class="fix">
|
|
|
+ <div class="img">
|
|
|
+ <img class="img" :src="videodetail.detail.image" alt="" />
|
|
|
+ </div>
|
|
|
+ <div style="display: flex; flex-direction: column; align-items: center">
|
|
|
+ <div class="join" v-if="islogin && is_join == 0">
|
|
|
+ <div>您已加入</div>
|
|
|
+ <div class="success">完成进度{{ percentage }}%</div>
|
|
|
</div>
|
|
|
- <div v-if="commentList.list.length > 0">
|
|
|
- <el-pagination
|
|
|
- background
|
|
|
- layout="prev, pager, next"
|
|
|
- :total="total"
|
|
|
- @size-change="handleSizeChange"
|
|
|
- @current-change="handleCurrentChange"
|
|
|
- :page-size="5"
|
|
|
+ <div class="progress" v-if="islogin && is_join == 0">
|
|
|
+ <el-progress
|
|
|
+ :percentage="percentage"
|
|
|
+ :color="customColor"
|
|
|
+ :show-text="false"
|
|
|
/>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div v-else>
|
|
|
- <div class="bigtitle">评论</div>
|
|
|
<div
|
|
|
- style="display: flex; flex-direction: column; align-items: center"
|
|
|
+ class="button"
|
|
|
+ v-if="is_join == 0"
|
|
|
+ @click="videoinfo(videodetail.detail.new_record)"
|
|
|
>
|
|
|
- <img class="suo" src="../../assets/images/suo.png" alt="" />
|
|
|
- <div class="login">登录后才能查看评论</div>
|
|
|
- <div class="log" @click="tologin">立即登录</div>
|
|
|
+ 继续学习
|
|
|
+ </div>
|
|
|
+ <div class="button" v-if="is_join == 1 && islogin" @click="join">
|
|
|
+ 加入课程
|
|
|
+ </div>
|
|
|
+ <div class="updata" v-if="videodetail.detail.updated_at">
|
|
|
+ 最后更新时间:{{ videodetail.detail.updated_at.slice(0, 10) }}
|
|
|
+ </div>
|
|
|
+ <div class="linea"></div>
|
|
|
+ <div class="share">
|
|
|
+ <img class="image" src="../../assets/images/share.png" alt="" />
|
|
|
+ <div class="font" @click="shareLink">分享</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <!-- 定位 -->
|
|
|
- <div class="fix">
|
|
|
- <div class="img">
|
|
|
- <img class="img" :src="videodetail.detail.image" alt="" />
|
|
|
- </div>
|
|
|
- <div style="display: flex; flex-direction: column; align-items: center">
|
|
|
- <div class="join" v-if="islogin && is_join == 0">
|
|
|
- <div>您已加入</div>
|
|
|
- <div class="success">完成进度{{ percentage }}%</div>
|
|
|
- </div>
|
|
|
- <div class="progress" v-if="islogin && is_join == 0">
|
|
|
- <el-progress
|
|
|
- :percentage="percentage"
|
|
|
- :color="customColor"
|
|
|
- :show-text="false"
|
|
|
- />
|
|
|
- </div>
|
|
|
- <div
|
|
|
- class="button"
|
|
|
- v-if="is_join == 0"
|
|
|
- @click="
|
|
|
- videoinfo(
|
|
|
- videodetail.detail.new_record.video_id,
|
|
|
- videodetail.detail.new_record.duration
|
|
|
- )
|
|
|
- "
|
|
|
- >
|
|
|
- 继续学习
|
|
|
- </div>
|
|
|
- <div class="button" v-if="is_join == 1 && islogin" @click="join">
|
|
|
- 加入课程
|
|
|
- </div>
|
|
|
- <div class="updata" v-if="videodetail.detail.updated_at">
|
|
|
- 最后更新时间:{{ videodetail.detail.updated_at.slice(0, 10) }}
|
|
|
- </div>
|
|
|
- <div class="linea"></div>
|
|
|
- <div class="share">
|
|
|
- <img class="image" src="../../assets/images/share.png" alt="" />
|
|
|
- <div class="font" @click="shareLink">分享</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -245,6 +256,7 @@ import { onMounted, ref, reactive } from "vue";
|
|
|
import * as videoAPi from "../../api/kecheng";
|
|
|
import row from "../../components/row/row.vue";
|
|
|
import * as copyDomText from "../../utils/common";
|
|
|
+import { ArrowLeft } from "@element-plus/icons-vue";
|
|
|
const router = useRouter();
|
|
|
const route = useRoute();
|
|
|
//判断是否加入
|
|
@@ -262,6 +274,10 @@ const videodetail = reactive({
|
|
|
const commentList = reactive({
|
|
|
list: [],
|
|
|
});
|
|
|
+//返回
|
|
|
+const returna = () => {
|
|
|
+ router.go(-1);
|
|
|
+};
|
|
|
//进度条
|
|
|
const percentage = ref(0);
|
|
|
const read = ref(0);
|
|
@@ -370,18 +386,28 @@ const tabs = (idx) => {
|
|
|
active.value = idx;
|
|
|
};
|
|
|
const customColor = ref("#409eff");
|
|
|
-const videoinfo = (id, time) => {
|
|
|
+const videoinfo = (child) => {
|
|
|
router.push({
|
|
|
name: "info",
|
|
|
query: {
|
|
|
- id: id,
|
|
|
- time: time || 0,
|
|
|
+ id: child.video_id || child.id,
|
|
|
+ time: child.study_record == null ? 0 : child.study_record.duration,
|
|
|
+ is_complete:child.study_record == null ? 1 : child.study_record.is_complete,
|
|
|
},
|
|
|
});
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
+:deep(.el-icon svg) {
|
|
|
+ width: 24px !important;
|
|
|
+ height: 24px !important;
|
|
|
+}
|
|
|
+.scroll-container {
|
|
|
+ height: 100vh;
|
|
|
+ overflow-y: scroll;
|
|
|
+ overflow-x: hidden;
|
|
|
+}
|
|
|
.videotitle {
|
|
|
width: 420px;
|
|
|
-webkit-line-clamp: 2;
|
|
@@ -542,7 +568,7 @@ const videoinfo = (id, time) => {
|
|
|
margin-right: 4px;
|
|
|
}
|
|
|
.jifen {
|
|
|
- width: 88px;
|
|
|
+ // width: 88px;
|
|
|
height: 24px;
|
|
|
background: #0d0fff;
|
|
|
border-radius: 2px;
|
|
@@ -554,6 +580,8 @@ const videoinfo = (id, time) => {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
+ padding: 3px 8px;
|
|
|
+ box-sizing: border-box;
|
|
|
}
|
|
|
.fix {
|
|
|
position: absolute;
|
|
@@ -756,6 +784,7 @@ const videoinfo = (id, time) => {
|
|
|
text-align: left;
|
|
|
font-style: normal;
|
|
|
margin-top: 76px;
|
|
|
+ cursor: pointer;
|
|
|
}
|
|
|
.info {
|
|
|
display: flex;
|