|
|
|
@ -11,6 +11,7 @@ import curRecord from '@/static/img/curRecord.png' |
|
|
|
|
import hourRecord from "@/static/img/hourRecord.png" |
|
|
|
|
import CustomPageContainer from "@/components/custom-page-container/custom-page-container"; |
|
|
|
|
import {Profile} from "@/store"; |
|
|
|
|
import LoginView from "@/components/loginView"; |
|
|
|
|
|
|
|
|
|
interface Props { |
|
|
|
|
data: CourseDepData | null |
|
|
|
@ -30,7 +31,7 @@ const Catalogue: FC<Props> = ({data, setHors, id, playId}) => { |
|
|
|
|
const [current, setCurrent] = useState(1) |
|
|
|
|
const [show, setShow] = useState(false) |
|
|
|
|
const [playing, setPlaying] = useState(false) |
|
|
|
|
const {token, empty} = Profile.useContainer() |
|
|
|
|
const {token} = Profile.useContainer() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
videoEvents.onVideoState(({name}) => { |
|
|
|
@ -154,6 +155,19 @@ const Catalogue: FC<Props> = ({data, setHors, id, playId}) => { |
|
|
|
|
{current === 0 && <View className='short_desc'>{data?.course.short_desc || data?.course.title}</View>} |
|
|
|
|
{current === 1 && <View> |
|
|
|
|
<View className='my-2'>课程目录</View> |
|
|
|
|
{!token && <LoginView offImage style={{ |
|
|
|
|
position: 'absolute', |
|
|
|
|
left: 0, |
|
|
|
|
height: 'auto', |
|
|
|
|
right: 0, |
|
|
|
|
bottom: 0, |
|
|
|
|
top: 0, |
|
|
|
|
margin: 'auto', |
|
|
|
|
paddingTop: '100rpx', |
|
|
|
|
justifyContent: 'flex-end', |
|
|
|
|
flexDirection: 'column-reverse', |
|
|
|
|
background: 'rgba(255,255,255,.9)' |
|
|
|
|
}}/>} |
|
|
|
|
{data?.chapters.length |
|
|
|
|
? Object.values(data?.chapters || {}).map((d, index) => <View key={d.id}> |
|
|
|
|
<Collapse title={`${index + 1}.${d.name}`}> |
|
|
|
@ -175,18 +189,15 @@ const Catalogue: FC<Props> = ({data, setHors, id, playId}) => { |
|
|
|
|
</View> |
|
|
|
|
</View> |
|
|
|
|
|
|
|
|
|
<View className='Videobutton'> |
|
|
|
|
{ |
|
|
|
|
token ? <> |
|
|
|
|
token && <View className='Videobutton'> |
|
|
|
|
{ |
|
|
|
|
playing ? <MyButton className='flex-1' onClick={onPause}>暂停</MyButton> |
|
|
|
|
: <MyButton className='flex-1' onClick={learning}>立即学习</MyButton> |
|
|
|
|
} |
|
|
|
|
<View className='px-3' onClick={() => setShow(true)}>...</View> |
|
|
|
|
</> |
|
|
|
|
: <MyButton className='flex-1' onClick={() => empty()}>立即登录</MyButton> |
|
|
|
|
} |
|
|
|
|
</View> |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
<CustomPageContainer |
|
|
|
|
show={show} |
|
|
|
|