|
@@ -1,250 +1,259 @@
|
|
|
-var purchase = {
|
|
|
- areaSelect: {
|
|
|
- "一个省": ["一个市"]
|
|
|
- }, //已选择地区 {"一个省":["一个市"]}计算价格临时变量
|
|
|
- industrySelect: ["一个行业"], // 已选择行业 一个行业(计算价格临时变量)
|
|
|
- timeSelect: [1, 2], //已选择时间 timeSelect[0]时长 timeSelect[1] 1:年 2:月
|
|
|
- timeValue: "一个月",
|
|
|
- endTime: "",
|
|
|
- price: {}, //价格
|
|
|
- nowBuyset: {},
|
|
|
- timeCheckOk: false,
|
|
|
- payWay: "wx_app",
|
|
|
- initData: function () {
|
|
|
- //已选择
|
|
|
- try {
|
|
|
- //即将到期 回显已购买
|
|
|
- if (!sessionStorage.getItem("pay_read_cache")) {
|
|
|
- $DoPost("/subscribepay/vipsubscribe/getSubBuyMsg", {}, function (r) {
|
|
|
- if (r.success) {
|
|
|
- if (!$.isEmptyObject(r.data.area)) {
|
|
|
- purchase.areaSelect = r.data.area
|
|
|
- } else {
|
|
|
- purchase.areaSelect = {
|
|
|
- "全国": []
|
|
|
- }
|
|
|
- }
|
|
|
- if (r.data.industry.length != 0) {
|
|
|
- purchase.industrySelect = r.data.industry
|
|
|
- } else {
|
|
|
- purchase.industrySelect = ["全部行业"]
|
|
|
- }
|
|
|
- if (r.data.endTime) {
|
|
|
- purchase.endTime = r.data.endTime;
|
|
|
- }
|
|
|
- sessionStorage.setItem("vipSubSelectArea", JSON.stringify(purchase.areaSelect));
|
|
|
- sessionStorage.setItem("vipSubSelectIndustry", JSON.stringify(purchase.industrySelect));
|
|
|
- sessionStorage.setItem("endTime", JSON.stringify(purchase.endTime))
|
|
|
- sessionStorage.setItem("vipSub_read", true);
|
|
|
- }
|
|
|
- }, false)
|
|
|
- } else {
|
|
|
- sessionStorage.removeItem("pay_read_cache");
|
|
|
- if (sessionStorage.getItem("vipSubSelectArea")) {
|
|
|
- this.areaSelect = JSON.parse(sessionStorage.getItem("vipSubSelectArea"));
|
|
|
- }
|
|
|
- if (sessionStorage.getItem("vipSubSelectIndustry")) {
|
|
|
- this.industrySelect = JSON.parse(sessionStorage.getItem("vipSubSelectIndustry"));
|
|
|
- }
|
|
|
- if (sessionStorage.getItem("endTime")) {
|
|
|
- this.endTime = parseInt(sessionStorage.getItem("endTime"))
|
|
|
- }
|
|
|
- }
|
|
|
- if (sessionStorage.getItem("vipSubSelectTime")) {
|
|
|
- this.timeSelect = JSON.parse(sessionStorage.getItem("vipSubSelectTime"));
|
|
|
+var renew = {
|
|
|
+ oldRules: Calculation.PriceRule.old,
|
|
|
+ newRules: Calculation.PriceRule.new,
|
|
|
+ requestRules: {},
|
|
|
+ price: '', // 单位分
|
|
|
+ timeSelect: [1, 2], // 续费周期(默认选中1个月)
|
|
|
+ timeCheckOk: true,
|
|
|
+ buyInfo: { // 购买的信息
|
|
|
+ startTime: 0,
|
|
|
+ endTime: 0,
|
|
|
+ area: {},
|
|
|
+ industry: [],
|
|
|
+ buyset: {
|
|
|
+ areacount: 0,
|
|
|
+ newcitys: [],
|
|
|
+ buyerclasscount: 3
|
|
|
+ },
|
|
|
+ isTrial: false,
|
|
|
+ renewList: []
|
|
|
+ },
|
|
|
+ init: function () {
|
|
|
+ this.recoverState()
|
|
|
+ this.getPrice()
|
|
|
+ this.getBuySetInfo()
|
|
|
+ this.initEvents()
|
|
|
+ },
|
|
|
+ setAreaAndIndustry: function () {
|
|
|
+ var buySet = this.buyInfo.buyset
|
|
|
+ var result = {
|
|
|
+ area: '',
|
|
|
+ industry: ''
|
|
|
+ }
|
|
|
+ // 区域
|
|
|
+ if (buySet.areacount === -1) {
|
|
|
+ result.area = '全国'
|
|
|
+ } else {
|
|
|
+ var strArr = []
|
|
|
+ if (buySet.areacount) {
|
|
|
+ strArr.push(buySet.areacount + '个省')
|
|
|
}
|
|
|
- if (sessionStorage.liveActiveCode_renew === "jianyu360") {
|
|
|
- $('.coupon-code-tx .keywords-text').text("支付成功赠送30天订阅周期");
|
|
|
- $('.coupon-picker .weui-input').val("jianyu360");
|
|
|
- $('.coupon-code-tx').off('click');
|
|
|
+ if (buySet.newcitys && buySet.newcitys.length !== 0) {
|
|
|
+ var count = 0
|
|
|
+ buySet.newcitys.forEach(function (item) {
|
|
|
+ count += item
|
|
|
+ })
|
|
|
+ strArr.push(count + '个市(分布在' + buySet.newcitys.length + '个省内')
|
|
|
}
|
|
|
- //加载价格
|
|
|
- $DoPost("/subscribepay/vipsubscribe/getPrice", {}, function (r) {
|
|
|
- if (r) {
|
|
|
- purchase.price = r;
|
|
|
- purchase.can1111 = r.isActiving && r.isWritten === 0
|
|
|
- if (purchase.can1111) {
|
|
|
- if (!sessionStorage.getItem("vipSubSelectTime")) {
|
|
|
- purchase.timeValue = "1年";
|
|
|
- purchase.timeSelect_tmp = [1,1]
|
|
|
- purchase.timeSelect = purchase.timeSelect_tmp;
|
|
|
- purchase.showTime();
|
|
|
- purchase.flushPrice(purchase.timeSelect, 1);
|
|
|
- sessionStorage.setItem("vipSubSelectTime", JSON.stringify(purchase.timeSelect));
|
|
|
- }
|
|
|
- showGiveStatus(true)
|
|
|
- } else {
|
|
|
- //showGiveStatus(false)
|
|
|
- }
|
|
|
- }
|
|
|
- }, false)
|
|
|
+ result.area = strArr.join('、')
|
|
|
+ }
|
|
|
|
|
|
- } catch (e) {
|
|
|
- console.log(e)
|
|
|
+ // 行业(3个行业价格和全部行业价格相同,当购买3个以上行业页面显示全部行业)
|
|
|
+ if (buySet.buyerclasscount === -1 || buySet.buyerclasscount >= 3) {
|
|
|
+ result.industry = '全部行业'
|
|
|
+ } else {
|
|
|
+ result.industry = buySet.buyerclasscount + '个行业'
|
|
|
}
|
|
|
- this.nowBuyset = getBuySet(purchase.areaSelect, purchase.industrySelect, this.price);
|
|
|
|
|
|
- if (sessionStorage.getItem("payWay")) {
|
|
|
- if (sessionStorage.getItem("payWay").indexOf("ali") > -1) {
|
|
|
- this.payWay = "ali_app";
|
|
|
- $("#zfb").prop("checked", true);
|
|
|
- $(".pay-mode-text").text("支付宝支付");
|
|
|
+ $('.area .item-r').text(result.area)
|
|
|
+ $('.industry .item-r').text(result.industry)
|
|
|
+
|
|
|
+ return result
|
|
|
+ },
|
|
|
+ initEvents: function () {
|
|
|
+ this.initClickEvents()
|
|
|
+ this.initPickerEvents()
|
|
|
+ },
|
|
|
+ getBuySetInfo: function () {
|
|
|
+ var _this = this
|
|
|
+ $.ajax({
|
|
|
+ url: '/subscribepay/vipsubscribe/getSubBuyMsg',
|
|
|
+ type: 'POST',
|
|
|
+ success: function (r) {
|
|
|
+ if (r.success && r.data) {
|
|
|
+ Object.assign(_this.buyInfo, r.data)
|
|
|
+ _this.setAreaAndIndustry()
|
|
|
+ _this.checkShowDueTip()
|
|
|
+ // 初始化默认续费周期
|
|
|
+ _this.calcDuration(true)
|
|
|
+ // 初始化价格计算类
|
|
|
+ Calculation.Init(
|
|
|
+ false,
|
|
|
+ new Buyset(_this.buyInfo.buyset.areacount, _this.buyInfo.buyset.newcitys, _this.buyInfo.buyset.buyerclasscount)
|
|
|
+ )
|
|
|
+ // 初始化默认金额
|
|
|
+ _this.setPrice(_this.calcPrice())
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
+ })
|
|
|
},
|
|
|
- showArea: function () {
|
|
|
- if (!$.isEmptyObject(this.areaSelect) && !this.areaSelect["一个省"]) { //有选择
|
|
|
- if (this.nowBuyset.areacount === -1) {
|
|
|
- $(".area .item-r").text("全国");
|
|
|
- } else {
|
|
|
- var tipTxt = "";
|
|
|
- if (this.nowBuyset.areacount > 0) tipTxt += this.nowBuyset.areacount + " 个省";
|
|
|
- var count = 0;
|
|
|
- this.nowBuyset.citys.forEach(function (item, index) {
|
|
|
- count += item;
|
|
|
- });
|
|
|
- if (count > 0) {
|
|
|
- if (this.nowBuyset.areacount > 0) tipTxt += "、";
|
|
|
- tipTxt += count + " 个市";
|
|
|
- if (this.nowBuyset.citys.length > 1) tipTxt += "(分布在" + this.nowBuyset.citys.length + "个省内)"
|
|
|
+ getPrice: function () {
|
|
|
+ var _this = this
|
|
|
+ $.ajax({
|
|
|
+ url: '/subscribepay/vipsubscribe/getPrice',
|
|
|
+ type: 'POST',
|
|
|
+ success: function (r) {
|
|
|
+ if (r) {
|
|
|
+ _this.requestRules = r
|
|
|
}
|
|
|
- $(".area .item-r").text(tipTxt);
|
|
|
}
|
|
|
- } else {
|
|
|
- $(".area .item-r").text("");
|
|
|
- }
|
|
|
+ })
|
|
|
},
|
|
|
- showPrice: function () {
|
|
|
- $('.monthly span:eq(0)').text(purchase.price.month.oneCity_oneBuyerClass / 100);
|
|
|
- $('.monthly span:eq(1)').text(purchase.price.month.oneCity_allBuyerClass / 100);
|
|
|
- $('.monthly span:eq(2)').text(purchase.price.month.oneProvince_oneBuyerClass / 100);
|
|
|
- $('.monthly span:eq(3)').text(purchase.price.month.oneProvince_allBuyerClass / 100);
|
|
|
- $('.monthly span:eq(4)').text(purchase.price.month.allProvince_oneBuyerClass / 100);
|
|
|
- $('.monthly span:eq(5)').text(purchase.price.month.allProvince_allBuyerClass / 100);
|
|
|
-
|
|
|
- $('.yearly span:eq(0)').text(purchase.price.year.oneCity_oneBuyerClass / 100);
|
|
|
- $('.yearly span:eq(1)').text(purchase.price.year.oneCity_allBuyerClass / 100);
|
|
|
- $('.yearly span:eq(2)').text(purchase.price.year.oneProvince_oneBuyerClass / 100);
|
|
|
- $('.yearly span:eq(3)').text(purchase.price.year.oneProvince_allBuyerClass / 100);
|
|
|
- $('.yearly span:eq(4)').text(purchase.price.year.allProvince_oneBuyerClass / 100);
|
|
|
- $('.yearly span:eq(5)').text(purchase.price.year.allProvince_allBuyerClass / 100);
|
|
|
+ calcPrice: function () {
|
|
|
+ return Calculation.GetTotal(undefined, this.timeSelect)
|
|
|
},
|
|
|
- showIndustry: function () {
|
|
|
- if (this.industrySelect.length > 0 && this.industrySelect[0] !== "一个行业") { //选择有行业信息
|
|
|
- if (this.nowBuyset.buyerclasscount === -1) {
|
|
|
- $(".industry .item-r").text("全部行业");
|
|
|
- } else {
|
|
|
- var tipTxt = "";
|
|
|
- $(".industry .item-r").text(tipTxt + this.nowBuyset.buyerclasscount + " 个行业");
|
|
|
- }
|
|
|
- } else {
|
|
|
- $(".industry .item-r").text("");
|
|
|
+ setPrice: function (price) {
|
|
|
+ this.price = price
|
|
|
+ coupon.updatePrice(formatMoney(this.price / 100))
|
|
|
+ },
|
|
|
+ // 根据选中结果得到一个时间段的时间戳
|
|
|
+ getDuration: function (timeSelect) {
|
|
|
+ var dStamp = 0
|
|
|
+ var s = ''
|
|
|
+ var perMonthStamp = 1000 * 60 * 60 * 24 * 30
|
|
|
+ if (timeSelect[1] === 1) {
|
|
|
+ // 年
|
|
|
+ dStamp = timeSelect[0] * 12 * perMonthStamp
|
|
|
+ s = timeSelect[0] + '年'
|
|
|
+ } else if (timeSelect[1] === 2) {
|
|
|
+ // 月
|
|
|
+ dStamp = timeSelect[0] * perMonthStamp
|
|
|
+ s = timeSelect[0] + '个月'
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ stamp: dStamp,
|
|
|
+ s: s
|
|
|
}
|
|
|
},
|
|
|
- showTime: function () {
|
|
|
- var tmp = this.timeSelect[0];
|
|
|
- if (this.timeSelect[1] === 1) {
|
|
|
- tmp += "年";
|
|
|
- $("#yearly").prop('checked', true);
|
|
|
- //$('.year_number:eq(' + (this.timeSelect[0] - 1) + ')').trigger("click");
|
|
|
- $('.year_number:eq(' + (this.timeSelect[0] - 1) + ')').addClass("active")
|
|
|
- //$(".number_box:eq(1)").addClass("active");
|
|
|
+ // 计算续费后的日期区间
|
|
|
+ calcDuration: function (needSet) {
|
|
|
+ // 根据
|
|
|
+ var endTime = this.buyInfo.endTime
|
|
|
+ if (!endTime) {
|
|
|
+ $('.select_cycle .duration').hide()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ var durationInfo = this.getDuration(this.timeSelect)
|
|
|
+ var durationStamp = durationInfo.stamp // 续费时间段时间戳
|
|
|
+ var durationStr = durationInfo.s // 续费时间段字符串
|
|
|
+ var buyEndTimeString = new Date(endTime * 1000).pattern('yyyy年MM月dd日') // svip到期时间
|
|
|
+ var renewEndTimeString = new Date(endTime * 1000 + durationStamp).pattern('yyyy年MM月dd日') //续费后到期时间
|
|
|
+
|
|
|
+ if (needSet) {
|
|
|
+ $('.select_cycle .month').text(durationStr)
|
|
|
+ $('.select_cycle .duration').text(buyEndTimeString + ' - ' + renewEndTimeString)
|
|
|
} else {
|
|
|
- tmp += "个月";
|
|
|
- $("#monthly").prop('checked', true);
|
|
|
- $(".number_box:eq(0)").addClass("active");
|
|
|
- $("#number_box_month .month_number").text(this.timeSelect[0]);
|
|
|
- //if (this.timeSelect[0] >= 10) {
|
|
|
- // $('.profit_tips').text("已选择" + this.timeSelect[0] + "个月,建议“按年订阅”").show();
|
|
|
- //}
|
|
|
- if (this.timeSelect[0] === 1) {
|
|
|
- $('#number_box_month button:eq(0)').attr("disabled", "disabled");
|
|
|
- } else {
|
|
|
- $('#number_box_month button:eq(0)').removeAttr("disabled");
|
|
|
+ return {
|
|
|
+ duration: durationStr, // 续费时间段字符串
|
|
|
+ buyEndTimeString: buyEndTimeString, // svip到期时间
|
|
|
+ renewEndTimeString: renewEndTimeString, //续费后到期时间
|
|
|
}
|
|
|
}
|
|
|
- this.timeValue = tmp;
|
|
|
},
|
|
|
- flushPrice: function (time, flag) {
|
|
|
- //var price = getsubVipOrderPrice(this.areaSelect, this.industrySelect, time, this.price);
|
|
|
- var times = [time[0], time[1]];
|
|
|
- var price = getsubVipOrderPriceBybuyset(this.nowBuyset, time);
|
|
|
- var givePrice = getsubVipOrderPriceBybuyset(this.nowBuyset, [time[1] === 1 ? 1 :time[0], time[1]]);
|
|
|
-
|
|
|
- var showPrice = formatMoney(price);
|
|
|
- if (flag === 1) {
|
|
|
- $('.billing-price').text(showPrice);
|
|
|
- $('.origin-price .price-num').text(formatMoney(price + givePrice));
|
|
|
- // 优惠明细
|
|
|
- $('.discount-price .dis-price').text(formatMoney(givePrice))
|
|
|
- $('.now-price .dis-price').text(formatMoney(price));
|
|
|
-
|
|
|
- } else if (flag === 2) {
|
|
|
- $('.computed_price').html(showPrice);
|
|
|
- } else {
|
|
|
- $('.billing-price').text(showPrice);
|
|
|
- $('.origin-price .price-num').text(formatMoney(price + givePrice));
|
|
|
- // 优惠明细
|
|
|
- $('.discount-price .dis-price').text(formatMoney(givePrice))
|
|
|
- $('.now-price .dis-price').text(formatMoney(price));
|
|
|
- $('.computed_price').html(showPrice);
|
|
|
+ // 月份转年份(超过1年才会转)
|
|
|
+ monthToYear: function (num) {
|
|
|
+ var year = Math.floor(num / 12)
|
|
|
+ var month = num % 12
|
|
|
+ var str = ''
|
|
|
+ if (year) {
|
|
|
+ str += (year + '年')
|
|
|
+ }
|
|
|
+ if (month) {
|
|
|
+ str += (month + '个月')
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ str: str,
|
|
|
+ year: year,
|
|
|
+ month: month
|
|
|
}
|
|
|
- this.flushSelectTime(times, flag === undefined ? 1 : flag);
|
|
|
- coupon.updatePrice(price)
|
|
|
},
|
|
|
- flushSelectTime(thisValue, flag) {
|
|
|
- if (this.endTime) {
|
|
|
- var time1 = new Date(this.endTime * 1000).pattern('yyyy年MM月dd日');
|
|
|
- var end = getVipEndDate(thisValue[1], thisValue[0], this.endTime);
|
|
|
- var time2 = new Date(end * 1000).pattern('yyyy年MM月dd日');
|
|
|
+ checkOver3Years: function () {
|
|
|
+ // 根据
|
|
|
+ var endTime = this.buyInfo.endTime
|
|
|
+ if (!endTime) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ var maxEndMonth = 36 // 最大续费36个月
|
|
|
+ var durationInfo = this.getDuration(this.timeSelect)
|
|
|
+ var durationStamp = durationInfo.stamp // 续费时间段时间戳
|
|
|
|
|
|
- if (flag === 1) {
|
|
|
- $(".select_cycle .month").text(this.timeValue);
|
|
|
- var giveTime = this.timeValue
|
|
|
- if (this.timeValue.indexOf('年') !== -1) {
|
|
|
- giveTime = '1年'
|
|
|
- }
|
|
|
- $(".select_cycle #giveTime").text(giveTime);
|
|
|
- $(".select_cycle .duration").text(time1 + "-" + time2);
|
|
|
- $(".select_cycle .duration").show();
|
|
|
- // @NewYearMarketing 2021/1/25
|
|
|
- checkMonth(giveTime)
|
|
|
- }
|
|
|
+ // 最长订阅周期不可超过3年 ------------
|
|
|
+ var nowStamp = Math.floor(Date.now() / 1000)
|
|
|
+ // 已购买的套餐剩余月数
|
|
|
+ var lastMonthStamp = endTime - nowStamp
|
|
|
+ var lastMonth = Math.ceil(lastMonthStamp / (60 * 60 * 24 * 30))
|
|
|
+ // 续费后套餐剩余月数(需要加上原剩余月数lastMonth)
|
|
|
+ var renewMonthTotalStamp = lastMonthStamp + (durationStamp / 1000)
|
|
|
+ var renewMonthTotal = Math.ceil(renewMonthTotalStamp / (60 * 60 * 24 * 30))
|
|
|
|
|
|
- //是否超过三年
|
|
|
- var now = Math.floor(new Date().getTime() / 1000);
|
|
|
- var MaxEnd = getVipEndDate(1, 3, now);
|
|
|
- if (!purchase.can1111 && end > MaxEnd) {
|
|
|
- var timeShow = getDateSub(now, this.endTime);
|
|
|
- var showTipText = "<div style='white-space: nowrap;'>最长订阅周期不可超过3年</div>剩余周期:";
|
|
|
- if (timeShow[0] !== 0) {
|
|
|
- showTipText += timeShow[0] + "年"
|
|
|
- }
|
|
|
- if (timeShow[1] !== 0) {
|
|
|
- showTipText += timeShow[1] + "个月"
|
|
|
- }
|
|
|
- weui.toast(showTipText, {
|
|
|
- duration: 3000,
|
|
|
- className: 'jy-toast',
|
|
|
- });
|
|
|
- if (flag === 1) this.timeCheckOk = false;
|
|
|
- if (flag === 2) $("#enter_period").prop("disabled", true);
|
|
|
- } else {
|
|
|
- if (flag === 1) this.timeCheckOk = true;
|
|
|
- if (flag === 2) $("#enter_period").prop("disabled", false);
|
|
|
- }
|
|
|
- this.flushSubmit();
|
|
|
+ if (renewMonthTotal > maxEndMonth) {
|
|
|
+ var showTipText = '<div style="white-space: nowrap;">最长订阅周期不可超过3年</div>剩余周期:' + this.monthToYear(lastMonth).str
|
|
|
+ weui.toast(showTipText, {
|
|
|
+ duration: 3000,
|
|
|
+ className: 'jy-toast',
|
|
|
+ })
|
|
|
+ // 确认按钮置灰
|
|
|
+ $('#enter_period').prop('disabled', true)
|
|
|
} else {
|
|
|
- $(".select_cycle .duration").hide();
|
|
|
+ $('#enter_period').prop('disabled', false)
|
|
|
}
|
|
|
},
|
|
|
- showTip() { //是否展示即将到期
|
|
|
- var timeSub = this.endTime * 1000 - new Date().getTime();
|
|
|
+ // 是否展示即将到期
|
|
|
+ checkShowDueTip () {
|
|
|
+ var endTime = this.buyInfo.endTime * 1000
|
|
|
+ var timeSub = endTime - Date.now()
|
|
|
if (timeSub > 0 && timeSub < 60 * 60 * 24 * 1000 * 3) {
|
|
|
- $(".vip-header").show();
|
|
|
+ $('.vip-header').show()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ setTimePickerSelected: function (timeSelect) {
|
|
|
+ timeSelect = [1 ,2]
|
|
|
+ if (timeSelect[1] === 1) {
|
|
|
+ // 年
|
|
|
+ dStamp = timeSelect[0] * 12 * perMonthStamp
|
|
|
+ s = timeSelect[0] + '年'
|
|
|
+ } else if (timeSelect[1] === 2) {
|
|
|
+ // 月
|
|
|
+ dStamp = timeSelect[0] * perMonthStamp
|
|
|
+ s = timeSelect[0] + '个月'
|
|
|
}
|
|
|
},
|
|
|
- flushSubmit() { //是否可提交
|
|
|
+ getTimePickerSelected: function () {
|
|
|
+ var timeSelectPicker = $('#time_cycle')
|
|
|
+ var $checkInput = timeSelectPicker.find('input[name=time]:checked')
|
|
|
+ if (!$checkInput) return
|
|
|
+ // year/month(按年或者按月购买)
|
|
|
+ var checkedType = $checkInput.val()
|
|
|
+ // timeSelectedArr[0] 代表选择的内容
|
|
|
+ // timeSelectedArr[1] 代表选择的类型 1年份 2月份
|
|
|
+ var timeSelectedArr = []
|
|
|
+ if (checkedType === 'month') {
|
|
|
+ timeSelectedArr = [$('#number_box_month .month_number').text() - 0, 2]
|
|
|
+ } else if (checkedType === 'year') {
|
|
|
+ timeSelectedArr = [$('#number_box_year .year_number.active').attr('data-id') - 0, 1]
|
|
|
+ }
|
|
|
+ return timeSelectedArr
|
|
|
+ },
|
|
|
+ onTimePickerChange: function () {
|
|
|
+ this.timeSelect = this.getTimePickerSelected()
|
|
|
+ var price = this.calcPrice()
|
|
|
+ $('.computed_price').text(formatMoney(price / 100))
|
|
|
+ this.checkOver3Years()
|
|
|
+ },
|
|
|
+ // 恢复数据
|
|
|
+ recoverState: function () {
|
|
|
+ var vipSubSelectTime = sessionStorage.getItem('vipSubSelectTime')
|
|
|
+ if (vipSubSelectTime) {
|
|
|
+ this.timeSelect = JSON.parse(vipSubSelectTime)
|
|
|
+ }
|
|
|
+ this.flushSubmit()
|
|
|
+ },
|
|
|
+ // 保存数据
|
|
|
+ saveState: function () {
|
|
|
+ sessionStorage.setItem('vipSubSelectTime', JSON.stringify(this.timeSelect))
|
|
|
+ },
|
|
|
+ // 是否可提交
|
|
|
+ flushSubmit: function () {
|
|
|
if (this.timeCheckOk && sessionStorage.getItem("vipSub_read") === "true") {
|
|
|
$('.vip-footer.renew .confirm').prop('disabled', false)
|
|
|
coupon.checkboxStatus = true
|
|
@@ -253,261 +262,187 @@ var purchase = {
|
|
|
$('.vip-footer.renew .confirm').prop('disabled', true)
|
|
|
coupon.$refs.couponRef.submitStatus = true
|
|
|
}
|
|
|
- }
|
|
|
-};
|
|
|
+ },
|
|
|
+ initClickEvents: function () {
|
|
|
+ var _this = this
|
|
|
+ /*------ 关闭弹窗事件 点击取消或遮罩层 -----*/
|
|
|
+ $('.weui-mask').click(hideDialog);
|
|
|
+ $('.cancel').click(hideDialog);
|
|
|
|
|
|
+ // 确认订阅周期
|
|
|
+ $('#enter_period').on('click', function () {
|
|
|
+ $('.weui-mask').trigger('click')
|
|
|
+ _this.calcDuration(true)
|
|
|
+ _this.setPrice(_this.calcPrice())
|
|
|
+ })
|
|
|
|
|
|
-$(function () {
|
|
|
- purchase.initData();
|
|
|
- purchase.showArea();
|
|
|
- purchase.showIndustry();
|
|
|
- purchase.showPrice();
|
|
|
- purchase.showTime();
|
|
|
- purchase.showTip();
|
|
|
- purchase.flushPrice(purchase.timeSelect);
|
|
|
- purchase.flushSubmit();
|
|
|
- var time_limit; //定义一个周期变量
|
|
|
- /*------ 关闭弹窗事件 点击取消或遮罩层 -----*/
|
|
|
- $('.weui-mask').click(hideDialog);
|
|
|
- $('.cancel').click(hideDialog);
|
|
|
+ $('.vip-footer.renew .confirm').on('click', function () {
|
|
|
+ $('.vip-footer.renew .confirm').prop('disabled', true)
|
|
|
+ //支付请求
|
|
|
+ var data = {
|
|
|
+ userLotteryId :coupon.$refs.couponRef.coupon.userLotteryId,
|
|
|
+ lotteryId : coupon.$refs.couponRef.coupon.lotteryId,
|
|
|
+ time : _this.getDuration(_this.timeSelect).s.trim(),
|
|
|
+ orderType: 5,
|
|
|
+ disWord :GetQueryString('disWord'),
|
|
|
+ price: _this.price
|
|
|
+ }
|
|
|
+ $.ajax({
|
|
|
+ // url: '/subscribepay/vipsubscribe/createOrder',
|
|
|
+ url: '/subscribepay/vipsubscribe/renew',
|
|
|
+ type: 'POST',
|
|
|
+ data: data,
|
|
|
+ success: function (r) {
|
|
|
+ $('.vip-footer.renew .confirm').prop('disabled', false)
|
|
|
+ clearSessionStorage()
|
|
|
+ if (r.success) {
|
|
|
+ try {
|
|
|
+ history.replaceState({}, '', '/jyapp/vipsubscribe/toOrderDetailPage?orderCode=' + r.data.code);
|
|
|
+ window.location.href = "/jyapp/pay/checkout_subvip?orderCode=" + r.data.code + "&t=1&from=buy"
|
|
|
+ } catch (e) {
|
|
|
+ showToast(e)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ showToast(r.errMsg || '请求失败')
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ initPickerEvents: function () {
|
|
|
+ var _this = this
|
|
|
+ /* ----- 订阅周期弹窗弹出事件 -------*/
|
|
|
+ // 选择订阅周期
|
|
|
+ $('.select_cycle a').click(function (e) {
|
|
|
+ _this.onTimePickerChange()
|
|
|
+ $('#time_cycle').show(200);
|
|
|
+ });
|
|
|
|
|
|
- /* ----- 订阅周期、支付方式弹窗弹出事件 -------*/
|
|
|
- // 选择订阅周期
|
|
|
- $('.select_cycle a').click(function (e) {
|
|
|
- $('#time_cycle').show(200);
|
|
|
- });
|
|
|
+ // 对订阅时间选择的input绑定点击事件
|
|
|
+ $('#time_cycle input:radio[name="time"]').on('click', function (e) {
|
|
|
+ // 解除确认按钮的锁定
|
|
|
+ if ($(e.target).hasClass('monthly') !== $('#number_box_month').hasClass('active')) {
|
|
|
+ $('#time_cycle .form-btn button').removeAttr('disabled');
|
|
|
+ }
|
|
|
+ if ($(e.target).hasClass('monthly')) {
|
|
|
+ // 按月订阅
|
|
|
+ $('#number_box_month').addClass('active');
|
|
|
+ $('#number_box_year span').removeClass('active');
|
|
|
+ } else {
|
|
|
+ // 按年订阅
|
|
|
+ $('#number_box_month').removeClass('active');
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
+ /* --------控制月份number_box的事件 点击加减号触发的事件------- */
|
|
|
+ $('#number_box_month').on('click', 'button', function (e) {
|
|
|
+ // 点击加减号让input radio选中
|
|
|
+ $('#monthly').prop('checked', true);
|
|
|
+ $('#yearly').prop('checked', false);
|
|
|
+ $('.number_box span').removeClass('active');
|
|
|
+ $('#number_box_month').addClass('active');
|
|
|
|
|
|
- /* ----- 选择完支付方式、订阅周期 回显到页面 -------*/
|
|
|
- $('.vip-body .pay-mode').on('click', function () {
|
|
|
- pickerShow('#pay_way', true)
|
|
|
- });
|
|
|
+ var $number = $('#number_box_month span.month_number');
|
|
|
+ var $monthlyInput = $('#monthly');
|
|
|
+ // 未整理的data数组,里面的值都是字符串
|
|
|
+ var preData = e.delegateTarget.dataset;
|
|
|
+ var currentNum = parseInt($number.text());
|
|
|
+ var data = {};
|
|
|
+ // 把字符串转换成数字
|
|
|
+ for (var i in preData) {
|
|
|
+ data[i] = preData[i] - 0
|
|
|
+ }
|
|
|
|
|
|
- $('#pay_way input:radio[name="way"]').click(function () {
|
|
|
- var checkValue = $('input:radio[name="way"]:checked').val();
|
|
|
- pickerShow('#pay_way', false)
|
|
|
- $('.vip-body .pay-mode .pay-mode-text').text(checkValue);
|
|
|
- if (checkValue === "微信支付") {
|
|
|
- purchase.payWay = "wx_app"
|
|
|
- } else {
|
|
|
- purchase.payWay = "ali_app"
|
|
|
- }
|
|
|
- sessionStorage.setItem("payWay", purchase.payWay);
|
|
|
- });
|
|
|
+ if (!$monthlyInput.prop('checked')) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 判断是点击的是+ 还是-
|
|
|
+ if ($(e.target).hasClass('add') || $(e.currentTarget).hasClass('add')) {
|
|
|
+ if (currentNum == 11) { //12个月自动跳转1年
|
|
|
+ $("#number_box_year .year_number:eq(0)").trigger("click");
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 点的+
|
|
|
+ currentNum = currentNum >= data.numboxMax ? data.numboxMax : (currentNum + data.numboxStep);
|
|
|
+ } else {
|
|
|
+ // 点的-
|
|
|
+ currentNum = currentNum <= data.numboxMin ? data.numboxMin : (currentNum - data.numboxStep);
|
|
|
+ }
|
|
|
+ $number.text(currentNum);
|
|
|
|
|
|
+ _this.onTimePickerChange()
|
|
|
|
|
|
- // 对订阅时间选择的input绑定点击事件
|
|
|
- $('#time_cycle input:radio[name="time"]').on('click', function (e) {
|
|
|
- // 解除确认按钮的锁定
|
|
|
- if ($(e.target).hasClass('monthly') !== $('#number_box_month').hasClass('active')) {
|
|
|
- $('#time_cycle .form-btn button').removeAttr('disabled');
|
|
|
- }
|
|
|
- if ($(e.target).hasClass('monthly')) {
|
|
|
- // 按月订阅
|
|
|
- $('#number_box_month').addClass('active');
|
|
|
- $('#number_box_year span').removeClass('active');
|
|
|
- } else {
|
|
|
- // 按年订阅
|
|
|
+ var firstButton = $('#number_box_month button:first');
|
|
|
+ var lastButton = $('#number_box_month button:last');
|
|
|
+ // 如果为操作后的结果为1,则锁定减号按钮
|
|
|
+ if (currentNum === data.numboxMin) {
|
|
|
+ firstButton.attr('disabled', true)
|
|
|
+ } else {
|
|
|
+ firstButton.removeAttr('disabled')
|
|
|
+ }
|
|
|
+ // 如果为操作后的结果为12,则锁定加号按钮
|
|
|
+ if (currentNum === data.numboxMax) {
|
|
|
+ lastButton.attr('disabled', true)
|
|
|
+ } else {
|
|
|
+ lastButton.removeAttr('disabled')
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ /* -------- 控制年份number_box的事件 点击1年 2年 3年触发的事件------- */
|
|
|
+ $('#number_box_year').on('click', 'span', function (e) {
|
|
|
$('#number_box_month').removeClass('active');
|
|
|
- // $('#number_box_year span:eq(0)').addClass('active').siblings().removeClass('active');
|
|
|
- }
|
|
|
- });
|
|
|
+ var id = e.target.dataset.id;
|
|
|
+ $(this).addClass('active').siblings().removeClass('active');
|
|
|
+ $('#yearly').prop('checked', true);
|
|
|
+ $("#monthly").prop('checked', false);
|
|
|
|
|
|
- /* --------控制月份number_box的事件 点击加减号触发的事件------- */
|
|
|
- $('#number_box_month').on('click', 'button', function (e) {
|
|
|
- // 点击加减号让input radio选中
|
|
|
- $('#monthly').prop('checked', true);
|
|
|
- $('#yearly').prop('checked', false);
|
|
|
- $('.number_box span').removeClass('active');
|
|
|
- $('#number_box_month').addClass('active');
|
|
|
+ _this.onTimePickerChange()
|
|
|
+ });
|
|
|
|
|
|
- var $number = $('#number_box_month span.month_number');
|
|
|
- var $monthlyInput = $('#monthly');
|
|
|
- // 未整理的data数组,里面的值都是字符串
|
|
|
- var preData = e.delegateTarget.dataset;
|
|
|
- var currentNum = parseInt($number.text());
|
|
|
- var data = {};
|
|
|
- // 把字符串转换成数字
|
|
|
- for (var i in preData) {
|
|
|
- data[i] = preData[i] - 0
|
|
|
- }
|
|
|
-
|
|
|
- if (!$monthlyInput.prop('checked')) {
|
|
|
- return
|
|
|
- }
|
|
|
- // 判断是点击的是+ 还是-
|
|
|
- if ($(e.target).hasClass('add') || $(e.currentTarget).hasClass('add')) {
|
|
|
- if (currentNum == 11) { //12个月自动跳转1年
|
|
|
- $("#number_box_year .year_number:eq(0)").trigger("click");
|
|
|
- return
|
|
|
+ /* -------- 选择按月订阅 radio触发的事件------- */
|
|
|
+ $('#monthly').on('change', function (e) {
|
|
|
+ var isChecked = $(this).is(':checked');
|
|
|
+ var val = $('.month_number').text();
|
|
|
+ if (!isChecked) {
|
|
|
+ $('#number_box_month button').attr('disabled', true)
|
|
|
}
|
|
|
- // 点的+
|
|
|
- currentNum = currentNum >= data.numboxMax ? data.numboxMax : (currentNum + data
|
|
|
- .numboxStep);
|
|
|
- } else {
|
|
|
- // 点的-
|
|
|
- currentNum = currentNum <= data.numboxMin ? data.numboxMin : (currentNum - data
|
|
|
- .numboxStep);
|
|
|
- }
|
|
|
- $number.text(currentNum);
|
|
|
- purchase.timeSelect_tmp = [Number(currentNum), 2];
|
|
|
- purchase.flushPrice(purchase.timeSelect_tmp, 2);
|
|
|
- //var price = (5.8 * currentNum).toFixed(1);
|
|
|
- //$('.computed_price').html('¥' + price)
|
|
|
- var firstButton = $('#number_box_month button:first');
|
|
|
- var lastButton = $('#number_box_month button:last');
|
|
|
- /*if (currentNum >= 10) {
|
|
|
- $('.profit_tips').text("已选择" + currentNum + "个月,建议“按年订阅”").show();
|
|
|
- } else {
|
|
|
- $('.profit_tips').hide();
|
|
|
- }*/
|
|
|
- // 如果为操作后的结果为1,则锁定减号按钮
|
|
|
- if (currentNum === data.numboxMin) {
|
|
|
- firstButton.attr('disabled', true)
|
|
|
- } else {
|
|
|
- firstButton.removeAttr('disabled')
|
|
|
- }
|
|
|
- // 如果为操作后的结果为12,则锁定加号按钮
|
|
|
- if (currentNum === data.numboxMax) {
|
|
|
- lastButton.attr('disabled', true)
|
|
|
- } else {
|
|
|
- lastButton.removeAttr('disabled')
|
|
|
- }
|
|
|
- });
|
|
|
+ _this.onTimePickerChange()
|
|
|
+ });
|
|
|
|
|
|
- /* -------- 控制年份number_box的事件 点击1年 2年 3年触发的事件------- */
|
|
|
- $('#number_box_year').on('click', 'span', function (e) {
|
|
|
- // console.log(e.target.dataset.id);
|
|
|
- $('#number_box_month').removeClass('active');
|
|
|
- var id = e.target.dataset.id;
|
|
|
- //$('.profit_tips').hide();
|
|
|
- $(this).addClass('active').siblings().removeClass('active');
|
|
|
- $('#yearly').prop('checked', true);
|
|
|
- $("#monthly").prop('checked', false);
|
|
|
+ /* -------- 选择按年订阅 radio触发的事件------- */
|
|
|
+ $('#yearly').on('change', function (e) {
|
|
|
+ var isChecked = $(this).is(':checked');
|
|
|
+ // 按年订阅默认选择1年
|
|
|
+ var val = 1;
|
|
|
+ if (isChecked) {
|
|
|
+ $('#number_box_year span:eq(0)').addClass('active').siblings().removeClass('active')
|
|
|
+ }
|
|
|
|
|
|
- // 渲染结果 保留一位小数
|
|
|
- //var result = (Number(id) * 58).toFixed(1);
|
|
|
- //$('.computed_price').html('¥' + result)
|
|
|
- purchase.timeSelect_tmp = [Number(id), 1];
|
|
|
- purchase.flushPrice(purchase.timeSelect_tmp, 2);
|
|
|
- });
|
|
|
+ _this.onTimePickerChange()
|
|
|
+ });
|
|
|
|
|
|
- /* -------- 选择按月订阅 radio触发的事件------- */
|
|
|
- $('#monthly').on('change', function (e) {
|
|
|
- var isChecked = $(this).is(':checked');
|
|
|
- var val = $('.month_number').text();
|
|
|
- /*if (val >= 10) {
|
|
|
- $('.profit_tips').show()
|
|
|
- }*/
|
|
|
- if (!isChecked) {
|
|
|
- $('#number_box_month button').attr('disabled', true)
|
|
|
- }
|
|
|
- //var result = (Number(val) * 5.8).toFixed(1);
|
|
|
- //$('.computed_price').html('¥' + result);
|
|
|
- purchase.timeSelect_tmp = [Number(val), 2];
|
|
|
- purchase.flushPrice(purchase.timeSelect_tmp, 2);
|
|
|
- });
|
|
|
- //计价清单
|
|
|
- $('.billing-list-btn').on('click', function () {
|
|
|
- pickerShow('.billing-list-container', true)
|
|
|
- })
|
|
|
- // 计算标准隐藏
|
|
|
- $('.billing-list-container .dialog_hd__close').on('click', function () {
|
|
|
- pickerShow('.billing-list-container', false)
|
|
|
- })
|
|
|
+ // 计价标准
|
|
|
+ $('.billing-list-btn').on('click', function () {
|
|
|
+ pickerShow('.billing-list-container', true)
|
|
|
+ })
|
|
|
+ // 计算标准隐藏
|
|
|
+ $('.billing-list-container .dialog_hd__close').on('click', function () {
|
|
|
+ pickerShow('.billing-list-container', false)
|
|
|
+ })
|
|
|
|
|
|
- $('.checkbox').on('click', function () {
|
|
|
- $(this).toggleClass('checked')
|
|
|
- var state = $(this).hasClass('checked');
|
|
|
- sessionStorage.setItem("vipSub_read", state);
|
|
|
- purchase.flushSubmit();
|
|
|
- //$('.vip-footer.renew .confirm').prop('disabled', !state)
|
|
|
- });
|
|
|
- //是否点击已读
|
|
|
- if (sessionStorage.getItem("vipSub_read") === "true") {
|
|
|
- $('.checkbox').addClass("checked");
|
|
|
+ $('.checkbox').on('click', function () {
|
|
|
+ $(this).toggleClass('checked')
|
|
|
+ var state = $(this).hasClass('checked')
|
|
|
+ sessionStorage.setItem("vipSub_read", state)
|
|
|
+ renew.flushSubmit()
|
|
|
+ });
|
|
|
}
|
|
|
+}
|
|
|
+$(function () {
|
|
|
+ renew.init()
|
|
|
+})
|
|
|
|
|
|
- /* -------- 选择按年订阅 radio触发的事件------- */
|
|
|
- $('#yearly').on('change', function (e) {
|
|
|
- //$('.profit_tips').hide();
|
|
|
- // console.log($(this).is(':checked'))
|
|
|
- var isChecked = $(this).is(':checked');
|
|
|
- // 按年订阅默认选择1年
|
|
|
- var val = 1;
|
|
|
- //$('.computed_price').html('¥' + Number(val) * 58)
|
|
|
- if (isChecked) {
|
|
|
- $('#number_box_year span:eq(0)').addClass('active').siblings().removeClass('active')
|
|
|
- }
|
|
|
- purchase.timeSelect_tmp = [Number(val), 1];
|
|
|
- purchase.flushPrice(purchase.timeSelect_tmp, 2);
|
|
|
- purchase.flushSelectTime(purchase.timeSelect_tmp, 2);
|
|
|
- });
|
|
|
-
|
|
|
- // 确认订阅周期
|
|
|
- $('#enter_period').on('click', function () {
|
|
|
- var val;
|
|
|
- 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 + "年";
|
|
|
- });
|
|
|
- } 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.timeSelect = purchase.timeSelect_tmp;
|
|
|
- purchase.showTime();
|
|
|
- purchase.flushPrice(purchase.timeSelect, 1);
|
|
|
- sessionStorage.setItem("vipSubSelectTime", JSON.stringify(purchase.timeSelect));
|
|
|
- });
|
|
|
- $('.vip-footer.renew .confirm').click(function () {
|
|
|
- $('.vip-footer.renew .confirm').attr("disabled", "disabled");
|
|
|
- //支付请求
|
|
|
- var area = purchase.areaSelect;
|
|
|
- var industry = purchase.industrySelect;
|
|
|
- if (area["全国"]) {
|
|
|
- area = {};
|
|
|
- }
|
|
|
- if (industry.length === 1 && industry[0] === "全部行业") {
|
|
|
- industry = [];
|
|
|
- }
|
|
|
- //优惠码
|
|
|
- /*var activeCode = $('.coupon-picker .weui-input').val();
|
|
|
- var activeCodes = "";
|
|
|
- if (activeCode.toLowerCase() === couponInfo.code && $('.coupon-code-tx .keywords-text').text() === couponInfo.successTip){
|
|
|
- activeCodes = couponInfo.code;
|
|
|
- }*/
|
|
|
- //付费用户
|
|
|
- var param = {
|
|
|
- "userLotteryId":coupon.$refs.couponRef.coupon.userLotteryId,
|
|
|
- "lotteryId": coupon.$refs.couponRef.coupon.lotteryId,
|
|
|
- "area": JSON.stringify(area),
|
|
|
- "industry": industry.join(","),
|
|
|
- "time": purchase.timeValue.trim(),
|
|
|
- "orderType": 5,
|
|
|
- "disWord":GetQueryString("disWord"),
|
|
|
- };
|
|
|
- $DoPost("/subscribepay/vipsubscribe/createOrder", param, function (r) {
|
|
|
- if (r.success) {
|
|
|
- try {
|
|
|
- clearSessionStorage()
|
|
|
- history.replaceState({}, '', '/jyapp/vipsubscribe/toOrderDetailPage?orderCode=' + r.data.code);
|
|
|
- window.location.href = "/jyapp/pay/checkout_subvip?orderCode=" + r.data.code + "&t=1&from=buy"
|
|
|
- } catch (e) {
|
|
|
- showToast(e)
|
|
|
- }
|
|
|
- }
|
|
|
- }, false);
|
|
|
- $('.vip-footer.renew .confirm').removeAttr("disabled");
|
|
|
- })
|
|
|
-
|
|
|
-});
|
|
|
|
|
|
//获取url中"?"符后的字符串并正则匹配
|
|
|
function GetQueryString(name) {
|
|
@@ -529,13 +464,10 @@ function hideDialog() {
|
|
|
}
|
|
|
|
|
|
function clearSessionStorage() {
|
|
|
- sessionStorage.removeItem("vipSubSelectArea");
|
|
|
- sessionStorage.removeItem("vipSubSelectIndustry");
|
|
|
sessionStorage.removeItem("vipSubSelectTime");
|
|
|
sessionStorage.removeItem("vipSub_read");
|
|
|
sessionStorage.removeItem("historypushDataCache");
|
|
|
sessionStorage.removeItem("endTime");
|
|
|
- sessionStorage.removeItem("payWay");
|
|
|
sessionStorage.To_introducePage = 2;
|
|
|
//订阅首页
|
|
|
sessionStorage.removeItem("sub_vip_state");
|
|
@@ -546,7 +478,12 @@ function clearSessionStorage() {
|
|
|
sessionStorage.removeItem("liveActiveCode_renew");
|
|
|
sessionStorage.removeItem("liveActiveCode_new");
|
|
|
}
|
|
|
-
|
|
|
+function showToast(text) {
|
|
|
+ weui.toast(text, {
|
|
|
+ duration: 3000,
|
|
|
+ className: 'jy-toast',
|
|
|
+ })
|
|
|
+}
|
|
|
function pickerShow(selector, f) {
|
|
|
if (f) {
|
|
|
// 添加进场动画,并显示
|
|
@@ -601,16 +538,18 @@ var coupon = new Vue({
|
|
|
},
|
|
|
// 校验checkbox
|
|
|
checkSubmitStatus: function (checkStatus) {
|
|
|
- sessionStorage.setItem("vipSub_read", checkStatus);
|
|
|
- purchase.flushSubmit();
|
|
|
- return purchase.timeCheckOk && sessionStorage.getItem("vipSub_read") === "true"
|
|
|
+ sessionStorage.setItem("vipSub_read", checkStatus)
|
|
|
+ renew.flushSubmit()
|
|
|
+ return renew.timeCheckOk && sessionStorage.getItem("vipSub_read") === "true"
|
|
|
},
|
|
|
saveEvent: function () {
|
|
|
+ renew.saveState()
|
|
|
sessionStorage.setItem("pay_read_cache", "0");
|
|
|
},
|
|
|
// 阅读协议点击事件
|
|
|
readEvent: function () {
|
|
|
- toRead()
|
|
|
+ renew.saveState()
|
|
|
+ toRead()
|
|
|
},
|
|
|
// 订单提交事件
|
|
|
submitOrder: function () {
|