Browse Source

feat: 订单仅增购子账号购买数量展示逻辑调整

cuiyalong 1 tháng trước cách đây
mục cha
commit
e279efe10c

+ 8 - 0
src/jfw/modules/app/src/web/staticres/jyapp/vipsubscribe/js/vip_order_detail.js

@@ -23,6 +23,10 @@ function calcAccountNum(order) {
     var buyAccountCount = filterInfo.buyAccountCount || filter_vip_new.buyAccountCount || 0
     var giftAccountCount = filterInfo.giftAccountCount || filter_vip_new.giftAccountCount || 0
     var totalAccountCount = Number(buyAccountCount) + Number(giftAccountCount) + 1
+
+    var addAreaCount = filterInfo.addAreaCount || filter_vip_new.addAreaCount || 0
+    var onlyAddCount = addAreaCount <= 0 // 仅增购子账号
+
     // 续费vip_type=1
     if (order.vip_type == 1 || order.service_type == 2) {
         // 人数就是购买人数
@@ -32,6 +36,10 @@ function calcAccountNum(order) {
         if (buyAccountCount == 0 && giftAccountCount == 0) {
             buyNumber2 = order.buyNum || filter_vip_new.finalAccountCount || 0
         } else {
+            // 仅增购子账号,不计算主账号数量
+            if (onlyAddCount) {
+                totalAccountCount -= 1
+            }
             buyNumber2 = order.buyNum || totalAccountCount || filter_vip_new.finalAccountCount || 0
         }
     } else {

+ 14 - 0
src/web/staticres/common-module/order-list/js/order-list.js

@@ -2738,6 +2738,16 @@ var vm = new Vue({
       var buyAccountCount = filterInfo.buyAccountCount || filter_vip_new.buyAccountCount || 0
       var giftAccountCount = filterInfo.giftAccountCount || filter_vip_new.giftAccountCount || 0
       var totalAccountCount = Number(buyAccountCount) + Number(giftAccountCount) + 1
+
+      var addAreaCount = filterInfo.addAreaCount || filter_vip_new.addAreaCount
+      var onlyAddCount = false
+      if (order.product_type === 'VIP订阅') {
+        onlyAddCount = addAreaCount <= 0 // 仅增购子账号
+      } else if (order.product_type === '大会员'){
+        // onlyAddCount = !supServiceIds
+        onlyAddCount = false
+      }
+
       // 续费vip_type=1
       if (order.vip_type == 1 || order.service_type == 2) {
         // 人数就是购买人数
@@ -2748,6 +2758,10 @@ var vm = new Vue({
         if (buyAccountCount == 0 && giftAccountCount == 0) {
             buyNumber2 = order.buyNum || filter_vip_new.finalAccountCount || 0
         } else {
+            // 仅增购子账号,不计算主账号数量
+            if (onlyAddCount) {
+                totalAccountCount -= 1
+            }
             buyNumber2 = order.buyNum || totalAccountCount || filter_vip_new.finalAccountCount || 0
         }
       } else {

+ 9 - 5
src/web/templates/pc/myOrder.html

@@ -1191,6 +1191,11 @@
                 v.vip_starttime = "-"
               }
               v.vipInfo = vipInfo
+
+              var addAreaCount = v.filter.addAreaCount || v.newFilter.addAreaCount || 0
+              if (addAreaCount <= 0) {
+                vipInfo.onlyAddCount = true
+              }
               
               // vip_type: //0:购买 1:续费 2:升级 3:试用
               var buyAccountCount = v.filter.buyAccountCount || v.newFilter.buyAccountCount || 0
@@ -1202,18 +1207,17 @@
                 v.buyAccountNum = v.buyNum||v.newFilter.finalAccountCount || 0
               } else if (v.vip_type == 2) {
                 // 人数是升级人数/如果只补充服务,则人数就是购买人数
-                
                 if (buyAccountCount == 0 && giftAccountCount == 0) {
                     v.buyAccountNum = v.buyNum||v.newFilter.finalAccountCount || 0
                 } else {
+                    // 仅增购子账号,不计算主账号数量
+                    if (vipInfo.onlyAddCount) {
+                      totalAccountCount -= 1
+                    }
                     v.buyAccountNum = v.buyNum||totalAccountCount||v.newFilter.finalAccountCount || 0
                 }
 
 
-                var addAreaCount = v.filter.addAreaCount || v.newFilter.addAreaCount || 0
-                if (addAreaCount <= 0) {
-                  vipInfo.onlyAddCount = true
-                }
               } else {
                 v.buyAccountNum = v.buyNum||v.newFilter.finalAccountCount || 0
               }

+ 8 - 0
src/web/templates/pc/vip_orderDetail.html

@@ -174,6 +174,10 @@
             var buyAccountCount = filterInfo.buyAccountCount || filter_vip_new.buyAccountCount || 0
             var giftAccountCount = filterInfo.giftAccountCount || filter_vip_new.giftAccountCount || 0
             var totalAccountCount = Number(buyAccountCount) + Number(giftAccountCount) + 1
+
+            var addAreaCount = v.filter.addAreaCount || v.newFilter.addAreaCount || 0
+            var onlyAddCount = addAreaCount <= 0 // 仅增购子账号
+            
             // 续费vip_type=1
             if (order.vip_type == 1 || order.service_type == 2) {
                 // 人数就是购买人数
@@ -184,6 +188,10 @@
                 if (buyAccountCount == 0 && giftAccountCount == 0) {
                     buyNumber2 = order.buyNum || filter_vip_new.finalAccountCount || 0
                 } else {
+                    // 仅增购子账号,不计算主账号数量
+                    if (onlyAddCount) {
+                        totalAccountCount -= 1
+                    }
                     buyNumber2 = order.buyNum || totalAccountCount || filter_vip_new.finalAccountCount || 0
                 }
             } else {