From 335988a0b16e5b1b0351c605e6e5038c5803223a Mon Sep 17 00:00:00 2001
From: caishi <1149225589@qq.com>
Date: Fri, 14 Jun 2019 10:15:16 +0800
Subject: [PATCH 1/4] =?UTF-8?q?=E6=94=AF=E4=BB=98=E6=8A=98=E6=89=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/trainings/pay.html.erb | 101 ++++++++++++++--------
public/stylesheets/educoder/trainings.css | 6 +-
2 files changed, 67 insertions(+), 40 deletions(-)
diff --git a/app/views/trainings/pay.html.erb b/app/views/trainings/pay.html.erb
index 17808d34..02290cd0 100644
--- a/app/views/trainings/pay.html.erb
+++ b/app/views/trainings/pay.html.erb
@@ -49,19 +49,23 @@
<%= render :partial => 'upload_img', :locals => {:training => @training} %>
-
费用明细
-
大数据培训缴费
-
-
-
- <%= @training.training_payinfo.num %>人
-
-
- ¥<%= @pay_fee * @training.training_payinfo.num %>
-
+ 费用明细(3人及以上8折优惠)
+ 含会议注册费、场地费、培训费、教材资料费、餐费、专家差率费等
+
+
+
+ ¥3000
+
+
+
+
+
+ 1人
+
+
+
-
-
+
" id="offlinePaySubmitBtn">
@@ -227,35 +231,56 @@
//上传头像
InitPhoto();
- //加减报名人数
- $(".minusNum").click(function(){
- var num=parseInt($("#enlistNum").html());
- var money=parseFloat($("#enlistMoney").html()).toFixed(2);
- if(num>1){
- money=parseFloat(parseFloat(money)-parseFloat(money)/parseFloat(num)).toFixed(2);
- num=num-1;
- $("#enlistNum").html(num);
- $("#enlistMoney").html(money);
- if(num==1){
- $(".icon-default").removeClass("blue").addClass("sky_blue");
- }
- $("input[name='enlistN']").val(num);
+ })
+
+ //加减报名人数
+ function minusNum(item){
+ var num=parseInt($("#enlistN").html());
+ var money=parseFloat(3000).toFixed(2);
+ var percent=$("#percentPay");
+ if(num>1){
+ num=num-1;
+ if(num == 1){
+ $(".icon-default").removeClass("blue").addClass("sky_blue");
}
- })
- $(".plusNum").click(function(){
- var num=parseInt($("#enlistNum").html());
- if(num==1){
- $(".icon-default").removeClass("sky_blue").addClass("blue");
+ money=parseFloat(parseFloat(money) *num).toFixed(2);
+ if($(percent).length>0 && num>2){
+ $(".lastPrice").html("¥"+ money);
+ money = parseFloat(parseFloat(money) *0.8);
+ }else{
+ $(".lastPrice").html("");
}
- var money=parseFloat($("#enlistMoney").html()).toFixed(2);
- money=parseFloat(parseFloat(money)+parseFloat(money)/parseFloat(num)).toFixed(2);
- num=num+1;
+ $("#enlistN").html(num);
+ $("#enlistM").html(money);
+ $("#enlistNum").val(num);
+ $("#enlistMoney").val(money);
- $("#enlistNum").html(num);
- $("#enlistMoney").html(money);
- $("input[name='enlistN']").val(num);
- })
- })
+ }
+ }
+ function plusNum(item){
+ var num=parseInt($("#enlistN").html());
+ var money=parseFloat(3000).toFixed(2);
+ var percent=$("#percentPay");
+
+ num=num+1;
+ if(num > 1){
+ $(".icon-default").removeClass("sky_blue").addClass("blue");
+ }
+ money=parseFloat(parseFloat(money) *num).toFixed(2);
+
+ if($(percent).length>0 && num>2){
+ $(".lastPrice").html("¥"+ money);
+ money = parseFloat(parseFloat(money) * 0.8).toFixed(2);
+ }else{
+ $(".lastPrice").html("");
+ }
+
+ $("#enlistN").html(num);
+ $("#enlistM").html(money);
+ $("#enlistNum").val(num);
+ $("#enlistMoney").val(money);
+ $("input[name='enlistNum']").val(num);
+ }
//页面加载时,初始化发票类型
function InitBill(userInfo){
var index=2;
diff --git a/public/stylesheets/educoder/trainings.css b/public/stylesheets/educoder/trainings.css
index 18038b11..c6a2b1bf 100644
--- a/public/stylesheets/educoder/trainings.css
+++ b/public/stylesheets/educoder/trainings.css
@@ -20,12 +20,13 @@ a{text-decoration: none}
.flex1{flex: 1}
li{list-style-type: none;}
-
+.color-orange{color: #FC682D!important;}
.mb5{margin-bottom: 5px}.mb10{margin-bottom: 10px!important;}
+
.mt5{margin-top: 5px}
.mr5{margin-right: 5px}
-.ml10{margin-left: 10px;}
+.ml5{margin-left: 5px;}.ml10{margin-left: 10px;}
.mr10{margin-right: 10px;}
.line20{line-height: 20px;}
@@ -240,6 +241,7 @@ input[type='text'].right_input{
.billInput.nullVal{border:1px solid #DD1717;}
.meetInfo{color: #4CACFF;}
.enrollNum{margin:10px 15px;font-size: 1.4rem;}
+.lastPrice{color: #bfbfbf;font-size: 1.2px;text-decoration: line-through;margin-left: 5px;}
/*上传图片*/
.weui-uploader__bd {position: relative;width: 100px;height: 100px;}
.weui-uploader__files {list-style: none;}
From 8b27e66fc35ea5bcb9b467aab471ff1213066792 Mon Sep 17 00:00:00 2001
From: caishi <1149225589@qq.com>
Date: Fri, 14 Jun 2019 11:00:18 +0800
Subject: [PATCH 2/4] =?UTF-8?q?=E5=8F=91=E7=A5=A8=E7=B1=BB=E5=9E=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/trainings/pay.html.erb | 8 ++++----
public/stylesheets/educoder/trainings.css | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/app/views/trainings/pay.html.erb b/app/views/trainings/pay.html.erb
index 02290cd0..3293be93 100644
--- a/app/views/trainings/pay.html.erb
+++ b/app/views/trainings/pay.html.erb
@@ -80,7 +80,7 @@
-
+
@@ -147,13 +147,13 @@
aboutPayType();
//初始化发票类型
- InitBill(userInfo);
+ //InitBill(userInfo);
//切换发票类型
$(".billType li").on("click", function () {
$(".billType li").removeClass("active");
$(this).addClass("active");
- billTypeShowFun(parseInt($(this).index()),userInfo);
+ //billTypeShowFun(parseInt($(this).index()),userInfo);
})
//关闭弹窗
$(".billClose").on("click", function () {
diff --git a/public/stylesheets/educoder/trainings.css b/public/stylesheets/educoder/trainings.css
index c6a2b1bf..44df1617 100644
--- a/public/stylesheets/educoder/trainings.css
+++ b/public/stylesheets/educoder/trainings.css
@@ -241,7 +241,7 @@ input[type='text'].right_input{
.billInput.nullVal{border:1px solid #DD1717;}
.meetInfo{color: #4CACFF;}
.enrollNum{margin:10px 15px;font-size: 1.4rem;}
-.lastPrice{color: #bfbfbf;font-size: 1.2px;text-decoration: line-through;margin-left: 5px;}
+.lastPrice{color: #bfbfbf;font-size: 0.8em;text-decoration: line-through;margin-left: 5px;margin-top: 2px;}
/*上传图片*/
.weui-uploader__bd {position: relative;width: 100px;height: 100px;}
.weui-uploader__files {list-style: none;}
From c15546369cd60c383fece8cc2ad5ab4c71c59cff Mon Sep 17 00:00:00 2001
From: caishi <1149225589@qq.com>
Date: Fri, 14 Jun 2019 11:02:05 +0800
Subject: [PATCH 3/4] =?UTF-8?q?=E6=94=AF=E4=BB=98-=E5=8F=91=E7=A5=A8?=
=?UTF-8?q?=E7=B1=BB=E5=9E=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/trainings/pay.html.erb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/views/trainings/pay.html.erb b/app/views/trainings/pay.html.erb
index 3293be93..ccc4f3eb 100644
--- a/app/views/trainings/pay.html.erb
+++ b/app/views/trainings/pay.html.erb
@@ -153,7 +153,7 @@
$(".billType li").on("click", function () {
$(".billType li").removeClass("active");
$(this).addClass("active");
- //billTypeShowFun(parseInt($(this).index()),userInfo);
+ billTypeShowFun(parseInt($(this).index()));
})
//关闭弹窗
$(".billClose").on("click", function () {
@@ -297,7 +297,7 @@
$(".billType li").eq(index).addClass("active");
billTypeShowFun(index,userInfo);
}
- function billTypeShowFun(index,userInfo){
+ function billTypeShowFun(index){
if (parseInt(index) == 0) {
$(".needWrite").removeClass("none");
$(".billUnit").attr("placeholder", "请填写公司单位名称").val(userInfo.school);
From 48cf73dbbf8f15d8e212121a30d3522c18796b22 Mon Sep 17 00:00:00 2001
From: p31729568
Date: Fri, 14 Jun 2019 11:25:20 +0800
Subject: [PATCH 4/4] modify training
---
app/controllers/trainings_controller.rb | 4 ++-
app/views/trainings/enroll.html.erb | 35 ++++++++++++++-----------
2 files changed, 23 insertions(+), 16 deletions(-)
diff --git a/app/controllers/trainings_controller.rb b/app/controllers/trainings_controller.rb
index 0668edde..e3e96f11 100644
--- a/app/controllers/trainings_controller.rb
+++ b/app/controllers/trainings_controller.rb
@@ -112,6 +112,7 @@ class TrainingsController < ApplicationController
@training.openid = session[:wechat_open_id]
@training.save!
+ flash[:message] = '提交成功'
redirect_to enroll_training_path(id: @tag_id)
# redirect_to pay_training_path(id: @tag_id)
end
@@ -130,6 +131,7 @@ class TrainingsController < ApplicationController
end
@training.save!
+ flash[:message] = '提交成功'
redirect_to enroll_training_path(id: @tag_id)
# redirect_to pay_training_path(id: @tag_id)
end
@@ -252,7 +254,7 @@ class TrainingsController < ApplicationController
def authenticate
if Rails.env.development?
- # session[:wechat_open_id] = "o5fSc0607iR3rp4-h_VnuBTp8CiM"
+ session[:wechat_open_id] = "o5fSc0607iR3rp4-h_VnuBTp8CiM"
end
unless session[:wechat_open_id].present?
diff --git a/app/views/trainings/enroll.html.erb b/app/views/trainings/enroll.html.erb
index 1362e78f..6b898691 100644
--- a/app/views/trainings/enroll.html.erb
+++ b/app/views/trainings/enroll.html.erb
@@ -205,27 +205,27 @@
<% end %>
- 通讯地址
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
手机号码
-
- Email
-
-
+
+
+
+
- 完成
+ 提交
<% end %>
@@ -248,7 +248,12 @@
} else {
$('#sex').val("2");
}
- })
+ });
+
+ var message = "<%= flash[:message] %>";
+ if (message && message.length > 0) {
+ alert(message);
+ }
})
//下一步