Merge branches 'dev_aliyun', 'yslcompetition' and 'ysm1' of https://bdgit.educoder.net/Hjqreturn/educoder into ysm1

dev_sync_trustie
杨树明 5 years ago
commit 1a40972f80

@ -11,6 +11,7 @@
//= require select2
//= require jquery.cxselect
//= require bootstrap-datepicker
//= require bootstrap-datetimepicker
//= require bootstrap.viewer
//= require jquery.mloading
//= require jquery-confirm.min

@ -1,24 +0,0 @@
class Weapps::RegisterCodesController < Weapps::BaseController
before_action :require_wechat_login!
def create
login = params[:login].to_s.strip
if login =~ /^[a-zA-Z0-9]+([._\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/
user = User.find_by(mail: login)
return render_error('该邮箱已注册') if user.present?
elsif login =~ /^1\d{10}$/
user = User.find_by(phone: params[:login])
return render_error('该手机号已注册') if user.present?
else
return render_error('请输入正确的邮箱或手机号')
end
code = %W(0 1 2 3 4 5 6 7 8 9)
verification_code = code.sample(6).join
send_type = login =~ /^1\d{10}$/ ? 1 : 8
# 记录验证码
check_verification_code(verification_code, send_type, login)
render_ok
end
end

@ -0,0 +1,51 @@
class Weapps::VerificationCodesController < Weapps::BaseController
before_action :require_wechat_login!
def create
params[:type] == 'register' ? check_can_register : check_can_reset_password
end
private
def check_can_register
login = params[:login].to_s.strip
if login =~ /^[a-zA-Z0-9]+([._\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/
user = User.find_by(mail: login)
return render_error('该邮箱已注册') if user.present?
elsif login =~ /^1\d{10}$/
user = User.find_by(phone: params[:login])
return render_error('该手机号已注册') if user.present?
else
return render_error('请输入正确的邮箱或手机号')
end
code = %W(0 1 2 3 4 5 6 7 8 9)
verification_code = code.sample(6).join
send_type = login =~ /^1\d{10}$/ ? 1 : 8
# 记录验证码
check_verification_code(verification_code, send_type, login)
render_ok
end
def check_can_reset_password
login = params[:login].to_s.strip
if login =~ /^[a-zA-Z0-9]+([._\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/
user = User.find_by(mail: login)
return render_error('该邮箱尚未注册') if user.blank?
elsif login =~ /^1\d{10}$/
user = User.find_by(phone: login)
return render_error('该手机号尚未注册') if user.blank?
else
return render_error('请输入正确的邮箱或手机号')
end
code = %W(0 1 2 3 4 5 6 7 8 9)
verification_code = code.sample(6).join
send_type = login =~ /^1\d{10}$/ ? 2 : 3
# 记录验证码
check_verification_code(verification_code, send_type, login)
render_ok
end
end

@ -5,11 +5,12 @@
<th width="16%">邮件地址</th>
<th width="10%">手机号码</th>
<th width="14%">单位</th>
<th width="8%">角色</th>
<th width="10%"><%= sort_tag('创建于', name: 'created_on', path: admins_users_path) %></th>
<th width="10%"><%= sort_tag('最后登录', name: 'last_login_on', path: admins_users_path) %></th>
<th width="6%"><%= sort_tag('经验值', name: 'experience', path: admins_users_path) %></th>
<th width="6%"><%= sort_tag('金币', name: 'grade', path: admins_users_path) %></th>
<th width="20%">操作</th>
<th width="12%">操作</th>
</tr>
</thead>
<tbody>
@ -24,6 +25,7 @@
<td><%= overflow_hidden_span display_text(user.mail), width: 150 %></td>
<td><%= overflow_hidden_span display_text(user.phone), width: 100 %></td>
<td><%= overflow_hidden_span display_text(user.school_name), width: 150 %></td>
<td><%= user.identity %></td>
<td><%= display_text(user.created_on&.strftime('%Y-%m-%d %H:%M')) %></td>
<td><%= display_text(user.last_login_on&.strftime('%Y-%m-%d %H:%M')) %></td>
<td><%= user.experience.to_i %></td>

@ -852,7 +852,7 @@ Rails.application.routes.draw do
resource :home, only: [:show]
resource :session, only: [:create]
resource :register, only: [:create]
resource :register_code, only: [:create]
resource :verification_code, only: [:create]
resource :code_session, only: [:create]
resource :verify, only: [:create]
resource :check_account, only: [:create]

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -25131,118 +25131,145 @@ input.form-control {
flex: 1;
}
/* line 32, app/assets/stylesheets/common.scss */
.fl {
float: left;
}
/* line 33, app/assets/stylesheets/common.scss */
.no_padding {
padding: 0px !important;
}
/* line 34, app/assets/stylesheets/common.scss */
.font-12 {
font-size: 12px !important;
}
/* line 34, app/assets/stylesheets/common.scss */
/* line 35, app/assets/stylesheets/common.scss */
.font-14 {
font-size: 14px !important;
}
/* line 35, app/assets/stylesheets/common.scss */
/* line 36, app/assets/stylesheets/common.scss */
.font-16 {
font-size: 16px !important;
}
/* line 36, app/assets/stylesheets/common.scss */
/* line 37, app/assets/stylesheets/common.scss */
.font-18 {
font-size: 18px !important;
}
/* line 37, app/assets/stylesheets/common.scss */
/* line 38, app/assets/stylesheets/common.scss */
.font-20 {
font-size: 20px !important;
}
/* line 38, app/assets/stylesheets/common.scss */
/* line 39, app/assets/stylesheets/common.scss */
.font-24 {
font-size: 24px !important;
}
/* line 39, app/assets/stylesheets/common.scss */
/* line 40, app/assets/stylesheets/common.scss */
.padding10-5 {
padding: 10px 5px;
}
/* line 40, app/assets/stylesheets/common.scss */
/* line 41, app/assets/stylesheets/common.scss */
.width100 {
width: 100%;
}
/* line 41, app/assets/stylesheets/common.scss */
/* line 42, app/assets/stylesheets/common.scss */
.mb10 {
margin-bottom: 10px;
}
/* line 42, app/assets/stylesheets/common.scss */
/* line 43, app/assets/stylesheets/common.scss */
.mt10 {
margin-top: 10px;
}
/* line 43, app/assets/stylesheets/common.scss */
/* line 44, app/assets/stylesheets/common.scss */
.mr10 {
margin-right: 10px;
}
/* line 44, app/assets/stylesheets/common.scss */
/* line 45, app/assets/stylesheets/common.scss */
.ml10 {
margin-left: 10px;
}
/* line 44, app/assets/stylesheets/common.scss */
/* line 45, app/assets/stylesheets/common.scss */
.ml20 {
margin-left: 20px;
}
/* line 45, app/assets/stylesheets/common.scss */
/* line 46, app/assets/stylesheets/common.scss */
.textarea-width-100 {
width: 100%;
resize: none;
border: 1px solid #ccc;
}
/* line 46, app/assets/stylesheets/common.scss */
/* line 47, app/assets/stylesheets/common.scss */
.padding10 {
padding: 10px;
}
/* line 47, app/assets/stylesheets/common.scss */
/* line 48, app/assets/stylesheets/common.scss */
.padding5-10 {
padding: 5px 10px;
}
/* line 48, app/assets/stylesheets/common.scss */
/* line 49, app/assets/stylesheets/common.scss */
.position-r {
position: relative;
}
/* line 49, app/assets/stylesheets/common.scss */
/* line 50, app/assets/stylesheets/common.scss */
.color-grey-c {
color: #ccc;
}
/* line 50, app/assets/stylesheets/common.scss */
/* line 51, app/assets/stylesheets/common.scss */
.color-blue {
color: #4CACFF;
}
/* line 51, app/assets/stylesheets/common.scss */
/* line 52, app/assets/stylesheets/common.scss */
.color-orange {
color: #ff6800;
}
/* line 53, app/assets/stylesheets/common.scss */
.inline-block {
display: inline-block;
}
/* line 52, app/assets/stylesheets/common.scss */
/* line 54, app/assets/stylesheets/common.scss */
.hide {
display: none;
}
/* line 53, app/assets/stylesheets/common.scss */
/* line 55, app/assets/stylesheets/common.scss */
.show {
display: block;
}
/* line 57, app/assets/stylesheets/common.scss */
.input_small {
-webkit-box-flex: 0 !important;
flex: 0 0 6% !important;
}
/* line 58, app/assets/stylesheets/common.scss */
.input_middle {
-webkit-box-flex: 0 !important;
flex: 0 0 13% !important;
}
/* line 2, app/assets/stylesheets/admins/auth_schools.scss */
.admins-auth-schools-index-page .list-item-title {
padding-bottom: 5px;
@ -25590,7 +25617,68 @@ input.form-control {
/* line 38, app/assets/stylesheets/admins/competition_settings.scss */
.admins-competition-settings-index-page .setBtn_s {
height: 35px;
line-height: 5px;
line-height: 20px;
}
/* line 43, app/assets/stylesheets/admins/competition_settings.scss */
.admins-competition-settings-index-page .sponsor_label {
border: 1px solid #4CACFF;
border-radius: 5px;
background-color: rgba(76, 172, 255, 0.3);
color: #333;
padding: 0px 4px;
height: 30px;
line-height: 30px;
float: left;
margin: 4px 5px;
}
/* line 54, app/assets/stylesheets/admins/competition_settings.scss */
.admins-competition-settings-index-page .sponsor_label span {
display: block;
float: left;
height: 28px;
line-height: 28px;
margin-right: 5px;
}
/* line 62, app/assets/stylesheets/admins/competition_settings.scss */
.admins-competition-settings-index-page .sponsor_label a {
font-size: 18px;
float: left;
height: 28px;
line-height: 28px;
}
/* line 70, app/assets/stylesheets/admins/competition_settings.scss */
.admins-competition-settings-index-page .large_panel {
padding: 0px 15px;
}
/* line 73, app/assets/stylesheets/admins/competition_settings.scss */
.admins-competition-settings-index-page .large_panel .large_panel_part {
border-top: 1px solid #eaeaea;
}
/* line 76, app/assets/stylesheets/admins/competition_settings.scss */
.admins-competition-settings-index-page .large_panel .large_panel_part:first-child {
border: none;
}
/* line 80, app/assets/stylesheets/admins/competition_settings.scss */
.admins-competition-settings-index-page .large_panel .large_panel_part > .row, .admins-competition-settings-index-page .large_panel .small_panel > .row {
border-bottom: 1px solid #eaeaea;
padding: 20px 0px;
}
/* line 84, app/assets/stylesheets/admins/competition_settings.scss */
.admins-competition-settings-index-page .large_panel .small_panel {
margin-left: 20px;
}
/* line 87, app/assets/stylesheets/admins/competition_settings.scss */
.admins-competition-settings-index-page .large_panel .row:last-child {
border: none;
}
/* line 4, app/assets/stylesheets/admins/cooperatives.scss */

@ -136155,6 +136155,19 @@ $(document).on('turbolinks:load', function(){
}
});
//添加主办方或者开放范围
function addSponsor(item){
var html='<div class="sponsor_label">\n' +
' <input type="hidden" value="school_id" />\n' +
' <span>caicai</span>\n' +
' <a href="javascript:void(0)" onclick="del_sponsor(this)">×</a>\n' +
' </div>';
$(item).parents(".sponsorPanel").append(html);
}
//删除
function del_sponsor(item){
$(item).parents(".sponsor_label").remove();
}
$(function () {
//MD编辑
@ -136297,7 +136310,8 @@ $(function () {
}
})
})
});
//新增子阶段
function add_task_sub(item){
var index = $(item).parents(".large_panel_part").attr("attr_line");
@ -136403,7 +136417,7 @@ function Del_tab(item) {
$(item).parents(".large_panel_part").remove();
}
//新增tab
function addNewTab() {
function addNewTab() {
var count = parseInt($("#large_panel").find(".large_panel_part").length)+1;
var html = '<div class="large_panel_part" attr_line="'+count+'"><div class="row d-flex mt-3">\n' +
' <span class="col-1 mt-2">tab标题</span>\n' +

@ -15767,118 +15767,145 @@ input.form-control {
flex: 1;
}
/* line 32, app/assets/stylesheets/common.scss */
.fl {
float: left;
}
/* line 33, app/assets/stylesheets/common.scss */
.no_padding {
padding: 0px !important;
}
/* line 34, app/assets/stylesheets/common.scss */
.font-12 {
font-size: 12px !important;
}
/* line 34, app/assets/stylesheets/common.scss */
/* line 35, app/assets/stylesheets/common.scss */
.font-14 {
font-size: 14px !important;
}
/* line 35, app/assets/stylesheets/common.scss */
/* line 36, app/assets/stylesheets/common.scss */
.font-16 {
font-size: 16px !important;
}
/* line 36, app/assets/stylesheets/common.scss */
/* line 37, app/assets/stylesheets/common.scss */
.font-18 {
font-size: 18px !important;
}
/* line 37, app/assets/stylesheets/common.scss */
/* line 38, app/assets/stylesheets/common.scss */
.font-20 {
font-size: 20px !important;
}
/* line 38, app/assets/stylesheets/common.scss */
/* line 39, app/assets/stylesheets/common.scss */
.font-24 {
font-size: 24px !important;
}
/* line 39, app/assets/stylesheets/common.scss */
/* line 40, app/assets/stylesheets/common.scss */
.padding10-5 {
padding: 10px 5px;
}
/* line 40, app/assets/stylesheets/common.scss */
/* line 41, app/assets/stylesheets/common.scss */
.width100 {
width: 100%;
}
/* line 41, app/assets/stylesheets/common.scss */
/* line 42, app/assets/stylesheets/common.scss */
.mb10 {
margin-bottom: 10px;
}
/* line 42, app/assets/stylesheets/common.scss */
/* line 43, app/assets/stylesheets/common.scss */
.mt10 {
margin-top: 10px;
}
/* line 43, app/assets/stylesheets/common.scss */
/* line 44, app/assets/stylesheets/common.scss */
.mr10 {
margin-right: 10px;
}
/* line 44, app/assets/stylesheets/common.scss */
/* line 45, app/assets/stylesheets/common.scss */
.ml10 {
margin-left: 10px;
}
/* line 44, app/assets/stylesheets/common.scss */
/* line 45, app/assets/stylesheets/common.scss */
.ml20 {
margin-left: 20px;
}
/* line 45, app/assets/stylesheets/common.scss */
/* line 46, app/assets/stylesheets/common.scss */
.textarea-width-100 {
width: 100%;
resize: none;
border: 1px solid #ccc;
}
/* line 46, app/assets/stylesheets/common.scss */
/* line 47, app/assets/stylesheets/common.scss */
.padding10 {
padding: 10px;
}
/* line 47, app/assets/stylesheets/common.scss */
/* line 48, app/assets/stylesheets/common.scss */
.padding5-10 {
padding: 5px 10px;
}
/* line 48, app/assets/stylesheets/common.scss */
/* line 49, app/assets/stylesheets/common.scss */
.position-r {
position: relative;
}
/* line 49, app/assets/stylesheets/common.scss */
/* line 50, app/assets/stylesheets/common.scss */
.color-grey-c {
color: #ccc;
}
/* line 50, app/assets/stylesheets/common.scss */
/* line 51, app/assets/stylesheets/common.scss */
.color-blue {
color: #4CACFF;
}
/* line 51, app/assets/stylesheets/common.scss */
/* line 52, app/assets/stylesheets/common.scss */
.color-orange {
color: #ff6800;
}
/* line 53, app/assets/stylesheets/common.scss */
.inline-block {
display: inline-block;
}
/* line 52, app/assets/stylesheets/common.scss */
/* line 54, app/assets/stylesheets/common.scss */
.hide {
display: none;
}
/* line 53, app/assets/stylesheets/common.scss */
/* line 55, app/assets/stylesheets/common.scss */
.show {
display: block;
}
/* line 57, app/assets/stylesheets/common.scss */
.input_small {
-webkit-box-flex: 0 !important;
flex: 0 0 6% !important;
}
/* line 58, app/assets/stylesheets/common.scss */
.input_middle {
-webkit-box-flex: 0 !important;
flex: 0 0 13% !important;
}
/* line 3, app/assets/stylesheets/colleges/statistic.scss */
.colleges-statistics-page .college-body-container .statistic-header {
width: 100%;

@ -24775,118 +24775,145 @@ input.form-control {
flex: 1;
}
/* line 32, app/assets/stylesheets/common.scss */
.fl {
float: left;
}
/* line 33, app/assets/stylesheets/common.scss */
.no_padding {
padding: 0px !important;
}
/* line 34, app/assets/stylesheets/common.scss */
.font-12 {
font-size: 12px !important;
}
/* line 34, app/assets/stylesheets/common.scss */
/* line 35, app/assets/stylesheets/common.scss */
.font-14 {
font-size: 14px !important;
}
/* line 35, app/assets/stylesheets/common.scss */
/* line 36, app/assets/stylesheets/common.scss */
.font-16 {
font-size: 16px !important;
}
/* line 36, app/assets/stylesheets/common.scss */
/* line 37, app/assets/stylesheets/common.scss */
.font-18 {
font-size: 18px !important;
}
/* line 37, app/assets/stylesheets/common.scss */
/* line 38, app/assets/stylesheets/common.scss */
.font-20 {
font-size: 20px !important;
}
/* line 38, app/assets/stylesheets/common.scss */
/* line 39, app/assets/stylesheets/common.scss */
.font-24 {
font-size: 24px !important;
}
/* line 39, app/assets/stylesheets/common.scss */
/* line 40, app/assets/stylesheets/common.scss */
.padding10-5 {
padding: 10px 5px;
}
/* line 40, app/assets/stylesheets/common.scss */
/* line 41, app/assets/stylesheets/common.scss */
.width100 {
width: 100%;
}
/* line 41, app/assets/stylesheets/common.scss */
/* line 42, app/assets/stylesheets/common.scss */
.mb10 {
margin-bottom: 10px;
}
/* line 42, app/assets/stylesheets/common.scss */
/* line 43, app/assets/stylesheets/common.scss */
.mt10 {
margin-top: 10px;
}
/* line 43, app/assets/stylesheets/common.scss */
/* line 44, app/assets/stylesheets/common.scss */
.mr10 {
margin-right: 10px;
}
/* line 44, app/assets/stylesheets/common.scss */
/* line 45, app/assets/stylesheets/common.scss */
.ml10 {
margin-left: 10px;
}
/* line 44, app/assets/stylesheets/common.scss */
/* line 45, app/assets/stylesheets/common.scss */
.ml20 {
margin-left: 20px;
}
/* line 45, app/assets/stylesheets/common.scss */
/* line 46, app/assets/stylesheets/common.scss */
.textarea-width-100 {
width: 100%;
resize: none;
border: 1px solid #ccc;
}
/* line 46, app/assets/stylesheets/common.scss */
/* line 47, app/assets/stylesheets/common.scss */
.padding10 {
padding: 10px;
}
/* line 47, app/assets/stylesheets/common.scss */
/* line 48, app/assets/stylesheets/common.scss */
.padding5-10 {
padding: 5px 10px;
}
/* line 48, app/assets/stylesheets/common.scss */
/* line 49, app/assets/stylesheets/common.scss */
.position-r {
position: relative;
}
/* line 49, app/assets/stylesheets/common.scss */
/* line 50, app/assets/stylesheets/common.scss */
.color-grey-c {
color: #ccc;
}
/* line 50, app/assets/stylesheets/common.scss */
/* line 51, app/assets/stylesheets/common.scss */
.color-blue {
color: #4CACFF;
}
/* line 51, app/assets/stylesheets/common.scss */
/* line 52, app/assets/stylesheets/common.scss */
.color-orange {
color: #ff6800;
}
/* line 53, app/assets/stylesheets/common.scss */
.inline-block {
display: inline-block;
}
/* line 52, app/assets/stylesheets/common.scss */
/* line 54, app/assets/stylesheets/common.scss */
.hide {
display: none;
}
/* line 53, app/assets/stylesheets/common.scss */
/* line 55, app/assets/stylesheets/common.scss */
.show {
display: block;
}
/* line 57, app/assets/stylesheets/common.scss */
.input_small {
-webkit-box-flex: 0 !important;
flex: 0 0 6% !important;
}
/* line 58, app/assets/stylesheets/common.scss */
.input_middle {
-webkit-box-flex: 0 !important;
flex: 0 0 13% !important;
}
/* line 4, app/assets/stylesheets/cooperative/carousels.scss */
.cooperative-carousels-index-page .carousels-card .custom-carousel-item > .drag {
cursor: move;

@ -66,6 +66,7 @@ class Registration extends React.Component {
competition_name: undefined,
mutiple_limited: false,
teamutiple_limited: false,
members_count: 0,
}
}
@ -145,19 +146,22 @@ class Registration extends React.Component {
}
if (result.data.enroll_ended === true) {
this.setState({
pint: 0
})
} else if (result.data.enrolled === true) {
this.setState({
pint: 2
})
} else if (result.data.enrolled === false) {
this.setState({
pint: 1
})
if (result.data.personal === true) {
if (result.data.enroll_ended === true) {
this.setState({
pint: 0
})
} else if (result.data.enrolled === true) {
this.setState({
pint: 2
})
} else if (result.data.enrolled === false) {
this.setState({
pint: 1
})
}
}
}
}
}).catch((error) => {
@ -192,7 +196,8 @@ class Registration extends React.Component {
data: result.data.my_teams,
competition_teams: result.data.competition_teams,
personal: result.data.personal,
competition_name: result.data.competition_name
competition_name: result.data.competition_name,
members_count: result.data.members_count
})
} else {
//普通账号
@ -202,7 +207,8 @@ class Registration extends React.Component {
data: result.data.my_teams,
competition_teams: result.data.competition_teams,
personal: result.data.personal,
competition_name: result.data.competition_name
competition_name: result.data.competition_name,
members_count: result.data.members_count
})
}
} else {
@ -216,7 +222,9 @@ class Registration extends React.Component {
count: result.data.count,
competition_teams: result.data.competition_teams,
personal: result.data.personal,
competition_name: result.data.competition_name
competition_name: result.data.competition_name,
members_count: result.data.members_count
})
} else {
@ -226,7 +234,9 @@ class Registration extends React.Component {
count: result.data.count,
competition_teams: result.data.competition_teams,
personal: result.data.personal,
competition_name: result.data.competition_name
competition_name: result.data.competition_name,
members_count: result.data.members_count
})
}
@ -238,7 +248,9 @@ class Registration extends React.Component {
data: result.data.my_teams,
count: result.data.count,
personal: result.data.personal,
competition_name: result.data.competition_name
competition_name: result.data.competition_name,
members_count: result.data.members_count
})
} else {
@ -248,7 +260,9 @@ class Registration extends React.Component {
data: result.data.my_teams,
count: result.data.count,
personal: result.data.personal,
competition_name: result.data.competition_name
competition_name: result.data.competition_name,
members_count: result.data.members_count
})
}
@ -262,7 +276,9 @@ class Registration extends React.Component {
count: result.data.count,
competition_teams: result.data.competition_teams,
personal: result.data.personal,
competition_name: result.data.competition_name
competition_name: result.data.competition_name,
members_count: result.data.members_count
})
@ -296,112 +312,120 @@ class Registration extends React.Component {
}
Getdatatype5 = (keyword, page, per_page, admin) => {
//搜索关键字 keyword
//页数 page
//分页 per_page
const datas = {
keyword: keyword,
page: page,
per_page: per_page,
};
let url = `/competitions/${this.props.match.params.identifier}/competition_teams.json`;
axios.get((url), {params: datas}).then((result) => {
this.setState({
loadingstate: false,
})
if (result) {
if (result.data) {
//// //////console.log(result);
if (result.data.personal === false) {
//不是个人赛
////console.log("Getdatatype5");
////console.log(result.data.my_teams.length);
if (result.data.my_teams.length === 0) {
// 没有创建数据的
//管理员
////console.log("a");
////console.log(this.state.competition_teams);
////console.log(result.data.competition_teams);
this.setState({
type: 4,
count: result.data.count,
competition_teams: result.data.competition_teams,
data: result.data.my_teams,
personal: result.data.personal,
competition_name: result.data.competition_name
})
} else {
//有数据的
////console.log("b");
if (result.data.my_teams[0].manage_permission === true) {
this.setState({
type: 5,
data: result.data.my_teams,
count: result.data.count,
competition_teams: result.data.competition_teams,
personal: result.data.personal,
competition_name: result.data.competition_name
})
} else {
////console.log("c");
this.setState({
type: 4,
data: result.data.my_teams,
count: result.data.count,
competition_teams: result.data.competition_teams,
personal: result.data.personal,
competition_name: result.data.competition_name
})
}
}
} else {
//团队赛
//////console.log("d");
this.setState({
type: 6,
data: result.data.my_teams,
count: result.data.count,
competition_teams: result.data.competition_teams,
personal: result.data.personal,
competition_name: result.data.competition_name
})
}
}
}
}).catch((error) => {
////console.log("k");
////console.log(error);
////console.log("报错了");
if (admin === true) {
//管理员
this.setState({
count: 0,
competition_teams: [],
data: [],
loadingstate: false,
})
} else {
//普通账号
this.setState({
count: 0,
competition_teams: [],
data: [],
loadingstate: false,
})
}
})
}
// Getdatatype5 = (keyword, page, per_page, admin) => {
// //搜索关键字 keyword
// //页数 page
// //分页 per_page
// const datas = {
// keyword: keyword,
// page: page,
// per_page: per_page,
// };
// let url = `/competitions/${this.props.match.params.identifier}/competition_teams.json`;
// axios.get((url), {params: datas}).then((result) => {
// this.setState({
// loadingstate: false,
// })
// if (result) {
// if (result.data) {
// //// //////console.log(result);
// if (result.data.personal === false) {
// //不是个人赛
// ////console.log("Getdatatype5");
// ////console.log(result.data.my_teams.length);
// if (result.data.my_teams.length === 0) {
// // 没有创建数据的
// //管理员
// ////console.log("a");
// ////console.log(this.state.competition_teams);
// ////console.log(result.data.competition_teams);
// this.setState({
// type: 4,
// count: result.data.count,
// competition_teams: result.data.competition_teams,
// data: result.data.my_teams,
// personal: result.data.personal,
// competition_name: result.data.competition_name,
// members_count:result.data.members_count
//
//
// })
// } else {
// //有数据的
// ////console.log("b");
//
// if (result.data.my_teams[0].manage_permission === true) {
// this.setState({
// type: 5,
// data: result.data.my_teams,
// count: result.data.count,
// competition_teams: result.data.competition_teams,
// personal: result.data.personal,
// competition_name: result.data.competition_name,
// members_count:result.data.members_count
//
//
// })
// } else {
// ////console.log("c");
//
// this.setState({
// type: 4,
// data: result.data.my_teams,
// count: result.data.count,
// competition_teams: result.data.competition_teams,
// personal: result.data.personal,
// competition_name: result.data.competition_name,
// members_count:result.data.members_count
//
//
// })
// }
// }
// } else {
// //团队赛
// //////console.log("d");
//
// this.setState({
// type: 6,
// data: result.data.my_teams,
// count: result.data.count,
// competition_teams: result.data.competition_teams,
// personal: result.data.personal,
// competition_name: result.data.competition_name,
// members_count:result.data.members_count
//
//
// })
// }
//
// }
// }
//
// }).catch((error) => {
// ////console.log("k");
//
// ////console.log(error);
// ////console.log("报错了");
// if (admin === true) {
// //管理员
// this.setState({
// count: 0,
// competition_teams: [],
// data: [],
// loadingstate: false,
// })
// } else {
// //普通账号
// this.setState({
// count: 0,
// competition_teams: [],
// data: [],
// loadingstate: false,
// })
// }
// })
// }
//团队竞赛翻页
@ -411,7 +435,7 @@ class Registration extends React.Component {
loadingstate: true,
})
const {keyword, per_page} = this.state;
this.Getdatatype5(keyword, pageNumber, per_page, this.props.user.admin);
this.Getdata(keyword, pageNumber, per_page, this.props.user.admin);
};
/**
@ -628,7 +652,7 @@ class Registration extends React.Component {
pages: 1,
limit: 20,
})
this.Getdatatype5(value, 1, 20, this.props.user.admin);
this.Getdata(value, 1, 20, this.props.user.admin);
}
//个人竞赛
@ -659,7 +683,7 @@ class Registration extends React.Component {
render() {
const {page, pages, limit, type, tmodalsType, tmodalsTypes, data, count, competition_teams, Newtit, itemiddata, messagePerbool, messageexitol, GetenrollmentAPI, loadingstate, pint, competition_name, mutiple_limited, teamutiple_limited} = this.state;
const {page, pages, limit, type, tmodalsType, tmodalsTypes, data, count, competition_teams, Newtit, itemiddata, messagePerbool, messageexitol, GetenrollmentAPI, loadingstate, pint, competition_name, mutiple_limited, teamutiple_limited, members_count} = this.state;
return (
<div className="newMain clearfix newMainybot">
@ -734,7 +758,7 @@ class Registration extends React.Component {
<div style={{
marginTop: "22px"
}}>
<p>参赛总人数<span style={{color: "#459BE5"}}>{data === null || data === undefined ? 0 : data.length}</span><span
<p>参赛总人数<span style={{color: "#459BE5"}}>{members_count}</span><span
style={{marginLeft: "5px"}}></span>
</p>
</div>
@ -806,7 +830,7 @@ class Registration extends React.Component {
}
{
type === 4 || type === 5 ?
type === 2 || type === 4 || type === 5 ?
(
count < 20 ? <div style={{
height: "20px",

@ -68,7 +68,7 @@ class PersonModal extends Component {
school_name: this.props.user.user_school,
student_id: null,
identity: this.props.user.user_identity,
type: "导师",
type: this.props.user.is_teacher === true ? "导师" : "队员",
};
data.push(datas);
@ -189,23 +189,23 @@ class PersonModal extends Component {
}
}
try {
if (i === 0) {
this.props.showNotification(`请添加导师`);
return;
}
} catch (e) {
}
try {
if (s === 0) {
this.props.showNotification(`请添加队员`);
return;
}
} catch (e) {
}
// try {
// if (i === 0) {
// this.props.showNotification(`请添加导师`);
// return;
// }
// } catch (e) {
//
// }
//
// try {
// if (s === 0) {
// this.props.showNotification(`请添加队员`);
// return;
// }
// } catch (e) {
//
// }
//确认的时候 去确认老师人数是否符合
@ -325,8 +325,8 @@ class PersonModal extends Component {
// ////console.log("搜索的老师");
const datas = {
keyword: keywordteachers,
team_id: team_idteachers,
teacher_ids: teacher_ids,
team_id: null,
teacher_ids: null,
};
let url = `/competitions/${this.props.match.params.identifier}/teachers.json`;
axios.get((url), {params: datas}).then((result) => {
@ -353,8 +353,8 @@ class PersonModal extends Component {
// ////console.log("搜索的学生");
const datas = {
keyword: keywordstudents,
team_id: team_idstudents,
student_ids: student_ids,
team_id: null,
student_ids: null,
};
let url = `/competitions/${this.props.match.params.identifier}/students.json`;
axios.get((url), {params: datas}).then((result) => {

Loading…
Cancel
Save