Commit a75bd985 by maolipeng

fix:很多bug

parent 8d4f36aa
......@@ -32,7 +32,8 @@ class AddLiveBasic extends React.Component {
showSelectFileModal: false,
cutImageBlob: null,
hasImgReady: false, // 图片是否上传成功
cropperInstace:null
cropperInstace:null,
courseNameLimit: props.courseNameLimit?props.courseNameLimit:40
}
}
componentWillUnmount() {}
......@@ -125,8 +126,8 @@ class AddLiveBasic extends React.Component {
</span>
<Input
value={courseName}
placeholder='请输入直播名称(40字以内)'
maxLength={40}
placeholder={`请输入直播名称(${this.state.courseNameLimit}字以内)`}
maxLength={this.state.courseNameLimit}
style={{ width: 240 }}
onChange={(e) => {
this.props.onChange('courseName', e.target.value);
......
......@@ -68,6 +68,7 @@ export default function AddLiveClassInfoWorkWX(props) {
}
} else {
setBeginDate(0)
setBeginTime(0)
}
}
......@@ -197,18 +198,22 @@ export default function AddLiveClassInfoWorkWX(props) {
<div className="AddLiveClassInfoWorkWX">
<div className="begin-time item">
<span className="label"><span className="require">*</span>开始时间:</span>
<DatePicker
<DatePicker
placeholder="请选择开始日期"
value={beginDate===0?undefined:moment(beginDate)}
onChange={onBeginDateChange}
onOk={onBeginDateOK}
disabledDate={disabledDate}
style={{width:"180px"}}
/>
<TimePicker
value={beginTime===0?undefined:moment(beginTime)}
onChange={onBeginTimeChange}
onOk={onBeginTimeOK}
allowClear={false}
format="HH:mm" />
format="HH:mm"
style={{width:"120px"}}
/>
</div>
<div className="duration-time item">
{
......@@ -216,19 +221,23 @@ export default function AddLiveClassInfoWorkWX(props) {
<>
<span className="label"><span className="require">*</span>结束时间:</span>
<DatePicker
placeholder="请选择结束日期"
value={endDate===0?undefined:moment(endDate)}
onChange={onEndDateChange}
onOk={onEndDateOK}
disabledDate={(current)=> {
return current && current < beginDate
}}
style={{width:"180px"}}
/>
<TimePicker
value={endTime === 0?undefined:moment(endTime)}
onChange={onEndTimeChange}
onOk={onEndTimeOK}
allowClear={false}
format="HH:mm" />
format="HH:mm"
style={{width:"120px"}}
/>
</>
) : (
<>
......
......@@ -309,6 +309,11 @@ function CreateWorkWXCourse() {
resolve(false)
return
}
if (introduce.length > 1000) {
message.warning("直播简介超过1000个字")
resolve(false)
return
}
resolve(true)
});
};
......@@ -337,7 +342,7 @@ function CreateWorkWXCourse() {
function handleGoBack() {
// 比较state的addLiveBasicInfo, addLiveClassInfo, addLiveIntroInfo和默认数据是否相等
// 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')
window.RCHistory.push({
pathname: `/live-course`,
......@@ -362,7 +367,7 @@ function CreateWorkWXCourse() {
<div className='add-live-page__form'>
<div className='basic-info__wrap'>
<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 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