Browse Source

fix:免费用户下载次数用完后提示逻辑判断

zhangsiya 1 năm trước cách đây
mục cha
commit
4d25eedeb2

+ 29 - 14
src/jfw/modules/app/src/web/templates/weixin/wxinfocontent.html

@@ -2050,20 +2050,35 @@
             success: function (r) {
                   // 重新获取下载次数
                   subPoint()
-                if (r&&r.r&&r.r.code&&r.r.code<0&&window.vipStatus>0){
-                    // 次数用完提醒联系客服
-                    vant.Dialog.confirm({
-                        message: '您本月附件下载机会已消耗完毕,如需下载更多附件,请前往充值。',
-                        showCancelButton: true,
-                        confirmButtonText: '立即充值',
-                        confirmButtonColor: '#2ABDD1',
-                        className: 'custom-dialog',
-                        width: 303
-
-                    }).then(() => {
-                        location.href = '/jy_mobile/common/order/create/filepack?type=0'
-                    })
-                        .catch(() => {})
+                if (r&&r.r&&r.r.code&&r.r.code<0){
+                    // 次数用完提醒
+                      if(window.vipStatus>0) {
+                        vant.Dialog.confirm({
+                          message: '您本月附件下载机会已消耗完毕,如需下载更多附件,请前往充值。',
+                          showCancelButton: true,
+                          confirmButtonText: '立即充值',
+                          confirmButtonColor: '#2ABDD1',
+                          className: 'custom-dialog',
+                          width: 303
+
+                        }).then(() => {
+                          location.href = '/jy_mobile/common/order/create/filepack?type=0'
+                        }).catch(() => {})
+                      } else if(window.isFree) {
+                        vant.Dialog.confirm({
+                          title: '开通超级订阅',
+                          message: '您的免费【附件下载】次数已使用完,暂无免费查看权限。如需查看更多,请开通超级订阅获取更多权限。',
+                          showCancelButton: true,
+                          confirmButtonText: '去开通',
+                          confirmButtonColor: '#2ABDD1',
+                          className: 'custom-dialog',
+                          width: 303,
+                          messageAlign: 'left',
+                        }).then(() => {
+                          // location.href = '/jyapp/vipsubscribe/vipsubscribe_new'
+                          location.href = '/jy_mobile/common/order/create/svip?type=buy'
+                        }).catch(() => {})
+                      }
                     return
                 }else if (r && r.m === '' && r.r) {
                     var url = r.r.downUrl

+ 30 - 13
src/web/templates/weixin/wxinfocontent_rec.html

@@ -2554,19 +2554,36 @@ function downloadFileAjax (fileName, callback) {
     success: function (r) {
       // 重新加载获取次数
       subPoint()
-      if (r&&r.r&&r.r.code&&r.r.code<0&&window.vipStatus>0){
-        vant.Dialog.confirm({
-          message: '您本月附件下载机会已消耗完毕,如需下载更多附件,请前往充值。',
-          showCancelButton: true,
-          confirmButtonText: '立即充值',
-          confirmButtonColor: '#2ABDD1',
-          className: 'custom-dialog',
-          width: 303
-
-        }).then(() => {
-          location.href = '/jy_mobile/common/order/create/filepack?type=0'
-        })
-          .catch(() => {})
+      if (r&&r.r&&r.r.code&&r.r.code<0){
+        // 次数用完提醒
+        if(window.vipStatus>0) {
+          vant.Dialog.confirm({
+            message: '您本月附件下载机会已消耗完毕,如需下载更多附件,请前往充值。',
+            showCancelButton: true,
+            confirmButtonText: '立即充值',
+            confirmButtonColor: '#2ABDD1',
+            className: 'custom-dialog',
+            width: 303
+
+          }).then(() => {
+            location.href = '/jy_mobile/common/order/create/filepack?type=0'
+          })
+            .catch(() => {})
+        } else if(window.isFree) {
+          vant.Dialog.confirm({
+            title: '开通超级订阅',
+            message: '您的免费【附件下载】次数已使用完,暂无免费查看权限。如需查看更多,请开通超级订阅获取更多权限。',
+            showCancelButton: true,
+            confirmButtonText: '去开通',
+            confirmButtonColor: '#2ABDD1',
+            className: 'custom-dialog',
+            width: 303,
+            messageAlign: 'left',
+          }).then(() => {
+            // location.href = '/front/vipsubscribe/vipsubscribe_new'
+            window.location.href="/jy_mobile/common/order/create/svip?type=buy"
+          }).catch(() => {})
+        }
         return
       }else if (r && r.m === '' && r.r) {
         var url = r.r.downUrl