Procházet zdrojové kódy

feat: 免费用户参数传递至数据报告页面

zhangyuhan před 4 roky
rodič
revize
3fcac6a3ac

+ 3 - 6
src/jfw/modules/app/src/web/staticres/jyapp/js/historypush.js

@@ -208,12 +208,9 @@ var vm = new Vue({
         type: 'POST',
         success: function(res) {
           // 如果是商机管理、大会员、超级订阅会员有筛选权限
-          console.log(res, 'sssss')
-          if (res.error_msg == '' && res.data) {
-            if (res.data.week_starttime != 0 && res.data.month_starttime != 0) {
-              window.isUserWeekMonthStatus = true
-              _this.checkShowFreeLink()
-            }
+          if (res != 0) {
+            window.isUserWeekMonthStatus = true
+            _this.checkShowFreeLink()
           }
         }
       })

+ 5 - 1
src/jfw/modules/app/src/web/templates/weixin/historypush.html

@@ -590,7 +590,11 @@
           $(".vip_report").click(function () {
             sessionStorage.setItem(vm.sessStorageKey, JSON.stringify(vm.$data))
             setSessionStorage();
-            window.location.href = "/vipreport/page/subreport.html";
+            var tempUrl = "/vipreport/page/subreport.html"
+            if (window.isFreeUserStatus && window.isUserWeekMonthStatus) {
+              tempUrl += '?free=1'
+            }
+            window.location.href = tempUrl;
           });
           thisClass.LoadDatas(r);
       }

+ 5 - 6
src/web/staticres/vipsubscribe/js/historypush.js

@@ -60,6 +60,7 @@ var vm = new Vue({
     }
   },
   created () {
+    this.getHasWeekMonthData()
     this.getUserRoot()
     if (firstTime) {
       firstTime = `${firstTime}_${firstTime}`
@@ -188,15 +189,13 @@ var vm = new Vue({
     getHasWeekMonthData: function () {
       var _this = this
       $.ajax({
-        url: '/bigmember/report/starttime',
+        url: '/subscribepay/report/starttime',
         type: 'POST',
         success: function(res) {
           // 如果是商机管理、大会员、超级订阅会员有筛选权限
-          if (res.error_msg == '' && res.data) {
-            if (res.data.week_starttime != 0 && res.data.month_starttime != 0) {
-              window.isUserWeekMonthStatus = true
-              _this.checkShowFreeLink()
-            }
+          if (res != 0) {
+            window.isUserWeekMonthStatus = true
+            _this.checkShowFreeLink()
           }
         }
       })

+ 5 - 1
src/web/templates/weixin/historypush.html

@@ -1184,7 +1184,11 @@
               });
               $(".vip_report").click(function () {
                 sessionStorage.setItem(vm.sessStorageKey, JSON.stringify(vm.$data))
-                  window.location.href = "/vipreport/page/subreport.html";
+                  var tempUrl = "/vipreport/page/subreport.html"
+                  if (window.isFreeUserStatus && window.isUserWeekMonthStatus) {
+                      tempUrl += '?free=1'
+                  }
+                  window.location.href = tempUrl;
               });
           }
       }