|
@@ -387,6 +387,7 @@
|
|
|
}, false)
|
|
|
}
|
|
|
if (sessionStorage.getItem("vipSubSelectTime")) {
|
|
|
+ console.log("ggggg", sessionStorage.getItem("vipSubSelectTime"))
|
|
|
this.timeSelect = JSON.parse(sessionStorage.getItem("vipSubSelectTime"));
|
|
|
}
|
|
|
|
|
@@ -453,10 +454,11 @@
|
|
|
},
|
|
|
showTime: function () {
|
|
|
var tmp = this.timeSelect[0];
|
|
|
- if (this.timeSelect[1] == 1) {
|
|
|
+ if (this.timeSelect[1] === 1) {
|
|
|
tmp += "年";
|
|
|
$("#yearly").prop('checked', true);
|
|
|
- $('.year_number:eq(' + (this.timeSelect[0] - 1) + ')').addClass("active");
|
|
|
+ //$('.year_number:eq(' + (this.timeSelect[0] - 1) + ')').trigger("click");
|
|
|
+ $('.year_number:eq(' + (this.timeSelect[0] - 1) + ')').addClass("active")
|
|
|
//$(".number_box:eq(1)").addClass("active");
|
|
|
} else {
|
|
|
tmp += "个月";
|
|
@@ -466,7 +468,7 @@
|
|
|
//if (this.timeSelect[0] >= 10) {
|
|
|
// $('.profit_tips').text("已选择" + this.timeSelect[0] + "个月,建议“按年订阅”").show();
|
|
|
//}
|
|
|
- if (this.timeSelect[0] == 1) {
|
|
|
+ if (this.timeSelect[0] === 1) {
|
|
|
$('#number_box_month button:eq(0)').attr("disabled", "disabled");
|
|
|
} else {
|
|
|
$('#number_box_month button:eq(0)').removeAttr("disabled");
|
|
@@ -667,7 +669,8 @@
|
|
|
// 渲染结果 保留一位小数
|
|
|
//var result = (Number(id) * 58).toFixed(1);
|
|
|
//$('.computed_price').html('¥' + result)
|
|
|
- purchase.timeSelect_tmp = [Number(id), 1]
|
|
|
+ console.log("xxxxxxxxx", Number(id));
|
|
|
+ purchase.timeSelect_tmp = [Number(id), 1];
|
|
|
purchase.flushPrice(purchase.timeSelect_tmp, 2);
|
|
|
});
|
|
|
|
|
@@ -726,24 +729,23 @@
|
|
|
// 确认订阅周期
|
|
|
$('#enter_period').on('click', function () {
|
|
|
var val;
|
|
|
- $('input[name="time"]').each(function (i, v) {
|
|
|
- var isChecked = $(v).is(':checked');
|
|
|
- if ($(v).is(':checked') === true && $('.year_number').hasClass('active')) {
|
|
|
- val = $('.active').html();
|
|
|
- purchase.timeSelect_tmp = [parseInt(val[0]), 1];
|
|
|
- $('#time_cycle').hide(function () {
|
|
|
- purchase.timeValue = val;
|
|
|
- purchase.flushSelectTime()
|
|
|
- });
|
|
|
- } else if ($(v).is(':checked') === true) {
|
|
|
- val = $('.month_number').html();
|
|
|
- purchase.timeSelect_tmp = [parseInt(val), 2];
|
|
|
- $('#time_cycle').hide(function () {
|
|
|
- purchase.timeValue = val + "个月";
|
|
|
- purchase.flushSelectTime()
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
+ var selectedDOM = $('#time_cycle input[name=time]:checked');
|
|
|
+ if (selectedDOM.val() === 'year') {
|
|
|
+ val = $('#number_box_year .year_number.active').attr('data-id');
|
|
|
+ purchase.timeSelect_tmp = [parseInt(val), 1];
|
|
|
+ $('#time_cycle').hide(function () {
|
|
|
+ purchase.timeValue = val + "年";
|
|
|
+ purchase.flushSelectTime()
|
|
|
+ });
|
|
|
+ } else if (selectedDOM.val() === 'month') {
|
|
|
+ val = $('#number_box_month .month_number').text();
|
|
|
+ purchase.timeSelect_tmp = [parseInt(val), 2];
|
|
|
+ $('#time_cycle').hide(function () {
|
|
|
+ purchase.timeValue = val + "个月";
|
|
|
+ purchase.flushSelectTime()
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
purchase.timeSelect = purchase.timeSelect_tmp;
|
|
|
purchase.flushPrice(purchase.timeSelect, 1);
|
|
|
sessionStorage.setItem("vipSubSelectTime", JSON.stringify(purchase.timeSelect));
|