traning educoder 2019

dev_aliyun
p31729568 5 years ago
parent 5b43287fb8
commit 25062d9ce0

@ -255,6 +255,7 @@ class TrainingsController < ApplicationController
case friendly_id case friendly_id
when 'aeee0601_2019' then 3 when 'aeee0601_2019' then 3
when 'ceeaa06_2019' then 4 when 'ceeaa06_2019' then 4
when 'educoder_2019' then 5
end end
end end

@ -3,7 +3,7 @@ class Training < ActiveRecord::Base
attr_accessible :address, :email, :name, :phone, :position, :school, :sex, :openid, :training_type, attr_accessible :address, :email, :name, :phone, :position, :school, :sex, :openid, :training_type,
:major, :student_id, :job_title, :uncertified_major :major, :student_id, :job_title, :uncertified_major
# training_type 1 2018-培训会 2 警察学院大数据培训会 3 大数据和人工智能 4 工程教育认证 # training_type 1 2018-培训会 2 警察学院大数据培训会 3 大数据和人工智能 4 工程教育认证 5 EduCoder-创先源于实践
has_one :training_payinfo has_one :training_payinfo

@ -7,6 +7,7 @@
<option value="2">2019湖南警察学院大数据培训</option> <option value="2">2019湖南警察学院大数据培训</option>
<option value="3">信息技术新工科产学研联盟师资培训班</option> <option value="3">信息技术新工科产学研联盟师资培训班</option>
<option value="4">工程教育认证</option> <option value="4">工程教育认证</option>
<option value="5">EduCoder-创先源于实践</option>
</select> </select>
<select class="fl mr10 winput-120-30" name="pay_type"> <select class="fl mr10 winput-120-30" name="pay_type">
<option value="-1">选择支付方式</option> <option value="-1">选择支付方式</option>

@ -123,6 +123,7 @@
</script> </script>
<% end %> <% end %>
<% if [3,4].include?(@training_type) %>
<div> <div>
<p class="collegeInfo"><%= @training_type == 3 ? '信息技术新工科产学研联盟师资培训班' : '工程教育专业认证师资培训' %></p> <p class="collegeInfo"><%= @training_type == 3 ? '信息技术新工科产学研联盟师资培训班' : '工程教育专业认证师资培训' %></p>
<%= form_for @training do |f| %> <%= form_for @training do |f| %>
@ -280,3 +281,66 @@
} }
</script> </script>
<% end %>
<% if @training_type == 5 %>
<div>
<p class="collegeInfo">EduCoder-创先源于实践</p>
<%= form_for @training do |f| %>
<%= hidden_field_tag(:friendly_id, @friendly_id) %>
<p class="subtitle">基本信息</p>
<li class="clearfix infoBar">
<span class="left_tag fl">姓名</span>
<input type="text" class="right_input" id="username" name="name"
placeholder="请输入真实姓名" value="<%= @training.name %>"/>
</li>
<li class="clearfix infoBar">
<span class="left_tag fl">单位</span>
<input type="text" class="right_input" id="userUnit" placeholder="请输入单位名称或者学校"
name="school"
value="<%= @training.school %>"/>
</li>
<li class="clearfix infoBar">
<span class="left_tag fl">手机号码</span>
<input type="text" class="right_input" placeholder="请输入手机号" id="userphone"
name="phone"
value="<%= @training.phone %>"/>
</li>
<p style="height: 50px;"></p>
<a href="javascript:void(0)" class="EnrollNext" onclick="NextStep();"><%= @training.new_record? ? '提交' : '保存' %></a>
<% end %>
</div>
<script>
//下一步
function NextStep() {
var username = $("#username").val();
var userUnit = $("#userUnit").val();
var userphone = $("#userphone").val();
if (username == '') {
alert("请输入姓名");
return;
}
if (userUnit == '') {
alert("请输入单位名称或者学校");
return;
}
if (userphone == '') {
alert("请输入手机号码");
return;
} else if (!/^1\d{10}$/.test(userphone) && !/^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/.test(userphone)) {
alert("请输入正确的手机号码");
return;
}
$('form').submit();
}
</script>
<% end %>

@ -1,3 +1,4 @@
<% if [3,4].include?(@training.training_type) %>
<div class="InfoTop"> <div class="InfoTop">
<div> <div>
<p class="font-22 color-white" style="text-align: center;"><span class="inline"><i class="iconfont icon-wancheng font-30 color-white mr10 fl" style="font-size: 20px;"></i>报名成功</span></p> <p class="font-22 color-white" style="text-align: center;"><span class="inline"><i class="iconfont icon-wancheng font-30 color-white mr10 fl" style="font-size: 20px;"></i>报名成功</span></p>
@ -62,3 +63,30 @@
class: 'rightbtn', style: 'width: 100%;' %> class: 'rightbtn', style: 'width: 100%;' %>
</div> </div>
<% end %> <% end %>
<% end %>
<% if @training.training_type == 5 %>
<div class="InfoTop">
<div>
<p class="font-22 color-white" style="text-align: center;"><span class="inline"><i class="iconfont icon-wancheng font-30 color-white mr10 fl" style="font-size: 20px;"></i>提交成功</span></p>
</div>
</div>
<div class="Infos">
<p class="Infos_title">基本信息</p>
<li class="clearfix">
<span>姓名</span>
<span><%= @training.name %></span>
</li>
<li class="clearfix">
<span>单位</span>
<span><%= @training.school %></span>
</li>
<li class="clearfix">
<span>手机号</span>
<span><%= @training.phone %></span>
</li>
</div>
<%= link_to('修改资料', enroll_training_path(id: @friendly_id, disable_redirect: true), class: 'info_updateBtn') %>
<% end %>
Loading…
Cancel
Save