瀏覽代碼

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

wangshan 4 年之前
父節點
當前提交
fe5098f964
共有 1 個文件被更改,包括 14 次插入13 次删除
  1. 14 13
      src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/price.js

+ 14 - 13
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/price.js

@@ -54,14 +54,14 @@ var Calculation = {
     OldBuyset: new Buyset(),//用户之前套餐
     EndTime: 0, //会员到期时间
     RenewList: [],
-    Init: (isTrial, oldBuyset, renewList, price, endTime) => { //首次购买时oldBuyset传入undefined
+    Init: function (isTrial, oldBuyset, renewList, price, endTime) { //首次购买时oldBuyset传入undefined
         this.IsTrial = isTrial;
         this.OldBuyset = oldBuyset;
         this.RenewList = renewList;
         this.EndTime = endTime;
-        this.PriceRule = price;
+        //this.PriceRule = price;
     },
-    Check: (tmpBuyset, oldBuyset) => { //校验是否合法
+    Check: function (tmpBuyset, oldBuyset) { //校验是否合法
         if (!oldBuyset) {
             oldBuyset = this.OldBuyset;
         }
@@ -80,7 +80,7 @@ var Calculation = {
           buyTime  [数量,单位(1:年,2月)]
     return 价格
     */
-    GetTotal: (newBuyset, buyTime = [1, 2]) => { //newBuyset 用户选择的套餐;
+    GetTotal: function (newBuyset, buyTime = [1, 2]) { //newBuyset 用户选择的套餐;
         if (newBuyset) {//首次购买
             return this.getBuysetPrice(newBuyset, buyTime)
         }
@@ -92,7 +92,7 @@ var Calculation = {
            buyTime  [数量,单位(1:年,2月)]
     return 价格、计价清单
      */
-    GetUpgradeDetail: (newBuyset = new Buyset(), buyTime = [1, 2]) => { //升级计价 time[数量,单位(1:年,2月)]
+    GetUpgradeDetail: function (newBuyset = new Buyset(), buyTime = [1, 2]) { //升级计价 time[数量,单位(1:年,2月)]
         let subtotail = []; //计价清单
         let final_price = 0; //最终计算价格
         let nowEndTime = this.EndTime;
@@ -151,7 +151,7 @@ var Calculation = {
         }
         return [final_price, subtotail]
     },
-    GetSubPrice: (oldBuyset, newBuyset, start, end) => { //升级-计算套餐差价
+    GetSubPrice: function (oldBuyset, newBuyset, start, end) { //升级-计算套餐差价
         if (this.check(newBuyset, oldBuyset)) {
             return -1
         }
@@ -170,7 +170,7 @@ var Calculation = {
         console.log("old ", oldBuyset, " \n new ", newBuyset, " \n 相差", t[0], "年 ", t[1], "个月\n price:", newPrice, "-", beforePrice, "=", (newPrice * 10000 - beforePrice * 10000) / 10000);
         return (newPrice * 10000 - beforePrice * 10000) / 10000
     },
-    getBuysetPrice: (vipbuyset = new Buyset(), t) => { //获取套餐价格
+    getBuysetPrice: function (vipbuyset = new Buyset(), t) { //获取套餐价格
         if (t.length !== 2) {
             return -1
         }
@@ -206,7 +206,8 @@ var Calculation = {
             final_price += vipbuyset.areacount * this.getSetMealPrice_old(1, vipbuyset.buyerclasscount, t[1]) * t[0];
             return final_price / 100
         } else {//新版大会员价格计算
-            pCount = vipbuyset.areacount
+            let pCount = vipbuyset.areacount
+            let count = t[0]
             if (pCount > this.PriceRule.new.provinceMaxCount) {
                 pCount = -1
             }
@@ -217,10 +218,10 @@ var Calculation = {
             if (t[0] > this.PriceRule.new.monthMaxCount && t[1] === 2) { //月份十个月以上价格一样
                 count = 10
             }
-            return this.getSetMealPrice_new(pCount, unit) * count //全国1行业套餐
+            return this.getSetMealPrice_new(pCount, t[1]) * count //全国1行业套餐
         }
     },
-    getSetMealPrice_old: (c, iCount, u) => { //旧套餐价格计算
+    getSetMealPrice_old: function (c, iCount, u) { //旧套餐价格计算
         var t = u === 2; //是否是月单位
         switch (c) {
             case 0:
@@ -249,7 +250,7 @@ var Calculation = {
                 }
         }
     },
-    getSetMealPrice_new: (p, u) => { //新套餐价格计算 p省份格式,u时间单位
+    getSetMealPrice_new: function (p, u) { //新套餐价格计算 p省份格式,u时间单位
         var t = u === 2 //是否是月单位
         switch (p) {
             case 0:
@@ -265,7 +266,7 @@ var Calculation = {
         }
         return -1
     },
-    getDateSub: (start, end) => { //计算时间间隔差 [年个数, 月个数]
+    getDateSub: function (start, end) { //计算时间间隔差 [年个数, 月个数]
         var startTime = new Date(start * 1000);
         var endTime = new Date(end * 1000);
 
@@ -316,7 +317,7 @@ var Calculation = {
         }
         return [finalYearNum, finalMonthNum]
     },
-    numAdd: (num1, num2) => {
+    numAdd: function (num1, num2) {
         return (num1 * 10000 + num2 * 10000) / 10000
     }
 }