附件上传 弹出框口

dev_forum
ysl 6 years ago
parent cc290824bd
commit 0f1211f555

@ -9,7 +9,7 @@ import '../css/Courses.css';
import Modals from "../../modals/Modals"; import Modals from "../../modals/Modals";
import AddStudentModal from '../members/modal/AddStudentModal' import AddStudentModal from '../members/modal/AddStudentModal'
import AddTeacherModal from '../members/modal/AddTeacherModal' import AddTeacherModal from '../members/modal/AddTeacherModal'
import Trialapplication from "../../login/Trialapplication";
// 点击按钮复制功能 // 点击按钮复制功能
// function jsCopy(){ // function jsCopy(){
@ -43,13 +43,20 @@ class CoursesBanner extends Component {
metype: 0, metype: 0,
modalsBottomval: "", modalsBottomval: "",
antIcon:false, antIcon:false,
coursedata:undefined coursedata:undefined,
user_phone_binded:false,
isRenders:false,
showTrial:false,
} }
console.log("CoursesBanner");
console.log("48");
console.log(props);
} }
componentDidMount() { componentDidMount() {
this.updatabanner() this.updatabanner()
this.setState({
user_phone_binded :this.props.user_phone_binded,
})
} }
updatabanner=()=>{ updatabanner=()=>{
let courseId = this.props.match.params.coursesId; let courseId = this.props.match.params.coursesId;
@ -57,9 +64,19 @@ class CoursesBanner extends Component {
axios.get(url).then((result) => { axios.get(url).then((result) => {
if( result!=undefined){ if( result!=undefined){
let data = result.data; let data = result.data;
this.setState({ if(result.data.status === 407){
coursedata: data this.setState({
}) isRenders:true,
coursedata: data,
showTrial:false,
})
}else{
this.setState({
coursedata: data,
showTrial:true,
})
}
} }
}) })
} }
@ -315,265 +332,271 @@ class CoursesBanner extends Component {
} }
render() { render() {
let { Addcoursestypes, coursedata, modalsType, modalsTopval, loadtype,modalsBottomval,antIcon} = this.state; let { Addcoursestypes, coursedata, modalsType, modalsTopval, loadtype,modalsBottomval,antIcon,user_phone_binded} = this.state;
return ( return (
<div>
<Trialapplication {...this.state} user_phone_binded={user_phone_binded} ></Trialapplication>
coursedata === undefined || coursedata.status===401? <div id="course_info_1309" className="courseHead" style={{height: '206px'}}></div>:<div id="course_info_1309" className="courseHead" style={{height: '206px'}}> {
coursedata === undefined || coursedata.status===401? <div id="course_info_1309" className="courseHead" style={{height: '206px'}}></div>:<div id="course_info_1309" className="courseHead" style={{height: '206px'}}>
{Addcoursestypes === true ? <Addcourses {Addcoursestypes === true ? <Addcourses
Addcoursestype={Addcoursestypes} Addcoursestype={Addcoursestypes}
hideAddcoursestype={() => this.tojoinclass(2)} hideAddcoursestype={() => this.tojoinclass(2)}
/> : ""} /> : ""}
<Modals <Modals
modalsType={modalsType} modalsType={modalsType}
modalsTopval={modalsTopval} modalsTopval={modalsTopval}
loadtype={loadtype} loadtype={loadtype}
modalsBottomval={modalsBottomval} modalsBottomval={modalsBottomval}
modalCancel={this.modalCancel} modalCancel={this.modalCancel}
modalSave={this.ModalAction} modalSave={this.ModalAction}
antIcon={antIcon} antIcon={antIcon}
></Modals> ></Modals>
<AddTeacherModal ref="addTeacherModal" <AddTeacherModal ref="addTeacherModal"
{...this.props} {...this.props}
isTeacher={this.state.isTeacher} isTeacher={this.state.isTeacher}
moduleName={this.state.isTeacher ? "教师" : "助教"} moduleName={this.state.isTeacher ? "教师" : "助教"}
addTeacherSuccess={this.addTeacherSuccess} addTeacherSuccess={this.addTeacherSuccess}
></AddTeacherModal> ></AddTeacherModal>
<AddStudentModal ref="addStudentModal" <AddStudentModal ref="addStudentModal"
{...this.props} {...this.props}
moduleName="学生" moduleName="学生"
addStudentSuccess={this.addStudentSuccess} addStudentSuccess={this.addStudentSuccess}
></AddStudentModal> ></AddStudentModal>
<div className="educontent clearfix educontentTop"> <div className="educontent clearfix educontentTop">
<div className="color-white clearfix mb10"> <div className="color-white clearfix mb10">
{ {
coursedata===undefined || coursedata.status===401 || coursedata.status===407?"": coursedata===undefined || coursedata.status===401 || coursedata.status===407?"":
<Tooltip placement="bottom" title={coursedata&&coursedata.name.length<38?"":coursedata.name}> <Tooltip placement="bottom" title={coursedata&&coursedata.name.length<38?"":coursedata.name}>
<span className="font-24 fl bannername">{coursedata.name}</span> <span className="font-24 fl bannername">{coursedata.name}</span>
</Tooltip> </Tooltip>
} }
{/*访 {/*访
公开公开课堂非课堂成员可以访问*/} 公开公开课堂非课堂成员可以访问*/}
<span className={"TabsWarp"}> <span className={"TabsWarp"}>
<CoursesListType <CoursesListType
typelist={coursedata.course_end === true ? ["已结束"] : coursedata.is_public === true ? ["公开"] : ["私有"]} typelist={coursedata.course_end === true ? ["已结束"] : coursedata.is_public === true ? ["公开"] : ["私有"]}
typesylename={"mt10"} tipval={coursedata.is_public === true?"":"私有课堂,非课堂成员不能访问"}/> typesylename={"mt10"} tipval={coursedata.is_public === true?"":"私有课堂,非课堂成员不能访问"}/>
</span> </span>
</div>
<div className="clearfix ">
<div className="fl fl mr40 mb20">
<a href={"/users/" + coursedata.teacher_login} className="fl">
<img alt="头像" className="radius fl mt3 bannerimgname"
src={getImageUrl(`images/` + coursedata.teacher_img)}/>
</a>
<div className="fl mt13">
<p className="color-white">
<a href={"/users/" + coursedata.teacher_login}
className="color-white bannnerusername">{coursedata.teacher_name}</a>
</p>
</div>
<div className="fl mt13">
<p className="color-white bannnerusernames">{coursedata.teacher_school}</p>
</div>
</div> </div>
<div className="clearfix ">
<div className="fl fl mr40 mb20">
<a href={"/users/" + coursedata.teacher_login} className="fl">
<img alt="头像" className="radius fl mt3 bannerimgname"
src={getImageUrl(`images/` + coursedata.teacher_img)}/>
</a>
<div className="fl mt13">
<p className="color-white">
<a href={"/users/" + coursedata.teacher_login}
className="color-white bannnerusername">{coursedata.teacher_name}</a>
</p>
</div>
<div className="fl mt13">
<p className="color-white bannnerusernames">{coursedata.teacher_school}</p>
</div>
</div>
<div>
{coursedata.switch_to_student === true ?
<Tooltip placement="bottom" title={"切换至学生可进行提交作品、答题等操作"}>
<a className="fr user_default_btn user_blue_btn mr20 font-18"
onClick={()=>this.switchidentity(1)}
> 切换为学生 </a>
</Tooltip>
:""}
{coursedata.switch_to_teacher === true ?
<Tooltip placement="bottom" title={"由学生身份切换至教师"}>
<a className="fr user_default_btn user_blue_btn mr20 font-18"
onClick={()=>this.switchidentity(2)}
> 切换为老师 </a>
</Tooltip>:""}
{coursedata.switch_to_assistant === true ?
<Tooltip placement="bottom" title={"由学生身份切换至助教"}>
<a className="fr user_default_btn user_blue_btn mr20 font-18"
onClick={()=>this.switchidentity(3)}
> 切换为助教 </a>
</Tooltip>:""}
{coursedata.course_identity === 6&&coursedata.educoder_teacher===false?
<a className="fr user_default_btn task-btn-orange font-18 mr20" id="shixun_operation"
onClick={() => this.tojoinclass(1)}>加入课堂</a>: ""}
{coursedata.course_identity === 6&&coursedata.educoder_teacher===true?
<a className="fr user_default_btn task-btn-orange font-18 mr20" id="shixun_operation"
onClick={() => this.tojoinclass(1)}>加入课堂</a>: ""}
{coursedata.course_identity === 6&&coursedata.educoder_teacher===true?
<a className="fr user_default_btn user_blue_btn mr20 font-18" onClick={() => this.ActionPoll(5)}> 复制课堂 </a>: ""}
{this.props.isStudent()?<a className="fr user_default_btn user_blue_btn mr20 font-18"
onClick={() => this.exitclass()}
> 退出课堂 </a>:""}
</div>
<div className="clearfix clearfixborder">
<ul className="fl color-grey-eb pathInfo pathInfobox mt10">
<li className={"mt7"}>
<Link to={"/courses/"+this.props.match.params.coursesId+"/teachers"}>
<span className="color-grey-c fl font-16">教师</span>
<span
className="color-white fl font-16 bannerurli">{coursedata.teacher_count}</span>
</Link>
</li>
<li className={"mt7"}>
<Link to={"/courses/"+this.props.match.params.coursesId+"/students"}>
<span className="color-grey-c fl font-16">学生</span>
<span
className={coursedata.credit===null?"color-white fl font-16":"color-white fl font-16 bannerurli"}>{coursedata.student_count}</span>
</Link>
</li>
{/*<li className={"mt7"}>*/}
{/*<a>*/}
{/*<span className="color-grey-c fl font-16">分班</span>*/}
{/*<span className="color-white fl font-16 bannerurli">{coursedata.course_group_count}</span>*/}
{/*</a>*/}
{/*</li>*/}
{coursedata.credit===null?"":<li className={"mt7"}>
<a>
<span className="color-grey-c fl font-16 mr10">学分</span>
<span className="color-white fl font-16 "
>{coursedata.credit}</span>
</a>
</li>}
{/*{coursedata.course_end===true? <li className={"mt7"}>*/}
{/*<span className="color-grey-c fl font-16">已结束</span>*/}
{/*</li>:<li className={"mt7"}>*/}
{/*<span className="color-grey-c fl font-16"> 结束</span>*/}
{/*<span className="color-white fl font-16"*/}
{/*style={{*/}
{/*marginLeft:coursedata.deadline===null?"":'8px'*/}
{/*}}*/}
{/*>{coursedata.deadline===null?"--":coursedata.deadline}</span>*/}
{/*</li>}*/}
</ul>
<div>
{coursedata.switch_to_student === true ?
<Tooltip placement="bottom" title={"切换至学生可进行提交作品、答题等操作"}>
<a className="fr user_default_btn user_blue_btn mr20 font-18"
onClick={()=>this.switchidentity(1)}
> 切换为学生 </a>
</Tooltip>
:""}
{coursedata.switch_to_teacher === true ?
<Tooltip placement="bottom" title={"由学生身份切换至教师"}>
<a className="fr user_default_btn user_blue_btn mr20 font-18"
onClick={()=>this.switchidentity(2)}
> 切换为老师 </a>
</Tooltip>:""}
{coursedata.switch_to_assistant === true ?
<Tooltip placement="bottom" title={"由学生身份切换至助教"}>
<a className="fr user_default_btn user_blue_btn mr20 font-18"
onClick={()=>this.switchidentity(3)}
> 切换为助教 </a>
</Tooltip>:""}
{this.props.isAdmin()? <ul className="fr color-grey-eb pathInfo pathInfobox mt10"
style={{ {coursedata.course_identity === 6&&coursedata.educoder_teacher===false?
position: "relative" <a className="fr user_default_btn task-btn-orange font-18 mr20" id="shixun_operation"
}} onClick={() => this.tojoinclass(1)}>加入课堂</a>: ""}
>
<li className={"mt7 mr10im"}> {coursedata.course_identity === 6&&coursedata.educoder_teacher===true?
<a onClick={()=>this.addTeacher(true)}> <a className="fr user_default_btn task-btn-orange font-18 mr20" id="shixun_operation"
<span className="color-white fl font-16 bannerurli width100f">添加老师</span> onClick={() => this.tojoinclass(1)}>加入课堂</a>: ""}
</a>
</li> {coursedata.course_identity === 6&&coursedata.educoder_teacher===true?
<a className="fr user_default_btn user_blue_btn mr20 font-18" onClick={() => this.ActionPoll(5)}> 复制课堂 </a>: ""}
<li className={"mt7 mr10im"}>
<a onClick={()=>this.addTeacher(false)}> {this.props.isStudent()?<a className="fr user_default_btn user_blue_btn mr20 font-18"
<span className="color-white fl font-16 bannerurli width100f">添加助教</span> onClick={() => this.exitclass()}
</a> > 退出课堂 </a>:""}
</li> </div>
<li className={"mt7 mr10im"}>
<a onClick={()=>this.addStudent()}> <div className="clearfix clearfixborder">
<span className="color-white fl font-16 bannerurli width100f">添加学生</span> <ul className="fl color-grey-eb pathInfo pathInfobox mt10">
</a> <li className={"mt7"}>
</li> <Link to={"/courses/"+this.props.match.params.coursesId+"/teachers"}>
<span className="color-grey-c fl font-16">教师</span>
<li className={"mt7 mr10im ml10"} style={{overflow:"hidden"}}> <span
<a> className="color-white fl font-16 bannerurli">{coursedata.teacher_count}</span>
<span className="color-grey-c fl font-16">邀请码</span> </Link>
<span </li>
className={coursedata.code_halt === true? "color-white fl font-16 bannerurli width75f" : "color-white fl font-16 bannerurli width107f marleftf10 color-orange-tip"}>
<li className={"mt7"}>
<Link to={"/courses/"+this.props.match.params.coursesId+"/students"}>
<span className="color-grey-c fl font-16">学生</span>
<span
className={coursedata.credit===null?"color-white fl font-16":"color-white fl font-16 bannerurli"}>{coursedata.student_count}</span>
</Link>
</li>
{/*<li className={"mt7"}>*/}
{/*<a>*/}
{/*<span className="color-grey-c fl font-16">分班</span>*/}
{/*<span className="color-white fl font-16 bannerurli">{coursedata.course_group_count}</span>*/}
{/*</a>*/}
{/*</li>*/}
{coursedata.credit===null?"":<li className={"mt7"}>
<a>
<span className="color-grey-c fl font-16 mr10">学分</span>
<span className="color-white fl font-16 "
>{coursedata.credit}</span>
</a>
</li>}
{/*{coursedata.course_end===true? <li className={"mt7"}>*/}
{/*<span className="color-grey-c fl font-16">已结束</span>*/}
{/*</li>:<li className={"mt7"}>*/}
{/*<span className="color-grey-c fl font-16"> 结束</span>*/}
{/*<span className="color-white fl font-16"*/}
{/*style={{*/}
{/*marginLeft:coursedata.deadline===null?"":'8px'*/}
{/*}}*/}
{/*>{coursedata.deadline===null?"--":coursedata.deadline}</span>*/}
{/*</li>}*/}
</ul>
{this.props.isAdmin()? <ul className="fr color-grey-eb pathInfo pathInfobox mt10"
style={{
position: "relative"
}}
>
<li className={"mt7 mr10im"}>
<a onClick={()=>this.addTeacher(true)}>
<span className="color-white fl font-16 bannerurli width100f">添加老师</span>
</a>
</li>
<li className={"mt7 mr10im"}>
<a onClick={()=>this.addTeacher(false)}>
<span className="color-white fl font-16 bannerurli width100f">添加助教</span>
</a>
</li>
<li className={"mt7 mr10im"}>
<a onClick={()=>this.addStudent()}>
<span className="color-white fl font-16 bannerurli width100f">添加学生</span>
</a>
</li>
<li className={"mt7 mr10im ml10"} style={{overflow:"hidden"}}>
<a>
<span className="color-grey-c fl font-16">邀请码</span>
<span
className={coursedata.code_halt === true? "color-white fl font-16 bannerurli width75f" : "color-white fl font-16 bannerurli width107f marleftf10 color-orange-tip"}>
{coursedata.code_halt === true? "已停用" : coursedata.invite_code} {coursedata.code_halt === true? "已停用" : coursedata.invite_code}
{coursedata.code_halt === true ? "" : {coursedata.code_halt === true ? "" :
<Tooltip placement="bottom" title={ <Tooltip placement="bottom" title={
<pre> <pre>
成员可以通过邀请码主动加入课堂<br/> 成员可以通过邀请码主动加入课堂<br/>
点击立刻复制邀请码 点击立刻复制邀请码
</pre> </pre>
}> }>
<i className="iconfont icon-fuzhi color-white font-14 ml10" <i className="iconfont icon-fuzhi color-white font-14 ml10"
onClick={() => { onClick={() => {
jsCopy() jsCopy()
}}></i> }}></i>
</Tooltip> </Tooltip>
} }
<input id="copy_invite_code" value={coursedata.invite_code}/> <input id="copy_invite_code" value={coursedata.invite_code}/>
</span> </span>
</a> </a>
</li> </li>
<li className={"mt7 ml10 mr0 "}> <li className={"mt7 ml10 mr0 "}>
<style> <style>
{ {
` `
.defaults{cursor:default} .defaults{cursor:default}
` `
} }
</style> </style>
<Popover placement="bottom" content={ <Popover placement="bottom" content={
<ul className="sandianbox" style={{ <ul className="sandianbox" style={{
display: 'block', display: 'block',
right: "-113px", right: "-113px",
top: "20px" top: "20px"
}}> }}>
{coursedata.is_public === true?coursedata.course_identity <3? {coursedata.is_public === true?coursedata.course_identity <3?
<div className={"defaults"} onClick={() => this.ActionPoll(2)}>设为私有</div>: "" : ""} <div className={"defaults"} onClick={() => this.ActionPoll(2)}>设为私有</div>: "" : ""}
{coursedata.is_public === false?coursedata.course_identity <3? {coursedata.is_public === false?coursedata.course_identity <3?
<div className={"defaults"} onClick={() => this.ActionPoll(3)}>设为公开</div> : "": ""} <div className={"defaults"} onClick={() => this.ActionPoll(3)}>设为公开</div> : "": ""}
{coursedata.course_identity <3? <div className={"defaults"} onClick={() => this.ActionPoll(4)}> {coursedata.course_identity <3? <div className={"defaults"} onClick={() => this.ActionPoll(4)}>
{coursedata.code_halt === true ?"启用邀请码":"停用邀请码"} {coursedata.code_halt === true ?"启用邀请码":"停用邀请码"}
</div>:""} </div>:""}
<div className={"defaults"} onClick={this.postsettings}>设置</div> <div className={"defaults"} onClick={this.postsettings}>设置</div>
<div className={"defaults"} onClick={() => this.ActionPoll(5)}>复制 <div className={"defaults"} onClick={() => this.ActionPoll(5)}>复制
</div> </div>
{coursedata.is_admin===true?coursedata.course_identity <3?<div className={"defaults"} onClick={() => this.ActionPoll(1)}>删除</div> {coursedata.is_admin===true?coursedata.course_identity <3?<div className={"defaults"} onClick={() => this.ActionPoll(1)}>删除</div>
:"":""} :"":""}
</ul> </ul>
} trigger="hover"> } trigger="hover">
<i className="iconfont icon-weibiaoti12 color-white font-14 relative"></i> <i className="iconfont icon-weibiaoti12 color-white font-14 relative"></i>
</Popover> </Popover>
</li> </li>
</ul>:""} </ul>:""}
</div> </div>
</div> </div>
</div> </div>
</div> </div>
}
</div>
) )
} }
} }

@ -71,7 +71,6 @@ class Trialapplication extends Component {
this.setState({ this.setState({
isRenders: true isRenders: true
}) })
this.props.setTrialapplication();
} }
return response; return response;
}, (error) => { }, (error) => {

@ -213,12 +213,12 @@ export function TPMIndexHOC(WrappedComponent) {
return this.state.coursedata&&this.state.coursedata.course_identity === 6 return this.state.coursedata&&this.state.coursedata.course_identity === 6
} }
setTrialapplication = ()=>{ // setTrialapplication = ()=>{
this.setState({ // this.setState({
isRenders:true // isRenders:true
}) // })
//
} // }
/** /**
@ -288,13 +288,13 @@ export function TPMIndexHOC(WrappedComponent) {
} }
return ( return (
<div> <div>
{ {/*{*/}
user_phone_binded === undefined? {/* user_phone_binded === undefined?*/}
"" {/* ""*/}
: {/* :*/}
<Trialapplication {...this.state} user_phone_binded={user_phone_binded} setTrialapplication = {this.setTrialapplication} ></Trialapplication> {/* <Trialapplication {...this.state} user_phone_binded={user_phone_binded} setTrialapplication = {this.setTrialapplication} ></Trialapplication>*/}
} {/*}*/}
<SiderBar <SiderBar
Headertop={Headertop} Headertop={Headertop}

Loading…
Cancel
Save