用户图像缓存问题

dev_ec
jingquan huang 5 years ago
commit b4869f9bbd

@ -378,7 +378,6 @@ DEPENDENCIES
kaminari (~> 1.1, >= 1.1.1) kaminari (~> 1.1, >= 1.1.1)
listen (>= 3.0.5, < 3.2) listen (>= 3.0.5, < 3.2)
mysql2 (>= 0.4.4, < 0.6.0) mysql2 (>= 0.4.4, < 0.6.0)
newrelic_rpm
oauth2 oauth2
pdfkit pdfkit
puma (~> 3.11) puma (~> 3.11)

@ -127,21 +127,21 @@ class AccountsController < ApplicationController
# UserDayCertification.create(user_id: user.id, status: 1) # UserDayCertification.create(user_id: user.id, status: 1)
end end
def set_autologin_cookie(user) # def set_autologin_cookie(user)
token = Token.get_or_create_permanent_login_token(user, "autologin") # token = Token.get_or_create_permanent_login_token(user, "autologin")
cookie_options = { # cookie_options = {
:value => token.value, # :value => token.value,
:expires => 1.month.from_now, # :expires => 1.month.from_now,
:path => '/', # :path => '/',
:secure => false, # :secure => false,
:httponly => true # :httponly => true
} # }
if edu_setting('cookie_domain').present? # if edu_setting('cookie_domain').present?
cookie_options = cookie_options.merge(domain: edu_setting('cookie_domain')) # cookie_options = cookie_options.merge(domain: edu_setting('cookie_domain'))
end # end
cookies[autologin_cookie_name] = cookie_options # cookies[autologin_cookie_name] = cookie_options
logger.info("cookies is #{cookies}") # logger.info("cookies is #{cookies}")
end # end
def logout def logout
UserAction.create(action_id: User.current.id, action_type: "Logout", user_id: User.current.id, :ip => request.remote_ip) UserAction.create(action_id: User.current.id, action_type: "Logout", user_id: User.current.id, :ip => request.remote_ip)

@ -620,6 +620,22 @@ class ApplicationController < ActionController::Base
cookies[:fileDownload] = true cookies[:fileDownload] = true
end end
def set_autologin_cookie(user)
token = Token.get_or_create_permanent_login_token(user, "autologin")
cookie_options = {
:value => token.value,
:expires => 1.month.from_now,
:path => '/',
:secure => false,
:httponly => true
}
if edu_setting('cookie_domain').present?
cookie_options = cookie_options.merge(domain: edu_setting('cookie_domain'))
end
cookies[autologin_cookie_name] = cookie_options
logger.info("cookies is #{cookies}")
end
# 149课程的评审用户数据创建包含创建课堂学生 # 149课程的评审用户数据创建包含创建课堂学生
def open_class_user def open_class_user
user = User.find_by(login: "OpenClassUser") user = User.find_by(login: "OpenClassUser")

@ -476,14 +476,13 @@ class GamesController < ApplicationController
if @myshixun.shixun.try(:status) < 2 if @myshixun.shixun.try(:status) < 2
tip_exception("代码获取异常,请检查实训模板的评测设置是否正确") tip_exception("代码获取异常,请检查实训模板的评测设置是否正确")
else else
# 报错继续retry
if params[:retry].to_i == 1
# 如果报错了并且retry 为1的时候则fork一个新的仓库
project_fork(@myshixun, @shixun.repo_path, current_user.login)
end
tip_exception(-3, "#{e.message}") tip_exception(-3, "#{e.message}")
end end
end end
# 如果报错了并且retry 为1的时候则fork一个新的仓库
if params[:retry].to_i == 1
project_fork(@myshixun, @shixun.repo_path, current_user.login)
end
tip_exception(0, e.message) tip_exception(0, e.message)
end end
end end

@ -4,5 +4,5 @@ json.name user.full_name
json.grade user.grade json.grade user.grade
json.identity user&.user_extension&.identity json.identity user&.user_extension&.identity
# json.email user.mail # 邮箱原则上不暴露的,如果实在需要的话只能对某些具体的接口公开 # json.email user.mail # 邮箱原则上不暴露的,如果实在需要的话只能对某些具体的接口公开
json.image_url url_to_avatar(user) json.image_url image_tag(url_to_avatar(user))
json.school user.school_name json.school user.school_name

File diff suppressed because one or more lines are too long

@ -1,4 +1,4 @@
document.write("<link href='//at.alicdn.com/t/font_653600_qa9lwwv74z.css' rel='stylesheet' type='text/css'/>"); document.write("<link href='https://at.alicdn.com/t/font_653600_qa9lwwv74z.css' rel='stylesheet' type='text/css'/>");
/*! /*!
* JavaScript Cookie v2.2.0 * JavaScript Cookie v2.2.0

@ -233,7 +233,7 @@ class Bullsubdirectory extends Component{
{ {
whethertoeditysl === false? whethertoeditysl === false?
<div> <div>
<div> <div className="fudonyingxiangysls">
<div className="fudonyingxiangysl"> <div className="fudonyingxiangysl">
<div style={{marginRight:"60px"}}> <div style={{marginRight:"60px"}}>
<span className="ysltitbt">{myname}</span> <span className="ysltitbt">{myname}</span>

@ -70,6 +70,10 @@
.fudonyingxiangysl{ .fudonyingxiangysl{
width: 100%; width: 100%;
} }
.fudonyingxiangysls{
display: flex;
flex-direction:column;
}
.yslbianji{ .yslbianji{
padding-top: 31px; padding-top: 31px;

@ -3059,20 +3059,20 @@ class Listofworksstudentone extends Component {
// console.log(this.props.isAdmin()); // console.log(this.props.isAdmin());
let course_is_end = this.props.current_user&&this.props.current_user.course_is_end; let course_is_end = this.props.current_user&&this.props.current_user.course_is_end;
try { // try {
if(this.props.isAdmin() === false){ // if(this.props.isAdmin() === false){
if(teacherdata&&teacherdata.student_works){ // if(teacherdata&&teacherdata.student_works){
if(teacherdata&&teacherdata.student_works.length>0){ // if(teacherdata&&teacherdata.student_works.length>0){
console.log("这是双层页面。。。。"); // console.log("这是双层页面。。。。");
//
} // }
} // }
//
} // }
}catch (e) { // }catch (e) {
console.log("Listofworksstudentone123"); // console.log("Listofworksstudentone123");
console.log(e); // console.log(e);
} // }
return ( return (
@ -3151,12 +3151,12 @@ class Listofworksstudentone extends Component {
typs={this.state.typs} typs={this.state.typs}
/> />
{ {
homework_status.length===0? homework_status&&homework_status.length===0?
<div className="edu-back-white"> <div className="edu-back-white">
<NoneData></NoneData> <NoneData></NoneData>
</div> </div>
: :
homework_status.length>0 && homework_status[0]==="未发布"? homework_status&&homework_status.length>0 && homework_status[0]==="未发布"?
<div className="edu-back-white"> <div className="edu-back-white">
<NoneData></NoneData> <NoneData></NoneData>
</div> </div>
@ -3491,12 +3491,12 @@ class Listofworksstudentone extends Component {
} }
{ {
homework_status.length===0? homework_status&&homework_status.length&&homework_status.length===0?
<div className=" clearfix edu-back-white" style={{margin: "auto" , minWidth:"1200px"}}> <div className=" clearfix edu-back-white" style={{margin: "auto" , minWidth:"1200px"}}>
<NoneData></NoneData> <NoneData></NoneData>
</div> </div>
: :
homework_status.length>0 && homework_status[0]==="未发布"? homework_status&&homework_status.length>0 && homework_status&&homework_status[0]==="未发布"?
<div className=" clearfix edu-back-white " style={{margin: "auto" , minWidth:"1200px"}}> <div className=" clearfix edu-back-white " style={{margin: "auto" , minWidth:"1200px"}}>
<NoneData></NoneData> <NoneData></NoneData>
</div> </div>
@ -3651,12 +3651,12 @@ class Listofworksstudentone extends Component {
} }
{ {
homework_status.length===0? homework_status&&homework_status.length===0?
<div className=" clearfix edu-back-white" style={{margin: "auto" , minWidth:"1200px"}}> <div className=" clearfix edu-back-white" style={{margin: "auto" , minWidth:"1200px"}}>
<NoneData></NoneData> <NoneData></NoneData>
</div> </div>
: :
homework_status.length>0 && homework_status[0]==="未发布"? homework_status&&homework_status.length>0 && homework_status&&homework_status[0]==="未发布"?
<div className=" clearfix edu-back-white" style={{margin: "auto" , minWidth:"1200px"}}> <div className=" clearfix edu-back-white" style={{margin: "auto" , minWidth:"1200px"}}>
<NoneData></NoneData> <NoneData></NoneData>
</div> </div>

@ -92,7 +92,7 @@ class Trainingjobsetting extends Component {
level: undefined, level: undefined,
ealuation: false, ealuation: false,
latededuction: undefined, latededuction: undefined,
latedeductiontwo: "20", latedeductiontwo: "0",
database: false, database: false,
datasheet: false, datasheet: false,
databasetwo: undefined, databasetwo: undefined,
@ -123,6 +123,7 @@ class Trainingjobsetting extends Component {
end_timebool:false, end_timebool:false,
late_timesbool:false, late_timesbool:false,
work_efficiencys:false,
} }
// console.log("获取到的值") // console.log("获取到的值")
// console.log("Trainingjobsetting") // console.log("Trainingjobsetting")
@ -284,7 +285,7 @@ class Trainingjobsetting extends Component {
allowreplenishment: result.data.allow_late, allowreplenishment: result.data.allow_late,
latededuction: result.data.late_penalty, latededuction: result.data.late_penalty,
level: result.data.answer_open_evaluation === true ? "满分" : "扣分", level: result.data.answer_open_evaluation === true ? "满分" : "扣分",
completionefficiencyscore: result.data.work_efficiency, work_efficiencys: result.data.work_efficiency,
latedeductiontwo: result.data.eff_score, latedeductiontwo: result.data.eff_score,
proportion: result.data.shixun_evaluation === 0 ? "均分比例" : result.data.shixun_evaluation === 1 ? "经验值比例" : result.data.shixun_evaluation === 2 ? "自定义分值" : "", proportion: result.data.shixun_evaluation === 0 ? "均分比例" : result.data.shixun_evaluation === 1 ? "经验值比例" : result.data.shixun_evaluation === 2 ? "自定义分值" : "",
publicwork: result.data.work_public, publicwork: result.data.work_public,
@ -635,7 +636,7 @@ class Trainingjobsetting extends Component {
late_penalty: parseInt(this.state.latededuction), //迟交扣分 late_penalty: parseInt(this.state.latededuction), //迟交扣分
late_time: moment(this.state.late_time).format('YYYY-MM-DD HH:mm'), //结束时间 late_time: moment(this.state.late_time).format('YYYY-MM-DD HH:mm'), //结束时间
answer_open_evaluation: this.state.level === "满分" ? true : false, //扣分项 answer_open_evaluation: this.state.level === "满分" ? true : false, //扣分项
work_efficiency: this.state.completionefficiencyscore, //完成效率评分占比 work_efficiency: this.state.work_efficiencys, //完成效率评分占比
eff_score: this.state.completionefficiencyscore === true ? this.state.latedeductiontwo : undefined,//占比分 eff_score: this.state.completionefficiencyscore === true ? this.state.latedeductiontwo : undefined,//占比分
shixun_evaluation: this.state.proportion === "均分比例" ? 0 : this.state.proportion === "经验值比例" ? 1 : this.state.proportion === "自定义分值" ? 2 : 0, shixun_evaluation: this.state.proportion === "均分比例" ? 0 : this.state.proportion === "经验值比例" ? 1 : this.state.proportion === "自定义分值" ? 2 : 0,
challenge_settings: array, challenge_settings: array,
@ -660,6 +661,7 @@ class Trainingjobsetting extends Component {
flagPageEditsthrees:false, flagPageEditsthrees:false,
flagPageEditsfor:false, flagPageEditsfor:false,
whethertopay:false, whethertopay:false,
completionefficiencyscore:false,
}) })
this.refs.targetElementTrainingjobsetting.scrollIntoView() this.refs.targetElementTrainingjobsetting.scrollIntoView()
@ -1004,6 +1006,7 @@ class Trainingjobsetting extends Component {
this.state.latedeductiontwo=20; this.state.latedeductiontwo=20;
this.setState({ this.setState({
completionefficiencyscore: e.target.checked, completionefficiencyscore: e.target.checked,
work_efficiencys:e.target.checked,
latedeductiontwo: 20, latedeductiontwo: 20,
}) })
//均分比例 //均分比例
@ -1020,6 +1023,7 @@ class Trainingjobsetting extends Component {
this.state.latedeductiontwo=0; this.state.latedeductiontwo=0;
this.setState({ this.setState({
completionefficiencyscore: e.target.checked, completionefficiencyscore: e.target.checked,
work_efficiencys:e.target.checked,
latedeductiontwo: 0, latedeductiontwo: 0,
}) })
//均分比例 //均分比例
@ -1068,7 +1072,7 @@ class Trainingjobsetting extends Component {
// //占比分 // //占比分
changeTopicNametwo = (value) => { changeTopicNametwo = (value) => {
// console.log("2e.target.value", value) // console.log("TrainingjobsettingTrainingjobsetting", value)
if (value === "" || value === undefined) { if (value === "" || value === undefined) {
return return
} }
@ -1703,7 +1707,6 @@ class Trainingjobsetting extends Component {
flagPageEditsthrees:deadline, flagPageEditsthrees:deadline,
flagPageEditsfor:endtime, flagPageEditsfor:endtime,
completionefficiencyscore:true, completionefficiencyscore:true,
latedeductiontwo:20,
unifiedsetting:this.state.unifiedsetting, unifiedsetting:this.state.unifiedsetting,
}) })
if(this.state.proportion === "自定义分值"){ if(this.state.proportion === "自定义分值"){
@ -1852,7 +1855,7 @@ class Trainingjobsetting extends Component {
const dataformat = 'YYYY-MM-DD HH:mm'; const dataformat = 'YYYY-MM-DD HH:mm';
let {flagPageEdit,testscripttiptype,publish_timebool,end_timebool,late_timesbool,flagPageEdits,flagPageEditstwo,flagPageEditsbox,whethertopay,handclass,flagPageEditsthrees, flagPageEditsfor,rules,rulest,unifiedsetting,group_settings, course_group,unit_e_tip, borreds,borredss,unit_p_tip, end_time, late_time, score_open, publish_time, starttimetype, modalsType, modalsTopval, loadtype, modalSave, endtimetype, latetimetype, allowlate, latepenaltytype, jobsettingsdata, endOpen, mystyle, mystyles} = this.state; let {flagPageEdit,testscripttiptype,publish_timebool,end_timebool,late_timesbool,work_efficiencys,flagPageEdits,flagPageEditstwo,flagPageEditsbox,whethertopay,handclass,flagPageEditsthrees, flagPageEditsfor,rules,rulest,unifiedsetting,group_settings, course_group,unit_e_tip, borreds,borredss,unit_p_tip, end_time, late_time, score_open, publish_time, starttimetype, modalsType, modalsTopval, loadtype, modalSave, endtimetype, latetimetype, allowlate, latepenaltytype, jobsettingsdata, endOpen, mystyle, mystyles} = this.state;
console.log(publish_timebool); console.log(publish_timebool);
console.log(!flagPageEditstwo); console.log(!flagPageEditstwo);
const radioStyle = { const radioStyle = {
@ -1880,6 +1883,8 @@ class Trainingjobsetting extends Component {
// } // }
// console.log(this.props.isAdmin()) // console.log(this.props.isAdmin())
// console.log(this.state.code_review===false) // console.log(this.state.code_review===false)
// console.log("引入的分值");
// console.log(this.state.work_efficiencys);
return ( return (
<div className=" clearfix " ref='targetElementTrainingjobsetting' style={{margin: "auto", minWidth:"1200px"}}> <div className=" clearfix " ref='targetElementTrainingjobsetting' style={{margin: "auto", minWidth:"1200px"}}>
{this.state.showmodel===true?<ShixunWorkModal {this.state.showmodel===true?<ShixunWorkModal
@ -2134,7 +2139,7 @@ class Trainingjobsetting extends Component {
<div className=" clearfix edu-back-white poll_list mt10" style={{marginLeft:" 40px"}}> <div className=" clearfix edu-back-white poll_list mt10" style={{marginLeft:" 40px"}}>
<Checkbox disabled={!flagPageEdit} className=" font-13 mt10" <Checkbox disabled={!flagPageEdit} className=" font-13 mt10"
onChange={this.onChangeeffectiveness} onChange={this.onChangeeffectiveness}
checked={this.state.completionefficiencyscore} style={{"color":"#666666"}}>效率分<span checked={this.state.work_efficiencys} style={{"color":"#666666"}}>效率分<span
className={"font-14 color-grey-c font-14 ml15"} style={{"text-align":"left"}}>(选中则学生最终成绩包含效率分)</span> className={"font-14 color-grey-c font-14 ml15"} style={{"text-align":"left"}}>(选中则学生最终成绩包含效率分)</span>
</Checkbox> </Checkbox>
<div> <div>

@ -144,11 +144,7 @@ class MainContent extends Component {
{/* readRepoTimeout 如果读取代码超时,显示重新加载按钮,重新拉取代码 */} {/* readRepoTimeout 如果读取代码超时,显示重新加载按钮,重新拉取代码 */}
{ {
st === 0 st === 0
? ?
readRepoTimeout === true ? <div className="readRepoFailed">
代码加载失败<a className="retry"
onClick={() => this.props.fetchRepositoryCode(this.props, null, null, true, true)}>重试</a>
</div> :
<React.Fragment> <React.Fragment>
<div style={{display: (codeLoading ? 'block' : 'none'), textAlign: 'center'}}> <div style={{display: (codeLoading ? 'block' : 'none'), textAlign: 'center'}}>
<CircularProgress size={40} thickness={3} <CircularProgress size={40} thickness={3}

@ -319,7 +319,8 @@ class MainContentContainer extends Component {
readingRepoTimes = readingRepoTimes + 1; readingRepoTimes = readingRepoTimes + 1;
if(readingRepoTimes > 9) { if(readingRepoTimes > 9) {
this.setState({ this.setState({
readRepoTimeout: true readRepoTimeout: true,
codeLoading: false
}) })
readingRepoTimes = 0; readingRepoTimes = 0;
showSnackbar(`网络异常,请稍后重试。`); showSnackbar(`网络异常,请稍后重试。`);

@ -474,7 +474,9 @@ class CodeRepositoryView extends Component {
<span id="return_last_code"> <span id="return_last_code">
</span> </span>
{ challenge.pathIndex !== -1 && game.status === 2 && tabIndex === 0 && <a href="javascript:void(0);" className="iconButton" id="reset_success_game_code" onClick={showResetPassedCodeDialog}> { challenge.pathIndex !== -1 && game.status === 2 && tabIndex === 0 &&
this.props.readRepoTimeout !== true &&
<a href="javascript:void(0);" className="iconButton" id="reset_success_game_code" onClick={showResetPassedCodeDialog}>
<Tooltip title={ "加载上次通过的代码"} disableFocusListener={true}> <Tooltip title={ "加载上次通过的代码"} disableFocusListener={true}>
<i className="iconfont icon-fanhuishangcidaima font-20 "></i> <i className="iconfont icon-fanhuishangcidaima font-20 "></i>
</Tooltip> </Tooltip>
@ -482,7 +484,7 @@ class CodeRepositoryView extends Component {
} }
{ {
challenge.pathIndex !== -1 && tabIndex === 0 && challenge.pathIndex !== -1 && tabIndex === 0 && this.props.readRepoTimeout !== true &&
<a href="javascript:void(0);" className="iconButton" id="reset_game_code" onClick={showResetCodeDialog}> <a href="javascript:void(0);" className="iconButton" id="reset_game_code" onClick={showResetCodeDialog}>
<Tooltip title={ "恢复初始代码"} disableFocusListener={true}> <Tooltip title={ "恢复初始代码"} disableFocusListener={true}>
<i className="iconfont icon-zhongzhi font-20 "></i> <i className="iconfont icon-zhongzhi font-20 "></i>
@ -491,7 +493,7 @@ class CodeRepositoryView extends Component {
} }
{ {
tabIndex === 0 && tabIndex === 0 && this.props.readRepoTimeout !== true &&
<a href="javascript:void(0);" className="iconButton" id="setting" onClick={() => showSettingDrawer(true)}> <a href="javascript:void(0);" className="iconButton" id="setting" onClick={() => showSettingDrawer(true)}>
<Tooltip title={ "设置"} disableFocusListener={true}> <Tooltip title={ "设置"} disableFocusListener={true}>
<i className="iconfont icon-shezhi " style={{fontSize: '19px'}}></i> <i className="iconfont icon-shezhi " style={{fontSize: '19px'}}></i>
@ -510,6 +512,7 @@ class CodeRepositoryView extends Component {
<div className="cl"></div> <div className="cl"></div>
</ul> </ul>
<div className="cl"></div> <div className="cl"></div>
<div id="codetab_con_1" style={{display: 'block', flex: 'auto'}} style={ tabIndex === 0 ? {display: 'block'} : {display: 'none'} }> <div id="codetab_con_1" style={{display: 'block', flex: 'auto'}} style={ tabIndex === 0 ? {display: 'block'} : {display: 'none'} }>
{/* 没必要显示这个,注释掉了 */} {/* 没必要显示这个,注释掉了 */}
{/* { !isEditablePath && {/* { !isEditablePath &&
@ -519,13 +522,20 @@ class CodeRepositoryView extends Component {
</div> </div>
</Tooltip> </Tooltip>
} */} } */}
<div className="codemirrorBackground" {this.props.readRepoTimeout === true ? <div className="readRepoFailed">
style={{ backgroundImage: `url('${notEditablePathImg}')` 代码加载失败<a className="retry"
, display: (isEditablePath || this.props.shixun && this.props.shixun.code_edit_permission ? 'none' : 'block') }}></div> onClick={() => this.props.fetchRepositoryCode(this.props, null, null, true, true)}>重试</a>
{/*<textarea className = "" id="extend-challenge-file-edit" name="content">{repositoryCode}</textarea>*/} </div> :
{/* cm monaco 切换 */} <React.Fragment>
{/* <TPICodeMirror {...this.props} ></TPICodeMirror> */} <div className="codemirrorBackground"
<TPIMonaco {...this.props}></TPIMonaco> style={{ backgroundImage: `url('${notEditablePathImg}')`
, display: (isEditablePath || this.props.shixun && this.props.shixun.code_edit_permission ? 'none' : 'block') }}></div>
{/*<textarea className = "" id="extend-challenge-file-edit" name="content">{repositoryCode}</textarea>*/}
{/* cm monaco 切换 */}
{/* <TPICodeMirror {...this.props} ></TPICodeMirror> */}
<TPIMonaco {...this.props}></TPIMonaco>
</React.Fragment>
}
</div> </div>
<div id="codetab_con_81" className="undis -relative" <div id="codetab_con_81" className="undis -relative"
style={ { color: '#fff', display: tabIndex === STABLE_SSH_TAB_ID ? 'block' : 'none', 'marginLeft': '2px'} }> style={ { color: '#fff', display: tabIndex === STABLE_SSH_TAB_ID ? 'block' : 'none', 'marginLeft': '2px'} }>

@ -348,7 +348,8 @@ class DetailTop extends Component{
let applypath=this.props.detailInfoList&&this.props.detailInfoList.participant_count!=undefined&&this.props.detailInfoList&&this.props.detailInfoList.allow_statistics===false; let applypath=this.props.detailInfoList&&this.props.detailInfoList.participant_count!=undefined&&this.props.detailInfoList&&this.props.detailInfoList.allow_statistics===false;
let coursestypes=this.props.courses!=undefined&&this.props.courses.length===0; let coursestypes=this.props.courses!=undefined&&this.props.courses.length===0;
console.log(coursestypes) let isadminallow_statistics=this.props.courses&&this.props.courses.length===0&&this.props.detailInfoList&&this.props.detailInfoList.allow_statistics===true;
return( return(
<div className={this.props.courses===undefined||this.props.courses.length===0?"subhead":applypath===false?"subhead mb70":this.state.MenuItemskey===this.props.courses.length?"subhead mb100":"subhead mb70"}> <div className={this.props.courses===undefined||this.props.courses.length===0?"subhead":applypath===false?"subhead mb70":this.state.MenuItemskey===this.props.courses.length?"subhead mb100":"subhead mb70"}>
@ -485,7 +486,7 @@ class DetailTop extends Component{
</div> </div>
{this.props.courses===undefined?"":<div className="userNavs mt20" style={applypath===false?{}:this.state.MenuItemskey===this.props.courses.length?{height:'158px'}:{}}> {this.props.courses===undefined||isadminallow_statistics===true?"":<div className="userNavs mt20" style={applypath===false?{}:this.state.MenuItemskey===this.props.courses.length?{height:'158px'}:{}}>
<style> <style>
{ {
` `
@ -625,30 +626,36 @@ class DetailTop extends Component{
border-radius: 4px; border-radius: 4px;
line-height: 46px !important; line-height: 46px !important;
} }
.lineHeight0{ .lineHeight1{
line-height: 0px; line-height: 1px;
} }
.font153{ .font153{
font-size: 14px; font-size: 14px;
font-weight: 400; font-weight: 400;
color: rgba(153,153,153,1); color: rgba(153,153,153,1);
line-height: 14px;
margin-left: 30px; margin-left: 30px;
} }
.absolutewidth{ .absolutewidth{
position: absolute; position: absolute;
top: -21px; top: 19px;
right: 71px; right: 71px;
} }
.relativewidth{ .relativewidth{
position: relative; position: relative;
width: 100%; width: 100%;
} }
.padding040{
padding: 0 43px;
}
.mt26{
margin-top:26px;
}
` `
} }
</style> </style>
{this.props.courses===undefined||this.props.courses.length===0?"":<li className={"fr mr25"}> {this.props.courses===undefined||this.props.courses.length===0?"":<li className={"fr padding040"}>
{/* {/*
@ -658,27 +665,32 @@ class DetailTop extends Component{
return( return(
<div key={key}> <div key={key}>
{applypath===false?"":this.state.MenuItemskey===this.props.courses.length||coursestypes===true?
this.props.detailInfoList&&this.props.detailInfoList.has_participate===false?
getappointmenttype===true?<span className={coursestypes===true?"fr user_default_btn background191 font-18 pathbtensbox mt5":"fr user_default_btn background191 font-18 pathbtensbox mt26"}>预约报名成功</span>:<a className={coursestypes===true?"fr user_default_btn task-btn-28BE6C font-18 pathbtensbox mt5":"fr user_default_btn task-btn-28BE6C font-18 pathbtensbox mt26"} onClick={()=>this.putappointment()}></a>:
<span className={coursestypes===true?"fr user_default_btn background191 font-18 pathbtensbox mt5":"fr user_default_btn background191 font-18 pathbtensbox mt26"}>预约报名成功</span>:""}
{/*{item.course_status.status===0?<div className="mr51 shixun_detail pointer fl user-colorgrey-green pathdefault">即将开课</div>:""}*/} {/*{item.course_status.status===0?<div className="mr51 shixun_detail pointer fl user-colorgrey-green pathdefault">即将开课</div>:""}*/}
{item.course_status.status===1?<div className="mr51 shixun_detail pointer fl color-orange pathdefault">{item.course_status.time}</div>:""} {item.course_status.status===1?<div className="mr51 shixun_detail pointer fl color-orange pathdefault">{item.course_status.time}</div>:""}
{item.course_status.status===2&&item.course_identity<6?<div className="mr20 shixun_detail pointer fl user-colorgrey-9b pathdefault">已结束</div>:""} {item.course_status.status===2&&item.course_identity<6?<div className="mr20 shixun_detail pointer fl user-colorgrey-9b pathdefault">已结束</div>:""}
{/*<div className="fr user_default_btn background191 font-18 mt28 pathbtens pathdefault">已结束</div>*/} {/*<div className="fr user_default_btn background191 font-18 mt28 pathbtens pathdefault">已结束</div>*/}
{item.course_status.status===0? {item.course_status.status===0?
item.course_identity<5?<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens courseslistsa" href={item.first_category_url} target="_blank"> item.course_identity<5?<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens courseslistsa mr20" href={item.first_category_url} target="_blank">
进入课堂 进入课堂
</a>:item.course_identity<6?<div className="fr user_default_btn background191 font-18 mt28 pathbtens pathdefault"></div> </a>:item.course_identity<6?<div className="fr user_default_btn background191 font-18 mt28 pathbtens pathdefault mr20"></div>
:<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens" onClick={()=>this.JoinnowCourse(item.course_id)}>立即报名</a>:""} :<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens mr20" onClick={()=>this.JoinnowCourse(item.course_id)}>立即报名</a>:""}
{item.course_status.status===1? {item.course_status.status===1?
item.course_identity<5?<a className="courseslistsa fr user_default_btn task-btn-orange font-18 mt28 pathbtens" href={item.first_category_url} target="_blank"> item.course_identity<5?<a className="courseslistsa fr user_default_btn task-btn-orange font-18 mt28 pathbtens mr20" href={item.first_category_url} target="_blank">
进入课堂 进入课堂
</a>:item.course_identity<6?<a className="courseslistsa fr user_default_btn task-btn-orange font-18 mt28 pathbtens" href={item.first_category_url} target="_blank"> </a>:item.course_identity<6?<a className="courseslistsa fr user_default_btn task-btn-orange font-18 mt28 pathbtens mr20" href={item.first_category_url} target="_blank">
立即学习 立即学习
</a>:<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens" onClick={()=>this.JoinnowCourse(item.course_id,item.course_status.status)}></a>:""} </a>:<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens mr20" onClick={()=>this.JoinnowCourse(item.course_id,item.course_status.status)}></a>:""}
{item.course_status.status===2? {item.course_status.status===2?
item.course_identity<6?<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens courseslistsa" href={item.first_category_url} target="_blank"> item.course_identity<6?<a className="fr user_default_btn task-btn-orange font-18 mt28 pathbtens courseslistsa mr20" href={item.first_category_url} target="_blank">
进入课堂 进入课堂
</a>:<div className="mr80 shixun_detail pointer fl user-colorgrey-9b pathdefault"></div>:""} </a>:<div className="mr20 shixun_detail pointer fl user-colorgrey-9b pathdefault"></div>:""}
</div> </div>
)})} )})}
@ -686,15 +698,27 @@ class DetailTop extends Component{
</li>} </li>}
{applypath===false?"":this.state.MenuItemskey===this.props.courses.length?<div className={"clear"}></div>:""} {applypath===false?"":this.state.MenuItemskey===this.props.courses.length?<div className={"clear"}></div>:""}
{applypath===false?"":this.state.MenuItemskey===this.props.courses.length||coursestypes===true?<span className={coursestypes===true?"fl ml20 lineHeight0 relativewidth mt43":"fl ml20 lineHeight0 relativewidth"}> {applypath===false?"":this.props.courses.length===0?"":this.state.MenuItemskey===this.props.courses.length||coursestypes===true?<span className={coursestypes===true?"fr lineHeight1 relativewidth mt43":"fl lineHeight1 relativewidth"}>
<span className={"fr mr30"}>当前预约报名人数<span className={"color-red mr5"}>{getappointmenttype===true?this.props.detailInfoList&&this.props.detailInfoList.participant_count+1:this.props.detailInfoList&&this.props.detailInfoList.participant_count}</span></span>
<span className={"font153 fr mr12"}>当预约报名人数达到 {this.props.detailInfoList&&this.props.detailInfoList.student_count} 人时即将开课</span>
{/*{this.props.detailInfoList&&this.props.detailInfoList.has_participate===false?*/}
{/*getappointmenttype===true?<span className={coursestypes===true?"fr user_default_btn background191 font-18 pathbtensbox absolutewidth mt5":"fr user_default_btn background191 font-18 pathbtensbox absolutewidth"}>预约报名成功</span>:<a className={coursestypes===true?"fr user_default_btn task-btn-28BE6C font-18 pathbtensbox absolutewidth mt5":"fr user_default_btn task-btn-28BE6C font-18 pathbtensbox absolutewidth"} onClick={()=>this.putappointment()}>期待开课并预约报名</a>:*/}
{/*<span className={coursestypes===true?"fr user_default_btn background191 font-18 pathbtensbox absolutewidth mt5":"fr user_default_btn background191 font-18 pathbtensbox absolutewidth"}>预约报名成功</span>}*/}
</span>
:""}
{applypath===true&&this.props.courses.length===0?this.state.MenuItemskey===this.props.courses.length||coursestypes===true?<span className={coursestypes===true?"fl ml20 lineHeight0 relativewidth":"fl ml20 lineHeight0 relativewidth"}>
<span>当前预约报名人数<span className={"color-red mr5"}>{getappointmenttype===true?this.props.detailInfoList&&this.props.detailInfoList.participant_count+1:this.props.detailInfoList&&this.props.detailInfoList.participant_count}</span></span> <span>当前预约报名人数<span className={"color-red mr5"}>{getappointmenttype===true?this.props.detailInfoList&&this.props.detailInfoList.participant_count+1:this.props.detailInfoList&&this.props.detailInfoList.participant_count}</span></span>
<span className={"font153"}>当预约报名人数达到 {this.props.detailInfoList&&this.props.detailInfoList.student_count} 人时即将开课</span> <span className={"font153"}>当预约报名人数达到 {this.props.detailInfoList&&this.props.detailInfoList.student_count} 人时即将开课</span>
{this.props.detailInfoList&&this.props.detailInfoList.has_participate===false? {this.props.detailInfoList&&this.props.detailInfoList.has_participate===false?
getappointmenttype===true?<span className={coursestypes===true?"fr user_default_btn background191 font-18 pathbtensbox absolutewidth mt5":"fr user_default_btn background191 font-18 pathbtensbox absolutewidth"}>预约报名成功</span>:<a className={coursestypes===true?"fr user_default_btn task-btn-28BE6C font-18 pathbtensbox absolutewidth mt5":"fr user_default_btn task-btn-28BE6C font-18 pathbtensbox absolutewidth"} onClick={()=>this.putappointment()}></a>: getappointmenttype===true?<span className={coursestypes===true?"fr user_default_btn background191 font-18 pathbtensbox absolutewidth mt5":"fr user_default_btn background191 font-18 pathbtensbox absolutewidth"}>预约报名成功</span>:<a className={coursestypes===true?"fr user_default_btn task-btn-28BE6C font-18 pathbtensbox absolutewidth mt5":"fr user_default_btn task-btn-28BE6C font-18 pathbtensbox absolutewidth"} onClick={()=>this.putappointment()}></a>:
<span className={coursestypes===true?"fr user_default_btn background191 font-18 pathbtensbox absolutewidth mt5":"fr user_default_btn background191 font-18 pathbtensbox absolutewidth"}>预约报名成功</span>} <span className={coursestypes===true?"fr user_default_btn background191 font-18 pathbtensbox absolutewidth mt5":"fr user_default_btn background191 font-18 pathbtensbox absolutewidth"}>预约报名成功</span>}
</span>:""} </span>:"":""}
</div>} </div>}

@ -865,7 +865,7 @@ submittojoinclass=(value)=>{
<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/shixuns`}>我的实训项目</Link></li> <li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/shixuns`}>我的实训项目</Link></li>
<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/paths`}>我的实践课程</Link></li> <li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/paths`}>我的实践课程</Link></li>
<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/projects`}>我的开发项目</Link></li> <li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/projects`}>我的开发项目</Link></li>
<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/package`}>我的众包</Link></li> {/*<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/package`}>我的众包</Link></li>*/}
<li style={{display: this.props.Headertop === undefined ? 'none' : this.props.Headertop.customer_management_url===null || this.props.Headertop.customer_management_url===""? 'none' : 'block'}}> <li style={{display: this.props.Headertop === undefined ? 'none' : this.props.Headertop.customer_management_url===null || this.props.Headertop.customer_management_url===""? 'none' : 'block'}}>
<a href={this.props.Headertop === undefined ? '' : this.props.Headertop.customer_management_url}>客户管理</a> <a href={this.props.Headertop === undefined ? '' : this.props.Headertop.customer_management_url}>客户管理</a>
</li> </li>

@ -111,11 +111,11 @@ class InfosBanner extends Component{
onClick={() => this.setState({moduleName: 'projects'})} onClick={() => this.setState({moduleName: 'projects'})}
to={`/users/${username}/projects`}>开发项目</Link> to={`/users/${username}/projects`}>开发项目</Link>
</li> </li>
<li className={`${moduleName == 'package' ? 'active' : '' }`}> {/*<li className={`${moduleName == 'package' ? 'active' : '' }`}>*/}
<Link {/* <Link*/}
onClick={() => this.setState({moduleName: 'package'})} {/* onClick={() => this.setState({moduleName: 'package'})}*/}
to={`/users/${username}/package`}>众包</Link> {/* to={`/users/${username}/package`}>众包</Link>*/}
</li> {/*</li>*/}
{((is_current && current_user && current_user.is_teacher ) || current_user && current_user.admin) {((is_current && current_user && current_user.is_teacher ) || current_user && current_user.admin)
&& <li className={`${moduleName == 'videos' ? 'active' : '' }`}> && <li className={`${moduleName == 'videos' ? 'active' : '' }`}>
<Link <Link

Loading…
Cancel
Save