Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_Ysl
commit
ca0fa6ed73
@ -0,0 +1,18 @@
|
||||
$(document).on('turbolinks:load', function() {
|
||||
if ($('body.admins-shixun-authorizations-index-page').length > 0) {
|
||||
var $searchFrom = $('.shixun-authorization-list-form');
|
||||
|
||||
$searchFrom.on('click', '.search-form-tab', function(){
|
||||
var $link = $(this);
|
||||
|
||||
$searchFrom.find('input[name="keyword"]').val('');
|
||||
$searchFrom.find('select[name="status"]').val('processed');
|
||||
|
||||
if($link.data('value') === 'processed'){
|
||||
$searchFrom.find('.status-filter').show();
|
||||
} else {
|
||||
$searchFrom.find('.status-filter').hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
@ -0,0 +1,18 @@
|
||||
$(document).on('turbolinks:load', function() {
|
||||
if ($('body.admins-subject-authorizations-index-page').length > 0) {
|
||||
var $searchFrom = $('.subject-authorization-list-form');
|
||||
|
||||
$searchFrom.on('click', '.search-form-tab', function(){
|
||||
var $link = $(this);
|
||||
|
||||
$searchFrom.find('input[name="keyword"]').val('');
|
||||
$searchFrom.find('select[name="status"]').val('processed');
|
||||
|
||||
if($link.data('value') === 'processed'){
|
||||
$searchFrom.find('.status-filter').show();
|
||||
} else {
|
||||
$searchFrom.find('.status-filter').hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,9 @@
|
||||
.admins-shixun-authorizations-index-page {
|
||||
.shixun-authorization-list-container {
|
||||
span {
|
||||
&.apply-status-1 { color: #28a745; }
|
||||
&.apply-status-2 { color: #dc3545; }
|
||||
&.apply-status-3 { color: #6c757d; }
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
.admins-subject-authorizations-index-page {
|
||||
.subject-authorization-list-container {
|
||||
span {
|
||||
&.apply-status-1 { color: #28a745; }
|
||||
&.apply-status-2 { color: #dc3545; }
|
||||
&.apply-status-3 { color: #6c757d; }
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
class Admins::ShixunAuthorizationsController < Admins::BaseController
|
||||
def index
|
||||
params[:status] ||= 'pending'
|
||||
|
||||
applies = ApplyAction.where(container_type: 'ApplyShixun')
|
||||
|
||||
status =
|
||||
case params[:status]
|
||||
when 'pending' then 0
|
||||
when 'processed' then [1, 2]
|
||||
when 'agreed' then 1
|
||||
when 'refused' then 2
|
||||
else 0
|
||||
end
|
||||
applies = applies.where(status: status) if status.present?
|
||||
|
||||
# 关键字模糊查询
|
||||
keyword = params[:keyword].to_s.strip
|
||||
if keyword.present?
|
||||
applies = applies.joins('JOIN shixuns ON shixuns.id = apply_actions.container_id')
|
||||
.where('shixuns.name LIKE :keyword', keyword: "%#{keyword}%")
|
||||
end
|
||||
|
||||
applies = applies.order(updated_at: :desc)
|
||||
|
||||
@applies = paginate applies.includes(user: :user_extension)
|
||||
|
||||
shixun_ids = @applies.map(&:container_id)
|
||||
@shixun_map = Shixun.where(id: shixun_ids).each_with_object({}) { |s, h| h[s.id] = s }
|
||||
end
|
||||
|
||||
def agree
|
||||
Admins::ShixunAuths::AgreeApplyService.call(current_apply, current_user)
|
||||
render_success_js
|
||||
end
|
||||
|
||||
def refuse
|
||||
Admins::ShixunAuths::RefuseApplyService.call(current_apply, current_user, params)
|
||||
|
||||
render_success_js
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def current_apply
|
||||
@_current_apply ||= ApplyAction.where(container_type: 'ApplyShixun').find(params[:id])
|
||||
end
|
||||
end
|
@ -0,0 +1,49 @@
|
||||
class Admins::SubjectAuthorizationsController < Admins::BaseController
|
||||
def index
|
||||
params[:status] ||= 'pending'
|
||||
|
||||
applies = ApplyAction.where(container_type: 'ApplySubject')
|
||||
|
||||
status =
|
||||
case params[:status]
|
||||
when 'pending' then 0
|
||||
when 'processed' then [1, 2]
|
||||
when 'agreed' then 1
|
||||
when 'refused' then 2
|
||||
else 0
|
||||
end
|
||||
applies = applies.where(status: status) if status.present?
|
||||
|
||||
# 关键字模糊查询
|
||||
keyword = params[:keyword].to_s.strip
|
||||
if keyword.present?
|
||||
applies = applies.joins('JOIN subjects ON subjects.id = apply_actions.container_id')
|
||||
.where('subjects.name LIKE :keyword', keyword: "%#{keyword}%")
|
||||
end
|
||||
|
||||
applies = applies.order(updated_at: :desc)
|
||||
|
||||
@applies = paginate applies.includes(user: :user_extension)
|
||||
|
||||
subject_ids = @applies.map(&:container_id)
|
||||
@subject_map = Subject.where(id: subject_ids).each_with_object({}) { |s, h| h[s.id] = s }
|
||||
@challenge_count_map = Challenge.joins(shixun: :stage_shixuns).where(st: 0, stage_shixuns: { subject_id: subject_ids}).group('subject_id').count
|
||||
end
|
||||
|
||||
def agree
|
||||
Admins::SubjectAuths::AgreeApplyService.call(current_apply, current_user)
|
||||
render_success_js
|
||||
end
|
||||
|
||||
def refuse
|
||||
Admins::SubjectAuths::RefuseApplyService.call(current_apply, current_user, params)
|
||||
|
||||
render_success_js
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def current_apply
|
||||
@_current_apply ||= ApplyAction.where(container_type: 'ApplySubject').find(params[:id])
|
||||
end
|
||||
end
|
@ -0,0 +1,43 @@
|
||||
class Admins::ShixunAuths::AgreeApplyService < ApplicationService
|
||||
attr_reader :apply, :user, :shixun
|
||||
|
||||
def initialize(apply, user)
|
||||
@apply = apply
|
||||
@user = user
|
||||
@shixun = Shixun.find(apply.container_id)
|
||||
end
|
||||
|
||||
def call
|
||||
ActiveRecord::Base.transaction do
|
||||
apply.update!(status: 1, dealer_id: user.id)
|
||||
shixun.update!(status: 2, publish_time: Time.now)
|
||||
|
||||
# 奖励金币、经验
|
||||
reward_grade_and_experience!
|
||||
|
||||
deal_tiding!
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def reward_grade_and_experience!
|
||||
score = shixun.all_score
|
||||
shixun_creator = shixun.user
|
||||
|
||||
RewardGradeService.call(shixun_creator, container_id: shixun.id, container_type: 'shixunPublish', score: score)
|
||||
|
||||
Experience.create!(user_id: shixun_creator.id, container_id: shixun.id, container_type: 'shixunPublish', score: score)
|
||||
shixun_creator.update_column(:experience, shixun_creator.experience.to_i + score)
|
||||
end
|
||||
|
||||
def deal_tiding!
|
||||
apply.tidings.where(tiding_type: 'Apply', status: 0).update_all(status: 1)
|
||||
|
||||
Tiding.create!(user_id: apply.user_id, trigger_user_id: 0,
|
||||
container_id: apply.id, container_type: 'ApplyAction',
|
||||
parent_container_id: apply.container_id, parent_container_type: apply.container_type,
|
||||
belong_container_id: apply.container_id, belong_container_type: 'Shixun',
|
||||
status: 1, tiding_type: 'System')
|
||||
end
|
||||
end
|
@ -0,0 +1,35 @@
|
||||
class Admins::ShixunAuths::RefuseApplyService < ApplicationService
|
||||
attr_reader :apply, :user, :shixun, :params
|
||||
|
||||
def initialize(apply, user, params)
|
||||
@apply = apply
|
||||
@user = user
|
||||
@shixun = Shixun.find(apply.container_id)
|
||||
@params = params
|
||||
end
|
||||
|
||||
def call
|
||||
ActiveRecord::Base.transaction do
|
||||
shixun.update!(status: 0)
|
||||
apply.update!(status: 2, reason: reason, dealer_id: user.id)
|
||||
|
||||
deal_tiding!
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def reason
|
||||
params[:reason].to_s.strip
|
||||
end
|
||||
|
||||
def deal_tiding!
|
||||
apply.tidings.where(tiding_type: 'Apply', status: 0).update_all(status: 1)
|
||||
|
||||
Tiding.create!(user_id: apply.user_id, trigger_user_id: 0,
|
||||
container_id: apply.id, container_type: 'ApplyAction',
|
||||
parent_container_id: apply.container_id, parent_container_type: apply.container_type,
|
||||
belong_container_id: apply.container_id, belong_container_type: 'Shixun',
|
||||
status: 2, tiding_type: 'System')
|
||||
end
|
||||
end
|
@ -0,0 +1,30 @@
|
||||
class Admins::SubjectAuths::AgreeApplyService < ApplicationService
|
||||
attr_reader :apply, :user, :subject
|
||||
|
||||
def initialize(apply, user)
|
||||
@apply = apply
|
||||
@user = user
|
||||
@subject = Subject.find(apply.container_id)
|
||||
end
|
||||
|
||||
def call
|
||||
ActiveRecord::Base.transaction do
|
||||
apply.update!(status: 1, dealer_id: user.id)
|
||||
subject.update!(status: 2, publish_time: Time.now)
|
||||
|
||||
deal_tiding!
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def deal_tiding!
|
||||
apply.tidings.where(tiding_type: 'Apply', status: 0).update_all(status: 1)
|
||||
|
||||
Tiding.create!(user_id: apply.user_id, trigger_user_id: 0,
|
||||
container_id: apply.id, container_type: 'ApplyAction',
|
||||
parent_container_id: apply.container_id, parent_container_type: apply.container_type,
|
||||
belong_container_id: apply.container_id, belong_container_type: 'Subject',
|
||||
status: 1, tiding_type: 'System')
|
||||
end
|
||||
end
|
@ -0,0 +1,35 @@
|
||||
class Admins::SubjectAuths::RefuseApplyService < ApplicationService
|
||||
attr_reader :apply, :user, :subject, :params
|
||||
|
||||
def initialize(apply, user, params)
|
||||
@apply = apply
|
||||
@user = user
|
||||
@subject = Subject.find(apply.container_id)
|
||||
@params = params
|
||||
end
|
||||
|
||||
def call
|
||||
ActiveRecord::Base.transaction do
|
||||
subject.update!(status: 0)
|
||||
apply.update!(status: 2, reason: reason, dealer_id: user.id)
|
||||
|
||||
deal_tiding!
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def reason
|
||||
params[:reason].to_s.strip
|
||||
end
|
||||
|
||||
def deal_tiding!
|
||||
apply.tidings.where(tiding_type: 'Apply', status: 0).update_all(status: 1)
|
||||
|
||||
Tiding.create!(user_id: apply.user_id, trigger_user_id: 0,
|
||||
container_id: apply.id, container_type: 'ApplyAction',
|
||||
parent_container_id: apply.container_id, parent_container_type: apply.container_type,
|
||||
belong_container_id: apply.container_id, belong_container_type: 'Subject',
|
||||
status: 2, tiding_type: 'System')
|
||||
end
|
||||
end
|
@ -0,0 +1,32 @@
|
||||
<% define_admin_breadcrumbs do %>
|
||||
<% add_admin_breadcrumb('实训发布') %>
|
||||
<% end %>
|
||||
|
||||
<div class="box search-form-container flex-column mb-0 pb-0 shixun-authorization-list-form">
|
||||
<ul class="nav nav-tabs w-100 search-form-tabs">
|
||||
<li class="nav-item">
|
||||
<%= link_to '待审批', admins_shixun_authorizations_path(status: :pending), remote: true, 'data-value': 'pending',
|
||||
class: "nav-link search-form-tab #{params[:status] == 'pending' ? 'active' : ''}" %>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<%= link_to '已审批', admins_shixun_authorizations_path(status: :processed), remote: true, 'data-value': 'processed',
|
||||
class: "nav-link search-form-tab #{params[:status] != 'pending' ? 'active' : ''}" %>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<%= form_tag(admins_shixun_authorizations_path(unsafe_params), method: :get, class: 'form-inline search-form justify-content-end mt-3', remote: true) do %>
|
||||
<div class="form-group status-filter" style="<%= params[:status] != 'pending' ? '' : 'display: none;' %>">
|
||||
<label for="status">审核状态:</label>
|
||||
<% status_options = [['全部', 'processed'], ['已同意', 'agreed'], ['已拒绝', 'refused']] %>
|
||||
<%= select_tag(:status, options_for_select(status_options), class: 'form-control') %>
|
||||
</div>
|
||||
<%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-sm-2 ml-3', placeholder: '实训名称检索') %>
|
||||
<%= submit_tag('搜索', class: 'btn btn-primary ml-3') %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="box shixun-authorization-list-container">
|
||||
<%= render(partial: 'admins/shixun_authorizations/shared/list', locals: { applies: @applies, shixun_map: @shixun_map }) %>
|
||||
</div>
|
||||
|
||||
<%= render(partial: 'admins/shared/admin_common_refuse_modal') %>
|
@ -0,0 +1 @@
|
||||
$('.shixun-authorization-list-container').html("<%= j( render partial: 'admins/shixun_authorizations/shared/list', locals: { applies: @applies, shixun_map: @shixun_map } ) %>");
|
@ -0,0 +1,60 @@
|
||||
<% is_processed = params[:status].to_s != 'pending' %>
|
||||
|
||||
<table class="table table-hover text-center shixun-authorization-list-table">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th width="8%">头像</th>
|
||||
<th width="14%">创建者</th>
|
||||
<th width="28%" class="text-left">实训名称</th>
|
||||
<th width="12%">任务数</th>
|
||||
<th width="16%">时间</th>
|
||||
<% if is_processed %>
|
||||
<th width="14%">拒绝原因</th>
|
||||
<th width="8%">状态</th>
|
||||
<% else %>
|
||||
<th width="22%">操作</th>
|
||||
<% end %>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% if applies.present? %>
|
||||
<% applies.each do |apply| %>
|
||||
<% user = apply.user %>
|
||||
<% shixun = shixun_map[apply.container_id] %>
|
||||
<tr class="shixun-authorization-item shixun-authorization-<%= apply.id %>">
|
||||
<td>
|
||||
<%= link_to "/users/#{user.login}", class: 'shixun-authorization-avatar', target: '_blank', data: { toggle: 'tooltip', title: '个人主页' } do %>
|
||||
<img src="/images/<%= url_to_avatar(user) %>" class="rounded-circle" width="40" height="40" />
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= user.real_name %></td>
|
||||
<td class="text-left">
|
||||
<%= link_to "/shixuns/#{shixun.identifier}", target: '_blank' do %>
|
||||
<%= overflow_hidden_span shixun.name, width: 300 %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= shixun.challenges_count %></td>
|
||||
<td><%= apply.updated_at.strftime('%Y-%m-%d %H:%M') %></td>
|
||||
|
||||
<% if is_processed %>
|
||||
<td class="text-secondary"><%= overflow_hidden_span apply.reason, width: 140 %></td>
|
||||
<td><span class="apply-status-<%= apply.status %>"><%= apply.status_text %></span></td>
|
||||
<% else %>
|
||||
<td class="action-container">
|
||||
<%= agree_link '同意', agree_admins_shixun_authorization_path(apply, element: ".shixun-authorization-#{apply.id}"), 'data-confirm': '确认审核通过?' %>
|
||||
<%= javascript_void_link('拒绝', class: 'action refuse-action',
|
||||
data: {
|
||||
toggle: 'modal', target: '.admin-common-refuse-modal', id: apply.id,
|
||||
url: refuse_admins_shixun_authorization_path(apply, element: ".shixun-authorization-#{apply.id}")
|
||||
}) %>
|
||||
</td>
|
||||
<% end %>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= render 'admins/shared/no_data_for_table' %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<%= render partial: 'admins/shared/paginate', locals: { objects: applies } %>
|
@ -0,0 +1,33 @@
|
||||
<% define_admin_breadcrumbs do %>
|
||||
<% add_admin_breadcrumb('实践课程发布') %>
|
||||
<% end %>
|
||||
|
||||
<div class="box search-form-container flex-column mb-0 pb-0 subject-authorization-list-form">
|
||||
<ul class="nav nav-tabs w-100 search-form-tabs">
|
||||
<li class="nav-item">
|
||||
<%= link_to '待审批', admins_subject_authorizations_path(status: :pending), remote: true, 'data-value': 'pending',
|
||||
class: "nav-link search-form-tab #{params[:status] == 'pending' ? 'active' : ''}" %>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<%= link_to '已审批', admins_subject_authorizations_path(status: :processed), remote: true, 'data-value': 'processed',
|
||||
class: "nav-link search-form-tab #{params[:status] != 'pending' ? 'active' : ''}" %>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<%= form_tag(admins_subject_authorizations_path(unsafe_params), method: :get, class: 'form-inline search-form justify-content-end mt-3', remote: true) do %>
|
||||
<div class="form-group status-filter" style="<%= params[:status] != 'pending' ? '' : 'display: none;' %>">
|
||||
<label for="status">审核状态:</label>
|
||||
<% status_options = [['全部', 'processed'], ['已同意', 'agreed'], ['已拒绝', 'refused']] %>
|
||||
<%= select_tag(:status, options_for_select(status_options), class: 'form-control') %>
|
||||
</div>
|
||||
<%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-sm-2 ml-3', placeholder: '实训课程名称检索') %>
|
||||
<%= submit_tag('搜索', class: 'btn btn-primary ml-3') %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="box subject-authorization-list-container">
|
||||
<%= render(partial: 'admins/subject_authorizations/shared/list',
|
||||
locals: { applies: @applies, subject_map: @subject_map, challenge_count_map: @challenge_count_map }) %>
|
||||
</div>
|
||||
|
||||
<%= render(partial: 'admins/shared/admin_common_refuse_modal') %>
|
@ -0,0 +1 @@
|
||||
$('.subject-authorization-list-container').html("<%= j( render partial: 'admins/subject_authorizations/shared/list', locals: { applies: @applies, subject_map: @subject_map, challenge_count_map: @challenge_count_map } ) %>");
|
@ -0,0 +1,64 @@
|
||||
<% is_processed = params[:status].to_s != 'pending' %>
|
||||
|
||||
<table class="table table-hover text-center subject-authorization-list-table">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th width="8%">头像</th>
|
||||
<th width="10%">创建者</th>
|
||||
<th width="28%" class="text-left">实践课程名称</th>
|
||||
<th width="6%">阶段数</th>
|
||||
<th width="6%">实训数</th>
|
||||
<th width="6%">关卡数</th>
|
||||
<th width="14%">时间</th>
|
||||
<% if is_processed %>
|
||||
<th width="14%">拒绝原因</th>
|
||||
<th width="8%">状态</th>
|
||||
<% else %>
|
||||
<th width="22%">操作</th>
|
||||
<% end %>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% if applies.present? %>
|
||||
<% applies.each do |apply| %>
|
||||
<% user = apply.user %>
|
||||
<% subject = subject_map[apply.container_id] %>
|
||||
<tr class="subject-authorization-item subject-authorization-<%= apply.id %>">
|
||||
<td>
|
||||
<%= link_to "/users/#{user.login}", class: 'subject-authorization-avatar', target: '_blank', data: { toggle: 'tooltip', title: '个人主页' } do %>
|
||||
<img src="/images/<%= url_to_avatar(user) %>" class="rounded-circle" width="40" height="40" />
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= user.real_name %></td>
|
||||
<td class="text-left">
|
||||
<%= link_to "/paths/#{subject.id}", target: '_blank' do %>
|
||||
<%= overflow_hidden_span subject.name, width: 300 %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= subject.stages_count %></td>
|
||||
<td><%= subject.shixuns_count %></td>
|
||||
<td><%= challenge_count_map.fetch(subject.id, 0) %></td>
|
||||
<td><%= apply.updated_at.strftime('%Y-%m-%d %H:%M') %></td>
|
||||
|
||||
<% if is_processed %>
|
||||
<td class="text-secondary"><%= overflow_hidden_span apply.reason, width: 140 %></td>
|
||||
<td><span class="apply-status-<%= apply.status %>"><%= apply.status_text %></span></td>
|
||||
<% else %>
|
||||
<td class="action-container">
|
||||
<%= agree_link '同意', agree_admins_subject_authorization_path(apply, element: ".subject-authorization-#{apply.id}"), 'data-confirm': '确认审核通过?' %>
|
||||
<%= javascript_void_link('拒绝', class: 'action refuse-action',
|
||||
data: {
|
||||
toggle: 'modal', target: '.admin-common-refuse-modal', id: apply.id,
|
||||
url: refuse_admins_subject_authorization_path(apply, element: ".subject-authorization-#{apply.id}")
|
||||
}) %>
|
||||
</td>
|
||||
<% end %>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= render 'admins/shared/no_data_for_table' %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<%= render partial: 'admins/shared/paginate', locals: { objects: applies } %>
|
@ -0,0 +1,7 @@
|
||||
zh-CN:
|
||||
apply_action:
|
||||
status:
|
||||
'0': '待处理'
|
||||
'1': '已同意'
|
||||
'2': '已拒绝'
|
||||
'3': '已撤销'
|
@ -0,0 +1,19 @@
|
||||
import React,{Component} from "React";
|
||||
|
||||
export default function LeaderIcon(props = {}) {
|
||||
let icon = null;
|
||||
if (props.small) {
|
||||
icon = <div className="font-8 blueFull Actionbtn" style={{
|
||||
height: '14px',
|
||||
'line-height': '14px',
|
||||
width: '24px',
|
||||
padding: 0,
|
||||
'margin-top': '-2px',
|
||||
'margin-left': '2px',
|
||||
'vertical-align': 'middle', }}>组长</div>
|
||||
} else {
|
||||
icon = <div className="font-8 blueFull Actionbtn" style={{ height: '16px', 'line-height': '16px', width: '30px'}}>组长</div>
|
||||
|
||||
}
|
||||
return icon
|
||||
}
|
@ -1,209 +1,209 @@
|
||||
import React, { Component } from "react";
|
||||
import { Modal, Checkbox, Input, Spin} from "antd";
|
||||
import axios from 'axios'
|
||||
import ModalWrapper from "../../common/ModalWrapper"
|
||||
import InfiniteScroll from 'react-infinite-scroller';
|
||||
|
||||
const Search = Input.Search
|
||||
const pageCount = 15;
|
||||
class SendToCourseModal extends Component{
|
||||
constructor(props){
|
||||
super(props);
|
||||
this.state={
|
||||
checkBoxValues: [],
|
||||
course_lists: [],
|
||||
course_lists_after_filter: [],
|
||||
searchValue: '',
|
||||
hasMore: true,
|
||||
loading: false,
|
||||
page: 1
|
||||
}
|
||||
}
|
||||
fetchCourseList = (arg_page) => {
|
||||
const page = arg_page || this.state.page;
|
||||
// search=''&
|
||||
let url = `/courses/mine.json?page=${page}&page_size=${pageCount}`
|
||||
const searchValue = this.state.searchValue.trim()
|
||||
if (searchValue) {
|
||||
url += `&search=${searchValue}`
|
||||
}
|
||||
this.setState({ loading: true })
|
||||
axios.get(url, {
|
||||
})
|
||||
.then((response) => {
|
||||
if (!response.data.data || response.data.data.length == 0) {
|
||||
this.setState({
|
||||
course_lists: page == 1 ? [] : this.state.course_lists,
|
||||
page,
|
||||
loading: false,
|
||||
hasMore: false,
|
||||
})
|
||||
} else {
|
||||
this.setState({
|
||||
course_lists: page == 1 ? response.data.data : this.state.course_lists.concat(response.data.data),
|
||||
course_lists_after_filter: response.data.data,
|
||||
page,
|
||||
loading: false,
|
||||
hasMore: response.data.data.length == pageCount
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
componentDidMount() {
|
||||
setTimeout(() => {
|
||||
this.fetchCourseList()
|
||||
}, 500)
|
||||
|
||||
}
|
||||
setVisible = (visible) => {
|
||||
this.refs.modalWrapper.setVisible(visible)
|
||||
if (visible == false) {
|
||||
this.setState({
|
||||
checkBoxValues: []
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
onSendOk = () => {
|
||||
if (!this.state.checkBoxValues || this.state.checkBoxValues.length == 0) {
|
||||
this.props.showNotification('请先选择要发送至的课堂')
|
||||
return;
|
||||
}
|
||||
if(this.props.url==="/files/bulk_send.json"){
|
||||
axios.post("/files/bulk_send.json", {
|
||||
course_id:this.props.match.params.coursesId,
|
||||
ids: this.props.selectedMessageIds,
|
||||
to_course_ids: this.state.checkBoxValues
|
||||
})
|
||||
.then((response) => {
|
||||
if (response.data.status == 0) {
|
||||
this.setVisible(false)
|
||||
this.props.gobackonSend(response.data.message)
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
}else{
|
||||
const bid = this.props.match.params.boardId
|
||||
const url = `/boards/${bid}/messages/bulk_send.json`
|
||||
axios.post(url, {
|
||||
ids: this.props.selectedMessageIds,
|
||||
to_course_ids: this.state.checkBoxValues
|
||||
})
|
||||
.then((response) => {
|
||||
if (response.data.status == 0) {
|
||||
this.setVisible(false)
|
||||
this.props.showNotification('发送成功')
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
onOk = () => {
|
||||
const { course_lists, checkBoxValues } = this.state
|
||||
this.onSendOk()
|
||||
// this.props.onOk && this.props.onOk(checkBoxValues)
|
||||
|
||||
// this.refs.modalWrapper.setVisible(false)
|
||||
}
|
||||
|
||||
onCheckBoxChange = (checkBoxValues) => {
|
||||
this.setState({
|
||||
checkBoxValues: checkBoxValues
|
||||
})
|
||||
}
|
||||
|
||||
onSearchChange = (e) => {
|
||||
this.setState({
|
||||
searchValue: e.target.value
|
||||
})
|
||||
}
|
||||
handleInfiniteOnLoad = () => {
|
||||
console.log('loadmore...')
|
||||
this.fetchCourseList(this.state.page + 1)
|
||||
}
|
||||
|
||||
onSearch = () => {
|
||||
// const course_lists_after_filter = this.state.course_lists.filter( item => item.name.indexOf(this.state.searchValue) != -1 )
|
||||
// this.setState({ course_lists_after_filter })
|
||||
this.fetchCourseList(1)
|
||||
}
|
||||
render(){
|
||||
const { course_lists, checkBoxValues, searchValue, loading, hasMore } = this.state
|
||||
const { moduleName } = this.props
|
||||
return(
|
||||
<ModalWrapper
|
||||
ref="modalWrapper"
|
||||
title={`发送${moduleName}`}
|
||||
{...this.props }
|
||||
onOk={this.onOk}
|
||||
>
|
||||
<style>
|
||||
{`
|
||||
.demo-loading-container {
|
||||
position: absolute;
|
||||
bottom: 93px;
|
||||
width: 82%;
|
||||
text-align: center;
|
||||
}`}
|
||||
</style>
|
||||
<p className="color-grey-6 mb20 edu-txt-center" style={{ fontWeight: "bold" }} >选择的{moduleName}发送到<span className="color-orange-tip">指定课堂</span></p>
|
||||
|
||||
<Search
|
||||
className="mb14"
|
||||
value={searchValue}
|
||||
placeholder="请输入课堂名称进行搜索"
|
||||
onChange={this.onSearchChange}
|
||||
onSearch={this.onSearch}
|
||||
></Search>
|
||||
|
||||
<div>
|
||||
{/* https://github.com/CassetteRocks/react-infinite-scroller/issues/70 */}
|
||||
<div className="edu-back-skyblue padding15" style={{"height":"300px", overflowY: "scroll", overflowAnchor: 'none' }}>
|
||||
<InfiniteScroll
|
||||
threshold={10}
|
||||
initialLoad={false}
|
||||
pageStart={0}
|
||||
loadMore={this.handleInfiniteOnLoad}
|
||||
hasMore={!loading && hasMore}
|
||||
useWindow={false}
|
||||
>
|
||||
<Checkbox.Group style={{ width: '100%' }} onChange={this.onCheckBoxChange} value={checkBoxValues}>
|
||||
|
||||
{ course_lists && course_lists.map( course => {
|
||||
return (
|
||||
<p className="clearfix mb7" key={course.id}>
|
||||
<Checkbox className="fl" value={course.id} key={course.id}></Checkbox>
|
||||
<span className="fl with45"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{course.name}</label></span>
|
||||
</p>
|
||||
)
|
||||
}) }
|
||||
</Checkbox.Group>
|
||||
{loading && hasMore && (
|
||||
<div className="demo-loading-container">
|
||||
<Spin />
|
||||
</div>
|
||||
)}
|
||||
{/* TODO */}
|
||||
{/* {
|
||||
!hasMore && <div>没有更多了。。</div>
|
||||
} */}
|
||||
</InfiniteScroll>
|
||||
</div>
|
||||
</div>
|
||||
</ModalWrapper>
|
||||
)
|
||||
}
|
||||
}
|
||||
export default SendToCourseModal;
|
||||
|
||||
|
||||
import React, { Component } from "react";
|
||||
import { Modal, Checkbox, Input, Spin} from "antd";
|
||||
import axios from 'axios'
|
||||
import ModalWrapper from "../../common/ModalWrapper"
|
||||
import InfiniteScroll from 'react-infinite-scroller';
|
||||
|
||||
const Search = Input.Search
|
||||
const pageCount = 15;
|
||||
class SendToCourseModal extends Component{
|
||||
constructor(props){
|
||||
super(props);
|
||||
this.state={
|
||||
checkBoxValues: [],
|
||||
course_lists: [],
|
||||
course_lists_after_filter: [],
|
||||
searchValue: '',
|
||||
hasMore: true,
|
||||
loading: false,
|
||||
page: 1
|
||||
}
|
||||
}
|
||||
fetchCourseList = (arg_page) => {
|
||||
const page = arg_page || this.state.page;
|
||||
// search=''&
|
||||
let url = `/courses/mine.json?page=${page}&page_size=${pageCount}`
|
||||
const searchValue = this.state.searchValue.trim()
|
||||
if (searchValue) {
|
||||
url += `&search=${searchValue}`
|
||||
}
|
||||
this.setState({ loading: true })
|
||||
axios.get(url, {
|
||||
})
|
||||
.then((response) => {
|
||||
if (!response.data.data || response.data.data.length == 0) {
|
||||
this.setState({
|
||||
course_lists: page == 1 ? [] : this.state.course_lists,
|
||||
page,
|
||||
loading: false,
|
||||
hasMore: false,
|
||||
})
|
||||
} else {
|
||||
this.setState({
|
||||
course_lists: page == 1 ? response.data.data : this.state.course_lists.concat(response.data.data),
|
||||
course_lists_after_filter: response.data.data,
|
||||
page,
|
||||
loading: false,
|
||||
hasMore: response.data.data.length == pageCount
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
componentDidMount() {
|
||||
setTimeout(() => {
|
||||
this.fetchCourseList()
|
||||
}, 500)
|
||||
|
||||
}
|
||||
setVisible = (visible) => {
|
||||
this.refs.modalWrapper.setVisible(visible)
|
||||
if (visible == false) {
|
||||
this.setState({
|
||||
checkBoxValues: []
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
onSendOk = () => {
|
||||
if (!this.state.checkBoxValues || this.state.checkBoxValues.length == 0) {
|
||||
this.props.showNotification('请先选择要发送至的课堂')
|
||||
return;
|
||||
}
|
||||
if(this.props.url==="/files/bulk_send.json"){
|
||||
axios.post("/files/bulk_send.json", {
|
||||
course_id:this.props.match.params.coursesId,
|
||||
ids: this.props.selectedMessageIds,
|
||||
to_course_ids: this.state.checkBoxValues
|
||||
})
|
||||
.then((response) => {
|
||||
if (response.data.status == 0) {
|
||||
this.setVisible(false)
|
||||
this.props.gobackonSend(response.data.message)
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
}else{
|
||||
const bid = this.props.match.params.boardId
|
||||
const url = `/boards/${bid}/messages/bulk_send.json`
|
||||
axios.post(url, {
|
||||
ids: this.props.selectedMessageIds,
|
||||
to_course_ids: this.state.checkBoxValues
|
||||
})
|
||||
.then((response) => {
|
||||
if (response.data.status == 0) {
|
||||
this.setVisible(false)
|
||||
this.props.showNotification('发送成功')
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
onOk = () => {
|
||||
const { course_lists, checkBoxValues } = this.state
|
||||
this.onSendOk()
|
||||
// this.props.onOk && this.props.onOk(checkBoxValues)
|
||||
|
||||
// this.refs.modalWrapper.setVisible(false)
|
||||
}
|
||||
|
||||
onCheckBoxChange = (checkBoxValues) => {
|
||||
this.setState({
|
||||
checkBoxValues: checkBoxValues
|
||||
})
|
||||
}
|
||||
|
||||
onSearchChange = (e) => {
|
||||
this.setState({
|
||||
searchValue: e.target.value
|
||||
})
|
||||
}
|
||||
handleInfiniteOnLoad = () => {
|
||||
console.log('loadmore...')
|
||||
this.fetchCourseList(this.state.page + 1)
|
||||
}
|
||||
|
||||
onSearch = () => {
|
||||
// const course_lists_after_filter = this.state.course_lists.filter( item => item.name.indexOf(this.state.searchValue) != -1 )
|
||||
// this.setState({ course_lists_after_filter })
|
||||
this.fetchCourseList(1)
|
||||
}
|
||||
render(){
|
||||
const { course_lists, checkBoxValues, searchValue, loading, hasMore } = this.state
|
||||
const { moduleName } = this.props
|
||||
return(
|
||||
<ModalWrapper
|
||||
ref="modalWrapper"
|
||||
title={`发送${moduleName}`}
|
||||
{...this.props }
|
||||
onOk={this.onOk}
|
||||
>
|
||||
<style>
|
||||
{`
|
||||
.demo-loading-container {
|
||||
position: absolute;
|
||||
bottom: 93px;
|
||||
width: 82%;
|
||||
text-align: center;
|
||||
}`}
|
||||
</style>
|
||||
<p className="color-grey-6 mb20 edu-txt-center" style={{ fontWeight: "bold" }} >选择的{moduleName}发送到<span className="color-orange-tip">指定课堂</span></p>
|
||||
|
||||
<Search
|
||||
className="mb14"
|
||||
value={searchValue}
|
||||
placeholder="请输入课堂名称进行搜索"
|
||||
onChange={this.onSearchChange}
|
||||
onSearch={this.onSearch}
|
||||
></Search>
|
||||
|
||||
<div>
|
||||
{/* https://github.com/CassetteRocks/react-infinite-scroller/issues/70 */}
|
||||
<div className="edu-back-skyblue padding15" style={{"height":"300px", overflowY: "scroll", overflowAnchor: 'none' }}>
|
||||
<InfiniteScroll
|
||||
threshold={10}
|
||||
initialLoad={false}
|
||||
pageStart={0}
|
||||
loadMore={this.handleInfiniteOnLoad}
|
||||
hasMore={!loading && hasMore}
|
||||
useWindow={false}
|
||||
>
|
||||
<Checkbox.Group style={{ width: '100%' }} onChange={this.onCheckBoxChange} value={checkBoxValues}>
|
||||
|
||||
{ course_lists && course_lists.map( course => {
|
||||
return (
|
||||
<p className="clearfix mb7" key={course.id}>
|
||||
<Checkbox className="fl" value={course.id} key={course.id}></Checkbox>
|
||||
<span className="fl with45"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{course.name}</label></span>
|
||||
</p>
|
||||
)
|
||||
}) }
|
||||
</Checkbox.Group>
|
||||
{loading && hasMore && (
|
||||
<div className="demo-loading-container">
|
||||
<Spin />
|
||||
</div>
|
||||
)}
|
||||
{/* TODO */}
|
||||
{/* {
|
||||
!hasMore && <div>没有更多了。。</div>
|
||||
} */}
|
||||
</InfiniteScroll>
|
||||
</div>
|
||||
</div>
|
||||
</ModalWrapper>
|
||||
)
|
||||
}
|
||||
}
|
||||
export default SendToCourseModal;
|
||||
|
||||
|
||||
|
@ -1,80 +1,80 @@
|
||||
.studentList_operation_ul{
|
||||
color: #999;
|
||||
font-size: 12px;
|
||||
float: right;
|
||||
margin-top: 2px;
|
||||
}
|
||||
.studentList_operation_ul li{
|
||||
float: left;
|
||||
padding:0px 20px;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
flex: 0 0 26px;
|
||||
line-height: 26px;
|
||||
}
|
||||
.studentList_operation_ul li.li_line:after{
|
||||
position: absolute;
|
||||
content: '';
|
||||
width: 1px;
|
||||
height: 12px;
|
||||
background-color: #EDEDED;
|
||||
right: 0px;
|
||||
top:6px;
|
||||
}
|
||||
.studentList_operation_ul li:last-child{
|
||||
padding-right: 0px;
|
||||
}
|
||||
.studentList_operation_ul li:last-child:after{
|
||||
width: 0px;
|
||||
}
|
||||
|
||||
/* 基础的下拉列表、列如排序等 */
|
||||
.drop_down_normal li{
|
||||
padding: 0px 20px;
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
min-width: 96px;
|
||||
color: #333;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.stu_table table{
|
||||
line-height: 1.2;
|
||||
}
|
||||
.stu_table .classesName{
|
||||
display: block;
|
||||
max-width: 428px;
|
||||
}
|
||||
.stu_table .ant-table-thead > tr > th{
|
||||
padding:21px 16px;
|
||||
border-bottom: none;
|
||||
}
|
||||
.stu_table .ant-table-tbody tr:last-child td{
|
||||
border-bottom: none;
|
||||
}
|
||||
.stu_table table .ant-table-tbody > tr:hover:not(.ant-table-expanded-row) > td{
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.stu_head{
|
||||
padding-bottom: 15px;
|
||||
}
|
||||
.ant-modal-body{
|
||||
padding:30px 40px;
|
||||
}
|
||||
.color-dark-21{
|
||||
color: #212121;
|
||||
}
|
||||
.tabletd {
|
||||
background-color:#E6F7FF;
|
||||
}
|
||||
|
||||
.yslminheigth{
|
||||
min-height: 20px;
|
||||
}
|
||||
|
||||
.yslminheigths{
|
||||
min-height: 21px;
|
||||
.studentList_operation_ul{
|
||||
color: #999;
|
||||
font-size: 12px;
|
||||
float: right;
|
||||
margin-top: 2px;
|
||||
}
|
||||
.studentList_operation_ul li{
|
||||
float: left;
|
||||
padding:0px 20px;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
flex: 0 0 26px;
|
||||
line-height: 26px;
|
||||
}
|
||||
.studentList_operation_ul li.li_line:after{
|
||||
position: absolute;
|
||||
content: '';
|
||||
width: 1px;
|
||||
height: 12px;
|
||||
background-color: #EDEDED;
|
||||
right: 0px;
|
||||
top:6px;
|
||||
}
|
||||
.studentList_operation_ul li:last-child{
|
||||
padding-right: 0px;
|
||||
}
|
||||
.studentList_operation_ul li:last-child:after{
|
||||
width: 0px;
|
||||
}
|
||||
|
||||
/* 基础的下拉列表、列如排序等 */
|
||||
.drop_down_normal li{
|
||||
padding: 0px 20px;
|
||||
height: 34px;
|
||||
line-height: 34px;
|
||||
min-width: 96px;
|
||||
color: #333;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.stu_table table{
|
||||
line-height: 1.2;
|
||||
}
|
||||
.stu_table .classesName{
|
||||
display: block;
|
||||
max-width: 428px;
|
||||
}
|
||||
.stu_table .ant-table-thead > tr > th{
|
||||
padding:21px 16px;
|
||||
border-bottom: none;
|
||||
}
|
||||
.stu_table .ant-table-tbody tr:last-child td{
|
||||
border-bottom: none;
|
||||
}
|
||||
.stu_table table .ant-table-tbody > tr:hover:not(.ant-table-expanded-row) > td{
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.stu_head{
|
||||
padding-bottom: 15px;
|
||||
}
|
||||
.ant-modal-body{
|
||||
padding:30px 40px;
|
||||
}
|
||||
.color-dark-21{
|
||||
color: #212121;
|
||||
}
|
||||
.tabletd {
|
||||
background-color:#E6F7FF;
|
||||
}
|
||||
|
||||
.yslminheigth{
|
||||
min-height: 20px;
|
||||
}
|
||||
|
||||
.yslminheigths{
|
||||
min-height: 21px;
|
||||
}
|
@ -1,45 +1,45 @@
|
||||
.ml350 {
|
||||
margin-left: 40%;
|
||||
}
|
||||
|
||||
.ml32 {
|
||||
margin-left: 32%;
|
||||
}
|
||||
|
||||
.square-Item{
|
||||
/*min-height: 324px;*/
|
||||
}
|
||||
.square-img{
|
||||
min-height: 210px;
|
||||
}
|
||||
.task-hide{
|
||||
margin-bottom: 0em;
|
||||
}
|
||||
.backFAFAFA{
|
||||
background:#FAFAFA;
|
||||
}
|
||||
|
||||
.demo {
|
||||
width: 500px;
|
||||
background-color: #0dcecb;
|
||||
text-align: center;
|
||||
padding:50px;
|
||||
}
|
||||
.next-loading {
|
||||
margin-bottom: 5px;
|
||||
width:100%;
|
||||
}
|
||||
|
||||
.next-rating-overlay .next-icon{
|
||||
color: #FFA800!important;
|
||||
}
|
||||
|
||||
.custom-pagination {
|
||||
display: inline-block;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.ml425{
|
||||
margin-left:42.5%;
|
||||
margin-top:20px;
|
||||
.ml350 {
|
||||
margin-left: 40%;
|
||||
}
|
||||
|
||||
.ml32 {
|
||||
margin-left: 32%;
|
||||
}
|
||||
|
||||
.square-Item{
|
||||
/*min-height: 324px;*/
|
||||
}
|
||||
.square-img{
|
||||
min-height: 210px;
|
||||
}
|
||||
.task-hide{
|
||||
margin-bottom: 0em;
|
||||
}
|
||||
.backFAFAFA{
|
||||
background:#FAFAFA;
|
||||
}
|
||||
|
||||
.demo {
|
||||
width: 500px;
|
||||
background-color: #0dcecb;
|
||||
text-align: center;
|
||||
padding:50px;
|
||||
}
|
||||
.next-loading {
|
||||
margin-bottom: 5px;
|
||||
width:100%;
|
||||
}
|
||||
|
||||
.next-rating-overlay .next-icon{
|
||||
color: #FFA800!important;
|
||||
}
|
||||
|
||||
.custom-pagination {
|
||||
display: inline-block;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.ml425{
|
||||
margin-left:42.5%;
|
||||
margin-top:20px;
|
||||
}
|
@ -1,249 +1,249 @@
|
||||
import React, { Component } from 'react';
|
||||
import {Pagination,Spin,Checkbox,Modal} from 'antd';
|
||||
import moment from 'moment';
|
||||
import axios from 'axios';
|
||||
import NoneData from '../../courses/coursesPublic/NoneData'
|
||||
import {getImageUrl} from 'educoder';
|
||||
import "./usersInfo.css"
|
||||
import Modals from '../../modals/Modals'
|
||||
|
||||
const dateFormat ="YYYY-MM-DD HH:mm"
|
||||
class InfosBank extends Component{
|
||||
constructor(props){
|
||||
super(props);
|
||||
this.state={
|
||||
category:"common",
|
||||
type:"publicly",
|
||||
page:1,
|
||||
per_page:16,
|
||||
sort_by:"updated_at",
|
||||
CoursesId:undefined,
|
||||
|
||||
totalCount:undefined,
|
||||
data:undefined,
|
||||
isSpin:false,
|
||||
|
||||
dialogOpen:false,
|
||||
modalsTopval:undefined,
|
||||
modalsBottomval:undefined,
|
||||
modalSave:undefined
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount=()=>{
|
||||
this.setState({
|
||||
isSpin:true
|
||||
})
|
||||
let{category,type,page,sort_by,CoursesId}=this.state;
|
||||
this.getCourses(category,type,page,sort_by,CoursesId);
|
||||
}
|
||||
|
||||
getCourses=(category,type,page,sort_by,CoursesId)=>{
|
||||
let url=`/users/${this.props.match.params.username}/question_banks.json`;
|
||||
axios.get((url),{params:{
|
||||
category,
|
||||
type,
|
||||
page,
|
||||
sort_by,
|
||||
per_page:category && page ==1?17:16,
|
||||
course_list_id:CoursesId
|
||||
}}).then((result)=>{
|
||||
if(result){
|
||||
this.setState({
|
||||
totalCount:result.data.count,
|
||||
data:result.data,
|
||||
isSpin:false
|
||||
})
|
||||
}
|
||||
}).catch((error)=>{
|
||||
console.log(error);
|
||||
})
|
||||
}
|
||||
|
||||
//切换种类
|
||||
changeCategory=(cate)=>{
|
||||
this.setState({
|
||||
category:cate,
|
||||
page:1,
|
||||
isSpin:true
|
||||
})
|
||||
let{type,sort_by,CoursesId}=this.state;
|
||||
this.getCourses(cate,type,1,sort_by,CoursesId);
|
||||
}
|
||||
//切换状态
|
||||
changeType=(type)=>{
|
||||
this.setState({
|
||||
type:type,
|
||||
page:1,
|
||||
isSpin:true
|
||||
})
|
||||
let{category,sort_by,CoursesId}=this.state;
|
||||
this.getCourses(category,type,1,sort_by,CoursesId);
|
||||
}
|
||||
//切换页数
|
||||
changePage=(page)=>{
|
||||
this.setState({
|
||||
page,
|
||||
isSpin:true
|
||||
})
|
||||
let{category,type,sort_by,CoursesId}=this.state;
|
||||
this.getCourses(category,type,page,sort_by,CoursesId);
|
||||
}
|
||||
|
||||
// 进入课堂
|
||||
turnToCourses=(url)=>{
|
||||
this.props.history.push(url);
|
||||
}
|
||||
|
||||
// 切换排序方式
|
||||
changeOrder= (sort)=>{
|
||||
this.setState({
|
||||
sort_by:sort,
|
||||
isSpin:true
|
||||
})
|
||||
let{category,type,page,CoursesId}=this.state;
|
||||
this.getCourses(category,type,page,sort,CoursesId);
|
||||
}
|
||||
|
||||
changeCourseListId =(CoursesId)=>{
|
||||
this.setState({
|
||||
CoursesId,
|
||||
isSpin:true
|
||||
})
|
||||
let{category,type,sort,page}=this.state;
|
||||
this.getCourses(category,type,page,sort,CoursesId);
|
||||
}
|
||||
|
||||
//设为公开/删除
|
||||
setPublic=(index)=>{
|
||||
this.setState({
|
||||
dialogOpen:true,
|
||||
modalsTopval:index==1?"您确定要公开吗?":"确定要删除该题吗?",
|
||||
modalsBottomval:index==1?"公开后不能重设为私有":"",
|
||||
modalSave:()=>this.sureOperation(index)
|
||||
})
|
||||
}
|
||||
// 确定--设为公开/删除
|
||||
sureOperation=()=>{
|
||||
|
||||
}
|
||||
|
||||
//弹框隐藏
|
||||
handleDialogClose=()=>{
|
||||
this.setState({
|
||||
dialogOpen:false
|
||||
})
|
||||
}
|
||||
|
||||
render(){
|
||||
let{
|
||||
category,
|
||||
type,
|
||||
page,
|
||||
data,
|
||||
totalCount,
|
||||
sort_by,
|
||||
isSpin,
|
||||
CoursesId,
|
||||
dialogOpen,
|
||||
modalsTopval,
|
||||
modalsBottomval,modalSave
|
||||
} = this.state;
|
||||
let isStudent = this.props.isStudent();
|
||||
let is_current=this.props.is_current;
|
||||
return(
|
||||
<div className="educontent">
|
||||
<Modals
|
||||
modalsType={dialogOpen}
|
||||
modalsTopval={modalsTopval}
|
||||
modalsBottomval={modalsBottomval}
|
||||
modalCancel={this.handleDialogClose}
|
||||
modalSave={modalSave}
|
||||
></Modals>
|
||||
<Spin size="large" spinning={isSpin}>
|
||||
<div className="white-panel edu-back-white pt20 pb20 clearfix ">
|
||||
<li className={type=="publicly" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeType("publicly")}>{is_current ? "我":"TA"}的题库</a></li>
|
||||
<li className={type=="personal" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeType("personal")}>公共题库</a></li>
|
||||
</div>
|
||||
<div className="edu-back-white padding20-30 bor-top-greyE">
|
||||
<ul className="clearfix secondNav">
|
||||
<li className={category=="common" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("common")}>普通作业</a></li>
|
||||
<li className={category=="group" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("group")}>分组作业</a></li>
|
||||
<li className={category=="exercise" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("exercise")}>试卷</a></li>
|
||||
<li className={category=="poll" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("poll")}>问卷</a></li>
|
||||
</ul>
|
||||
<div className="edu-txt-left mt10 bankTag">
|
||||
<ul className="inline" id="sourceTag">
|
||||
<li className={ CoursesId ? "" : "active" } onClick={()=>this.changeCourseListId()}>
|
||||
<a href="javascript:void(0)">全部</a>
|
||||
</li>
|
||||
{
|
||||
data && data.course_list && data.course_list.map((item,key)=>{
|
||||
return(
|
||||
<li className={CoursesId==item.id?"active":""} key={key} onClick={()=>this.changeCourseListId(`${item.id}`)}>
|
||||
<a href="javascript:void(0)">{item.name}</a>
|
||||
</li>
|
||||
)
|
||||
})
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<p className="pl25 pr25 clearfix font-12 mb20 mt20">
|
||||
<span className="fl color-grey-9">共参与{totalCount}个题库</span>
|
||||
<div className="fr">
|
||||
<li className="drop_down">
|
||||
<span className="color-grey-9 font-12">{sort_by=="updated_at"?"时间最新":sort_by=="name"?"作业名称":"贡献者"}</span><i className="iconfont icon-xiajiantou font-12 ml2 color-grey-6"></i>
|
||||
<ul className="drop_down_normal">
|
||||
<li onClick={()=>this.changeOrder("updated_at")}>时间最新</li>
|
||||
<li onClick={()=>this.changeOrder("name")}>作业名称</li>
|
||||
<li onClick={()=>this.changeOrder("contributor")}>贡献者</li>
|
||||
</ul>
|
||||
</li>
|
||||
</div>
|
||||
</p>
|
||||
<div className="dataBank_list edu-back-white educontent">
|
||||
{
|
||||
!data || data.question_banks.length==0 && <NoneData></NoneData>
|
||||
}
|
||||
{
|
||||
data && data.question_banks && data.question_banks.map((item,key)=>{
|
||||
return(
|
||||
<div className="dataBank_Item clearfix" key={key}>
|
||||
<div className="fl dataItemLeft">
|
||||
<Checkbox value={item.id} key={item.id}></Checkbox>
|
||||
</div>
|
||||
<div className="fr dataItemRight bank_item">
|
||||
<p className="mb10 clearfix">
|
||||
<span className="dataTitle fl mr80">{item.name}</span>
|
||||
<a href="javascript:void(0)" data-object="2599" className="bank_send fr">发送</a>
|
||||
{
|
||||
item.is_public ==false ?
|
||||
<a href="javascript:void(0)" onClick={()=>this.setPublic(1)} className="bank_public color-blue_4C fr mr60">设为公开</a>:""
|
||||
}
|
||||
</p>
|
||||
<p className="itembottom clearfix">
|
||||
<span className="fl bottomspan color-grey-9">{item.quotes_count}次引用</span>
|
||||
<span className="fl bottomspan color-grey-9">{item.solve_count}次答题</span>
|
||||
<span className="fl bottomspan color-grey-9">{moment(item.updated_at).format('YYYY-MM-DD HH:mm')}</span>
|
||||
<span className="fr"><a href="javascript:void(0)" className="bank_delete color-grey-9" onClick={()=>this.setPublic(2)}>删除</a></span>
|
||||
<span className="bank_list_Tag">{item.course_list_name}</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
})
|
||||
}
|
||||
</div>
|
||||
{
|
||||
totalCount > 15 &&
|
||||
<div className="mt30 mb50 edu-txt-center">
|
||||
<Pagination showQuickJumper total={totalCount} onChange={this.changePage} pageSize={16} current={page}/>
|
||||
</div>
|
||||
}
|
||||
</Spin>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
import React, { Component } from 'react';
|
||||
import {Pagination,Spin,Checkbox,Modal} from 'antd';
|
||||
import moment from 'moment';
|
||||
import axios from 'axios';
|
||||
import NoneData from '../../courses/coursesPublic/NoneData'
|
||||
import {getImageUrl} from 'educoder';
|
||||
import "./usersInfo.css"
|
||||
import Modals from '../../modals/Modals'
|
||||
|
||||
const dateFormat ="YYYY-MM-DD HH:mm"
|
||||
class InfosBank extends Component{
|
||||
constructor(props){
|
||||
super(props);
|
||||
this.state={
|
||||
category:"common",
|
||||
type:"publicly",
|
||||
page:1,
|
||||
per_page:16,
|
||||
sort_by:"updated_at",
|
||||
CoursesId:undefined,
|
||||
|
||||
totalCount:undefined,
|
||||
data:undefined,
|
||||
isSpin:false,
|
||||
|
||||
dialogOpen:false,
|
||||
modalsTopval:undefined,
|
||||
modalsBottomval:undefined,
|
||||
modalSave:undefined
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount=()=>{
|
||||
this.setState({
|
||||
isSpin:true
|
||||
})
|
||||
let{category,type,page,sort_by,CoursesId}=this.state;
|
||||
this.getCourses(category,type,page,sort_by,CoursesId);
|
||||
}
|
||||
|
||||
getCourses=(category,type,page,sort_by,CoursesId)=>{
|
||||
let url=`/users/${this.props.match.params.username}/question_banks.json`;
|
||||
axios.get((url),{params:{
|
||||
category,
|
||||
type,
|
||||
page,
|
||||
sort_by,
|
||||
per_page:category && page ==1?17:16,
|
||||
course_list_id:CoursesId
|
||||
}}).then((result)=>{
|
||||
if(result){
|
||||
this.setState({
|
||||
totalCount:result.data.count,
|
||||
data:result.data,
|
||||
isSpin:false
|
||||
})
|
||||
}
|
||||
}).catch((error)=>{
|
||||
console.log(error);
|
||||
})
|
||||
}
|
||||
|
||||
//切换种类
|
||||
changeCategory=(cate)=>{
|
||||
this.setState({
|
||||
category:cate,
|
||||
page:1,
|
||||
isSpin:true
|
||||
})
|
||||
let{type,sort_by,CoursesId}=this.state;
|
||||
this.getCourses(cate,type,1,sort_by,CoursesId);
|
||||
}
|
||||
//切换状态
|
||||
changeType=(type)=>{
|
||||
this.setState({
|
||||
type:type,
|
||||
page:1,
|
||||
isSpin:true
|
||||
})
|
||||
let{category,sort_by,CoursesId}=this.state;
|
||||
this.getCourses(category,type,1,sort_by,CoursesId);
|
||||
}
|
||||
//切换页数
|
||||
changePage=(page)=>{
|
||||
this.setState({
|
||||
page,
|
||||
isSpin:true
|
||||
})
|
||||
let{category,type,sort_by,CoursesId}=this.state;
|
||||
this.getCourses(category,type,page,sort_by,CoursesId);
|
||||
}
|
||||
|
||||
// 进入课堂
|
||||
turnToCourses=(url)=>{
|
||||
this.props.history.push(url);
|
||||
}
|
||||
|
||||
// 切换排序方式
|
||||
changeOrder= (sort)=>{
|
||||
this.setState({
|
||||
sort_by:sort,
|
||||
isSpin:true
|
||||
})
|
||||
let{category,type,page,CoursesId}=this.state;
|
||||
this.getCourses(category,type,page,sort,CoursesId);
|
||||
}
|
||||
|
||||
changeCourseListId =(CoursesId)=>{
|
||||
this.setState({
|
||||
CoursesId,
|
||||
isSpin:true
|
||||
})
|
||||
let{category,type,sort,page}=this.state;
|
||||
this.getCourses(category,type,page,sort,CoursesId);
|
||||
}
|
||||
|
||||
//设为公开/删除
|
||||
setPublic=(index)=>{
|
||||
this.setState({
|
||||
dialogOpen:true,
|
||||
modalsTopval:index==1?"您确定要公开吗?":"确定要删除该题吗?",
|
||||
modalsBottomval:index==1?"公开后不能重设为私有":"",
|
||||
modalSave:()=>this.sureOperation(index)
|
||||
})
|
||||
}
|
||||
// 确定--设为公开/删除
|
||||
sureOperation=()=>{
|
||||
|
||||
}
|
||||
|
||||
//弹框隐藏
|
||||
handleDialogClose=()=>{
|
||||
this.setState({
|
||||
dialogOpen:false
|
||||
})
|
||||
}
|
||||
|
||||
render(){
|
||||
let{
|
||||
category,
|
||||
type,
|
||||
page,
|
||||
data,
|
||||
totalCount,
|
||||
sort_by,
|
||||
isSpin,
|
||||
CoursesId,
|
||||
dialogOpen,
|
||||
modalsTopval,
|
||||
modalsBottomval,modalSave
|
||||
} = this.state;
|
||||
let isStudent = this.props.isStudent();
|
||||
let is_current=this.props.is_current;
|
||||
return(
|
||||
<div className="educontent">
|
||||
<Modals
|
||||
modalsType={dialogOpen}
|
||||
modalsTopval={modalsTopval}
|
||||
modalsBottomval={modalsBottomval}
|
||||
modalCancel={this.handleDialogClose}
|
||||
modalSave={modalSave}
|
||||
></Modals>
|
||||
<Spin size="large" spinning={isSpin}>
|
||||
<div className="white-panel edu-back-white pt20 pb20 clearfix ">
|
||||
<li className={type=="publicly" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeType("publicly")}>{is_current ? "我":"TA"}的题库</a></li>
|
||||
<li className={type=="personal" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeType("personal")}>公共题库</a></li>
|
||||
</div>
|
||||
<div className="edu-back-white padding20-30 bor-top-greyE">
|
||||
<ul className="clearfix secondNav">
|
||||
<li className={category=="common" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("common")}>普通作业</a></li>
|
||||
<li className={category=="group" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("group")}>分组作业</a></li>
|
||||
<li className={category=="exercise" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("exercise")}>试卷</a></li>
|
||||
<li className={category=="poll" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("poll")}>问卷</a></li>
|
||||
</ul>
|
||||
<div className="edu-txt-left mt10 bankTag">
|
||||
<ul className="inline" id="sourceTag">
|
||||
<li className={ CoursesId ? "" : "active" } onClick={()=>this.changeCourseListId()}>
|
||||
<a href="javascript:void(0)">全部</a>
|
||||
</li>
|
||||
{
|
||||
data && data.course_list && data.course_list.map((item,key)=>{
|
||||
return(
|
||||
<li className={CoursesId==item.id?"active":""} key={key} onClick={()=>this.changeCourseListId(`${item.id}`)}>
|
||||
<a href="javascript:void(0)">{item.name}</a>
|
||||
</li>
|
||||
)
|
||||
})
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<p className="pl25 pr25 clearfix font-12 mb20 mt20">
|
||||
<span className="fl color-grey-9">共参与{totalCount}个题库</span>
|
||||
<div className="fr">
|
||||
<li className="drop_down">
|
||||
<span className="color-grey-9 font-12">{sort_by=="updated_at"?"时间最新":sort_by=="name"?"作业名称":"贡献者"}</span><i className="iconfont icon-xiajiantou font-12 ml2 color-grey-6"></i>
|
||||
<ul className="drop_down_normal">
|
||||
<li onClick={()=>this.changeOrder("updated_at")}>时间最新</li>
|
||||
<li onClick={()=>this.changeOrder("name")}>作业名称</li>
|
||||
<li onClick={()=>this.changeOrder("contributor")}>贡献者</li>
|
||||
</ul>
|
||||
</li>
|
||||
</div>
|
||||
</p>
|
||||
<div className="dataBank_list edu-back-white educontent">
|
||||
{
|
||||
!data || data.question_banks.length==0 && <NoneData></NoneData>
|
||||
}
|
||||
{
|
||||
data && data.question_banks && data.question_banks.map((item,key)=>{
|
||||
return(
|
||||
<div className="dataBank_Item clearfix" key={key}>
|
||||
<div className="fl dataItemLeft">
|
||||
<Checkbox value={item.id} key={item.id}></Checkbox>
|
||||
</div>
|
||||
<div className="fr dataItemRight bank_item">
|
||||
<p className="mb10 clearfix">
|
||||
<span className="dataTitle fl mr80">{item.name}</span>
|
||||
<a href="javascript:void(0)" data-object="2599" className="bank_send fr">发送</a>
|
||||
{
|
||||
item.is_public ==false ?
|
||||
<a href="javascript:void(0)" onClick={()=>this.setPublic(1)} className="bank_public color-blue_4C fr mr60">设为公开</a>:""
|
||||
}
|
||||
</p>
|
||||
<p className="itembottom clearfix">
|
||||
<span className="fl bottomspan color-grey-9">{item.quotes_count}次引用</span>
|
||||
<span className="fl bottomspan color-grey-9">{item.solve_count}次答题</span>
|
||||
<span className="fl bottomspan color-grey-9">{moment(item.updated_at).format('YYYY-MM-DD HH:mm')}</span>
|
||||
<span className="fr"><a href="javascript:void(0)" className="bank_delete color-grey-9" onClick={()=>this.setPublic(2)}>删除</a></span>
|
||||
<span className="bank_list_Tag">{item.course_list_name}</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
})
|
||||
}
|
||||
</div>
|
||||
{
|
||||
totalCount > 15 &&
|
||||
<div className="mt30 mb50 edu-txt-center">
|
||||
<Pagination showQuickJumper total={totalCount} onChange={this.changePage} pageSize={16} current={page}/>
|
||||
</div>
|
||||
}
|
||||
</Spin>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
export default InfosBank;
|
@ -1,115 +1,122 @@
|
||||
import React, { Component } from 'react';
|
||||
|
||||
import {Link} from 'react-router-dom';
|
||||
import {Tooltip,Menu} from 'antd';
|
||||
import {getImageUrl} from 'educoder';
|
||||
|
||||
import "./usersInfo.css"
|
||||
import "../../courses/css/members.css"
|
||||
import "../../courses/css/Courses.css"
|
||||
|
||||
import banner from '../../../images/account/infobanner.png'
|
||||
|
||||
class InfosBanner extends Component{
|
||||
constructor(props){
|
||||
super(props);
|
||||
}
|
||||
render(){
|
||||
let {
|
||||
data ,
|
||||
id,
|
||||
login,
|
||||
moduleName,
|
||||
current_user,
|
||||
}=this.props;
|
||||
let is_current=this.props.is_current;
|
||||
let {username}= this.props.match.params;
|
||||
let {pathname}=this.props.location;
|
||||
moduleName=pathname.split("/")[3];
|
||||
return(
|
||||
<div className="bannerPanel mb60">
|
||||
<div className="educontent">
|
||||
<div className="clearfix color-white mb25">
|
||||
<p className="myPhoto mr20 fl"><img alt="头像" src={data && `${getImageUrl('images/'+data.avatar_url)}`}/></p>
|
||||
<div className="fl">
|
||||
<p className="clearfix mt20">
|
||||
<span className="username task-hide" style={{"maxWidth":'370px'}}>{data && data.name}</span>
|
||||
{
|
||||
data && is_current == false && data.identity =="学生" ? "" :
|
||||
<span className="userpost"><label>{data && data.identity}</label></span>
|
||||
}
|
||||
</p>
|
||||
<p className="mt15">
|
||||
<Tooltip placement='bottom' title={ data && data.professional_certification ?"已职业认证":"未职业认证"}>
|
||||
<i className={ data && data.professional_certification ? "iconfont icon-shenfenzhenghaomaguizheng font-18 user-colorgrey-green mr20 ml2":"iconfont icon-shenfenzhenghaomaguizheng font-18 user-colorgrey-B8 mr20 ml2"}></i>
|
||||
</Tooltip>
|
||||
<Tooltip placement='bottom' title={ data && data.authentication ?"已实名认证":"未实名认证"}>
|
||||
<i className={ data && data.authentication ? "iconfont icon-renzhengshangjia font-18 user-colorgrey-green":"iconfont icon-renzhengshangjia font-18 user-colorgrey-B8"}></i>
|
||||
</Tooltip>
|
||||
</p>
|
||||
</div>
|
||||
<div className="fr">
|
||||
<div class="fl headtab mt20">
|
||||
<span>{is_current ? "我":"TA"}的经验值</span>
|
||||
<a style={{"cursor":"default"}}>{data && data.experience}</a>
|
||||
</div>
|
||||
<div class="fl headtab mt20 pr leftTransform pl20">
|
||||
<span>{is_current ? "我":"TA"}的金币</span>
|
||||
<a style={{"cursor":"default"}}>{data && data.grade}</a>
|
||||
</div>
|
||||
{
|
||||
is_current ?
|
||||
<span className="fl mt35 ml60">
|
||||
{
|
||||
data && data.attendance_signed ?
|
||||
<span className="user_default_btn user_grey_btn font-18">已签到</span>
|
||||
:
|
||||
<a herf="javascript:void(0);" onClick={this.props.signFor} className="user_default_btn user_yellow_btn fl font-18">签到</a>
|
||||
}
|
||||
</span>
|
||||
:
|
||||
<span className="fl mt35 ml60">
|
||||
<a href={`/messages/${login}/message_detail?target_ids=${id}`} className="user_default_btn user_yellow_btn fl font-18">私信</a>
|
||||
</span>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div className="userNav">
|
||||
<li className={`${moduleName == 'courses' ||moduleName == undefined ? 'active' : '' }`}>
|
||||
<Link
|
||||
onClick={() => this.setState({moduleName: 'courses'})}
|
||||
to={`/users/${username}/courses`}>翻转课堂</Link>
|
||||
</li>
|
||||
<li className={`${moduleName == 'shixuns' ? 'active' : '' }`}>
|
||||
<Link
|
||||
onClick={() => this.setState({moduleName: 'shixuns'})}
|
||||
to={`/users/${username}/shixuns`}>实训项目</Link>
|
||||
</li>
|
||||
<li className={`${moduleName == 'paths' ? 'active' : '' }`}>
|
||||
<Link
|
||||
onClick={() => this.setState({moduleName: 'paths'})}
|
||||
to={`/users/${username}/paths`}>实践课程</Link>
|
||||
</li>
|
||||
<li className={`${moduleName == 'projects' ? 'active' : '' }`}>
|
||||
<Link
|
||||
onClick={() => this.setState({moduleName: 'projects'})}
|
||||
to={`/users/${username}/projects`}>开发项目</Link>
|
||||
</li>
|
||||
<li className={`${moduleName == 'package' ? 'active' : '' }`}>
|
||||
<Link
|
||||
onClick={() => this.setState({moduleName: 'package'})}
|
||||
to={`/users/${username}/package`}>众包</Link>
|
||||
</li>
|
||||
{((is_current && current_user && current_user.is_teacher ) || current_user && current_user.admin)
|
||||
&& <li className={`${moduleName == 'videos' ? 'active' : '' }`}>
|
||||
<Link
|
||||
onClick={() => this.setState({moduleName: 'videos'})}
|
||||
to={`/users/${username}/videos`}>视频</Link>
|
||||
</li>}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
import React, { Component } from 'react';
|
||||
|
||||
import {Link} from 'react-router-dom';
|
||||
import {Tooltip,Menu} from 'antd';
|
||||
import {getImageUrl} from 'educoder';
|
||||
|
||||
import "./usersInfo.css"
|
||||
import "../../courses/css/members.css"
|
||||
import "../../courses/css/Courses.css"
|
||||
|
||||
import { LinkAfterLogin } from 'educoder'
|
||||
|
||||
class InfosBanner extends Component{
|
||||
constructor(props){
|
||||
super(props);
|
||||
}
|
||||
render(){
|
||||
let {
|
||||
data ,
|
||||
id,
|
||||
login,
|
||||
moduleName,
|
||||
current_user,
|
||||
}=this.props;
|
||||
let is_current=this.props.is_current;
|
||||
let {username}= this.props.match.params;
|
||||
let {pathname}=this.props.location;
|
||||
moduleName=pathname.split("/")[3];
|
||||
return(
|
||||
<div className="bannerPanel mb60">
|
||||
<div className="educontent">
|
||||
<div className="clearfix color-white mb25">
|
||||
<p className="myPhoto mr20 fl"><img alt="头像" src={data && `${getImageUrl('images/'+data.avatar_url)}`}/></p>
|
||||
<div className="fl">
|
||||
<p className="clearfix mt20">
|
||||
<span className="username task-hide" style={{"maxWidth":'370px'}}>{data && data.name}</span>
|
||||
{
|
||||
data && is_current == false && data.identity =="学生" ? "" :
|
||||
<span className="userpost"><label>{data && data.identity}</label></span>
|
||||
}
|
||||
</p>
|
||||
<p className="mt15">
|
||||
<Tooltip placement='bottom' title={ data && data.professional_certification ?"已职业认证":"未职业认证"}>
|
||||
<i className={ data && data.professional_certification ? "iconfont icon-shenfenzhenghaomaguizheng font-18 user-colorgrey-green mr20 ml2":"iconfont icon-shenfenzhenghaomaguizheng font-18 user-colorgrey-B8 mr20 ml2"}></i>
|
||||
</Tooltip>
|
||||
<Tooltip placement='bottom' title={ data && data.authentication ?"已实名认证":"未实名认证"}>
|
||||
<i className={ data && data.authentication ? "iconfont icon-renzhengshangjia font-18 user-colorgrey-green":"iconfont icon-renzhengshangjia font-18 user-colorgrey-B8"}></i>
|
||||
</Tooltip>
|
||||
</p>
|
||||
</div>
|
||||
<div className="fr">
|
||||
<div class="fl headtab mt20">
|
||||
<span>{is_current ? "我":"TA"}的经验值</span>
|
||||
<a style={{"cursor":"default"}}>{data && data.experience}</a>
|
||||
</div>
|
||||
<div class="fl headtab mt20 pr leftTransform pl20">
|
||||
<span>{is_current ? "我":"TA"}的金币</span>
|
||||
<a style={{"cursor":"default"}}>{data && data.grade}</a>
|
||||
</div>
|
||||
{
|
||||
is_current ?
|
||||
<span className="fl mt35 ml60">
|
||||
{
|
||||
data && data.attendance_signed ?
|
||||
<span className="user_default_btn user_grey_btn font-18">已签到</span>
|
||||
:
|
||||
<a herf="javascript:void(0);" onClick={this.props.signFor} className="user_default_btn user_yellow_btn fl font-18">签到</a>
|
||||
}
|
||||
</span>
|
||||
:
|
||||
<span className="fl mt35 ml60">
|
||||
<LinkAfterLogin
|
||||
{...this.props}
|
||||
{...this.state}
|
||||
className="user_default_btn user_yellow_btn fl font-18"
|
||||
to={`/messages/${login}/message_detail?target_ids=${id}`}
|
||||
>
|
||||
私信
|
||||
</LinkAfterLogin>
|
||||
</span>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div className="userNav">
|
||||
<li className={`${moduleName == 'courses' ||moduleName == undefined ? 'active' : '' }`}>
|
||||
<Link
|
||||
onClick={() => this.setState({moduleName: 'courses'})}
|
||||
to={`/users/${username}/courses`}>翻转课堂</Link>
|
||||
</li>
|
||||
<li className={`${moduleName == 'shixuns' ? 'active' : '' }`}>
|
||||
<Link
|
||||
onClick={() => this.setState({moduleName: 'shixuns'})}
|
||||
to={`/users/${username}/shixuns`}>开发社区</Link>
|
||||
</li>
|
||||
<li className={`${moduleName == 'paths' ? 'active' : '' }`}>
|
||||
<Link
|
||||
onClick={() => this.setState({moduleName: 'paths'})}
|
||||
to={`/users/${username}/paths`}>实践课程</Link>
|
||||
</li>
|
||||
<li className={`${moduleName == 'projects' ? 'active' : '' }`}>
|
||||
<Link
|
||||
onClick={() => this.setState({moduleName: 'projects'})}
|
||||
to={`/users/${username}/projects`}>项目</Link>
|
||||
</li>
|
||||
<li className={`${moduleName == 'package' ? 'active' : '' }`}>
|
||||
<Link
|
||||
onClick={() => this.setState({moduleName: 'package'})}
|
||||
to={`/users/${username}/package`}>众包</Link>
|
||||
</li>
|
||||
{((is_current && current_user && current_user.is_teacher ) || current_user && current_user.admin)
|
||||
&& <li className={`${moduleName == 'videos' ? 'active' : '' }`}>
|
||||
<Link
|
||||
onClick={() => this.setState({moduleName: 'videos'})}
|
||||
to={`/users/${username}/videos`}>视频</Link>
|
||||
</li>}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
export default InfosBanner;
|
@ -1,190 +1,190 @@
|
||||
import React, { Component } from 'react';
|
||||
|
||||
import {Link} from 'react-router-dom';
|
||||
import {Tooltip,Menu} from 'antd';
|
||||
import {getImageUrl} from 'educoder';
|
||||
|
||||
import "./usersInfo.css"
|
||||
import "../../courses/css/members.css"
|
||||
import "../../courses/css/Courses.css"
|
||||
class banner_out extends Component{
|
||||
constructor(props){
|
||||
super(props);
|
||||
}
|
||||
render(){
|
||||
let {
|
||||
data ,
|
||||
is_current,
|
||||
is_edit,
|
||||
sign,
|
||||
type,
|
||||
followed,
|
||||
id,
|
||||
login,
|
||||
moduleName,
|
||||
next_gold
|
||||
}=this.props;
|
||||
let {username}= this.props.match.params;
|
||||
return(
|
||||
<div className="user-main-half">
|
||||
<div className="user-headImg"></div>
|
||||
<div className="user-headCon">
|
||||
<div className="pr" style={{"min-height": "465px"}}>
|
||||
<div className="educontent pt80 clearfix edu-txt-center">
|
||||
<div className="inline">
|
||||
<div className="fl headtab">
|
||||
<span>{is_current ? "我":"TA"}的经验值</span>
|
||||
<a style={{ cursor: 'default' }}
|
||||
// href={`${this.props.Headertop && this.props.Headertop.old_url}/users/${username}/user_experience`}
|
||||
>{data && data.experience}</a>
|
||||
</div>
|
||||
<em className="v-h-line fl"></em>
|
||||
<div className="fl headtab">
|
||||
<span>{is_current ? "我":"TA"}的金币</span>
|
||||
<a style={{ cursor: 'default' }}
|
||||
// href={`${this.props.Headertop && this.props.Headertop.old_url}/users/${username}/user_grade`}
|
||||
id="user_code">{data && data.grade}</a>
|
||||
</div>
|
||||
<div className="headphoto mt14">
|
||||
<img alt="头像" id="user_avatar_show" nhname="avatar_image" src={data && `${getImageUrl('images/'+data.avatar_url)}`}/>
|
||||
</div>
|
||||
<div className="fl headtab">
|
||||
<span>{is_current ? "我":"TA"}的粉丝</span>
|
||||
<a style={{ cursor: 'default' }}
|
||||
// href={`${this.props.Headertop && this.props.Headertop.old_url}/users/${username}/user_fanslist`}
|
||||
id="user_h_fan_count">{data && data.fan_count}</a>
|
||||
</div>
|
||||
<em className="v-h-line fl"></em>
|
||||
<div className="fl headtab">
|
||||
<span>{is_current ? "我":"TA"}的关注</span>
|
||||
<a style={{ cursor: 'default' }}
|
||||
// href={`${this.props.Headertop && this.props.Headertop.old_url}/users/${username}/user_watchlist`}
|
||||
>{data && data.follow_count}</a>
|
||||
</div>
|
||||
<span className="clearfix"></span>
|
||||
<span className="myName">{data && data.name}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="educontent mt10 clearfix edu-txt-center">
|
||||
<div className="inline">
|
||||
{
|
||||
data && is_current == false && data.identity =="学生" ? "" : <span className="mypost fl mr10">{data && data.identity}</span>
|
||||
}
|
||||
<a
|
||||
// href={is_current ? `${this.props.Headertop && this.props.Headertop.old_url}/account/authentication` :"javascript:void(0)"}
|
||||
// target="_blank"
|
||||
className={is_current ? "ringauto fl" :"ringauto fl cdefault"}>
|
||||
<Tooltip placement='bottom' title={ data && data.authentication ?"已实名认证":"未实名认证"}>
|
||||
<i className={ data && data.authentication ? "iconfont icon-shenfenrenzheng font-13 color-blue":"iconfont icon-shenfenrenzheng font-13 color-grey-9"}></i>
|
||||
</Tooltip>
|
||||
</a>
|
||||
<a
|
||||
// href={is_current ? `${this.props.Headertop && this.props.Headertop.old_url}/account/professional_certification` :"javascript:void(0)"}
|
||||
// target="_blank"
|
||||
className={is_current ? "ringauto fl" :"ringauto fl cdefault"}>
|
||||
<Tooltip placement='bottom' title={ data && data.professional_certification ?"已职业认证":"未职业认证"}>
|
||||
<i className={ data && data.professional_certification ? "iconfont icon-zhiyerenzheng font-13 color-blue":"iconfont icon-zhiyerenzheng font-13 color-grey-9"}></i>
|
||||
</Tooltip>
|
||||
</a>
|
||||
<a
|
||||
// href={is_current ? `${this.props.Headertop && this.props.Headertop.old_url}/account/change_or_bind?type=phone` :"javascript:void(0)"}
|
||||
// target="_blank"
|
||||
className={is_current ? "ringauto fl" :"ringauto fl cdefault"}>
|
||||
<Tooltip placement='bottom' title={ data && data.phone_binded ?"已手机认证":"未手机认证"}>
|
||||
<i className={ data && data.phone_binded ? "iconfont icon-shoujirenzheng font-13 color-blue":"iconfont icon-shoujirenzheng font-13 color-grey-9"}></i>
|
||||
</Tooltip>
|
||||
</a>
|
||||
<a
|
||||
// href={is_current ? `${this.props.Headertop && this.props.Headertop.old_url}/my/account` :"javascript:void(0)"}
|
||||
// target="_blank"
|
||||
className={is_current ? "ringauto fl" :"ringauto fl cdefault"}>
|
||||
<Tooltip placement='bottom' title={ data && data.email_binded ?"已邮箱认证":"未邮箱认证"}>
|
||||
<i className={ data && data.email_binded ? "iconfont icon-youxiangrenzheng font-13 color-blue":"iconfont icon-youxiangrenzheng font-13 color-grey-9"}></i>
|
||||
</Tooltip>
|
||||
</a>
|
||||
{/* <!--学院管理员身份--> */}
|
||||
{
|
||||
data && data.college_identifier &&
|
||||
<a
|
||||
// href={`${this.props.Headertop && this.props.Headertop.old_url}/colleges/${data.college_identifier}/statistics`} target="_blank"
|
||||
className={is_current ? "ringauto fl" :"ringauto fl cdefault"}>
|
||||
<Tooltip placement='bottom' title="学院管理员">
|
||||
<i className="iconfont icon-chengyuanguanli font-12 color-blue" data-tip-down="学院管理员"></i>
|
||||
</Tooltip>
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div className="mt15 educontent clearfix edu-txt-center">
|
||||
<p className="mb20" style={{"height": "28px"}}>
|
||||
{
|
||||
is_edit && is_current ?
|
||||
<input type="text" id="mysign" class="mysign-input" placeholder="请输入您的个性签名" style={{height:"20px"}} value={sign} onInput={this.inputSign} onBlur={this.savemysign}/>
|
||||
:
|
||||
is_current ?
|
||||
<a className="mysign-span" onClick={this.editmysign} style={{"display": "block"}}>{sign || "这家伙很懒,什么都没留下~"}</a>
|
||||
:
|
||||
<span className="mysign-span" style={{"display": "block","cursor":"default"}}>{sign || "这家伙很懒,什么都没留下~"}</span>
|
||||
}
|
||||
</p>
|
||||
{
|
||||
is_current ?
|
||||
<div className="inline">
|
||||
{
|
||||
data && data.attendance_signed ?
|
||||
<React.Fragment>
|
||||
<span className="user_default_btn user_grey_btn mb5">已签到</span>
|
||||
<p id="attendance_notice" className="none font-12 color-grey-6" style={{"display":"block"}}>明日签到 <font className="color-orange">+{next_gold}</font> 金币</p>
|
||||
</React.Fragment>
|
||||
:
|
||||
<a herf="javascript:void(0);" onClick={this.props.signFor} id="attendance" className="user_default_btn user_orange_btn fl mb15">签到</a>
|
||||
// <a herf="javascript:void(0);" onClick={this.trialapplications} id="authentication_apply" className="user_default_btn user_private_btn fl ml15">试用申请</a>
|
||||
}
|
||||
</div>
|
||||
:
|
||||
<div className="inline">
|
||||
<a href="javascript:void(0);" onClick={this.props.followPerson} className="user_default_btn user_watch_btn user_private_btn fl mr20">{followed ? "取消关注":"关注"}</a>
|
||||
<a href={`${this.props.Headertop && this.props.Headertop.old_url}/messages/${login}/message_detail?target_ids=${id}`} className="user_default_btn user_private_btn fl">私信</a>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div className="edu-txt-center navInfo">
|
||||
<div className="inline">
|
||||
<li className={`${moduleName == 'courses' ||moduleName == undefined ? 'active' : '' }`}>
|
||||
<Link
|
||||
onClick={() => this.setState({moduleName: 'courses'})}
|
||||
to={`/users/${username}/courses`}>课堂</Link>
|
||||
</li>
|
||||
<li className={`${moduleName == 'shixuns' ? 'active' : '' }`}>
|
||||
<Link
|
||||
onClick={() => this.setState({moduleName: 'shixuns'})}
|
||||
to={`/users/${username}/shixuns`}>实训</Link>
|
||||
</li>
|
||||
<li className={`${moduleName == 'paths' ? 'active' : '' }`}>
|
||||
<Link
|
||||
onClick={() => this.setState({moduleName: 'paths'})}
|
||||
to={`/users/${username}/paths`}>实践课程</Link>
|
||||
</li>
|
||||
<li className={`${moduleName == 'projects' ? 'active' : '' }`}>
|
||||
<Link
|
||||
onClick={() => this.setState({moduleName: 'projects'})}
|
||||
to={`/users/${username}/projects`}>开发项目</Link>
|
||||
</li>
|
||||
|
||||
<li className={`${moduleName == 'package' ? 'active' : '' }`}>
|
||||
<Link
|
||||
onClick={() => this.setState({moduleName: 'package'})}
|
||||
to={`/users/${username}/package`}>众包</Link>
|
||||
</li>
|
||||
|
||||
{/*{ data && data.identity!="学生" && <li> <a href={`${this.props.Headertop && this.props.Headertop.old_url}/users/${username}?type=m_bank`}>题库</a></li>}*/}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
import React, { Component } from 'react';
|
||||
|
||||
import {Link} from 'react-router-dom';
|
||||
import {Tooltip,Menu} from 'antd';
|
||||
import {getImageUrl} from 'educoder';
|
||||
|
||||
import "./usersInfo.css"
|
||||
import "../../courses/css/members.css"
|
||||
import "../../courses/css/Courses.css"
|
||||
class banner_out extends Component{
|
||||
constructor(props){
|
||||
super(props);
|
||||
}
|
||||
render(){
|
||||
let {
|
||||
data ,
|
||||
is_current,
|
||||
is_edit,
|
||||
sign,
|
||||
type,
|
||||
followed,
|
||||
id,
|
||||
login,
|
||||
moduleName,
|
||||
next_gold
|
||||
}=this.props;
|
||||
let {username}= this.props.match.params;
|
||||
return(
|
||||
<div className="user-main-half">
|
||||
<div className="user-headImg"></div>
|
||||
<div className="user-headCon">
|
||||
<div className="pr" style={{"min-height": "465px"}}>
|
||||
<div className="educontent pt80 clearfix edu-txt-center">
|
||||
<div className="inline">
|
||||
<div className="fl headtab">
|
||||
<span>{is_current ? "我":"TA"}的经验值</span>
|
||||
<a style={{ cursor: 'default' }}
|
||||
// href={`${this.props.Headertop && this.props.Headertop.old_url}/users/${username}/user_experience`}
|
||||
>{data && data.experience}</a>
|
||||
</div>
|
||||
<em className="v-h-line fl"></em>
|
||||
<div className="fl headtab">
|
||||
<span>{is_current ? "我":"TA"}的金币</span>
|
||||
<a style={{ cursor: 'default' }}
|
||||
// href={`${this.props.Headertop && this.props.Headertop.old_url}/users/${username}/user_grade`}
|
||||
id="user_code">{data && data.grade}</a>
|
||||
</div>
|
||||
<div className="headphoto mt14">
|
||||
<img alt="头像" id="user_avatar_show" nhname="avatar_image" src={data && `${getImageUrl('images/'+data.avatar_url)}`}/>
|
||||
</div>
|
||||
<div className="fl headtab">
|
||||
<span>{is_current ? "我":"TA"}的粉丝</span>
|
||||
<a style={{ cursor: 'default' }}
|
||||
// href={`${this.props.Headertop && this.props.Headertop.old_url}/users/${username}/user_fanslist`}
|
||||
id="user_h_fan_count">{data && data.fan_count}</a>
|
||||
</div>
|
||||
<em className="v-h-line fl"></em>
|
||||
<div className="fl headtab">
|
||||
<span>{is_current ? "我":"TA"}的关注</span>
|
||||
<a style={{ cursor: 'default' }}
|
||||
// href={`${this.props.Headertop && this.props.Headertop.old_url}/users/${username}/user_watchlist`}
|
||||
>{data && data.follow_count}</a>
|
||||
</div>
|
||||
<span className="clearfix"></span>
|
||||
<span className="myName">{data && data.name}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="educontent mt10 clearfix edu-txt-center">
|
||||
<div className="inline">
|
||||
{
|
||||
data && is_current == false && data.identity =="学生" ? "" : <span className="mypost fl mr10">{data && data.identity}</span>
|
||||
}
|
||||
<a
|
||||
// href={is_current ? `${this.props.Headertop && this.props.Headertop.old_url}/account/authentication` :"javascript:void(0)"}
|
||||
// target="_blank"
|
||||
className={is_current ? "ringauto fl" :"ringauto fl cdefault"}>
|
||||
<Tooltip placement='bottom' title={ data && data.authentication ?"已实名认证":"未实名认证"}>
|
||||
<i className={ data && data.authentication ? "iconfont icon-shenfenrenzheng font-13 color-blue":"iconfont icon-shenfenrenzheng font-13 color-grey-9"}></i>
|
||||
</Tooltip>
|
||||
</a>
|
||||
<a
|
||||
// href={is_current ? `${this.props.Headertop && this.props.Headertop.old_url}/account/professional_certification` :"javascript:void(0)"}
|
||||
// target="_blank"
|
||||
className={is_current ? "ringauto fl" :"ringauto fl cdefault"}>
|
||||
<Tooltip placement='bottom' title={ data && data.professional_certification ?"已职业认证":"未职业认证"}>
|
||||
<i className={ data && data.professional_certification ? "iconfont icon-zhiyerenzheng font-13 color-blue":"iconfont icon-zhiyerenzheng font-13 color-grey-9"}></i>
|
||||
</Tooltip>
|
||||
</a>
|
||||
<a
|
||||
// href={is_current ? `${this.props.Headertop && this.props.Headertop.old_url}/account/change_or_bind?type=phone` :"javascript:void(0)"}
|
||||
// target="_blank"
|
||||
className={is_current ? "ringauto fl" :"ringauto fl cdefault"}>
|
||||
<Tooltip placement='bottom' title={ data && data.phone_binded ?"已手机认证":"未手机认证"}>
|
||||
<i className={ data && data.phone_binded ? "iconfont icon-shoujirenzheng font-13 color-blue":"iconfont icon-shoujirenzheng font-13 color-grey-9"}></i>
|
||||
</Tooltip>
|
||||
</a>
|
||||
<a
|
||||
// href={is_current ? `${this.props.Headertop && this.props.Headertop.old_url}/my/account` :"javascript:void(0)"}
|
||||
// target="_blank"
|
||||
className={is_current ? "ringauto fl" :"ringauto fl cdefault"}>
|
||||
<Tooltip placement='bottom' title={ data && data.email_binded ?"已邮箱认证":"未邮箱认证"}>
|
||||
<i className={ data && data.email_binded ? "iconfont icon-youxiangrenzheng font-13 color-blue":"iconfont icon-youxiangrenzheng font-13 color-grey-9"}></i>
|
||||
</Tooltip>
|
||||
</a>
|
||||
{/* <!--学院管理员身份--> */}
|
||||
{
|
||||
data && data.college_identifier &&
|
||||
<a
|
||||
// href={`${this.props.Headertop && this.props.Headertop.old_url}/colleges/${data.college_identifier}/statistics`} target="_blank"
|
||||
className={is_current ? "ringauto fl" :"ringauto fl cdefault"}>
|
||||
<Tooltip placement='bottom' title="学院管理员">
|
||||
<i className="iconfont icon-chengyuanguanli font-12 color-blue" data-tip-down="学院管理员"></i>
|
||||
</Tooltip>
|
||||
</a>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div className="mt15 educontent clearfix edu-txt-center">
|
||||
<p className="mb20" style={{"height": "28px"}}>
|
||||
{
|
||||
is_edit && is_current ?
|
||||
<input type="text" id="mysign" class="mysign-input" placeholder="请输入您的个性签名" style={{height:"20px"}} value={sign} onInput={this.inputSign} onBlur={this.savemysign}/>
|
||||
:
|
||||
is_current ?
|
||||
<a className="mysign-span" onClick={this.editmysign} style={{"display": "block"}}>{sign || "这家伙很懒,什么都没留下~"}</a>
|
||||
:
|
||||
<span className="mysign-span" style={{"display": "block","cursor":"default"}}>{sign || "这家伙很懒,什么都没留下~"}</span>
|
||||
}
|
||||
</p>
|
||||
{
|
||||
is_current ?
|
||||
<div className="inline">
|
||||
{
|
||||
data && data.attendance_signed ?
|
||||
<React.Fragment>
|
||||
<span className="user_default_btn user_grey_btn mb5">已签到</span>
|
||||
<p id="attendance_notice" className="none font-12 color-grey-6" style={{"display":"block"}}>明日签到 <font className="color-orange">+{next_gold}</font> 金币</p>
|
||||
</React.Fragment>
|
||||
:
|
||||
<a herf="javascript:void(0);" onClick={this.props.signFor} id="attendance" className="user_default_btn user_orange_btn fl mb15">签到</a>
|
||||
// <a herf="javascript:void(0);" onClick={this.trialapplications} id="authentication_apply" className="user_default_btn user_private_btn fl ml15">试用申请</a>
|
||||
}
|
||||
</div>
|
||||
:
|
||||
<div className="inline">
|
||||
<a href="javascript:void(0);" onClick={this.props.followPerson} className="user_default_btn user_watch_btn user_private_btn fl mr20">{followed ? "取消关注":"关注"}</a>
|
||||
<a href={`${this.props.Headertop && this.props.Headertop.old_url}/messages/${login}/message_detail?target_ids=${id}`} className="user_default_btn user_private_btn fl">私信</a>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div className="edu-txt-center navInfo">
|
||||
<div className="inline">
|
||||
<li className={`${moduleName == 'courses' ||moduleName == undefined ? 'active' : '' }`}>
|
||||
<Link
|
||||
onClick={() => this.setState({moduleName: 'courses'})}
|
||||
to={`/users/${username}/courses`}>课堂</Link>
|
||||
</li>
|
||||
<li className={`${moduleName == 'shixuns' ? 'active' : '' }`}>
|
||||
<Link
|
||||
onClick={() => this.setState({moduleName: 'shixuns'})}
|
||||
to={`/users/${username}/shixuns`}>实训</Link>
|
||||
</li>
|
||||
<li className={`${moduleName == 'paths' ? 'active' : '' }`}>
|
||||
<Link
|
||||
onClick={() => this.setState({moduleName: 'paths'})}
|
||||
to={`/users/${username}/paths`}>实践课程</Link>
|
||||
</li>
|
||||
<li className={`${moduleName == 'projects' ? 'active' : '' }`}>
|
||||
<Link
|
||||
onClick={() => this.setState({moduleName: 'projects'})}
|
||||
to={`/users/${username}/projects`}>开发项目</Link>
|
||||
</li>
|
||||
|
||||
<li className={`${moduleName == 'package' ? 'active' : '' }`}>
|
||||
<Link
|
||||
onClick={() => this.setState({moduleName: 'package'})}
|
||||
to={`/users/${username}/package`}>众包</Link>
|
||||
</li>
|
||||
|
||||
{/*{ data && data.identity!="学生" && <li> <a href={`${this.props.Headertop && this.props.Headertop.old_url}/users/${username}?type=m_bank`}>题库</a></li>}*/}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
export default banner_out;
|
@ -0,0 +1,6 @@
|
||||
/*global __webpack_public_path__ */
|
||||
if (window._enableCDN && window.location.host == 'pre-newweb.educoder.net') {
|
||||
__webpack_public_path__ = 'http://testali-cdn.educoder.net/react/build/'
|
||||
} else if (window._enableCDN && window.location.host == 'www.educoder.net') {
|
||||
__webpack_public_path__ = 'https://ali-newweb.educoder.net/react/build/'
|
||||
}
|
Loading…
Reference in new issue