Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

courseware
daiao 5 years ago
commit db176376a9

@ -191,15 +191,21 @@ class Video extends Component {
const CourseId = this.props.match.params.coursesId; const CourseId = this.props.match.params.coursesId;
const VID = this.props.match.params.videoId; const VID = this.props.match.params.videoId;
const login = this.props.user && this.props.user.login; let login = this.props && this.props.user&&this.props.user.login;;
const _inputValue = videoId && this.getCopyText(videoId.file_url, videoId.cover_url); const _inputValue = videoId && this.getCopyText(videoId.file_url, videoId.cover_url);
const { admin, is_teacher, business, user_id } = this.props.user; // const { admin, is_teacher, business, user_id } = this.props && this.props.user;
let admin = this.props && this.props.user&&this.props.user.admin;;
let business = this.props && this.props.user&&this.props.user.business;;
let user_id = this.props && this.props.user&&this.props.user.user_id;;
const { videos, upload, uploadVideo, videoData, changePage, pageSize, page } = this.props; const { videos, upload, uploadVideo, videoData, changePage, pageSize, page } = this.props;
const operation = admin || business; const operation = admin || business;
const { course_identity } = this.props.coursedata; const { course_identity } = this.props && this.props.coursedata;
const flagMove = parseInt(course_identity) < 5; const flagMove = parseInt(course_identity) < 5;
return ( return (

@ -12,6 +12,7 @@ import Videostatistics from '../videostatistics/Videostatistics';
import './video.css'; import './video.css';
import '../css/Courses.css'; import '../css/Courses.css';
import '../publicNav/nav.css'; import '../publicNav/nav.css';
const PAGE_SIZE = 15; const PAGE_SIZE = 15;
const LIVE_PAGE_SIZE = 10; const LIVE_PAGE_SIZE = 10;
const $ = window.$; const $ = window.$;
@ -20,6 +21,7 @@ function getRight(){
var right = parseInt($(".-task-sidebar").css("right")); var right = parseInt($(".-task-sidebar").css("right"));
return right === 0 ? 0 : right; return right === 0 ? 0 : right;
} }
class VideoIndex extends Component { class VideoIndex extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
@ -241,15 +243,16 @@ class VideoIndex extends Component{
statistics: bool statistics: bool
}) })
} }
render() { render() {
const {videos, upload, videoData, type, liveData, lives, page, liveVisible, isSpining, liveId, otherLinkVisible, statistics} = this.state; const {videos, upload, videoData, type, liveData, lives, page, liveVisible, isSpining, liveId, otherLinkVisible, statistics} = this.state;
const { is_teacher } = this.props.user;
const {coursesId, videoId} = this.props.match.params; const {coursesId, videoId} = this.props.match.params;
let {course_identity} = this.props && this.props.coursedata;
const {course_identity} = this.props.coursedata; let is_teacher = this.props && this.props.user && this.props.user.is_teacher;
const flag = parseInt(course_identity) < 5; const flag = parseInt(course_identity) < 5;
const newOperation = flag; const newOperation = flag;
const new_upload = flag && (is_teacher && this.props.checkIfProfessionalCertification()); const new_upload = flag && (is_teacher && this.props.checkIfProfessionalCertification());
return ( return (
<React.Fragment> <React.Fragment>
<VideoLink <VideoLink
@ -313,11 +316,14 @@ class VideoIndex extends Component{
><i className="iconfont icon-tongji1 mr5"></i></WordsBtn> ><i className="iconfont icon-tongji1 mr5"></i></WordsBtn>
{ {
videoId ? videoId ?
<WordsBtn style="blue" onClick={()=>this.editDir(videoData && videoData.category_name,videoId)} className={"ml30 font-16"}>目录重命名</WordsBtn> <WordsBtn style="blue"
onClick={() => this.editDir(videoData && videoData.category_name, videoId)}
className={"ml30 font-16"}>目录重命名</WordsBtn>
: :
<WordsBtn style="blue" className="ml30 font-16" onClick={this.addDir}>新建目录</WordsBtn> <WordsBtn style="blue" className="ml30 font-16" onClick={this.addDir}>新建目录</WordsBtn>
} }
<WordsBtn style="blue" className="ml30 font-16" onClick={()=>this.setLinkeVisible(true)}>增加外链</WordsBtn> <WordsBtn style="blue" className="ml30 font-16"
onClick={() => this.setLinkeVisible(true)}>增加外链</WordsBtn>
</span> : "" </span> : ""
} }
{ {
@ -325,11 +331,13 @@ class VideoIndex extends Component{
<span> <span>
{ {
upload ? upload ?
<WordsBtn style="grey" className="font-16 ml30" onClick={()=>this.uploadVideo(false)}>取消</WordsBtn> <WordsBtn style="grey" className="font-16 ml30"
onClick={() => this.uploadVideo(false)}>取消</WordsBtn>
: :
<WordsBtn style="blue" className="font-16 ml30" onClick={this.toUpload}>上传视频</WordsBtn> <WordsBtn style="blue" className="font-16 ml30" onClick={this.toUpload}>上传视频</WordsBtn>
} }
</span>:"" </span>
: ""
} }
</React.Fragment> </React.Fragment>
: :
@ -379,4 +387,5 @@ class VideoIndex extends Component{
) )
} }
} }
export default VideoIndex; export default VideoIndex;

@ -188,6 +188,12 @@
padding-top: 20px; padding-top: 20px;
padding-bottom: 20px; padding-bottom: 20px;
} }
.teacherentrydivss{
padding-left: 20px;
padding-right: 20px;
padding-top: 20px;
padding-bottom: 20px;
}
.teachedivp{ .teachedivp{
font-size:16px; font-size:16px;
font-family:Microsoft YaHei; font-family:Microsoft YaHei;

@ -33,7 +33,7 @@ class Videostatisticscom extends Component {
<div className="ws100s edu-back-white sortinxdirection" style={{ <div className="ws100s edu-back-white sortinxdirection" style={{
position: "relative" position: "relative"
}}> }}>
<div className="ws100s teacherentrydivs "> <div className="ws100s teacherentrydivss ">
<div className="ws100s sortinxdirection"> <div className="ws100s sortinxdirection">
<div className="ws50s sptits">视频统计总览</div> <div className="ws50s sptits">视频统计总览</div>
<div className="ws50s sptitss xaxisreverseorder">播放数据从{this.props.watch_staticsdata&&this.props.watch_staticsdata.begin_at?this.props.watch_staticsdata.begin_at:0}开始统计</div> <div className="ws50s sptitss xaxisreverseorder">播放数据从{this.props.watch_staticsdata&&this.props.watch_staticsdata.begin_at?this.props.watch_staticsdata.begin_at:0}开始统计</div>

@ -1,6 +1,6 @@
import React, {Component} from "react"; import React, {Component} from "react";
import '../../signin/css/signincdi.css'; import '../../signin/css/signincdi.css';
import {Pagination, Table, Menu, Dropdown} from 'antd'; import {Pagination, Table, Menu, Dropdown,Spin} from 'antd';
import {getImageUrl, sortDirections} from 'educoder'; import {getImageUrl, sortDirections} from 'educoder';
import axios from 'axios'; import axios from 'axios';
import LoadingSpin from "../../../../common/LoadingSpin"; import LoadingSpin from "../../../../common/LoadingSpin";
@ -16,7 +16,7 @@ class Videostatisticscomtwo extends Component {
this.state = { this.state = {
data: [], data: [],
page: 1, page: 1,
limit: 10, limit: 20,
members_count: 0, members_count: 0,
columnsstu: [ columnsstu: [
{ {
@ -38,7 +38,12 @@ class Videostatisticscomtwo extends Component {
className: 'font-14 maxnamewidth100s', className: 'font-14 maxnamewidth100s',
width: '100px', width: '100px',
render: (text, record) => ( render: (text, record) => (
<span style={{width: '100px'}} className="maxnamewidth100s">{record.user_name}</span> <span style={{width: '100px'}} className="maxnamewidth100s">
<a className="maxnamewidth100s" style={{
color:"#333333"
}} title={record.user_name}>{record.user_name}</a>
</span>
), ),
}, },
{ {
@ -63,7 +68,9 @@ class Videostatisticscomtwo extends Component {
sorter: true, sorter: true,
sortDirections: sortDirections, sortDirections: sortDirections,
render: (text, record) => ( render: (text, record) => (
<span style={{width: '150px'}} className="maxnamewidth150s">{record.total_duration}</span> <span style={{width: '150px'}} className="maxnamewidth150s"><a className="maxnamewidth150s" style={{
color:"#333333"
}} title={record.total_duration}>{record.total_duration}</a></span>
), ),
}, },
{ {
@ -76,7 +83,11 @@ class Videostatisticscomtwo extends Component {
sorter: true, sorter: true,
sortDirections: sortDirections, sortDirections: sortDirections,
render: (text, record) => ( render: (text, record) => (
<span style={{width: '100px'}} className="maxnamewidth100s">{record.feq}</span> <span style={{width: '100px'}} className="maxnamewidth100s">
<a className="maxnamewidth100s" style={{
color:"#333333"
}} title={record.feq}>{record.feq}</a>
</span>
), ),
}, },
{ {
@ -87,7 +98,11 @@ class Videostatisticscomtwo extends Component {
className: 'font-14 maxnamewidth100s', className: 'font-14 maxnamewidth100s',
width: '100px', width: '100px',
render: (text, record) => ( render: (text, record) => (
<span style={{width: '100px', color: '#5091FF'}} className="xiaoshou">{record.start_at}</span> <span style={{width: '100px'}} >
<a className="maxnamewidth100s" style={{
color:"#333333"
}} title= {record.start_at}> {record.start_at}</a>
</span>
), ),
}, },
{ {
@ -98,7 +113,11 @@ class Videostatisticscomtwo extends Component {
className: 'font-14 maxnamewidth100s', className: 'font-14 maxnamewidth100s',
width: '100px', width: '100px',
render: (text, record) => ( render: (text, record) => (
<span style={{width: '100px', color: '#5091FF'}} className="xiaoshou">{record.end_at}</span> <span style={{width: '100px'}} >
<a className="maxnamewidth100s" style={{
color:"#333333"
}} title= {record.end_at}>{record.end_at}</a>
</span>
), ),
} }
], ],
@ -409,7 +428,7 @@ class Videostatisticscomtwo extends Component {
return ( return (
<React.Fragment> <React.Fragment>
<div className="ws100s"> <div className="ws100s">
<div className="ws100s teacherentrydivs edu-back-white "> <div className="ws100s teacherentrydivss edu-back-white ">
<div className="ws100s sortinxdirection"> <div className="ws100s sortinxdirection">
<div className="ws50s sptits">视频名称视频名称</div> <div className="ws50s sptits">视频名称视频名称</div>
<div className="ws50s sptitss xaxisreverseorder font-14" style={{ <div className="ws50s sptitss xaxisreverseorder font-14" style={{
@ -452,15 +471,8 @@ class Videostatisticscomtwo extends Component {
` `
} }
</style> </style>
{
loading === true ? <div className="ws100s ysltableo">
<div style={{
minHeight: "400px",
}} className="ws100s">
<LoadingSpin></LoadingSpin>
</div>
:
<div className="ws100s ysltableo teacherentrydivs">
{ {
data.length === 0 ? data.length === 0 ?
<div style={{ <div style={{
@ -469,17 +481,18 @@ class Videostatisticscomtwo extends Component {
<NoneDatas></NoneDatas> <NoneDatas></NoneDatas>
</div> </div>
: :
<Spin spinning={loading}>
<Table <Table
columns={columnsstu} columns={columnsstu}
dataSource={data} dataSource={data}
pagination={false} pagination={false}
onChange={this.table1handleChange} onChange={this.table1handleChange}
/> />
</Spin>
} }
</div> </div>
}
</div> </div>

@ -1,7 +1,7 @@
import React, {Component} from "react"; import React, {Component} from "react";
import '../../signin/css/signincdi.css'; import '../../signin/css/signincdi.css';
import {Pagination,Table} from 'antd'; import {Pagination,Table,Spin} from 'antd';
import {getImageUrl,sortDirections} from 'educoder'; import {getImageUrl,sortDirections,formatSeconds} from 'educoder';
import axios from 'axios'; import axios from 'axios';
import LoadingSpin from "../../../../common/LoadingSpin"; import LoadingSpin from "../../../../common/LoadingSpin";
import NoneDatas from "../../signin/component/NoneDatas"; import NoneDatas from "../../signin/component/NoneDatas";
@ -34,7 +34,12 @@ class Videostatisticslist extends Component {
className: 'font-14 maxnamewidth150s', className: 'font-14 maxnamewidth150s',
width: '150px', width: '150px',
render: (text, record) => ( render: (text, record) => (
<span style={{width: '150px'}} className="maxnamewidth150s">{record.title}</span> <span style={{width: '150px'}} className="maxnamewidth150s">
<a className="maxnamewidth150s" style={{
color:"#333333"
}} title={record.title}>{record.title}</a>
</span>
), ),
}, },
{ {
@ -55,12 +60,17 @@ class Videostatisticslist extends Component {
dataIndex: 'total_time', dataIndex: 'total_time',
key: 'total_time', key: 'total_time',
align: "center", align: "center",
className: 'font-14 maxnamewidth150s', className: 'font-14 maxnamewidth100s',
width: '150px', width: '100px',
sorter: true, sorter: true,
sortDirections: sortDirections, sortDirections: sortDirections,
render: (text, record) => ( render: (text, record) => (
<span style={{width: '150px'}} className="maxnamewidth150s">{record.total_time}</span> <span style={{width: '100px'}} className="maxnamewidth100s">
<a className="maxnamewidth100s" style={{
color:"#333333"
}} title={record.total_time}>{record.total_time}</a>
</span>
), ),
}, },
{ {
@ -71,7 +81,12 @@ class Videostatisticslist extends Component {
className: 'font-14 maxnamewidth100s', className: 'font-14 maxnamewidth100s',
width: '100px', width: '100px',
render: (text, record) => ( render: (text, record) => (
<span style={{width: '100px'}} className="maxnamewidth100s">{record.user_name}</span> <span style={{width: '100px'}} className="maxnamewidth100s">
<a className="maxnamewidth100s" style={{
color:"#333333"
}} title={record.user_name}>{record.user_name}</a>
</span>
), ),
}, },
{ {
@ -80,16 +95,16 @@ class Videostatisticslist extends Component {
key: 'id', key: 'id',
align: "center", align: "center",
className: 'font-14', className: 'font-14',
width: '90px', width: '50px',
render: (text, record) => ( render: (text, record) => (
<span style={{width: '90px',color:'#5091FF'}} className="xiaoshou" onClick={()=>this.props.tisticsbools(true,record.id)}>详情</span> <span style={{width: '50px',color:'#5091FF'}} className="xiaoshou" onClick={()=>this.props.tisticsbools(true,record.id)}>详情</span>
), ),
} }
], ],
loading:false, loading:false,
data:[], data:[],
page:1, page:1,
limit:10, limit:20,
members_count:0, members_count:0,
order:undefined, order:undefined,
} }
@ -134,10 +149,10 @@ class Videostatisticslist extends Component {
let datalists = []; let datalists = [];
for (var i = 0; i < response.data.videos.length; i++) { for (var i = 0; i < response.data.videos.length; i++) {
datalists.push({ datalists.push({
number: (parseInt(this.state.spage) - 1) * parseInt(this.state.limit) + (i + 1), number: (parseInt(this.state.page) - 1) * parseInt(this.state.limit) + (i + 1),
title: response.data.videos[i].title, title: response.data.videos[i].title,
people_num: response.data.videos[i].people_num, people_num: response.data.videos[i].people_num,
total_time: response.data.videos[i].total_time, total_time: response.data.videos[i].total_time?formatSeconds(response.data.videos[i].total_time):0,
user_name: response.data.videos[i].user_name, user_name: response.data.videos[i].user_name,
id: response.data.videos[i].id, id: response.data.videos[i].id,
}) })
@ -235,7 +250,7 @@ class Videostatisticslist extends Component {
<React.Fragment> <React.Fragment>
<div className="ws100s mt20"> <div className="ws100s mt20">
<div className="ws100s edu-back-white"> <div className="ws100s edu-back-white">
<div className="ws100s teacherentrydivs "> <div className="ws100s teacherentrydivss ">
<div className="ws100s sortinxdirection"> <div className="ws100s sortinxdirection">
<div className="ws100s sptits">统计详情</div> <div className="ws100s sptits">统计详情</div>
</div> </div>
@ -250,14 +265,7 @@ class Videostatisticslist extends Component {
` `
} }
</style> </style>
{
loading===true?
<div style={{
minHeight: "400px",
}} className="ws100s">
<LoadingSpin></LoadingSpin>
</div>
:
<div className="ws100s ysltableo teacherentrydivs"> <div className="ws100s ysltableo teacherentrydivs">
{ {
data.length===0? data.length===0?
@ -267,6 +275,7 @@ class Videostatisticslist extends Component {
<NoneDatas></NoneDatas> <NoneDatas></NoneDatas>
</div> </div>
: :
<Spin spinning={loading}>
<Table <Table
columns={columnsstu} columns={columnsstu}
dataSource={data} dataSource={data}
@ -274,11 +283,11 @@ class Videostatisticslist extends Component {
onChange={this.table1handleChange} onChange={this.table1handleChange}
/> />
</Spin>
} }
</div> </div>
}
</div> </div>

@ -55,26 +55,30 @@ class AccountImg extends Component {
.newheadphotoblack{ .newheadphotoblack{
position: absolute; position: absolute;
top: 49px; top: 45px;
left: 4px; left: 0px;
text-align: center; text-align: center;
color: #fff; color: #fff;
width: 107px; width: 110px;
height: 23px; height: 23px;
line-height: 23px; line-height: 23px;
background: rgba(76,172,255,0.7); background: rgba(76,172,255,0.7);
} }
.borderradiusbox{ .relativeRadiusbox{
border-top-left-radius: 4px; overflow: hidden;
border-top-right-radius: 4px; position: relative;
border-bottom-right-radius: 4px; width: 109px;
border-bottom-left-radius: 4px; border-radius: 50%;
height: 109px;
} }
`}</style> `}</style>
<div className={"relativeRadiusbox"}>
<img alt="头像" id="user_avatar_show" nhname="avatar_image" className={"xiaoshou"} src={`${picUrl}`} onClick={this.editImg} ></img> <img alt="头像" id="user_avatar_show" nhname="avatar_image" className={"xiaoshou"} src={`${picUrl}`} onClick={this.editImg} ></img>
<div className="newheadphotoblack xiaoshou borderradiusbox" onClick={this.editImg} >修改头像</div> <div className="newheadphotoblack xiaoshou" onClick={this.editImg} >修改头像</div>
</div>
</div> </div>
); );
} }

@ -74,7 +74,8 @@ function VideoInReviewItem (props) {
<div className="df buttonRow mb10"> <div className="df buttonRow mb10">
{/* <div className={"play_duration"}>累计学习时长:{play_duration} h</div> */} {/* <div className={"play_duration"}>累计学习时长:{play_duration} h</div> */}
{/* <span className="time">{moment(published_at || created_at).format('YYYY-MM-DD HH:mm:ss')}{people_num}</span> */} {/* <span className="time">{moment(published_at || created_at).format('YYYY-MM-DD HH:mm:ss')}{people_num}</span> */}
{link ?<span className="time"> </span>:<span className="time">{
{link||total_time===undefined?<span className="time"> </span>:<span className="time">{
formatSeconds(total_time)} formatSeconds(total_time)}
{/* total_time<60?total_time+' s':total_time/60<60?(total_time/60).toFixed(0)+' min':(total_time/3600).toFixed(1)+ ' h' */} {/* total_time<60?total_time+' s':total_time/60<60?(total_time/60).toFixed(0)+' min':(total_time/3600).toFixed(1)+ ' h' */}
</span>} </span>}
@ -82,7 +83,7 @@ function VideoInReviewItem (props) {
<div className="df buttonRow"> <div className="df buttonRow">
{/* 2019-09-01 10:00:22 */} {/* 2019-09-01 10:00:22 */}
<span className={"dianjilianicon"}> <span className={"dianjilianicon"}>
{!people_num || (people_num && people_num)===0 ? "" : <Tooltip title="观看人数" placement="bottom"> {total_time===undefined?'':!people_num || (people_num && people_num)===0 ? "" : <Tooltip title="观看人数" placement="bottom">
<i className={`icon-dianjiliang iconfont dianjilianicon font-12`}> {!people_num || (people_num && people_num)===0?"":people_num}</i> <i className={`icon-dianjiliang iconfont dianjilianicon font-12`}> {!people_num || (people_num && people_num)===0?"":people_num}</i>
</Tooltip> } </Tooltip> }
</span> </span>

Loading…
Cancel
Save