Commit a75bd985 by maolipeng

fix:很多bug

parent 8d4f36aa
...@@ -32,7 +32,8 @@ class AddLiveBasic extends React.Component { ...@@ -32,7 +32,8 @@ class AddLiveBasic extends React.Component {
showSelectFileModal: false, showSelectFileModal: false,
cutImageBlob: null, cutImageBlob: null,
hasImgReady: false, // 图片是否上传成功 hasImgReady: false, // 图片是否上传成功
cropperInstace:null cropperInstace:null,
courseNameLimit: props.courseNameLimit?props.courseNameLimit:40
} }
} }
componentWillUnmount() {} componentWillUnmount() {}
...@@ -125,8 +126,8 @@ class AddLiveBasic extends React.Component { ...@@ -125,8 +126,8 @@ class AddLiveBasic extends React.Component {
</span> </span>
<Input <Input
value={courseName} value={courseName}
placeholder='请输入直播名称(40字以内)' placeholder={`请输入直播名称(${this.state.courseNameLimit}字以内)`}
maxLength={40} maxLength={this.state.courseNameLimit}
style={{ width: 240 }} style={{ width: 240 }}
onChange={(e) => { onChange={(e) => {
this.props.onChange('courseName', e.target.value); this.props.onChange('courseName', e.target.value);
......
...@@ -68,6 +68,7 @@ export default function AddLiveClassInfoWorkWX(props) { ...@@ -68,6 +68,7 @@ export default function AddLiveClassInfoWorkWX(props) {
} }
} else { } else {
setBeginDate(0) setBeginDate(0)
setBeginTime(0)
} }
} }
...@@ -198,17 +199,21 @@ export default function AddLiveClassInfoWorkWX(props) { ...@@ -198,17 +199,21 @@ export default function AddLiveClassInfoWorkWX(props) {
<div className="begin-time item"> <div className="begin-time item">
<span className="label"><span className="require">*</span>开始时间:</span> <span className="label"><span className="require">*</span>开始时间:</span>
<DatePicker <DatePicker
placeholder="请选择开始日期"
value={beginDate===0?undefined:moment(beginDate)} value={beginDate===0?undefined:moment(beginDate)}
onChange={onBeginDateChange} onChange={onBeginDateChange}
onOk={onBeginDateOK} onOk={onBeginDateOK}
disabledDate={disabledDate} disabledDate={disabledDate}
style={{width:"180px"}}
/> />
<TimePicker <TimePicker
value={beginTime===0?undefined:moment(beginTime)} value={beginTime===0?undefined:moment(beginTime)}
onChange={onBeginTimeChange} onChange={onBeginTimeChange}
onOk={onBeginTimeOK} onOk={onBeginTimeOK}
allowClear={false} allowClear={false}
format="HH:mm" /> format="HH:mm"
style={{width:"120px"}}
/>
</div> </div>
<div className="duration-time item"> <div className="duration-time item">
{ {
...@@ -216,19 +221,23 @@ export default function AddLiveClassInfoWorkWX(props) { ...@@ -216,19 +221,23 @@ export default function AddLiveClassInfoWorkWX(props) {
<> <>
<span className="label"><span className="require">*</span>结束时间:</span> <span className="label"><span className="require">*</span>结束时间:</span>
<DatePicker <DatePicker
placeholder="请选择结束日期"
value={endDate===0?undefined:moment(endDate)} value={endDate===0?undefined:moment(endDate)}
onChange={onEndDateChange} onChange={onEndDateChange}
onOk={onEndDateOK} onOk={onEndDateOK}
disabledDate={(current)=> { disabledDate={(current)=> {
return current && current < beginDate return current && current < beginDate
}} }}
style={{width:"180px"}}
/> />
<TimePicker <TimePicker
value={endTime === 0?undefined:moment(endTime)} value={endTime === 0?undefined:moment(endTime)}
onChange={onEndTimeChange} onChange={onEndTimeChange}
onOk={onEndTimeOK} onOk={onEndTimeOK}
allowClear={false} allowClear={false}
format="HH:mm" /> format="HH:mm"
style={{width:"120px"}}
/>
</> </>
) : ( ) : (
<> <>
......
...@@ -309,6 +309,11 @@ function CreateWorkWXCourse() { ...@@ -309,6 +309,11 @@ function CreateWorkWXCourse() {
resolve(false) resolve(false)
return return
} }
if (introduce.length > 1000) {
message.warning("直播简介超过1000个字")
resolve(false)
return
}
resolve(true) resolve(true)
}); });
}; };
...@@ -337,7 +342,7 @@ function CreateWorkWXCourse() { ...@@ -337,7 +342,7 @@ function CreateWorkWXCourse() {
function handleGoBack() { function handleGoBack() {
// 比较state的addLiveBasicInfo, addLiveClassInfo, addLiveIntroInfo和默认数据是否相等 // 比较state的addLiveBasicInfo, addLiveClassInfo, addLiveIntroInfo和默认数据是否相等
// const { addLiveBasicInfo, addLiveClassInfo, addLiveIntroInfo } = this.state; // const { addLiveBasicInfo, addLiveClassInfo, addLiveIntroInfo } = this.state;
if (!_.isEqual(basicInfo, defaultBasicInfo) || !_.isEqual(classInfo, defaultClassInfo)) { if (!_.isEqual(basicInfo, defaultBasicInfo) || !_.isEqual(classInfo, defaultClassInfo) || introduce.length > 0) {
console.log('ghjklkjh') console.log('ghjklkjh')
window.RCHistory.push({ window.RCHistory.push({
pathname: `/live-course`, pathname: `/live-course`,
...@@ -362,7 +367,7 @@ function CreateWorkWXCourse() { ...@@ -362,7 +367,7 @@ function CreateWorkWXCourse() {
<div className='add-live-page__form'> <div className='add-live-page__form'>
<div className='basic-info__wrap'> <div className='basic-info__wrap'>
<div className='title'>基本信息<span style={{marginLeft:"24px",color:"#2966FF",fontSize:"14px"}}>温馨提示:在直播间可控制回放录制功能。</span></div> <div className='title'>基本信息<span style={{marginLeft:"24px",color:"#2966FF",fontSize:"14px"}}>温馨提示:在直播间可控制回放录制功能。</span></div>
<AddLiveBasic isEdit={isEdit} pageType={type} data={basicInfo} onChange={handleChangeBasicInfo} /> <AddLiveBasic isEdit={isEdit} pageType={type} data={basicInfo} onChange={handleChangeBasicInfo} courseNameLimit={20}/>
</div> </div>
<div className='class-info__wrap'> <div className='class-info__wrap'>
......
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