Commit 19fe8d86 by 陈超

T

parent ad3f488c
...@@ -179,132 +179,6 @@ ...@@ -179,132 +179,6 @@
}); });
'</if>' '</if>'
$(function() {
$(".pay_dl .g-vo .g-radio:checked").siblings(".icon").addClass("icon-xuanze").removeClass("icon-yuan1")
$(".pay_dl .g-vo").click(function(){
$(this).children(".icon").addClass("icon-xuanze").removeClass("icon-yuan1").parent(".g-vo").siblings(".g-vo").find(".icon").addClass("icon-yuan1").removeClass("icon-xuanze");
$(this).children('input').prop('checked',true);
});
$("#vip_type_time .g-time").click(function(){
$(this).addClass("on").siblings().removeClass("on");
$(this).find("input").attr("checked","checked").parents(".g-time").siblings().find("input").removeAttr("checked");
});
$("#vip_time .vip_count .icon").click(function(){
var num=$("#vip_time .vip_count .num").val();
if ($(this).hasClass("icon-jian")){
if(num==1){
num=1;
}else{
num--;
if (num<0) {
num=0;
$("#vip_time .vip_count .num").val(num);
}else {
$("#vip_time .vip_count .num").val(num);
}
}
} else {
num++;
$("#vip_time .vip_count .num").val(num);
}
});
$(".header").hide();
$(".choose").click(function(){
$(this).addClass("on").siblings().removeClass('on');
$('.teacher_bd').stop(true,true).hide().eq($(this).index()).show();
});
$(document).on('click','[name="group-list"] label',function(){
$(this).addClass('selected').siblings().removeClass('selected');
var pay = $(this).parents('form').find('input:hidden[name="pay"]').val();
if(pay == 'cardpay'){
$('#oline_pay_div').hide(100);
$('#cardpay_div').show(100);
}else{
$('#oline_pay_div').show(100);
$('#cardpay_div').hide(100);
}
});
$('.btn_je_box a.btn_hui_h:eq(1)').click();
$('.btn_je_box a.btn_hui_h').click(function(){
$(this).parents('form').find('input:hidden[name="money"]').val($(this).attr('val')+$(this).attr('give'));
$('#lan_txt_cost').text($(this).attr('val'));
$('input#custom_money').val('').blur();
});
$('input#custom_money').change(function(e) {
$('.btn_je_box').children().removeAttr('selected');
$(this).parents('form').find('input:hidden[name="money"]').val($(this).val());
$('#lan_txt_cost').text($(this).val());
});
//选择充值VIP类型
$('.g-vo').click(function(){
$('.g-vo').removeClass("on");
$(this).addClass("on")
var _this = $(this).children("input");
var vip_month = _this.attr('data-vip-month');
var vip_year = _this.attr('data-vip-year');
var vip_time = $('input[name="vip_time"]').val();
var html = '<div class="g-time on" onclick="wode(this)"><input type="radio" name="vip_type_time" id="vip_month" data-value="'+vip_month+'" value="month" checked/><em>¥ '+vip_month+'</em>/月</div><div class="g-time" onclick="wode(this)"><input type="radio" name="vip_type_time" id="vip_year" data-value="'+vip_year+'" value="year" /><em>¥'+vip_year+'</em>/年</div>';
$("#vip_type_time").html(html);
var text = $('input[name="vip_type_time"]:checked').attr('data-value')*vip_time;
$('#price_show').html("¥"+text);
});
//选择充值时长
$(document).on("click","#vip_type_time .g-time",function(){
var _this = this;
var _val = $(_this).find("input").attr("data-value");
var val = $(_this).find("input").val();
var vip_time = $('input[name="vip_time"]').val();
var text = _val*vip_time;
$(_this).addClass("on").siblings().removeClass("on");
$(_this).find("input").attr("checked","checked").parents(".g-time").siblings().find("input").removeAttr("checked");
if( val == 'year') {
$('#vip_time .change').text('年');
} else {
$('#vip_time .change').text('月');
}
$('#price_show').html("¥"+text);
});
//输入月数
$('#vip_time .icon').click(function(){
var _this = this;
var vip_time = parseInt($("#vip_time .vip_count .num").val());
var val = $('input[name="vip_type_time"]:checked').attr('data-value');
if(vip_time <= 0 || isNaN(vip_time)){
$("#vip_time .vip_count .num").val('');$('#price_show').html("¥"+0);return ;
}else{
$("#vip_time .vip_count .num").val(vip_time);
}
$('#price_show').html("¥"+vip_time*val);
});
});
function select_pay(sbt,val){
var form = $(sbt).parents('form');
if(val==1){
form.find('input:hidden[name="pay"]').val("alipay");
}else if(val==2){
form.find('input:hidden[name="pay"]').val("unionpay");
}else if(val==3){
form.find('input:hidden[name="pay"]').val("wxpay");
}else if(val==4){
form.find('input:hidden[name="pay"]').val("cardpay");
}else if(val==5){
form.find('input:hidden[name="pay"]').val("lcnpay");
}
$(sbt).find(".yuan").addClass("on").removeClass("yuan");
$(sbt).siblings().find(".on").removeClass("on").addClass("yuan");
}
//充值VIP //充值VIP
function rechangeVip(sbt){ function rechangeVip(sbt){
var form = $(sbt).parents('form'); var form = $(sbt).parents('form');
...@@ -416,10 +290,5 @@ ...@@ -416,10 +290,5 @@
form.submit(); form.submit();
} }
} }
function wode(a){
$(a).addClass("on").siblings().removeClass("on");
$(a).find("input").attr("checked","checked").parents(".g-time").siblings().find("input").removeAttr("checked");
}
</script> </script>
<include file="__THEME__/public_footer_w3g"/> <include file="__THEME__/public_footer_w3g"/>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment