Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_oauth
hjm 6 years ago
commit e41dbea3e0

@ -906,15 +906,17 @@ class CoursesController < ApplicationController
# 邀请码验证
return normal_status(-1, "邀请码不能为空") if params[:invite_code].blank?
invite_code = params[:invite_code]
course = Course.find_by(invite_code: invite_code, is_delete: 0, invite_code_halt: 0, is_end: 0)
course = Course.find_by(invite_code: invite_code, is_delete: 0, invite_code_halt: 0)
course_group = CourseGroup.find_by(invite_code: invite_code)
if course.blank?
return normal_status(-1, "邀请码无效") if course_group.blank?
course = Course.find_by(id: course_group.course_id, is_delete: 0, invite_code_halt: 0, is_end: 0)
course = Course.find_by(id: course_group.course_id, is_delete: 0, invite_code_halt: 0)
return normal_status(-1, "邀请码无效") if course.blank?
end
return normal_status(-1, "课堂已结束,无法加入") if course.is_end
# 实名认证和职业认证的身份判断
return normal_status(-1, "该课堂要求成员完成实名和职业认证") if course.authentication &&
course.professional_certification && (!current_user.authentication || !current_user.professional_certification)

@ -85,6 +85,16 @@ class SubjectsController < ApplicationController
# 合作团队
@shixuns = @subject.shixuns.published.pluck(:id)
@courses = @subject.courses if @subject.excellent
@members = @subject.subject_members.includes(:user)
shixuns = @subject.shixuns.published.pluck(:id)
challenge_ids = Challenge.where(shixun_id: shixuns).pluck(:id)
# 实训路径中的所有实训标签
@tags = ChallengeTag.where(challenge_id: challenge_ids).pluck(:name).uniq
# 用户获取的实训标签
# @user_tags = @subject.shixuns.map(&:user_tags_name).flatten.uniq
@user_tags = user_shixun_tags challenge_ids, @user.id
@my_subject_progress = @subject.my_subject_progress
# 访问数变更
@subject.increment!(:visits)
end
@ -149,7 +159,7 @@ class SubjectsController < ApplicationController
end
def choose_subject_shixun
@search = params[:search]
@search = params[:search].strip if params[:search]
@type = params[:type]
# 超级管理员用户显示所有未隐藏的实训、非管理员显示合作团队用户的实训(对本单位公开且未隐藏)
if current_user.admin?
@ -163,8 +173,9 @@ class SubjectsController < ApplicationController
tag_ids = @shixuns.joins(:shixun_tag_repertoires).pluck(:tag_repertoire_id).uniq
@tags = TagRepertoire.select([:id, :name]).where(id: tag_ids)
if params[:search]
@shixuns = @shixuns.where("name like ?", "%#{@search}%")
unless params[:search].blank?
@shixuns = @shixuns.joins(:user).where("shixuns.name like ? or concat(users.lastname, users.firstname) like ?",
"%#{@search}%", "%#{@search}%").distinct
end
unless @type.nil? || @type == "" || @type == "all"

@ -23,4 +23,26 @@ if @subject.excellent
json.course_identity @user.course_identity(course)
json.course_status subject_course_status course
end
end
json.members @members do |member|
json.partial! 'subject_member', locals: { user: member.user }
json.role member.role
end
# 技能标签
json.tags @tags do |tag|
unless tag.blank?
json.tag_name tag
json.status @user_tags.include?(tag)
end
end
# 我的进展
json.progress do
json.my_score @subject.my_subject_score
json.all_score @subject.all_score
json.learned @subject.my_subject_progress
json.time @subject.my_consume_time
end

@ -19,6 +19,7 @@ import Trialapplicationysl from './modules/login/Trialapplicationysl';
import Trialapplicationreview from './modules/user/Trialapplicationreview';
import Addcourses from "./modules/courses/coursesPublic/Addcourses";
import AccountProfile from "./modules/user/AccountProfile";
import Certifiedprofessional from "./modules/modals/Certifiedprofessional"
import Trialapplication from './modules/login/Trialapplication'
import NotFoundPage from './NotFoundPage'
@ -305,7 +306,7 @@ class App extends Component {
<Trialapplicationreview {...this.props} {...this.state}></Trialapplicationreview>
<Addcourses {...this.props} {...this.state}/>
<AccountProfile {...this.props} {...this.state}/>
{/*<Certifiedprofessional {...this.props} {...this.state}/>*/}
<Router>
<Switch>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

@ -214,6 +214,10 @@ class Addcourses extends Component{
}
).then((response) => {
if(response === undefined){
this.setState({
// Addcoursestype:false,
isSpin:false
});
return
}
if(response.data.status===0){
@ -269,14 +273,16 @@ class Addcourses extends Component{
// })
}
this.setState({
this.setState({
Addcoursestype:false,
isSpin:false
})
});
}).catch((error) => {
console.log(error)
this.setState({
Addcoursestype:false,
isSpin:false
})
});
})
// if(value===0){

@ -2033,7 +2033,7 @@ class Studentshavecompletedthelist extends Component {
page:1,
})
}
this.Searchdatasys(this.state.order, this.state.commit_status, null, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit);
this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, null, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit);
}
// notlimiteds = () => {
// this.setState({
@ -2160,7 +2160,7 @@ class Studentshavecompletedthelist extends Component {
})
}
this.Searchdatasys(this.state.order, this.state.commit_status, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit);
this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit);
} else if (checkedValues.length === data.length) {
if (this.state.loadingstate === false) {
this.setState({
@ -2177,7 +2177,7 @@ class Studentshavecompletedthelist extends Component {
})
}
this.Searchdatasys(this.state.order, this.state.commit_status, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit);
this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit);
} else {
// console.log(checkedValues);
if (this.state.loadingstate === false) {
@ -2195,7 +2195,7 @@ class Studentshavecompletedthelist extends Component {
})
}
this.Searchdatasys(this.state.order, this.state.commit_status, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit);
this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, checkedValues, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit);
}
}
@ -2218,7 +2218,7 @@ class Studentshavecompletedthelist extends Component {
})
}
this.Searchdatasys(this.state.order, this.state.commit_status, this.state.review, undefined, this.state.searchtext, 1, this.state.limit)
this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, undefined, this.state.searchtext, 1, this.state.limit)
}
funtaskstatustwo = (checkedValues, data) => {
@ -2240,7 +2240,7 @@ class Studentshavecompletedthelist extends Component {
})
}
this.Searchdatasys(this.state.order, this.state.commit_status, this.state.review, checkedValues, this.state.searchtext, 1, this.state.limit)
this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, checkedValues, this.state.searchtext, 1, this.state.limit)
} else if (checkedValues.length === data.length) {
if (this.state.loadingstate === false) {
this.setState({
@ -2257,7 +2257,7 @@ class Studentshavecompletedthelist extends Component {
})
}
this.Searchdatasys(this.state.order, this.state.commit_status, this.state.review, checkedValues, this.state.searchtext, 1, this.state.limit)
this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, checkedValues, this.state.searchtext, 1, this.state.limit)
} else {
// console.log(checkedValues);
if (this.state.loadingstate === false) {
@ -2278,7 +2278,7 @@ class Studentshavecompletedthelist extends Component {
}
this.Searchdatasys(this.state.order, this.state.commit_status, this.state.review, checkedValues, this.state.searchtext, 1, this.state.limit)
this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, checkedValues, this.state.searchtext, 1, this.state.limit)
this.props.setcourse_groupysls(checkedValues)
}
@ -2299,7 +2299,7 @@ class Studentshavecompletedthelist extends Component {
})
}
this.Searchdatasys(this.state.order, this.state.commit_status, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit);
this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, 1, this.state.limit);
}
};
//搜索学生按钮输入 老师
@ -2316,7 +2316,7 @@ class Studentshavecompletedthelist extends Component {
})
}
this.Searchdatasys(this.state.order, this.state.commit_status, this.state.review, this.state.checkedValuesineinfo, value, 1, this.state.limit);
this.Searchdatasys(this.state.order, this.state.course_groupyslstwo, this.state.review, this.state.checkedValuesineinfo, value, 1, this.state.limit);
// this.Startsorting(this.state.order,this.state.checkedValuesine,this.state.checkedValuesineinfo,value);
// console.log(value)
@ -2353,6 +2353,8 @@ class Studentshavecompletedthelist extends Component {
//排序
funordersy = (e) => {
console.log(this.state.course_groupyslstwo);
debugger
if (e === "end_at") {
// 时间
// 时间排序是从小到大
@ -2367,7 +2369,7 @@ class Studentshavecompletedthelist extends Component {
})
}
this.Searchdatasys(e, this.state.commit_status, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page,this.state.limit)
this.Searchdatasys(e, this.state.course_groupyslstwo, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page,this.state.limit)
}
if (e === "score") {
@ -2385,7 +2387,7 @@ class Studentshavecompletedthelist extends Component {
}
this.Searchdatasys(e, this.state.commit_status, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, null, null)
this.Searchdatasys(e, this.state.course_groupyslstwo, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, null, null)
}
if (e === "student_id") {
@ -2402,7 +2404,7 @@ class Studentshavecompletedthelist extends Component {
})
}
this.Searchdatasys(e, this.state.commit_status, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, null, null)
this.Searchdatasys(e, this.state.course_groupyslstwo, this.state.review, this.state.checkedValuesineinfo, this.state.searchtext, null, null)
}
}
setExerciseReviewAndAnswer = () => {

@ -1,6 +1,9 @@
import React, { Component } from 'react';
import { Modal} from 'antd';
import axios from 'axios';
import shimingrenzheng from '../../../src/images/cert/shimingrenzheng.png';
import zhiyerenzheng from '../../../src/images/cert/zhiyerenzheng.png';
import './certfed.css';
//认证职业
class Certifiedprofessional extends Component {
@ -21,23 +24,23 @@ class Certifiedprofessional extends Component {
axios.interceptors.response.use((response) => {
if (response != undefined)
if (response && response.data.status === -1) {
if(response.data.message==="该课堂要求成员完成实名认证"){
this.setState({
mydisplay:true,
occupation:1,
})
if(response.data.message==="该课堂要求成员完成实名认证"){
this.setState({
mydisplay:true,
occupation:1,
})
}else if(response.data.message==="该课堂要求成员完成职业认证"){
this.setState({
mydisplay:true,
occupation:2,
})
}else if(response.data.message==="该课堂要求成员完成实名和职业认证"){
this.setState({
mydisplay:true,
occupation:3,
})
}
}else if(response.data.message==="该课堂要求成员完成职业认证"){
this.setState({
mydisplay:true,
occupation:2,
})
}else if(response.data.message==="该课堂要求成员完成实名和职业认证"){
this.setState({
mydisplay:true,
occupation:3,
})
}
}
return response;
}, (error) => {
@ -52,7 +55,7 @@ class Certifiedprofessional extends Component {
};
setDownload=()=>{
window.location.href="/account/certification"
}
@ -60,7 +63,8 @@ class Certifiedprofessional extends Component {
render() {
// console.log("加入金品课堂2");
// console.log(this.props);
return(
let{occupation} =this.state;
return(
<Modal
keyboard={false}
closable={false}
@ -70,12 +74,51 @@ class Certifiedprofessional extends Component {
centered={true}
visible={this.state.mydisplay}
width="600px"
heigth="307px"
>
<div className="educouddiv">
<div className={"tabeltext-alignleft"}><p style={{fontSize: "16px",marginTop:"46px"}}>请在完成条件后重试</p></div>
<div className="clearfix edu-txt-center" style={{marginTop:"98px"}}>
<a className="task-btn mr30" onClick={()=>this.modalCancel()}>取消</a>
<a className="task-btn task-btn-orange" onClick={()=>this.setDownload()}>确认</a>
<div className={"tabeltext-alignleft fontsizecoirlysl"}><p style={{fontSize: "16px"}}>请在完成条件后重试</p></div>
{
occupation=== 3?
<div className="yslcentercerlfed edu-txt-center mt30" >
<div className="mr55 imgysldivone">
<img className="yslimgwidthte"
src={shimingrenzheng}
/>
<span className="fontsizecoirlysltwo mt15">未实名认证</span>
</div>
<div className="imgysldivone">
<img className="yslimgwidthte"
src={zhiyerenzheng}
/>
<span className="fontsizecoirlysltwo mt15">未职业认证</span>
</div>
</div>
:occupation=== 2?
<div className="yslcentercerlfed edu-txt-center mt30" >
<div className="imgysldivone">
<img className="yslimgwidthte"
src={zhiyerenzheng}
/>
<span className="fontsizecoirlysltwo mt15">未职业认证</span>
</div>
</div>
:
<div className="yslcentercerlfed edu-txt-center mt30" >
<div className=" imgysldivone">
<img className="yslimgwidthte"
src={shimingrenzheng}
/>
<span className="fontsizecoirlysltwo mt15">未实名认证</span>
</div>
</div>
}
<div className="clearfix edu-txt-center mt28">
<a className="task-btn mr60 w90" onClick={()=>this.modalCancel()}>取消</a>
<a className="task-btn task-btn-orange w90" onClick={()=>this.setDownload()}>立即认证</a>
</div>
</div>
</Modal>

@ -0,0 +1,44 @@
.yslcenter
{
display: flex;
justify-content:center;
display: flex;
flex-direction:column;
}
.yslcentercerlfed
{ display: flex;
justify-content:center;
display: flex;
flex-direction:row;
}
.fontsizecoirlysl{
color: #333333;
font-size: 16px;
}
.fontsizecoirlysltwo{
font-size: 14px;
color: #979797;
}
.imgysldivone{
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.yslimgwidthte{
width: 40px;
height: 37px;
}
.mr55{
margin-right: 55px;
}
.mt28{
margin-top: 28px;
}
.w90{
width: 90px;
}
.mr60{
margin-right: 60px;
}

@ -449,7 +449,7 @@ class DetailCardsEditAndAdd extends Component{
<Spin spinning={hometypepvisible} size="large" style={{marginTop:'15%'}}>
<div className="newupload_conbox">
<div className="clearfix mb20 shixun_work_div newshixun_tab_div cdefault" style={{"marginRight":"4px"}} id="shixun_tab_div">
<li className="fl mr5 mt5"> <a onClick={()=>this.changeTag(0,`${search}`)} className={ type===0 ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>全部</a></li>
<li className="fl mr5 mt5"> <a onClick={()=>this.changeTag(0,`${search}`)} className={ parseInt(type)===0 ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>全部</a></li>
{
ChooseShixunList && ChooseShixunList.tags.map((item,key)=>{
return(

@ -81,6 +81,7 @@ class DetailCardsEditAndEdit extends Component{
//打开选择实训弹框初始化tag标签和列表
changeTag(id,search){
this.setState({
ChooseShixunListshixun_list:[],
page:1,
@ -481,7 +482,7 @@ class DetailCardsEditAndEdit extends Component{
<Spin spinning={hometypepvisible} size="large" style={{marginTop:'15%'}}>
<div className="newupload_conbox">
<div className="clearfix mb20 shixun_work_div newshixun_tab_div cdefault" style={{"marginRight":"4px"}} id="shixun_tab_div">
<li className="fl mr5 mt5"> <a onClick={()=>this.changeTag(0,`${search}`)} className={ type===0 ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>全部</a></li>
<li className="fl mr5 mt5"> <a onClick={()=>this.changeTag(0,`${search}`)} className={ parseInt(type)===0 ? "active edu-filter-cir-grey font-12":"edu-filter-cir-grey font-12"}>全部</a></li>
{
ChooseShixunList && ChooseShixunList.tags.map((item,key)=>{
return(

Loading…
Cancel
Save