Commit 5b5c23ae by zhujian

fix

parent 849e1607
...@@ -341,13 +341,13 @@ class AddOfflineCourse extends React.Component { ...@@ -341,13 +341,13 @@ class AddOfflineCourse extends React.Component {
this.setState({ previewOfflineModal }); this.setState({ previewOfflineModal });
}; };
handleSelectCover = (file)=> { handleSelectCover = (file) => {
this.setState({ this.setState({
visible: true, visible: true,
imageFile:file imageFile: file
}); });
} }
//获取resourceId //获取resourceId
getSignature = (blob, fileName) => { getSignature = (blob, fileName) => {
...@@ -658,6 +658,11 @@ class AddOfflineCourse extends React.Component { ...@@ -658,6 +658,11 @@ class AddOfflineCourse extends React.Component {
}; };
whetherVisitorsJoinChange = () => { whetherVisitorsJoinChange = () => {
const {whetherSetApply,whetherVisitorsJoin} =this.state;
if(whetherSetApply =='NO'){
message.warning('关闭报名无法获取手机号!')
return
}
if (this.state.whetherVisitorsJoin === 'NO') { if (this.state.whetherVisitorsJoin === 'NO') {
this.setState({ whetherVisitorsJoin: 'YES' }); this.setState({ whetherVisitorsJoin: 'YES' });
} else { } else {
...@@ -855,13 +860,7 @@ class AddOfflineCourse extends React.Component { ...@@ -855,13 +860,7 @@ class AddOfflineCourse extends React.Component {
})} })}
</Select> </Select>
</div> </div>
<div className='allow-tourist-join'>
<span className='label'>观看设置:</span>
<div className='content'>
<Switch checked={whetherVisitorsJoin === 'NO' ? true : false} onChange={this.whetherVisitorsJoinChange} />
<div className='desc'>{whetherVisitorsJoin === 'NO' ? '已开启,学员需绑定手机号才可观看' : '已关闭,学员无需绑定手机号即可观看'}</div>
</div>
</div>
<div className='introduce'> <div className='introduce'>
<span className='label'>课程简介:</span> <span className='label'>课程简介:</span>
<div className='content'> <div className='content'>
...@@ -965,6 +964,7 @@ class AddOfflineCourse extends React.Component { ...@@ -965,6 +964,7 @@ class AddOfflineCourse extends React.Component {
startTimeApply: undefined, startTimeApply: undefined,
endTimeApply: undefined, endTimeApply: undefined,
quota: null, quota: null,
whetherVisitorsJoin: whetherSetApply !== 'YES' ? whetherVisitorsJoin : false
}); });
}} }}
/> />
...@@ -1076,6 +1076,13 @@ class AddOfflineCourse extends React.Component { ...@@ -1076,6 +1076,13 @@ class AddOfflineCourse extends React.Component {
)} )}
</div> </div>
</div> </div>
<div className='allow-tourist-join'>
<span className='label'>观看设置:</span>
<div className='content'>
<Switch checked={whetherVisitorsJoin === 'NO' ? true : false} onChange={this.whetherVisitorsJoinChange} />
<div className='desc'>{whetherVisitorsJoin === 'NO' ? '已开启,仅限绑定了手机号的学员报名线下课' : '已关闭,允许未绑定手机号的学员报名线下课'}</div>
</div>
</div>
<div className='course-catalog'> <div className='course-catalog'>
<span className='label'>考勤签到:</span> <span className='label'>考勤签到:</span>
<div className='switch-box'> <div className='switch-box'>
...@@ -1275,12 +1282,12 @@ class AddOfflineCourse extends React.Component { ...@@ -1275,12 +1282,12 @@ class AddOfflineCourse extends React.Component {
}} }}
onSelect={this.handleSelectCover} onSelect={this.handleSelectCover}
/> />
) )
} }
{ visible && {visible &&
<ImgClipModal visible={visible} imgUrl={imageFile.ossUrl} onConfirm={this.getSignature} onClose={()=>{this.setState({ visible: false });}}/> <ImgClipModal visible={visible} imgUrl={imageFile.ossUrl} onConfirm={this.getSignature} onClose={() => { this.setState({ visible: false }); }} />
} }
{ this.state.previewOfflineModal } {this.state.previewOfflineModal}
</div> </div>
); );
} }
......
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