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