Browse Source

Merge branch 'dev4.4' of http://192.168.3.207:10080/qmx/jy into dev4.4

zhangyuhan 4 years ago
parent
commit
f3256640f3

+ 10 - 10
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/vip_upgrade.js

@@ -105,14 +105,14 @@ var purchase = {
     this.nowBuyset = getBuySet(purchase.areaSelect, purchase.industrySelect, this.price);
 
     var old = this.oldBuySet
-    // 选择完区域回显后 需判断选择省份结果与原购买的省份结果进行对比,取最多的值
-    if (purchase.nowBuyset.areacount == -1) {
-      old.areacount = -1
-    } else {
-      if (purchase.nowBuyset.areacount > old.areacount) {
-        old.areacount = purchase.nowBuyset.areacount
-      }
-    }
+    // 选择完区域回显后 需判断选择省份结果
+    // if (purchase.nowBuyset.areacount == -1) {
+    //   old.areacount = -1
+    // } else {
+    //   if (purchase.nowBuyset.areacount > old.areacount) {
+    //     old.areacount = purchase.nowBuyset.areacount
+    //   }
+    // }
     //初始化 
     Calculation.Init(this.isTrial,new Buyset(old.areacount, old.newcitys, old.buyerclasscount,old.upgrade),this.renewList,  purchase.price, this.endTime)
 
@@ -213,13 +213,13 @@ var purchase = {
     if (this.oldBuySet.areacount == -1) {
       $('[data-upgrade-to-area]').attr('href', 'javascript:;')
       // $('[data-upgrade-to-area] .iconfont').hide()
-      obj.areacount = -1
     } else {
       // 如果原购买的省份数量大于当前选择的 则按最大的数量走
-      if (this.oldBuySet.areacount > obj.areacount) {
+      if (obj.areacount != -1 && this.oldBuySet.areacount > obj.areacount) {
         obj.areacount = this.oldBuySet.areacount
       }
     }
+    console.log(obj.areacount)
     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')

+ 12 - 10
src/web/staticres/vipsubscribe/js/vip_upgrade.js

@@ -115,15 +115,15 @@ var purchase = {
     this.nowBuyset = getBuySet(purchase.areaSelect, purchase.industrySelect, this.price);
     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
-      }
-    }
-    Calculation.Init(this.isTrial,new Buyset(old.areacount, old.newcitys, old.buyerclasscount,old.upgrade),this.renewList, undefined, this.endTime)
+    // 选择完区域回显后 需判断选择省份结果与原购买的省份结果进行对比,取最多的值
+    // if (purchase.nowBuyset.areacount == -1) {
+    //   old.areacount = -1
+    // } else {
+    //   if (purchase.nowBuyset.areacount > old.areacount) {
+    //     old.areacount = purchase.nowBuyset.areacount
+    //   }
+    // }
+    Calculation.Init(this.isTrial,new Buyset(old.areacount, old.newcitys, old.buyerclasscount,old.upgrade),this.renewList, purchase.price, this.endTime)
   },
   showArea: function () {
     if (!$.isEmptyObject(this.areaSelect) && !this.areaSelect["一个省"]) { //有选择
@@ -209,16 +209,18 @@ 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()
       obj.areacount = -1
     } else {
       // 如果原购买的省份数量大于当前选择的 则按最大的数量走
-      if (this.oldBuySet.areacount > obj.areacount) {
+      if (obj.areacount != -1 && this.oldBuySet.areacount > obj.areacount) {
         obj.areacount = this.oldBuySet.areacount
       }
     }
+    
     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')