|
@@ -1,6 +1,6 @@
|
|
import request from '@/helpers/request'
|
|
import request from '@/helpers/request'
|
|
import { state } from '@/state'
|
|
import { state } from '@/state'
|
|
-import { Button, Cell, CellGroup, Popup, Dialog, Toast } from 'vant'
|
|
|
|
|
|
+import { Button, Cell, CellGroup, Popup, Dialog, Toast, Circle } from 'vant'
|
|
import { Vue3Lottie } from 'vue3-lottie'
|
|
import { Vue3Lottie } from 'vue3-lottie'
|
|
import AstronautJSON from '../music-detail/animate/bigLoad.json'
|
|
import AstronautJSON from '../music-detail/animate/bigLoad.json'
|
|
import {
|
|
import {
|
|
@@ -18,24 +18,16 @@ import {
|
|
postMessage,
|
|
postMessage,
|
|
removeListenerMessage
|
|
removeListenerMessage
|
|
} from '@/helpers/native-message'
|
|
} from '@/helpers/native-message'
|
|
-// import iconLook from './image/look.svg'
|
|
|
|
import iconCourse from './image/icon-course.png'
|
|
import iconCourse from './image/icon-course.png'
|
|
import iconCachePoint from './image/icon-cache-point.png'
|
|
import iconCachePoint from './image/icon-cache-point.png'
|
|
-// import iconCourseLock from './image/icon-course-lock.png';
|
|
|
|
-// import iconTip from './image/iconTip.png';
|
|
|
|
|
|
+import play from './image/paly.png'
|
|
import { browser } from '@/helpers/utils'
|
|
import { browser } from '@/helpers/utils'
|
|
import ColResult from '@/components/col-result'
|
|
import ColResult from '@/components/col-result'
|
|
-function hasVip() {
|
|
|
|
- return false
|
|
|
|
-}
|
|
|
|
-function handleCheckVip() {
|
|
|
|
- return false
|
|
|
|
-}
|
|
|
|
|
|
+import { useEventListener } from '@vant/use'
|
|
import TheSticky from '@/components/the-sticky'
|
|
import TheSticky from '@/components/the-sticky'
|
|
import ColHeader from '@/components/col-header'
|
|
import ColHeader from '@/components/col-header'
|
|
import iconList from './image/icon-list.png'
|
|
import iconList from './image/icon-list.png'
|
|
// import OSticky from '@/components/o-sticky';
|
|
// import OSticky from '@/components/o-sticky';
|
|
-import { useEventListener } from '@vant/use'
|
|
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
name: 'courseList',
|
|
name: 'courseList',
|
|
setup() {
|
|
setup() {
|
|
@@ -47,32 +39,33 @@ export default defineComponent({
|
|
catchStatus: false,
|
|
catchStatus: false,
|
|
catchItem: {} as any,
|
|
catchItem: {} as any,
|
|
loading: true,
|
|
loading: true,
|
|
- detail: {
|
|
|
|
- cover: '',
|
|
|
|
- name: '',
|
|
|
|
- des: ''
|
|
|
|
- },
|
|
|
|
|
|
+ detail: {} as Record<string, any>,
|
|
list: [] as any,
|
|
list: [] as any,
|
|
isDownloading: false // 是否在下载资源
|
|
isDownloading: false // 是否在下载资源
|
|
})
|
|
})
|
|
|
|
|
|
/** 获取课件详情 */
|
|
/** 获取课件详情 */
|
|
const getDetail = async () => {
|
|
const getDetail = async () => {
|
|
- const res: any = await request.get(
|
|
|
|
- `${state.platformApi}/lessonCourseware/getLessonCoursewareDetail/${route.query.id}`
|
|
|
|
- )
|
|
|
|
- if (res?.data) {
|
|
|
|
- data.detail.cover = res.data.coverImg
|
|
|
|
- data.detail.name = res.data.name
|
|
|
|
- data.detail.des = res.data.lessonTargetDesc
|
|
|
|
|
|
+ try {
|
|
|
|
+ const res: any = await request.post(
|
|
|
|
+ `/api-student/tenantAlbumMusic/getLessonCoursewareDetail`,
|
|
|
|
+ {
|
|
|
|
+ data: {
|
|
|
|
+ lessonCoursewareId: route.query.id,
|
|
|
|
+ albumId: route.query.albumId
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ )
|
|
|
|
+ data.detail = res?.data || {}
|
|
|
|
+ } catch {
|
|
|
|
+ //
|
|
}
|
|
}
|
|
}
|
|
}
|
|
const getList = async () => {
|
|
const getList = async () => {
|
|
data.loading = true
|
|
data.loading = true
|
|
try {
|
|
try {
|
|
const res: any = await request.get(
|
|
const res: any = await request.get(
|
|
- state.platformApi +
|
|
|
|
- '/lessonCourseware/getLessonCoursewareCourseList/' +
|
|
|
|
|
|
+ '/api-student/tenantAlbumMusic/getLessonCoursewareCourseList/' +
|
|
route.query.id
|
|
route.query.id
|
|
)
|
|
)
|
|
if (Array.isArray(res?.data)) {
|
|
if (Array.isArray(res?.data)) {
|
|
@@ -136,16 +129,16 @@ export default defineComponent({
|
|
})
|
|
})
|
|
|
|
|
|
const handleClick = async (item: any) => {
|
|
const handleClick = async (item: any) => {
|
|
|
|
+ if (!data.detail?.play) {
|
|
|
|
+ gotoPlay(item)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
if (!item.knowledgePointList) {
|
|
if (!item.knowledgePointList) {
|
|
Dialog.confirm({
|
|
Dialog.confirm({
|
|
message: '该课件暂无知识点'
|
|
message: '该课件暂无知识点'
|
|
})
|
|
})
|
|
return
|
|
return
|
|
}
|
|
}
|
|
-
|
|
|
|
- const isVip = handleCheckVip()
|
|
|
|
- if (!isVip) return
|
|
|
|
-
|
|
|
|
if (!item.hasCache) {
|
|
if (!item.hasCache) {
|
|
// const hasFree = String(item.accessScope) === '0';
|
|
// const hasFree = String(item.accessScope) === '0';
|
|
// if (!hasFree) {
|
|
// if (!hasFree) {
|
|
@@ -229,6 +222,7 @@ export default defineComponent({
|
|
}
|
|
}
|
|
// 下载缓存
|
|
// 下载缓存
|
|
const downCatch = async (item: any) => {
|
|
const downCatch = async (item: any) => {
|
|
|
|
+ console.log(item)
|
|
if (browserInfo.isApp) {
|
|
if (browserInfo.isApp) {
|
|
data.catchStatus = false
|
|
data.catchStatus = false
|
|
data.isDownloading = true
|
|
data.isDownloading = true
|
|
@@ -279,7 +273,7 @@ export default defineComponent({
|
|
<TheSticky position="top">
|
|
<TheSticky position="top">
|
|
<ColHeader
|
|
<ColHeader
|
|
hideHeader={false}
|
|
hideHeader={false}
|
|
- background="transparent"
|
|
|
|
|
|
+ background={`rgba(255,255,255, ${data.titleOpacity})`}
|
|
isFixed={false}
|
|
isFixed={false}
|
|
border={false}
|
|
border={false}
|
|
title={'教程详情'}
|
|
title={'教程详情'}
|
|
@@ -289,7 +283,7 @@ export default defineComponent({
|
|
<div class={styles.periodContent}>
|
|
<div class={styles.periodContent}>
|
|
<div class={styles.cover}>
|
|
<div class={styles.cover}>
|
|
<img
|
|
<img
|
|
- src={data.detail.cover}
|
|
|
|
|
|
+ src={data.detail.coverImg}
|
|
onLoad={(e: Event) => {
|
|
onLoad={(e: Event) => {
|
|
if (e.target) {
|
|
if (e.target) {
|
|
;(e.target as any).style.opacity = 1
|
|
;(e.target as any).style.opacity = 1
|
|
@@ -299,7 +293,9 @@ export default defineComponent({
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div>
|
|
<div class={styles.contentTitle}>{data.detail.name}</div>
|
|
<div class={styles.contentTitle}>{data.detail.name}</div>
|
|
- <div class={styles.contentLabel}>教学目标:{data.detail.des}</div>
|
|
|
|
|
|
+ <div class={styles.contentLabel}>
|
|
|
|
+ 教学目标:{data.detail.lessonTargetDesc}
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<TransitionGroup name="van-fade">
|
|
<TransitionGroup name="van-fade">
|
|
@@ -345,7 +341,7 @@ export default defineComponent({
|
|
) : (
|
|
) : (
|
|
''
|
|
''
|
|
)}
|
|
)}
|
|
- {item.downloadStatus === 1 && (
|
|
|
|
|
|
+ {item.downloadStatus == 1 && (
|
|
<div class={styles.downloading}>{`${
|
|
<div class={styles.downloading}>{`${
|
|
item.progress || 0
|
|
item.progress || 0
|
|
}%`}</div>
|
|
}%`}</div>
|
|
@@ -357,37 +353,20 @@ export default defineComponent({
|
|
<>
|
|
<>
|
|
{item.knowledgePointList ? (
|
|
{item.knowledgePointList ? (
|
|
<>
|
|
<>
|
|
- {item.hasCache ? (
|
|
|
|
- <Button
|
|
|
|
- class={[
|
|
|
|
- styles.baseBtn,
|
|
|
|
- styles.look,
|
|
|
|
- state.platformType === 'STUDENT' &&
|
|
|
|
- !hasVip()
|
|
|
|
- ? styles.disabled
|
|
|
|
- : ''
|
|
|
|
- ]}
|
|
|
|
- >
|
|
|
|
- 查看
|
|
|
|
- </Button>
|
|
|
|
|
|
+ {item.hasCache ||
|
|
|
|
+ item.downloadStatus !== 1 ? (
|
|
|
|
+ <img class={styles.basePlay} src={play} />
|
|
) : (
|
|
) : (
|
|
- <Button
|
|
|
|
- class={[
|
|
|
|
- styles.baseBtn,
|
|
|
|
- styles.down,
|
|
|
|
- state.platformType === 'STUDENT' &&
|
|
|
|
- !hasVip()
|
|
|
|
- ? styles.disabled
|
|
|
|
- : '',
|
|
|
|
- item.downloadStatus == 1
|
|
|
|
- ? styles.downing
|
|
|
|
- : ''
|
|
|
|
- ]}
|
|
|
|
- >
|
|
|
|
- {item.downloadStatus === 1
|
|
|
|
- ? `取消下载`
|
|
|
|
- : '查看'}
|
|
|
|
- </Button>
|
|
|
|
|
|
+ <div class={styles.circleProgress}>
|
|
|
|
+ <Circle
|
|
|
|
+ v-model:current-rate={item.progress}
|
|
|
|
+ rate={item.progress}
|
|
|
|
+ speed={10}
|
|
|
|
+ stroke-width={80}
|
|
|
|
+ layer-color={'#B3B3B3'}
|
|
|
|
+ color={'#FE2451'}
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
)}
|
|
)}
|
|
</>
|
|
</>
|
|
) : (
|
|
) : (
|
|
@@ -416,6 +395,23 @@ export default defineComponent({
|
|
{!data.loading && !data.list.length && (
|
|
{!data.loading && !data.list.length && (
|
|
<ColResult tips="暂无内容" classImgSize="SMALL" btnStatus={false} />
|
|
<ColResult tips="暂无内容" classImgSize="SMALL" btnStatus={false} />
|
|
)}
|
|
)}
|
|
|
|
+ <TheSticky position="bottom">
|
|
|
|
+ {!data.detail.play && (
|
|
|
|
+ <div class={styles.footers}>
|
|
|
|
+ <Button
|
|
|
|
+ round
|
|
|
|
+ block
|
|
|
|
+ type="primary"
|
|
|
|
+ color="linear-gradient(270deg, #FF3C81 0%, #FF76A6 100%)"
|
|
|
|
+ onClick={() => {
|
|
|
|
+ //
|
|
|
|
+ }}
|
|
|
|
+ >
|
|
|
|
+ 开通训练教程
|
|
|
|
+ </Button>
|
|
|
|
+ </div>
|
|
|
|
+ )}
|
|
|
|
+ </TheSticky>
|
|
<Popup
|
|
<Popup
|
|
v-model:show={data.catchStatus}
|
|
v-model:show={data.catchStatus}
|
|
round
|
|
round
|