trainings(联盟师资培训)

dev_trainings
caishi 6 years ago
parent cb20217d49
commit 1fe13e8f4a

@ -5,9 +5,9 @@ class TrainingsController < ApplicationController
skip_before_filter :verify_signature, only: [:show, :create, :test] skip_before_filter :verify_signature, only: [:show, :create, :test]
ROOT_URL = ENV["wechat_url"] || "#{Setting.protocol}://#{Setting.host_name}" # ROOT_URL = ENV["wechat_url"] || "#{Setting.protocol}://#{Setting.host_name}"
#
before_filter :authenticate, except: [:auth, :auth_callback, :pay_callback] # before_filter :authenticate, except: [:auth, :auth_callback, :pay_callback]
before_filter :find_training, only: [:show, :test] before_filter :find_training, only: [:show, :test]
before_filter :valid_training, only: [:pay, :result, :pay_js] before_filter :valid_training, only: [:pay, :result, :pay_js]

@ -1,3 +1,4 @@
<% if false %>
<div> <div>
<p class="collegeInfo">湖南警察学院大数据培训缴费</p> <p class="collegeInfo">湖南警察学院大数据培训缴费</p>
<%= form_for @training do |f| %> <%= form_for @training do |f| %>
@ -121,3 +122,161 @@
} }
</script> </script>
<% end %>
<div>
<p class="collegeInfo">信息技术新工科产学研联盟师资培训班</p>
<%= form_for @training do |f| %>
<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" id="userSex" NavShow>
<span class="left_tag fl">性别</span>
<label class="fr" id="sexl" style="margin-right: 24px;"><%= @training.sex == 1 ? '男' : '女' %></label>
<i class="iconfont icon-youjiantou rightArrow"></i>
<input type="hidden" id="sex" name="sex" value="<%= @training.sex ==1 ?1 : 2 %>">
</li>
<li class="clearfix infoBar">
<span class="left_tag fl">单位</span>
<input type="text" class="right_input" id="userUnit" placeholder="请输入单位名称或者学校"
name="major"
value="<%= @training.major %>"/>
</li>
<li class="clearfix infoBar">
<span class="left_tag fl">职称</span>
<input type="text" class="right_input" id="userPositional" placeholder="请输入职称"
name="student_id"
value="<%= @training.student_id %>"/>
</li>
<p class="subtitle">您的授课/研究领域最少选1项</p>
<li class="clearfix infoBar">
<span class="left_tag fl">机器学习/深度学习</span>
<span class="fr">
<input type="checkbox" name="study" value="1" id="check_1" class="magic-checkbox">
<label for="check_1" style="top:8px">&nbsp;</label>
</span>
</li>
<li class="clearfix infoBar">
<span class="left_tag fl">计算机结构与组成</span>
<span class="fr">
<input type="checkbox" name="study" value="2" id="check_2" class="magic-checkbox">
<label for="check_2" style="top:8px">&nbsp;</label>
</span>
</li>
<li class="clearfix infoBar">
<span class="left_tag fl">计算机系统</span>
<span class="fr">
<input type="checkbox" name="study" value="3" id="check_3" class="magic-checkbox">
<label for="check_3" style="top:8px">&nbsp;</label>
</span>
</li>
<li class="clearfix infoBar">
<span class="left_tag fl">计算机软件技术和应用</span>
<span class="fr">
<input type="checkbox" name="study" value="4" id="check_4" class="magic-checkbox">
<label for="check_4" style="top:8px">&nbsp;</label>
</span>
</li>
<li class="clearfix infoBar">
<span class="left_tag fl">计算机理论</span>
<span class="fr">
<input type="checkbox" name="study" value="5" id="check_5" class="magic-checkbox">
<label for="check_5" style="top:8px">&nbsp;</label>
</span>
</li>
<li class="clearfix infoBar">
<span class="left_tag fl">计算机应用与学科交叉</span>
<span class="fr">
<input type="checkbox" name="study" value="6" id="check_6" class="magic-checkbox">
<label for="check_6" style="top:8px">&nbsp;</label>
</span>
</li>
<li class="clearfix infoBar">
<span class="left_tag fl">其他</span>
<span class="fr">
<input type="checkbox" name="study" value="7" id="check_7" class="magic-checkbox">
<label for="check_7" style="top:8px">&nbsp;</label>
</span>
</li>
<p class="subtitle">通讯地址</p>
<li class="clearfix infoBar">
<!--<div class="clearfix" id="userArea" NavShow>-->
<!--<span class="left_tag fl">地区</span>-->
<!--<input type="text" class="right_input" id="usertitle" placeholder="填写区域"/>-->
<!--<i class="iconfont icon-youjiantou rightArrow"></i>-->
<!--</div>-->
<textarea class="DetailAddress" placeholder="请输入详细地址" name="address" id="DetailAdd" style="margin-top: 15px;"><%#= @training.address %></textarea>
</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>
<li class="clearfix infoBar">
<span class="left_tag fl">Email</span>
<input type="text" class="right_input" placeholder="请输入Email" id="userEmail" name="email" value="<%#= @training.email %>"/>
</li>
<p style="height: 50px;"></p>
<a href="javascript:void(0)" class="EnrollNext" onclick="NextStep();">完成</a>
<% end %>
</div>
<div class="sexDownNav downNav">
<li>男</li>
<li>女</li>
</div>
<script>
$(function () {
var down = $('#userSex');
var downNav = $(".sexDownNav");
showNav(down, downNav, "down");
$(".sexDownNav li").on("click", function () {
$(down).find("#sexl").html($(this).html());
hideNav(downNav);
if ($(this).html()=='男'){
$('#sex').val("1");
} else {
$('#sex').val("2");
}
})
})
//下一步
function NextStep() {
var username = $("#username").val();
var userMajor = $("#userMajor").val();
var userphone = $("#userphone").val();
var userID = $("#userID").val();
if (username == '') {
alert("请输入真实姓名");
return;
}
if (userMajor == '') {
alert("请输入专业");
return;
}
if (userID == '') {
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>

File diff suppressed because one or more lines are too long

@ -120,7 +120,7 @@ input::-ms-input-placeholder,textarea::-ms-input-placeholder {color:#cccccc;}
span.left_tag{font-weight:bold; } span.left_tag{font-weight:bold; }
input[type='text'].right_input{ input[type='text'].right_input{
float: right;border: none;text-align: right;height: 44px;line-height: 44px;outline: none; float: right;border: none;text-align: right;height: 44px;line-height: 44px;outline: none;
font-size: 1.4rem;width: 70%;margin-right: 24px; font-size: 1.4rem;width: 70%;/*margin-right: 24px;*/
} }
.infoBar label.right_tag{ .infoBar label.right_tag{
float: right;color: #cccccc;font-size: 1.4rem;margin-right: 24px; float: right;color: #cccccc;font-size: 1.4rem;margin-right: 24px;

Loading…
Cancel
Save