|
|
@ -1,5 +1,6 @@
|
|
|
|
<form action="/trainings/update_payinfo" method="post" accept-charset="UTF-8" enctype="multipart/form-data">
|
|
|
|
<form action="/trainings/update_payinfo" method="post" accept-charset="UTF-8" enctype="multipart/form-data">
|
|
|
|
<div style="padding-top: 10px">
|
|
|
|
<div style="padding-top: 10px">
|
|
|
|
|
|
|
|
<%= hidden_field_tag(:tag_id, params[:id]) %>
|
|
|
|
<div class="showPanel" id="payTypeLine" NavShow>
|
|
|
|
<div class="showPanel" id="payTypeLine" NavShow>
|
|
|
|
<p class="clearfix pr">
|
|
|
|
<p class="clearfix pr">
|
|
|
|
<label>支付方式</label>
|
|
|
|
<label>支付方式</label>
|
|
|
@ -39,7 +40,7 @@
|
|
|
|
<p class="clearfix" id="billRemark">
|
|
|
|
<p class="clearfix" id="billRemark">
|
|
|
|
<span class="grey fl">发票内容</span>
|
|
|
|
<span class="grey fl">发票内容</span>
|
|
|
|
<input type="text" name="invoice_content" class="right_input"
|
|
|
|
<input type="text" name="invoice_content" class="right_input"
|
|
|
|
value="<%#= @training.training_payinfo.invoice_content.presence || '会议注册费' %>"/>
|
|
|
|
value="<%= @training.training_payinfo.try(:invoice_content).presence || '研讨会' %>"/>
|
|
|
|
</p>
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="infoBar mb10">
|
|
|
|
<div class="infoBar mb10">
|
|
|
@ -49,32 +50,36 @@
|
|
|
|
<%= render :partial => 'upload_img', :locals => {:training => @training} %>
|
|
|
|
<%= render :partial => 'upload_img', :locals => {:training => @training} %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="infoBar mb10">
|
|
|
|
<div class="infoBar mb10">
|
|
|
|
<p>费用明细<span class="color-orange" id="percentPay">(3人及以上8折优惠)</span></p>
|
|
|
|
<p>费用明细
|
|
|
|
|
|
|
|
<% if @training.training_type == 3 %>
|
|
|
|
|
|
|
|
<span class="color-orange" id="percentPay">(3人及以上8折优惠)</span>
|
|
|
|
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
</p>
|
|
|
|
<p class="break-word justify moneyDetail">含会议注册费、场地费、培训费、教材资料费、餐费、专家差率费等</p>
|
|
|
|
<p class="break-word justify moneyDetail">含会议注册费、场地费、培训费、教材资料费、餐费、专家差率费等</p>
|
|
|
|
<p class="clearfix">
|
|
|
|
<p class="clearfix">
|
|
|
|
<input type="hidden" name="enlistNum" value="1"/>
|
|
|
|
<input type="hidden" name="enlistNum" value="1"/>
|
|
|
|
<input type="hidden" name="enlistMoney" value="3000"/>
|
|
|
|
<input type="hidden" name="enlistMoney" value="<%= @training.registration_fee %>"/>
|
|
|
|
<span class="fl red mr5 font-16">¥<span id="enlistM">3000</span></span>
|
|
|
|
<span class="fl red mr5 font-16">¥<span id="enlistM"><%= @training.registration_fee %></span></span>
|
|
|
|
<span class="lastPrice"></span>
|
|
|
|
<span class="lastPrice"></span>
|
|
|
|
<span class="fr font-16">
|
|
|
|
<span class="fr font-16">
|
|
|
|
<a href="javascript:void(0)" class="minusNum" onclick="minusNum(this)">
|
|
|
|
<a href="javascript:void(0)" class="minusNum" onclick="minusNum(this)">
|
|
|
|
<i class="iconfont icon-default sky_blue font-18"></i>
|
|
|
|
<i class="iconfont icon-default sky_blue font-18"></i>
|
|
|
|
</a>
|
|
|
|
</a>
|
|
|
|
<span class="mr5 ml5 font-14"><span id="enlistN">1</span>人</span>
|
|
|
|
<span class="mr5 ml5 font-14"><span id="enlistN">1</span>人</span>
|
|
|
|
<a href="javascript:void(0)" class="plusNum" onclick="plusNum(this)">
|
|
|
|
<a href="javascript:void(0)" class="plusNum" onclick="plusNum(this)">
|
|
|
|
<i class="iconfont icon-roundaddfill blue font-18"></i>
|
|
|
|
<i class="iconfont icon-roundaddfill blue font-18"></i>
|
|
|
|
</a>
|
|
|
|
</a>
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
</p>
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<p style="height: 44px;"></p>
|
|
|
|
<p style="height: 44px;"></p>
|
|
|
|
<div class="bottomBtn <%= @training.training_payinfo.pay_type.to_i ==3 ? "" : "none" %>" id="offlinePaySubmitBtn">
|
|
|
|
<div class="bottomBtn <%= @training.training_payinfo.pay_type.to_i ==3 ? "" : "none" %>" id="offlinePaySubmitBtn">
|
|
|
|
<a href="<%= enroll_training_path(id: 'bigdata_hnjcxy_2019') %>" class="leftbtn">返回</a>
|
|
|
|
<a href="<%= enroll_training_path(id: @tag_id) %>" class="leftbtn">返回</a>
|
|
|
|
<a href="javascript:void(0)" class="rightbtn" id="submitFormBtn">提交</a>
|
|
|
|
<a href="javascript:void(0)" class="rightbtn" id="submitFormBtn">提交</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="bottomBtn <%= @training.training_payinfo.pay_type.to_i ==3 ? "none" : "" %>" id="paySubmitBtn">
|
|
|
|
<div class="bottomBtn <%= @training.training_payinfo.pay_type.to_i ==3 ? "none" : "" %>" id="paySubmitBtn">
|
|
|
|
<a href="<%= enroll_training_path(id: 'bigdata_hnjcxy_2019') %>" class="leftbtn">返回</a>
|
|
|
|
<a href="<%= enroll_training_path(id: @tag_id) %>" class="leftbtn">返回</a>
|
|
|
|
<a href="javascript:void(0)" class="rightbtn" id="payBtn">立即支付</a>
|
|
|
|
<a href="javascript:void(0)" class="rightbtn" id="payBtn">立即支付</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
@ -124,22 +129,20 @@
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// eruda.init();
|
|
|
|
// eruda.init();
|
|
|
|
|
|
|
|
|
|
|
|
// var userInfo = {
|
|
|
|
var userInfo = {
|
|
|
|
// name: '<%= @training.name %>',
|
|
|
|
name: '<%= @training.name %>',
|
|
|
|
// school: '<%= @training.school %>',
|
|
|
|
school: '<%= @training.school %>',
|
|
|
|
// //支付方式,默认为0
|
|
|
|
//支付方式,默认为0
|
|
|
|
// // 1 微信支付
|
|
|
|
// 1 微信支付
|
|
|
|
// // 2 支付宝支付
|
|
|
|
// 2 支付宝支付
|
|
|
|
// // 3 银行卡支付
|
|
|
|
// 3 银行卡支付
|
|
|
|
// payType: <%#= @training.training_payinfo.pay_type.to_i %>,
|
|
|
|
payType: <%= @training.training_payinfo.pay_type.to_i %>,
|
|
|
|
//
|
|
|
|
//发票抬头
|
|
|
|
// //发票抬头
|
|
|
|
//为空则代表不需要发票
|
|
|
|
// //为空则代表不需要发票
|
|
|
|
invoiceTitle: '<%= @training.training_payinfo.invoice_title %>',
|
|
|
|
// invoiceTitle: '<%#= @training.training_payinfo.invoice_title %>',
|
|
|
|
//税号
|
|
|
|
//
|
|
|
|
invoiceNo: '<%= @training.training_payinfo.invoice_no %>'
|
|
|
|
// //税号
|
|
|
|
};
|
|
|
|
// invoiceNo: '<%#= @training.training_payinfo.invoice_no %>'
|
|
|
|
|
|
|
|
// };
|
|
|
|
|
|
|
|
//点击弹出发票弹框
|
|
|
|
//点击弹出发票弹框
|
|
|
|
aboutBillType(userInfo);
|
|
|
|
aboutBillType(userInfo);
|
|
|
|
|
|
|
|
|
|
|
@ -147,13 +150,13 @@
|
|
|
|
aboutPayType();
|
|
|
|
aboutPayType();
|
|
|
|
|
|
|
|
|
|
|
|
//初始化发票类型
|
|
|
|
//初始化发票类型
|
|
|
|
//InitBill(userInfo);
|
|
|
|
InitBill(userInfo);
|
|
|
|
|
|
|
|
|
|
|
|
//切换发票类型
|
|
|
|
//切换发票类型
|
|
|
|
$(".billType li").on("click", function () {
|
|
|
|
$(".billType li").on("click", function () {
|
|
|
|
$(".billType li").removeClass("active");
|
|
|
|
$(".billType li").removeClass("active");
|
|
|
|
$(this).addClass("active");
|
|
|
|
$(this).addClass("active");
|
|
|
|
billTypeShowFun(parseInt($(this).index()));
|
|
|
|
billTypeShowFun(parseInt($(this).index()), userInfo);
|
|
|
|
})
|
|
|
|
})
|
|
|
|
//关闭弹窗
|
|
|
|
//关闭弹窗
|
|
|
|
$(".billClose").on("click", function () {
|
|
|
|
$(".billClose").on("click", function () {
|
|
|
@ -205,7 +208,7 @@
|
|
|
|
// 使用以上方式判断前端返回,微信团队郑重提示:
|
|
|
|
// 使用以上方式判断前端返回,微信团队郑重提示:
|
|
|
|
//res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
|
|
|
|
//res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
|
|
|
|
setTimeout(function () {
|
|
|
|
setTimeout(function () {
|
|
|
|
window.location.href = "/trainings/bigdata_hnjcxy_2019/result";
|
|
|
|
window.location.href = "/trainings/<%= @tag_id %>/result";
|
|
|
|
}, 500);
|
|
|
|
}, 500);
|
|
|
|
} else if (res.err_msg == 'get_brand_wcpay_request:cancel') {
|
|
|
|
} else if (res.err_msg == 'get_brand_wcpay_request:cancel') {
|
|
|
|
|
|
|
|
|
|
|
@ -236,7 +239,7 @@
|
|
|
|
//加减报名人数
|
|
|
|
//加减报名人数
|
|
|
|
function minusNum(item){
|
|
|
|
function minusNum(item){
|
|
|
|
var num=parseInt($("#enlistN").html());
|
|
|
|
var num=parseInt($("#enlistN").html());
|
|
|
|
var money=parseFloat(3000).toFixed(2);
|
|
|
|
var money=parseFloat(<%= @training.registration_fee %>).toFixed(2);
|
|
|
|
var percent=$("#percentPay");
|
|
|
|
var percent=$("#percentPay");
|
|
|
|
if(num>1){
|
|
|
|
if(num>1){
|
|
|
|
num=num-1;
|
|
|
|
num=num-1;
|
|
|
@ -259,7 +262,7 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function plusNum(item){
|
|
|
|
function plusNum(item){
|
|
|
|
var num=parseInt($("#enlistN").html());
|
|
|
|
var num=parseInt($("#enlistN").html());
|
|
|
|
var money=parseFloat(3000).toFixed(2);
|
|
|
|
var money=parseFloat(<%= @training.registration_fee %>).toFixed(2);
|
|
|
|
var percent=$("#percentPay");
|
|
|
|
var percent=$("#percentPay");
|
|
|
|
|
|
|
|
|
|
|
|
num=num+1;
|
|
|
|
num=num+1;
|
|
|
@ -297,7 +300,7 @@
|
|
|
|
$(".billType li").eq(index).addClass("active");
|
|
|
|
$(".billType li").eq(index).addClass("active");
|
|
|
|
billTypeShowFun(index,userInfo);
|
|
|
|
billTypeShowFun(index,userInfo);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function billTypeShowFun(index){
|
|
|
|
function billTypeShowFun(index, userInfo){
|
|
|
|
if (parseInt(index) == 0) {
|
|
|
|
if (parseInt(index) == 0) {
|
|
|
|
$(".needWrite").removeClass("none");
|
|
|
|
$(".needWrite").removeClass("none");
|
|
|
|
$(".billUnit").attr("placeholder", "请填写公司单位名称").val(userInfo.school);
|
|
|
|
$(".billUnit").attr("placeholder", "请填写公司单位名称").val(userInfo.school);
|
|
|
@ -353,7 +356,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//提交发票信息
|
|
|
|
//提交发票信息
|
|
|
|
/*function submitBillInfo() {
|
|
|
|
function submitBillInfo() {
|
|
|
|
var type = $(".billType li.active").html();
|
|
|
|
var type = $(".billType li.active").html();
|
|
|
|
var unit = $(".billUnit").val();
|
|
|
|
var unit = $(".billUnit").val();
|
|
|
|
var tax = $(".taxNumber").val();
|
|
|
|
var tax = $(".taxNumber").val();
|
|
|
@ -386,7 +389,7 @@
|
|
|
|
//记录选中的发票类型
|
|
|
|
//记录选中的发票类型
|
|
|
|
$("#billDemand").attr("status",$(".billType li.active").index());
|
|
|
|
$("#billDemand").attr("status",$(".billType li.active").index());
|
|
|
|
hideNav($(".billDownNav"));
|
|
|
|
hideNav($(".billDownNav"));
|
|
|
|
}*/
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function InitPhoto() {
|
|
|
|
function InitPhoto() {
|
|
|
|
var tmpl = '<li class="weui-uploader__file" style="background-image:url(#url#)"></li>',
|
|
|
|
var tmpl = '<li class="weui-uploader__file" style="background-image:url(#url#)"></li>',
|
|
|
|