Commit 6e5f9023 by chenshu

fix:修复管理端部分问题

parent d9637fd4
......@@ -215,7 +215,7 @@ class AddOfflineCourse extends React.Component {
startTimeApply,
endTimeApply,
quota: quota < 0 ? null : quota,
oldQuta: quota < 0 ? null : quota,
oldQuta: quota,
calendarTime,
signInTimeNum,
signInTimeUnit,
......@@ -588,7 +588,7 @@ class AddOfflineCourse extends React.Component {
} else if(!data.startTime || !data.endTime){
message.warning('请选择上课时间');
resolve(false);
} else if(moment(moment(data.calendarTime[0]).format('YYYY-MM-DD') + moment(data.endTime).format(' HH:mm')).valueOf() < Date.now()){
} else if(moment(moment(data.calendarTime[0]).format('YYYY-MM-DD') + moment(data.startTime).format(' HH:mm')).valueOf() < Date.now()){
message.warning('上课时间不能早于现在');
resolve(false);
} else if(data.startTime > data.endTime){
......@@ -1018,6 +1018,38 @@ class AddOfflineCourse extends React.Component {
format={"YYYY-MM-DD HH:mm"}
onChange={(dates) => { this.handleChangeDates(dates) }}
style={{ width: "calc(100% - 70px)" }}
renderExtraFooter={() => calendarTime[0] ? <div style={{ position: 'absolute', bottom: 8, cursor: 'pointer' }}>
<span
onClick={() => this.setState({ startTimeApply: moment(calendarTime[0]).subtract(1, 'days').valueOf(), endTimeApply: calendarTime[0] })}
style={{
color: '#FFB714',
border: '1px solid #FFB714',
padding: '2px 8px',
borderRadius: '2px',
marginRight: 8,
}}
>上课前1天</span>
<span
onClick={() => this.setState({ startTimeApply: moment(calendarTime[0]).subtract(2, 'days').valueOf(), endTimeApply: calendarTime[0] })}
style={{
color: '#FFB714',
border: '1px solid #FFB714',
padding: '2px 8px',
borderRadius: '2px',
marginRight: 8,
}}
>上课前2天</span>
<span
onClick={() => this.setState({ startTimeApply: moment(calendarTime[0]).subtract(3, 'days').valueOf(), endTimeApply: calendarTime[0] })}
style={{
color: '#FFB714',
border: '1px solid #FFB714',
padding: '2px 8px',
borderRadius: '2px',
marginRight: 8,
}}
>上课前3天</span>
</div> : null}
/>
</div>}
{whetherSetApply === 'YES' && <div className="switch-item" key="3">
......@@ -1033,6 +1065,7 @@ class AddOfflineCourse extends React.Component {
min={oldQuta || 1}
precision={0}
style={{ margin: '0 4px', width: 90 }}
disabled={oldQuta < 0}
onChange={(value) => {
this.setState({ quota: value })
}}
......
......@@ -125,7 +125,7 @@ class OfflineCourseList extends React.Component {
return (
<Switch
disabled={item.courseState === 'EXPIRED'}
defaultChecked={item.shelfState === "YES"}
checked={item.shelfState === "YES"}
onChange={() => this.changeShelfState(item)}
/>
)
......@@ -226,7 +226,7 @@ class OfflineCourseList extends React.Component {
renderMoreOperate = (item) => {
return (
<div className="live-course-more-menu">
{item.courseState !== 'EXPIRED' && <div
{item.courseState !== 'EXPIRED' && (item.whetherSetSignIn === 'YES' || item.whetherSetSignOut === 'YES') && <div
className="operate__item"
key="qrcode"
onClick={() => {
......@@ -287,6 +287,7 @@ class OfflineCourseList extends React.Component {
}else{
message.success("已取消展示");
}
this.props.onChange();
}
})
}
......
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