Commit ffaaa96d by guomingpang

feat:外部课程相关模块提交

parent 34887728
...@@ -64,7 +64,15 @@ class VideoCourseList extends React.Component { ...@@ -64,7 +64,15 @@ class VideoCourseList extends React.Component {
return ( return (
<div className='record__item'> <div className='record__item'>
{/* 上传了封面的话就用上传的封面, 没有的话就取视频的第一帧 */} {/* 上传了封面的话就用上传的封面, 没有的话就取视频的第一帧 */}
<img className='course-cover' src={coverUrl || `${scheduleVideoUrl}?x-oss-process=video/snapshot,t_0,m_fast`} alt='' /> <img
className='course-cover'
src={
coverUrl || type === 'internal'
? `${scheduleVideoUrl}?x-oss-process=video/snapshot,t_0,m_fast`
: 'https://image.xiaomaiketang.com/xm/mt3ZQRxGKB.png'
}
alt=''
/>
<Choose> <Choose>
<When condition={record.courseName.length > 25}> <When condition={record.courseName.length > 25}>
<Tooltip title={record.courseName}> <Tooltip title={record.courseName}>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2020-08-05 10:08:06 * @Date: 2020-08-05 10:08:06
* @LastEditors: fusanqiasng * @LastEditors: fusanqiasng
* @LastEditTime: 2021-05-25 12:00:56 * @LastEditTime: 2021-05-25 18:08:10
* @Description: 云课堂-视频课入口页面 * @Description: 云课堂-视频课入口页面
* @Copyright: 杭州杰竞科技有限公司 版权所有 * @Copyright: 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -51,6 +51,12 @@ class VideoCourse extends React.Component { ...@@ -51,6 +51,12 @@ class VideoCourse extends React.Component {
CourseService.videoSchedulePage(query).then((res) => { CourseService.videoSchedulePage(query).then((res) => {
const { result = {} } = res || {} const { result = {} } = res || {}
const { records = [], total = 0 } = result const { records = [], total = 0 } = result
if (query.size * (query.current - 1) >= Number(total)) {
this.handleFetchScheduleList({
current: 1
})
return
}
this.setState({ this.setState({
dataSource: records, dataSource: records,
totalCount: Number(total) totalCount: Number(total)
...@@ -58,9 +64,14 @@ class VideoCourse extends React.Component { ...@@ -58,9 +64,14 @@ class VideoCourse extends React.Component {
}) })
} }
currenTabChange = (currentTabKey) => { currenTabChange = (currentTabKey) => {
const { query } = this.state
this.setState( this.setState(
{ {
currentTabKey currentTabKey,
query: {
...query,
current: 1
}
}, },
() => { () => {
this.handleFetchScheduleList() this.handleFetchScheduleList()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment