|
@@ -1,6 +1,17 @@
|
|
|
import request from '@/helpers/request'
|
|
|
import { state } from '@/state'
|
|
|
-import { Button, Empty, Grid, GridItem, Icon, showConfirmDialog, showToast } from 'vant'
|
|
|
+import {
|
|
|
+ Button,
|
|
|
+ Cell,
|
|
|
+ CellGroup,
|
|
|
+ Empty,
|
|
|
+ Grid,
|
|
|
+ GridItem,
|
|
|
+ Icon,
|
|
|
+ showConfirmDialog,
|
|
|
+ showToast,
|
|
|
+ Space
|
|
|
+} from 'vant'
|
|
|
import { defineComponent, onMounted, reactive, onUnmounted } from 'vue'
|
|
|
import styles from './index.module.less'
|
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
@@ -12,11 +23,15 @@ import {
|
|
|
} from '@/helpers/native-message'
|
|
|
import iconLook from './image/look.svg'
|
|
|
import iconCourse from './image/icon-course.png'
|
|
|
+import iconCourseLock from './image/icon-course-lock.png'
|
|
|
import { browser } from '@/helpers/utils'
|
|
|
import OEmpty from '@/components/o-empty'
|
|
|
import { handleCheckVip } from '../hook/useFee'
|
|
|
+import iconList from './image/icon-list.png'
|
|
|
+import OSticky from '@/components/o-sticky'
|
|
|
+import OHeader from '@/components/o-header'
|
|
|
export default defineComponent({
|
|
|
- name: 'lessonCourseware',
|
|
|
+ name: 'courseList',
|
|
|
setup() {
|
|
|
const route = useRoute()
|
|
|
const router = useRouter()
|
|
@@ -185,59 +200,95 @@ export default defineComponent({
|
|
|
} catch (error) {}
|
|
|
}
|
|
|
return () => (
|
|
|
- <div style={{ paddingTop: '14px' }}>
|
|
|
- <Grid gutter={14} columnNum={3} class={styles.grid}>
|
|
|
- {data.list.map((item: any) => {
|
|
|
- return (
|
|
|
- <GridItem>
|
|
|
- <div class={styles.gridItem} onClick={() => handleClick(item)}>
|
|
|
- <img src={iconCourse} class={styles.cover} />
|
|
|
- <div class={styles.title}>
|
|
|
- <div class="van-multi-ellipsis--l2">{item.coursewareDetailName}</div>
|
|
|
- {!browserInfo.isStudent && (
|
|
|
- <div class={styles.subtitle}>已使用 {item.useNum} 次</div>
|
|
|
- )}
|
|
|
- </div>
|
|
|
- {route.query.code !== 'select' ? (
|
|
|
- <>
|
|
|
- {!!item.knowledgePointList && (
|
|
|
- <>
|
|
|
- {item.hasCache ? (
|
|
|
- <div class={styles.num}>
|
|
|
- 查看
|
|
|
- <Icon name="play-circle-o" />
|
|
|
- </div>
|
|
|
- ) : (
|
|
|
- <>
|
|
|
- {item.downloadStatus === 1 ? (
|
|
|
- <div class={styles.num}>下载中 {item.progress || 0}%</div>
|
|
|
- ) : item.downloadStatus === 2 ? (
|
|
|
- <div class={styles.num}>下载成功</div>
|
|
|
- ) : item.downloadStatus === 3 ? (
|
|
|
- <div class={styles.num}>重新下载</div>
|
|
|
- ) : (
|
|
|
- <div class={styles.num}>下载</div>
|
|
|
- )}
|
|
|
- </>
|
|
|
- )}
|
|
|
- </>
|
|
|
- )}
|
|
|
- </>
|
|
|
- ) : (
|
|
|
- <div class={styles.num}>选择</div>
|
|
|
- )}
|
|
|
+ <div class={styles.courseList}>
|
|
|
+ <OSticky
|
|
|
+ onGetHeight={(height: number) => {
|
|
|
+ document.documentElement.style.setProperty('--header-height', height + 'px')
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ <OHeader
|
|
|
+ border={false}
|
|
|
+ background="transparent"
|
|
|
+ color="rgba(124, 61, 18, 1)"
|
|
|
+ title="我的教材"
|
|
|
+ />
|
|
|
+ </OSticky>
|
|
|
+
|
|
|
+ <div class={styles.periodContent}>
|
|
|
+ <img class={styles.cover} src={'https://gyt.ks3-cn-beijing.ksyuncs.com/courseware/1678340522843.png'} />
|
|
|
+ <div>
|
|
|
+ <div class={styles.contentTitle}>小号第三学期 (上册)</div>
|
|
|
+ <div class={styles.contentLabel}>
|
|
|
+ 教学目标:让学生了解小号乐器的组成,学习呼吸的方式,学习基础的嘴形以及乐理知识。让学生了解小号乐器的组成。
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
|
|
|
- {(route.query.code == 'select' || state.platformType == 'STUDENT') &&
|
|
|
- !item.unlock && (
|
|
|
- <div class={styles.look} onClick={(e: Event) => e.stopPropagation()}>
|
|
|
- <Icon name={iconLook} /> 未解锁
|
|
|
+ <div class={styles.periodTitle}>
|
|
|
+ <img class={styles.pIcon} src={iconList} />
|
|
|
+ <div class={styles.pTitle}>课程列表</div>
|
|
|
+ <div class={styles.pNum}>共{data.list.length}课</div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class={styles.periodList}>
|
|
|
+ <CellGroup inset>
|
|
|
+ {data.list.map((item: any) => {
|
|
|
+ const isLock =
|
|
|
+ (route.query.code == 'select' || state.platformType == 'STUDENT') &&
|
|
|
+ !item.unlock &&
|
|
|
+ true
|
|
|
+ const isSelect = route.query.code === 'select'
|
|
|
+ return (
|
|
|
+ <Cell
|
|
|
+ border
|
|
|
+ center
|
|
|
+ title={item.coursewareDetailName}
|
|
|
+ label={`已使用${item.useNum}次`}
|
|
|
+ onClick={() => !isLock && handleClick(item)}
|
|
|
+ >
|
|
|
+ {{
|
|
|
+ icon: () => (
|
|
|
+ <div class={styles.periodItem}>
|
|
|
+ <div class={styles.periodItemModel}>
|
|
|
+ <img src={isLock ? iconCourseLock : iconCourse} />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- )}
|
|
|
- </div>
|
|
|
- </GridItem>
|
|
|
- )
|
|
|
- })}
|
|
|
- </Grid>
|
|
|
+ ),
|
|
|
+ value: () => (
|
|
|
+ <>
|
|
|
+ {isSelect ? (
|
|
|
+ <Button class={[styles.baseBtn, styles.look]}>选择</Button>
|
|
|
+ ) : item.knowledgePointList ? (
|
|
|
+ <>
|
|
|
+ {item.hasCache ? (
|
|
|
+ <Button class={[styles.baseBtn, styles.look]}>查看</Button>
|
|
|
+ ) : (
|
|
|
+ <Button
|
|
|
+ disabled={isLock}
|
|
|
+ class={[styles.baseBtn, isLock ? styles.disable : styles.down]}
|
|
|
+ >
|
|
|
+ {item.downloadStatus === 1
|
|
|
+ ? `下载中 ${item.progress || 0}%`
|
|
|
+ : item.downloadStatus === 2
|
|
|
+ ? '下载成功'
|
|
|
+ : item.downloadStatus === 3
|
|
|
+ ? '重新下载'
|
|
|
+ : '下载'}
|
|
|
+ </Button>
|
|
|
+ )}
|
|
|
+ </>
|
|
|
+ ) : (
|
|
|
+ ''
|
|
|
+ )}
|
|
|
+ </>
|
|
|
+ )
|
|
|
+ }}
|
|
|
+ </Cell>
|
|
|
+ )
|
|
|
+ })}
|
|
|
+ </CellGroup>
|
|
|
+ </div>
|
|
|
+
|
|
|
{!data.loading && !data.list.length && <OEmpty tips="暂无内容" />}
|
|
|
</div>
|
|
|
)
|