diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 64833a14..b0088d44 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -80,7 +80,7 @@ class AccountController < ApplicationController set_autologin_cookie(@user) end # 记录用户登录行为 - UserActions.create(:action_id => @user.id, :action_type => "Login", :user_id => @user.id) + UserActions.create(:action_id => @user.id, :action_type => "Login", :user_id => @user.id, :ip => request.remote_ip) end respond_to do |format| format.js @@ -381,6 +381,7 @@ class AccountController < ApplicationController ip = request.remote_ip ua = UserAgent.find_by_ip(ip) ua.update_column(:agent_type, UserAgent::USER_REGISTER) if ua + UserActions.create(:action_id => @user.id, :action_type => "Register", :user_id => @user.id, :ip => ip) if !@user.new_record? self.logged_user = @user flash[:notice] = l(:notice_account_activated) @@ -1403,7 +1404,7 @@ class AccountController < ApplicationController code = /\d*/ # 记录用户登录行为 - UserActions.create(:action_id => User.current.id, :action_type => "Login", :user_id => User.current.id) + UserActions.create(:action_id => User.current.id, :action_type => "Login", :user_id => User.current.id, :ip => request.remote_ip) =begin if user.created_on.strftime('%Y-%m-%d %H:%M:%S') > "2018-01-01 00:00:00" && user.phone.blank? redirect_to change_or_bind_path(:type => 'phone') diff --git a/app/controllers/colleges_controller.rb b/app/controllers/colleges_controller.rb index 418015fd..4bc6cd87 100644 --- a/app/controllers/colleges_controller.rb +++ b/app/controllers/colleges_controller.rb @@ -67,12 +67,12 @@ class CollegesController < ApplicationController user_extensions.`school_id`=#{@school.id}) and work_status between 1 and 2 and myshixun_id !=0").first.try(:sw_count) @teachers = User.find_by_sql("SELECT users.id, users.login, users.lastname, users.firstname, users.nickname, IFNULL((SELECT count(shixuns.id) FROM shixuns where shixuns.user_id =users.id group by shixuns.user_id), 0) AS publish_shixun_count, - (SELECT count(c.id) FROM courses c, members m, member_roles mr WHERE m.course_id = c.id AND m.id=mr.member_id AND mr.role_id in (3,7,9) AND m.user_id=users.id AND c.is_delete = 0) as course_count + (SELECT count(c.id) FROM courses c, members m, member_roles mr WHERE c.id != 1309 and m.course_id = c.id AND m.id=mr.member_id AND mr.role_id in (3,7,9) and c.school_id = #{@school.id} AND m.user_id=users.id AND c.is_delete = 0) as course_count FROM `users`, user_extensions ue where users.id=ue.user_id and ue.identity=0 and ue.school_id=#{@school.id} ORDER BY publish_shixun_count desc, course_count desc, id desc LIMIT 10") # ).order("publish_shixun_count desc, experience desc").limit(10) @teachers = @teachers.map do |teacher| - course_ids = Course.find_by_sql("SELECT c.id FROM courses c, members m, member_roles mr WHERE c.id != 1309 and m.course_id = c.id AND m.id=mr.member_id AND mr.role_id in (3,7,9) AND m.user_id=#{teacher.id} AND c.is_delete = 0") + course_ids = Course.find_by_sql("SELECT c.id FROM courses c, members m, member_roles mr WHERE c.id != 1309 and m.course_id = c.id AND m.id=mr.member_id AND mr.role_id in (3,7,9) AND m.user_id=#{teacher.id} AND c.is_delete = 0 and c.school_id = #{@school.id}") course_count = course_ids.size homeworks = HomeworkCommon.where(:homework_type => 4, :course_id => course_ids.map(&:id)) un_shixun_work_count = homeworks.where("publish_time > '#{Time.now}' or publish_time is null").count diff --git a/app/controllers/competition_teams_controller.rb b/app/controllers/competition_teams_controller.rb index 06d504b2..c285fba7 100644 --- a/app/controllers/competition_teams_controller.rb +++ b/app/controllers/competition_teams_controller.rb @@ -228,9 +228,9 @@ class CompetitionTeamsController < ApplicationController end team.team_members.create!(user_id: User.current.id, role: 2, competition_id: @competition.id) - # 记录引流 - record_agent_user_action end + # 记录引流 + record_agent_user_action end # 退出战队 非创建者直接退出,创建者退出则解散团队 diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb index 4feaa3d0..c0abee20 100644 --- a/app/controllers/welcome_controller.rb +++ b/app/controllers/welcome_controller.rb @@ -40,6 +40,20 @@ class WelcomeController < ApplicationController render :json => {status: 0, message: "success"} end + # 运营引流个人数据展示 + def user_agents + @user_agents = UserAgent.where(key: params[:edu]).includes(:user_actionss) + @agents_count = @user_agents.count + limit = 20 + @agents_pages = Paginator.new @agents_count, limit, params['page'] || 1 + @offset ||= @agents_pages.offset + @user_agents = paginateHelper @user_agents, limit + respond_to do |format| + format.js + format.html{ render :layout=>'users_base'} + end + end + def shixun_to_local identifiers = params[:identifiers].split(",") diff --git a/app/helpers/colleges_helper.rb b/app/helpers/colleges_helper.rb index 49a7fdc2..f7238ce6 100644 --- a/app/helpers/colleges_helper.rb +++ b/app/helpers/colleges_helper.rb @@ -14,4 +14,13 @@ module CollegesHelper end type end + + def course_managers teachers + str = "" + teachers.each_with_index do |teacher, index| + str += "、" if index > 0 + str += teacher.user.try(:show_real_name) + end + str + end end diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb index 2306adb9..395bb07a 100644 --- a/app/helpers/welcome_helper.rb +++ b/app/helpers/welcome_helper.rb @@ -22,6 +22,27 @@ module WelcomeHelper include CoursesHelper include ProjectsHelper + # 引流注册情况 + def register_info user_agent + if user_agent.agent_type.to_i == UserAgent::USER_AD + user_id = user_agent.user_actionss.first.try(:user_id) + if user_id && User.where("id = #{user_id} and created_on < '2019-07-15 00:00:00'").present? + "代理前注册" + else + "未转换" + end + elsif user_agent.agent_type.to_i == UserAgent::USER_REGISTER || UserActions.find_by_ip(user_agent.ip) + "代理后注册" + else + user_id = user_agent.user_actionss.first.try(:user_id) + if user_id && User.where("id = #{user_id} and created_on < '2019-07-15 00:00:00'").present? + "代理前注册" + else + "代理后注册" + end + end + end + def color_change index case index when 0 diff --git a/app/models/user_actions.rb b/app/models/user_actions.rb index de238891..66c83f39 100644 --- a/app/models/user_actions.rb +++ b/app/models/user_actions.rb @@ -1,4 +1,4 @@ class UserActions < ActiveRecord::Base - attr_accessible :action_id, :action_type, :user_id + attr_accessible :action_id, :action_type, :user_id, :ip has_many :users end diff --git a/app/models/user_agent.rb b/app/models/user_agent.rb index acc45a8a..3bb16582 100644 --- a/app/models/user_agent.rb +++ b/app/models/user_agent.rb @@ -1,5 +1,5 @@ class UserAgent < ActiveRecord::Base - + has_many :user_actionss, :foreign_key => "ip", :primary_key => "ip" USER_AD = 1 # 广告宣传的引流 USER_REGISTER = 2 # 引流注册 USER_COMPETITION = 3 # 引流参加竞赛 diff --git a/app/views/colleges/_course_statistics.html.erb b/app/views/colleges/_course_statistics.html.erb index d112c839..67e989f3 100644 --- a/app/views/colleges/_course_statistics.html.erb +++ b/app/views/colleges/_course_statistics.html.erb @@ -2,7 +2,7 @@ - + @@ -16,7 +16,9 @@ <% @courses.each do |course| %> - + diff --git a/app/views/colleges/statistics.html.erb b/app/views/colleges/statistics.html.erb index 98c5be73..3c842539 100644 --- a/app/views/colleges/statistics.html.erb +++ b/app/views/colleges/statistics.html.erb @@ -100,7 +100,12 @@

在线实训情况

-
+ <% if @shixun_tags_name.size == 0 %> + <%= render :partial => 'welcome/no_data' %> +
+ <% else %> +
+ <% end %>
diff --git a/app/views/competitions/_competitions_name.html.erb b/app/views/competitions/_competitions_name.html.erb new file mode 100644 index 00000000..8597b4fc --- /dev/null +++ b/app/views/competitions/_competitions_name.html.erb @@ -0,0 +1,42 @@ + +
+
+ +
+
+ + diff --git a/app/views/competitions/_team_list.html.erb b/app/views/competitions/_team_list.html.erb index ba445c7b..f2134708 100644 --- a/app/views/competitions/_team_list.html.erb +++ b/app/views/competitions/_team_list.html.erb @@ -19,10 +19,10 @@ <% team.teachers.each do |teacher| %> <%= link_to image_tag(url_to_avatar(teacher.user), width: 26, height: 26, class: 'radius fl mr4'), user_path(teacher.user), class: 'fl', target: '_blank', data: { 'tip-down' => "指导老师:#{teacher.user.show_name}" } %> <% end %> - <% team.members.each do |member| %> + <% team.members[0, 8].each do |member| %> <%= link_to image_tag(url_to_avatar(member.user), :width => "20", :height => "20", :class => "radius fl mr4 mt3"), user_path(member.user), :title => member.user.show_name, :target => "_blank", :class => "fl", :alt => "用户头像" %> <% end %> - <% if team.members.size > 9 %> + <% if team.members.size > 8 %> ... <% end %> diff --git a/app/views/competitions/competitionsName.html.erb.html b/app/views/competitions/competitionsName.html.erb.html deleted file mode 100644 index e0248043..00000000 --- a/app/views/competitions/competitionsName.html.erb.html +++ /dev/null @@ -1,24 +0,0 @@ - -
-
- -
-
- - diff --git a/app/views/competitions/enroll.html.erb b/app/views/competitions/enroll.html.erb index 69bedd2f..ee439267 100644 --- a/app/views/competitions/enroll.html.erb +++ b/app/views/competitions/enroll.html.erb @@ -76,10 +76,10 @@ <% if team.teacher_id.present? %> <%= image_tag(url_to_avatar(team.teacher), :width => "26", :height => "26", :class => "radius fl mr4") %> <% end %> - <% team.team_members.where("user_id != #{team.teacher_id.present? ? team.teacher_id : '-1'}")[0, 9].each do |member| %> + <% team.team_members.where("user_id != #{team.teacher_id.present? ? team.teacher_id : '-1'}")[0, 8].each do |member| %> <%= link_to image_tag(url_to_avatar(member.user), :width => "20", :height => "20", :class => "radius fl mr5 mt3"), user_path(member.user), :title => member.user.show_name, :target => "_blank", :class => "fl", :alt => "用户头像" %> <% end %> - <% if team.team_members.size > 9 %> + <% if team.team_members.size > 8 %> <% end %> diff --git a/app/views/layouts/_logined_header.html.erb b/app/views/layouts/_logined_header.html.erb index 3e4c08da..795adc11 100644 --- a/app/views/layouts/_logined_header.html.erb +++ b/app/views/layouts/_logined_header.html.erb @@ -23,7 +23,7 @@
  • "><%= link_to "教学案例", libraries_path %>
  • -
  • "><%= link_to "众包任务", project_packages_path %>
  • +
  • "><%= link_to "众包创新", project_packages_path %>
  • "><%= link_to "交流问答", forums_path %>
  • <% if User.current.ec_school.present? %>
  • " id="ec_banner"> @@ -129,6 +129,20 @@ <% end %> <% end %> + var begin_time = new Date(); + var end_time = new Date("2019-10-10"); + if (begin_time < end_time) { + if (window.localStorage) { + var uid = localStorage.getItem('competition_uid'); + } else { + var uid = false + } + if (!uid) { + var htmlvalue = "<%= escape_javascript(render :partial => 'competitions/competitions_name')%>"; + pop_box_new(htmlvalue, 500, 380); + } + } + <% notice = SystemUpdateNotice.last %> <% if @noticed_update || ((User.current.certification == 1 || params[:controller] != "welcome") && notice.present? && notice.end_time > Time.now && notice.start_time >= (Time.now - 21600) && User.current.user_system_notices.where(:notice_type => notice.notice_type).count == 0) %> diff --git a/app/views/layouts/_unlogin_header.html.erb b/app/views/layouts/_unlogin_header.html.erb index b69a87ec..37f49dfe 100644 --- a/app/views/layouts/_unlogin_header.html.erb +++ b/app/views/layouts/_unlogin_header.html.erb @@ -24,7 +24,7 @@
  • "><%= link_to "教学案例", libraries_path %>
  • -
  • "><%= link_to "众包任务", project_packages_path %>
  • +
  • "><%= link_to "众包创新", project_packages_path %>
  • "><%= link_to "交流问答", forums_path %>
  • @@ -93,4 +93,17 @@ var sl=-Math.max(document.body.scrollLeft,document.documentElement.scrollLeft); document.getElementById('nHeader').style.left=sl+'px'; }; + + $(function() { + if (window.localStorage) { + var uid = localStorage.getItem('competition_uid'); + } else { + var uid = false + } + if(!uid){ + var htmlvalue = "<%= escape_javascript(render :partial => 'competitions/competitions_name')%>"; + pop_box_new(htmlvalue, 500, 380); + } + }) + \ No newline at end of file diff --git a/app/views/libraries/_form.html.erb b/app/views/libraries/_form.html.erb index 6a1afdef..c71bc7c1 100644 --- a/app/views/libraries/_form.html.erb +++ b/app/views/libraries/_form.html.erb @@ -70,11 +70,11 @@ <%= hidden_field_tag 'cover_file_name', '', class: 'cover-file-name' %> -
    +
    <% cover_url = cover_exists ? download_attachment_path(@library.cover_id) : '' %> - +
    @@ -140,13 +140,14 @@ var submitForm = function(){ var title = $("input[name='library[title]']").val(); var content = $("textarea[name='library[content]']").val(); - var author_name = $("input[name='library[author_name]']").val(); - var author_school_name = $("input[name='library[author_school_name]']").val(); - var cover_file = $("input[name='cover_file").val(); + var author_name = $("input[name='library[author_name]']").val(); + var author_school_name = $("input[name='library[author_school_name]']").val(); + var cover_file = $("input[name='cover_file").val(); if (!title || title.length == 0) { $("#title_notice").removeClass("none"); $("#title_notice").html("请输入标题"); + $(document).scrollTop(parseInt($("#title_notice").offset().top)-150); return }else{ $("#title_notice").addClass("none"); @@ -163,29 +164,33 @@ if (!content || content.length == 0) { $("#des_notice").removeClass("none"); + $(document).scrollTop(parseInt($("#des_notice").offset().top)-150); return }else{ $("#des_notice").addClass("none"); } - if (!author_name || author_name.length == 0) { - $("#author_name_notice").removeClass("none"); - return - }else{ - $("#author_name_notice").addClass("none"); - } - - if (!author_name || author_name.length >10) { - $("#title_author_name").removeClass("none"); + if (!author_name || author_name.length == 0) { + $("#author_name_notice").removeClass("none"); + $(document).scrollTop(parseInt($("#author_name_notice").offset().top)-150); return - }else{ - $("#title_author_name").addClass("none"); - } + }else{ + $("#author_name_notice").addClass("none"); + } + + if (!author_name || author_name.length >10) { + $("#title_author_name").removeClass("none"); + $(document).scrollTop(parseInt($("#title_author_name").offset().top)-150); + return + }else{ + $("#title_author_name").addClass("none"); + } if (!author_school_name || author_school_name.length == 0) { $("#author_school_name_notice").removeClass("none"); + $(document).scrollTop(parseInt($("#author_school_name_notice").offset().top)-150); return }else{ $("#author_school_name_notice").addClass("none"); @@ -201,6 +206,7 @@ if($('.attachments_fields .attachment').length == 0){ $("#file_notice").removeClass("none"); + $(document).scrollTop(parseInt($("#file_notice").offset().top)-150); return }else{ $("#file_notice").addClass("none"); diff --git a/app/views/libraries/_library_list.html.erb b/app/views/libraries/_library_list.html.erb index fc0e6e62..b5551966 100644 --- a/app/views/libraries/_library_list.html.erb +++ b/app/views/libraries/_library_list.html.erb @@ -9,24 +9,24 @@ <%= link_to library.title, library_path(library),:class => "task-hide font-22 library_l_name" %> <%= show_library_tags(library, class: 'mt10 ml10') %> - <% if params[:type] == 'mine' %> - 上传时间:<%= library.created_at.strftime('%Y-%m-%d %H:%M') %> - <% else %> - 发布时间:<%= library.published_at.try(:strftime, '%Y-%m-%d %H:%M') %> - <% end %> + <%# if params[:type] == 'mine' %> + + <%# else %> + + <%# end %>

    - 作者: + <%= library.author_name %> <%= library.author_school_name %> - <%= library.visited_count || 0 %> 浏览 <% download_count = @download_count_map.try(:fetch, library.id, 0) || library.attachments.count %> <% if download_count.nonzero? %> - <%= download_count %> 下载 + <%= download_count %> 下载 <% end %> <% if library.praise_tread_cache.try(:praise_num).to_i.nonzero? %> - <%= library.praise_tread_cache.try(:praise_num) %> 赞 + <%= library.praise_tread_cache.try(:praise_num) %> 赞 <% end %> + <%= library.visited_count || 0 %> 浏览

    diff --git a/app/views/libraries/index.html.erb b/app/views/libraries/index.html.erb index 087ae03c..3a277f0b 100644 --- a/app/views/libraries/index.html.erb +++ b/app/views/libraries/index.html.erb @@ -1,54 +1,54 @@ - -
    -
    -

    - 教学案例 - <%= link_to '发布案例', new_library_path, class: 'white-btn edu-filter-btn-blue fr mr10 mt8', style: 'color: #4CACFF' %> -

    -
    - <% if User.current.try(:logged?) %> -
      -
    • - <%= link_to '全部', libraries_path(search: params[:search]), remote: true %> -
    • -
    • - <%= link_to '我的', libraries_path(search: params[:search], type: 'mine'), remote: true %> -
    • -
    - <% end %> -
    - <%= hidden_field_tag(:type, params[:type]) %> - - -
    -
    -
    -
    - <%= render partial: 'library_list' %> -
    -
    - \ No newline at end of file diff --git a/app/views/managements/_reject_authorization_model.html.erb b/app/views/managements/_reject_authorization_model.html.erb index 6d7468f4..93389cd8 100644 --- a/app/views/managements/_reject_authorization_model.html.erb +++ b/app/views/managements/_reject_authorization_model.html.erb @@ -125,7 +125,7 @@ modal.hide(); }; // 隐藏弹窗 - modal.on("click", '.mask', hideRejectModalFunc); + // modal.on("click", '.mask', hideRejectModalFunc); modal.on("click", '.cancel-btn', hideRejectModalFunc); }) diff --git a/app/views/users/_returnTop_btn.html.erb b/app/views/users/_returnTop_btn.html.erb index 9bdc31d6..9a3c7c32 100644 --- a/app/views/users/_returnTop_btn.html.erb +++ b/app/views/users/_returnTop_btn.html.erb @@ -30,9 +30,35 @@ -
    +
    + + + -
    \ No newline at end of file +
    + diff --git a/app/views/welcome/_user_agent_list.html.erb b/app/views/welcome/_user_agent_list.html.erb new file mode 100644 index 00000000..34792244 --- /dev/null +++ b/app/views/welcome/_user_agent_list.html.erb @@ -0,0 +1,32 @@ +
    名称创建教师管理教师 评测次数 学生 实训作业
    <%= course.name %><%= course.username %> + <%= course_managers course.teachers %> + <%= course.evaluating_count %> <%= course.student_count.to_i %> <%= course.hcm_count.to_i %>
    + + + + + + + + + + <% @user_agents.each_with_index do |ua, index| %> + <% user = User.find_by_login(ua.key) %> + + + + + + + + + <% end %> + +
    ID代理人登录名代理人姓名注册情况竞赛报名ip
    <%= index+1 %><%= link_to ua.key, user_path(ua.key), :target => "_blank" %><%= link_to user.try(:show_real_name), user_path(user), target:'_blank' %><%= register_info(ua) %><%= ua.agent_type.to_i == UserAgent::USER_COMPETITION ? "已报名" : "未报名" %><%= ua.ip %>
    +
    +
    +
    + +
    +
    +
    diff --git a/app/views/welcome/user_agents.html.erb b/app/views/welcome/user_agents.html.erb new file mode 100644 index 00000000..4fe6649c --- /dev/null +++ b/app/views/welcome/user_agents.html.erb @@ -0,0 +1,9 @@ +
    +
    + 统计总计: + 引流总人数<%= @agents_count %>人, +
    +
    +
    + <%= render :partial => "welcome/user_agent_list" %> +
    \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 427b4744..c967e51f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -297,6 +297,7 @@ RedmineApp::Application.routes.draw do ## oauth相关 get 'welcome/shixun_to_local' => 'welcome#shixun_to_local' get 'welcome/local_to_shixun' => 'welcome#local_to_shixun' get 'welcome/local_init' => 'welcome#local_init' + get 'welcome/user_agents' => 'welcome#user_agents' # get 'competitions/home' => 'competitions#home' # get 'competitions/hn' => 'competitions#index' diff --git a/db/migrate/20190719062616_add_ip_for_user_actions.rb b/db/migrate/20190719062616_add_ip_for_user_actions.rb new file mode 100644 index 00000000..d1297176 --- /dev/null +++ b/db/migrate/20190719062616_add_ip_for_user_actions.rb @@ -0,0 +1,10 @@ +class AddIpForUserActions < ActiveRecord::Migration + def up + add_column :user_actions, :ip, :string + + UserAgent.where("agent_type is null").update_all(:agent_type => 1) + end + + def down + end +end diff --git a/db/migrate/20190719091918_add_index_for_user_actions.rb b/db/migrate/20190719091918_add_index_for_user_actions.rb new file mode 100644 index 00000000..43282065 --- /dev/null +++ b/db/migrate/20190719091918_add_index_for_user_actions.rb @@ -0,0 +1,8 @@ +class AddIndexForUserActions < ActiveRecord::Migration + def up + add_index :user_actions, :ip + end + + def down + end +end diff --git a/public/images/educoder/competitionslog.png b/public/images/educoder/competitionslog.png index 97ce6c77..595f35b3 100755 Binary files a/public/images/educoder/competitionslog.png and b/public/images/educoder/competitionslog.png differ diff --git a/public/images/educoder/project_packagesHead.jpg b/public/images/educoder/project_packagesHead.jpg new file mode 100644 index 00000000..181045e0 Binary files /dev/null and b/public/images/educoder/project_packagesHead.jpg differ diff --git a/public/react/src/App.css b/public/react/src/App.css index da3a5dc5..1797997c 100644 --- a/public/react/src/App.css +++ b/public/react/src/App.css @@ -34,4 +34,7 @@ */ .editormd .CodeMirror-linenumbers { padding: 0; +} +.editormd-html-preview hr, .editormd-preview-container hr { + border-top: 1px solid #ccc; } \ No newline at end of file diff --git a/public/react/src/modules/projectPackages/PackageIndex/PackageConcent.js b/public/react/src/modules/projectPackages/PackageIndex/PackageConcent.js index 47eed534..72105371 100644 --- a/public/react/src/modules/projectPackages/PackageIndex/PackageConcent.js +++ b/public/react/src/modules/projectPackages/PackageIndex/PackageConcent.js @@ -51,7 +51,7 @@ class PackageConcent extends Component { //否 string 排序,默认最新, ‘recently’, ‘price’ // 否 string 类型, front,backend,mobile,database, cloud_compute_and_big_data,devops_and_test,ai,other componentDidMount() { - window.document.title = '众包社区' + window.document.title = '众包创新' let {category,keyword,sort_by,sort_direction,page}=this.state this.setdatas(category,keyword,sort_by,sort_direction,page) diff --git a/public/react/src/modules/projectPackages/PackageIndex/PackageIndex.js b/public/react/src/modules/projectPackages/PackageIndex/PackageIndex.js index 9d51a16b..e6c7cdc9 100644 --- a/public/react/src/modules/projectPackages/PackageIndex/PackageIndex.js +++ b/public/react/src/modules/projectPackages/PackageIndex/PackageIndex.js @@ -11,7 +11,7 @@ class PackageIndex extends Component{ } componentDidMount(){ - window.document.title = '众包社区' + window.document.title = '众包创新' } render() { diff --git a/public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/PackageIndexNEITaskDetails.js b/public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/PackageIndexNEITaskDetails.js index 9be5dfb1..0a6aeaa0 100644 --- a/public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/PackageIndexNEITaskDetails.js +++ b/public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/PackageIndexNEITaskDetails.js @@ -49,7 +49,7 @@ class PackageIndexNEITaskDetails extends Component { componentDidMount() { this.getdatas() - window.document.title = '众包社区' + window.document.title = '众包创新' } getdatas=()=>{ @@ -251,7 +251,7 @@ class PackageIndexNEITaskDetails extends Component { '} className={"fl"}> {/*{this.props.current_user.username}*/} - 众包社区 + 众包创新 {data&&data.title} diff --git a/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEIBannerConcent.js b/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEIBannerConcent.js index 7262c9f6..281fb5be 100644 --- a/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEIBannerConcent.js +++ b/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEIBannerConcent.js @@ -75,7 +75,7 @@ class PackageIndexNEIBannerConcent extends Component { } componentDidMount() { - window.document.title = '众包社区' + window.document.title = '众包创新' if(this.props.match.params.id!=undefined){ let url=`/api/v1/project_packages/${this.props.match.params.id}.json` diff --git a/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEISubmit.js b/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEISubmit.js index 0e02aa0f..9f287e90 100644 --- a/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEISubmit.js +++ b/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEISubmit.js @@ -10,7 +10,7 @@ class PackageIndexNEISubmit extends Component { } } componentDidMount() { - window.document.title = '众包社区' + window.document.title = '众包创新' } setageload=(sum)=>{ if(sum===undefined){ diff --git a/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNewandEditIndex.js b/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNewandEditIndex.js index 6f521bc7..1571fd77 100644 --- a/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNewandEditIndex.js +++ b/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNewandEditIndex.js @@ -18,7 +18,7 @@ class PackageIndexNewandEditIndex extends Component{ } componentDidMount(){ - window.document.title = '众包社区' + window.document.title = '众包创新' } setPublicationfun=(ids)=>{ diff --git a/public/react/src/modules/projectPackages/ProjectPackageIndex.js b/public/react/src/modules/projectPackages/ProjectPackageIndex.js index 560a059d..097e012e 100644 --- a/public/react/src/modules/projectPackages/ProjectPackageIndex.js +++ b/public/react/src/modules/projectPackages/ProjectPackageIndex.js @@ -32,7 +32,7 @@ class ProjectPackageIndex extends Component { } componentDidMount(){ - window.document.title = '众包社区' + window.document.title = '众包创新' } render() { diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 45be29bd..5a1e0e8f 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -5,6 +5,8 @@ import PropTypes from 'prop-types'; import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; +import { Modal} from 'antd'; + // import searchImg from '../../../../images/educoder/icon/search.svg' // /images/educoder/icon/search.svg @@ -134,7 +136,8 @@ class NewHeader extends Component { ImageUrl:"", ecUrl:null, project_packages_url:null, - ImageUrlType:false + ImageUrlType:false, + competitiontype:false } } componentWillMount(){ @@ -230,9 +233,30 @@ class NewHeader extends Component { }); - + if (window.localStorage) { + var uid = localStorage.getItem('competition_uid'); + } else { + var uid = false + } + if(!uid){ + this.setState({ + competitiontype:true + }) + } } + setcompetitionfun=()=>{ + this.competitionfun(); + window.location.href="/competitions" + } + + competitionfun=()=>{ + this.setState({ + competitiontype:false + }) + localStorage.setItem('competition_uid', true); + } + render() { let {careerslist,isLogin,current_user,ImageUrl,ecUrl,ImageUrlType,project_packages_url} = this.state; // const isLogin = isLogintype; // 这里不会出现未登录的情况,服务端在服务端路由时发现如果是未登录,则跳转到登录页了。 @@ -246,6 +270,7 @@ class NewHeader extends Component { let activeCareers = false; let activeCourses = false; let competitions = false; + let crowdsourcing=false; if (match.path === '/forums') { activeForums = true; } else if (match.path.startsWith('/shixuns')) { @@ -258,6 +283,8 @@ class NewHeader extends Component { activeCourses=true; }else if(match.path.startsWith('/competitions')){ competitions=true; + }else if(match.path.startsWith('/crowdsourcing')){ + crowdsourcing=true }else{ activeIndex = true; } @@ -268,6 +295,45 @@ class NewHeader extends Component { // console.log(match.path.startsWith("/ec_courses")) return (
    + + + + +
    +
    + + this.competitionfun()} id="closeIcon" + style={{position: "absolute",right: "-20px",top: "36px"}} + > + + + + + + this.setcompetitionfun()}> + + + +
    +
    +
    {/*<%= link_to image_tag("/images/educoder/logo.png", alt:"高校智能化教学与实训平台", className:"logoimg"), home_path %>*/} @@ -304,10 +370,12 @@ class NewHeader extends Component { 在线竞赛 +
  • 教学案例
  • -
  • + +
  • - {project_packages_url===null||project_packages_url===undefined||project_packages_url===""?'':'众包'} + {project_packages_url===null||project_packages_url===undefined||project_packages_url===""?'':'众包创新'}
  • 交流问答
  • @@ -464,11 +532,3 @@ class NewHeader extends Component { export default NewHeader; - -//
      -//
    • 1{/*<%= link_to "首页", home_path %>*/}
    • -//
    • 2{/*<%= link_to "精选实训", shixuns_path %>*/}
    • -//
    • 3{/*<%= link_to "实训路径", subjects_path %>*/}
    • -//
    • 4{/*<%= link_to "在线课堂", courses_path %>*/}
    • -//
    • 5{/*<%= link_to "讨论组", forums_path %>*/}
    • -//
    diff --git a/public/react/src/modules/tpm/SiderBar.js b/public/react/src/modules/tpm/SiderBar.js index fd74c759..b7f5b5ec 100644 --- a/public/react/src/modules/tpm/SiderBar.js +++ b/public/react/src/modules/tpm/SiderBar.js @@ -7,14 +7,33 @@ const $ = window.$; class SiderBar extends Component { constructor(props) { super(props) - + this.state = { + trophyreturn: false + } } componentDidMount() { window._initSider(); - + var trophy_uid = false; + if (window.localStorage) { + trophy_uid = localStorage.getItem('trophy_uid'); + } else { + trophy_uid = false + } + if(trophy_uid==="true"||trophy_uid===true){ + this.setState({ + trophyreturn:true + }) + } + } + trophyreturnfun=()=>{ + this.setState({ + trophyreturn:true + }) + localStorage.setItem('trophy_uid', true); + } render() { return (
    @@ -51,11 +70,15 @@ class SiderBar extends Component {
    -
    + {this.state.trophyreturn===true?"":
    + + + -
    +
    }
    ); diff --git a/public/stylesheets/educoder/edu-all.css b/public/stylesheets/educoder/edu-all.css index f1cfa765..0c3c23ce 100644 --- a/public/stylesheets/educoder/edu-all.css +++ b/public/stylesheets/educoder/edu-all.css @@ -2,7 +2,7 @@ /*头部导航条样式---2018-03-19--by-cs*/ .newHeader{background: #24292D;width:100%; height: 60px; min-width: 1200px;position: fixed;top: 0px;left: 0px;z-index:1000;-moz-box-shadow: 0px 0px 12px rgba(0,0,0,0.1); /* 老的 Firefox */box-shadow: 0px 0px 12px rgba(0,0,0,0.1);} .newHeader .logoimg{margin-top:12px;float: left;width: 36px} -.head-nav{float: left;width: 780px;text-align: center;height: 60px;box-sizing: border-box; min-width: 400px;} +.head-nav{float: left;width: 920px;text-align: center;height: 60px;box-sizing: border-box; min-width: 400px;} .head-nav ul#header-nav{position: absolute;top: 0px;z-index: 3;height: 60px;box-sizing: border-box;padding-left: 30px;} .head-nav ul#header-nav li{float: left;height: 60px;line-height: 60px;margin-right: 30px;cursor: pointer;position: relative;font-size: 16px} .head-nav ul#header-nav li a{display: block;height: 100%;width: 100%;color: #fff} @@ -464,7 +464,7 @@ li.li-width7{width: 7%;text-align: left} .top-black-trangle{display: block;border-width: 8px;position: absolute;top: -16px;right: 4px;border-style: dashed solid dashed dashed;border-color: transparent transparent rgba(5,16,26,0.6) transparent;font-size: 0;line-height: 0;} .right-black-trangle{display: block;border-width: 8px;position: absolute;top: 10px;right: -16px;border-style: dashed solid dashed dashed;border-color: transparent transparent transparent rgba(5,16,26,0.6);font-size: 0;line-height: 0;} .activity-nav.active{color: #4CACFF!important;} -.project_packagesHead{width: 100%;margin-bottom:40px;background-size: 100% 100%;background-image: url("/images/educoder/project_packagesHead.png");height: 240px; +.project_packagesHead{width: 100%;margin-bottom:40px;background-size: 100% 100%;background-image: url("/images/educoder/project_packagesHead.jpg");height: 240px; justify-content: center;align-items: center;display: -webkit-flex;} .courseNewNum{display: block;background: #FF6800;border-radius:30px;padding:0px 2px;color: #fff!important;font-size: 11px; diff --git a/public/stylesheets/educoder/edu-main.css b/public/stylesheets/educoder/edu-main.css index 0df8d6e8..1d693f20 100644 --- a/public/stylesheets/educoder/edu-main.css +++ b/public/stylesheets/educoder/edu-main.css @@ -1243,6 +1243,19 @@ html>body #ajax-indicator { position: fixed; } } .login_regs{ - margin-right: 35%; - width: 558px; + width: 580px !important; +} + +.login_regs a{ + cursor: pointer; +} + +#member_block{ + height: 260px; + overflow-y: auto; +} + +#trophyreturn i{ + font-size: 16px!important; + color: #AAAAAA; } \ No newline at end of file