|
|
|
@ -20,6 +20,7 @@ interface Props { |
|
|
|
|
setHors: (is_complete: boolean, id: number) => void |
|
|
|
|
id: number //课程
|
|
|
|
|
playId: number | null |
|
|
|
|
refresh: () => void |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const tabList = [ |
|
|
|
@ -29,7 +30,7 @@ const tabList = [ |
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Catalogue: FC<Props> = ({data, setHors, id, playId}) => { |
|
|
|
|
const Catalogue: FC<Props> = ({data, setHors, id, playId, refresh}) => { |
|
|
|
|
const [current, setCurrent] = useState(1) |
|
|
|
|
const [show, setShow] = useState(false) |
|
|
|
|
const [playing, setPlaying] = useState(false) |
|
|
|
@ -152,19 +153,24 @@ 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)' |
|
|
|
|
}}/>} |
|
|
|
|
{ |
|
|
|
|
!token && <LoginView |
|
|
|
|
onSuccess={refresh} |
|
|
|
|
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}`}> |
|
|
|
|