|
@@ -29,7 +29,7 @@ var purchase = {
|
|
|
$('.coupon-code-tx').off('click');
|
|
|
}
|
|
|
//即将到期 回显已购买
|
|
|
- if (!sessionStorage.getItem("vipSubSelectArea") || !sessionStorage.getItem("vipSubSelectIndustry")) {
|
|
|
+ if (!sessionStorage.getItem("vipSubSelectArea")) {
|
|
|
$DoPost("/subscribepay/vipsubscribe/getSubBuyMsg", {}, function (r) {
|
|
|
if (r.success) {
|
|
|
if (!$.isEmptyObject(r.data.area)) {
|
|
@@ -113,17 +113,18 @@ var purchase = {
|
|
|
console.log(e)
|
|
|
}
|
|
|
this.nowBuyset = getBuySet(purchase.areaSelect, purchase.industrySelect, this.price);
|
|
|
+ console.log(this.nowBuyset,this.oldBuySet)
|
|
|
var old = this.oldBuySet
|
|
|
//初始化 非试用用户 已经购买了 1个省份 两个省份【1个城市、两个城市】 3个行业 非升级版超级订阅
|
|
|
- // 选择完区域回显后 需判断选择省份结果与原购买的省份结果进行对比,取最多的值
|
|
|
- // if (purchase.nowBuyset.areacount == -1) {
|
|
|
- // old.areacount = -1
|
|
|
- // } else {
|
|
|
- // if (purchase.nowBuyset.areacount > old.areacount) {
|
|
|
- // old.areacount = purchase.nowBuyset.areacount
|
|
|
- // }
|
|
|
- // }
|
|
|
- console.log(old)
|
|
|
+ if (purchase.oldBuySet.upgrade == 0) {
|
|
|
+ if (this.nowBuyset.areacount != -1 && Object.keys(purchase.areaSelect).length <= old.areacount) {
|
|
|
+ $('.error-update-tips').show()
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (this.nowBuyset.areacount != -1 && Object.keys(purchase.areaSelect).length < old.areacount) {
|
|
|
+ $('.error-update-tips').show()
|
|
|
+ }
|
|
|
+ }
|
|
|
Calculation.Init(this.isTrial,new Buyset(old.areacount, old.newcitys, old.buyerclasscount,old.upgrade),this.renewList, purchase.price, this.endTime)
|
|
|
},
|
|
|
showArea: function () {
|
|
@@ -210,7 +211,7 @@ var purchase = {
|
|
|
3.当前选择的省份数量小于原省份数量 则按原省份数量
|
|
|
总:按照选择最多省份数量的计算
|
|
|
*/
|
|
|
- console.log(obj, 'obj')
|
|
|
+
|
|
|
if (this.oldBuySet.areacount == -1) {
|
|
|
$('[data-upgrade-to-area]').attr('href', 'javascript:;')
|
|
|
// $('[data-upgrade-to-area] .iconfont').hide()
|
|
@@ -221,10 +222,9 @@ var purchase = {
|
|
|
obj.areacount = this.oldBuySet.areacount
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ console.log(obj, 'obj')
|
|
|
var price = Calculation.GetUpgradeDetail(new Buyset(obj.areacount,[],obj.buyerclasscount,1), time)
|
|
|
var givePrice = Calculation.GetUpgradeDetail(new Buyset(obj.areacount,[],obj.buyerclasscount,1), [time[1] === 1 ? 1 : time[0], time[1]])
|
|
|
- console.log(typeof price,price, 'price')
|
|
|
price = price[0] / 100
|
|
|
|
|
|
var showPrice = formatMoney(price);
|
|
@@ -261,7 +261,7 @@ var purchase = {
|
|
|
$('.now-price .dis-price').text(formatMoney(price));
|
|
|
}
|
|
|
this.flushSelectTime(times, flag === undefined ? 1 : flag);
|
|
|
- coupon.updatePrice(price)
|
|
|
+ coupon.updatePrice(Number(price) < 0 ? 0 : price)
|
|
|
},
|
|
|
flushSelectTime(thisValue, flag) {
|
|
|
if (this.endTime) {
|
|
@@ -319,6 +319,12 @@ var purchase = {
|
|
|
flushSubmit() {//是否可提交
|
|
|
if (this.timeCheckOk && sessionStorage.getItem("vipSub_read") === "true") {
|
|
|
$('.vip-footer.renew .confirm').prop('disabled', false)
|
|
|
+ console.log(coupon.initPrice, 'coupon.initPrice')
|
|
|
+ if (!$('.error-update-tips').is(':hidden')) {
|
|
|
+ coupon.$refs.couponRef.submitStatus = true
|
|
|
+ } else {
|
|
|
+ coupon.$refs.couponRef.submitStatus = false
|
|
|
+ }
|
|
|
} else {
|
|
|
$('.vip-footer.renew .confirm').prop('disabled', true)
|
|
|
}
|
|
@@ -559,7 +565,8 @@ $(function () {
|
|
|
var param = {
|
|
|
"userLotteryId":coupon.$refs.couponRef.coupon.userLotteryId,
|
|
|
"lotteryId": coupon.$refs.couponRef.coupon.lotteryId,
|
|
|
- "area": JSON.stringify(area),
|
|
|
+ "area": flag ? JSON.stringify(area) : '',
|
|
|
+ 'area_count': flag ? 0 : areaCount,
|
|
|
// "industry": industry.join(","),
|
|
|
'price': coupon.initPrice*100,
|
|
|
"time": purchase.timeValue.trim(),
|
|
@@ -726,7 +733,7 @@ var coupon = new Vue({
|
|
|
var endTime = sessionStorage.getItem('endTime')
|
|
|
var readSelect = sessionStorage.getItem('vipSub_read') === 'true' ? true : false
|
|
|
purchase.flushSubmit();
|
|
|
- return Object.keys(areaSelect).length > 0 && industrySelect.length > 0 && readSelect
|
|
|
+ return Object.keys(areaSelect).length > 0 && industrySelect.length > 0 && readSelect && $('.error-update-tips').is(':hidden')
|
|
|
},
|
|
|
saveEvent: function() {
|
|
|
// sessionStorage.setItem("vipSub_read", 0)
|