Pārlūkot izejas kodu

移动端三级页面附加权益

wangshan 3 gadi atpakaļ
vecāks
revīzija
b0542dc64d

+ 40 - 22
src/jfw/modules/app/src/web/templates/weixin/wxinfocontent.html

@@ -1010,6 +1010,10 @@
                 if (res.data.memberStatus > 0 && res.data.power.indexOf(3) == -1) {
                     window.isNoMember = true
                 }
+                // 是大会员 有下载权限
+        				if (res.data.memberStatus > 0 && res.data.power.indexOf(3) > -1) {
+        					  window.isMemberAndPower = true
+        				}
                 window.isFree = res.data.isFree // 是否是免费用户
                 window.freeFile = res.data.freeFile // 免费用户 是否体验过 0:未体验过 -1:体验过
                 window.vipStatus = res.data.vipStatus // 是否是超级订阅用户
@@ -1059,7 +1063,8 @@
                 if (res.data && res.data.isFree && res.data.freeFile == 0) {
                   $('.free-down-text').css('display', 'inline-block')
                 }
-                if (res.data && res.data.vipStatus > 0 && res.data.viper) {
+                //非大会员或大会员无此功能 且是新超级订阅用户
+                if (res.data && res.data.vipStatus > 0 && res.data.viper&&!window.isMemberAndPower) {
                   $('.file-count-tip').css('display', 'inline-block')
                   $('.concat-kf').css('display', 'inline-block')
                   $('.icon-help').css('display', 'inline-block')
@@ -1222,16 +1227,8 @@
                         if (window.freeFile == 0) {
                           // 判断有无留过资 且未体验过 - 去留资
                           location.href = '/jyapp/frontPage/bigmember/free/perfect_info?source=article_attach_freeuser'
-                        } else if (window.freeFile > 0 ){
-                          // 留过资 更新下载次数 进入附件下载页面
-                          if (url) {
-                            if(mySysIsIos()){
-                              iosShow(url)
-                            } else {
-                              location.href = url
-                            }
-                          }
-                        } else {
+                          return
+                        } else if (window.freeFile < 0 ) {
                           // 免费用户 体验过 下载次数为-1 弹框提醒跳至超级订阅购买页
                           vant.Dialog.confirm({
                             title: '开通超级订阅',
@@ -1242,16 +1239,16 @@
                             className: 'custom-dialog',
                             width: 303,
                             messageAlign: 'left',
-
                           }).then(() => {
-                            location.href = '/front/vipsubscribe/vipsubscribe_new'
+                            location.href = '/jyapp/vipsubscribe/vipsubscribe_new'
                           })
                           .catch(() => {})
+                          return
                         }
                       } else {
                         // 付费用户
                         // 大会员用户 有下载权限
-                        if (bigstatus > 0 && hasServiceArr.indexOf(3) > -1) {
+                        if (window.isMemberAndPower) {
                           if(mySysIsIos()){
                             iosShow(url)
                           } else {
@@ -1264,13 +1261,7 @@
                           // 是新超级订阅用户
                           if (window.viper) {
                             // 有下载次数
-                            if (window.fileNum > 0) {
-                              if(mySysIsIos()){
-                                iosShow(url)
-                              } else {
-                                location.href = url
-                              }
-                            } else {
+                            if (window.fileNum <= 0) {
                               // 次数用完提醒联系客服
                               vant.Dialog.confirm({
                                 message: '您本月查看机会已经消耗完毕,如需要更多服务,请前往联系客服。',
@@ -1284,6 +1275,7 @@
                                 location.href = '/jyapp/free/customer'
                               })
                               .catch(() => {})
+                              return
                             }
                           } else {
                             // 老超级订阅用户 提醒升级
@@ -1298,8 +1290,8 @@
                             }).then(() => {
                               location.href = '/jyapp/vipsubscribe/upgradePage'
                             }).catch(() => {})
+                            return
                           }
-                          return
                         }
                         // 是大会员自定义版本没有下载权限 或 非超级订阅的商机管理用户 (弹框提醒联系客服)
                         if (window.isNoMember == true || (window.vipStatus <=0 && window.entniche)) {
@@ -1313,6 +1305,8 @@
                           return
                         }
                       }
+                      //
+                      gotoFilePage($(this).find('a').text())
                     })
                     $('.atta-list').show()
                 }else{
@@ -1330,6 +1324,30 @@
             }
         });
     }
+    //浏览附件
+    function gotoFilePage(name){
+      $.ajax({
+            type:'post',
+            url:'/publicapply/attachment/get',
+            data:{
+                infoId:{{.T.obj._id}}
+            },
+            success:function(r){
+              if(r.data&&r.data.attachment !=null&&r.data.attachment.length!=0){
+                for(var i=0;i<r.data.attachment.length;i++) {
+                  if (name!=""&&name == r.data.attachment[i].filename){
+                    var url = r.data.attachment[i].downurl
+                    if(mySysIsIos()){
+                        iosShow(url)
+                    } else {
+                        location.href = url
+                    }
+                  }
+                }
+              }
+            }
+          })
+    }
     andownload()
     //如果是ios显示附件下载弹框
     function iosShow(url){

+ 87 - 33
src/web/templates/weixin/wxinfocontent_rec.html

@@ -1534,8 +1534,13 @@ function isOpening() {
 					//console.log(res)
           bigstatus = res.data.memberStatus
           powerArr = res.data.power
+          // 是大会员没有下载权限
+          if (bigstatus > 0 && powerArr.indexOf(3) == -1) {
+              window.isNoMember = true
+          }
+          // 是大会员 有下载权限
   				if (bigstatus > 0 && powerArr.indexOf(3) > -1) {
-  					window.isMemberAndPower = true
+  					  window.isMemberAndPower = true
   				}
           window.isFree = res.data.isFree // 是否是免费用户
           window.freeFile = res.data.freeFile // 免费用户 是否体验过 0:未体验过 -1:体验过
@@ -1563,7 +1568,8 @@ function isOpening() {
           if (res.data && res.data.isFree && res.data.freeFile == 0) {
             $('.free-down-text').css('display', 'inline-block')
           }
-          if (res.data && res.data.vipStatus > 0 && res.data.viper) {
+          //非大会员或大会员无此功能 且是新超级订阅用户
+          if (res.data && res.data.vipStatus > 0 && res.data.viper&&!window.isMemberAndPower) {
             $('.file-count-tip').css('display', 'inline-block')
             $('.concat-kf').css('display', 'inline-block')
             $('.icon-help').css('display', 'inline-block')
@@ -1623,39 +1629,87 @@ function andownload() {
 
                 $('.download-list>ul').append(html)
                 $('.downs').on('click', function(){
-                  //  留资判断
-                  if (window.isFree&&window.freeFile==0) {
+                  //免费用户
+                  if(window.isFree){
+                    //  留资判断
+                    if (window.freeFile==0) {
                       location.href = '/weixin/frontPage/bigmember/free/perfect_info?source=article_attach_freeuser'
                       return
-                  }
-                  //超级订阅
-                  if (window.vipStatus&&window.viper&&window.fileNum<=0){
-                    // 次数用完提醒联系客服
-                    vant.Dialog.confirm({
-                      message: '您本月查看机会已经消耗完毕,如需要更多服务,请前往联系客服。',
-                      showCancelButton: true,
-                      confirmButtonText: '联系客服',
-                      confirmButtonColor: '#2ABDD1',
-                      className: 'custom-dialog',
-                      width: 303
-
-                    }).then(() => {
-                      location.href = '/big/wx/page/customer'
-                    })
-                    .catch(() => {})
-                    return
-                  }
-                  //付费用户 无大会员此功能权限
-                  if (!window.isMemberAndPower&&!isFree){
-                    vant.Dialog.alert({
-                      message: '您未购买此服务,如需使用请联系您的客户经理或客服升级套餐,谢谢!',
-                      className: 'custom-dialog',
-                      confirmButtonText: '我知道了',
-                      confirmButtonColor: '#2ABDD1',
-                      closeOnClickOverlay: true,
-                      width: 303,
-                    }).then(() => {})
-                    return
+                    }else if (window.freeFile < 0 ) {
+                      // 免费用户 体验过 下载次数为-1 弹框提醒跳至超级订阅购买页
+                      vant.Dialog.confirm({
+                        title: '开通超级订阅',
+                        message: '您已经免费解锁过【附件下载】权益1次,暂无免费查看权限。如需查看更多,请开通超级订阅获取更多权限。',
+                        showCancelButton: true,
+                        confirmButtonText: '去开通',
+                        confirmButtonColor: '#2ABDD1',
+                        className: 'custom-dialog',
+                        width: 303,
+                        messageAlign: 'left',
+                      }).then(() => {
+                        location.href = '/front/vipsubscribe/vipsubscribe_new'
+                      })
+                      .catch(() => {})
+                      return
+                    }
+                  }else{
+                    // 付费用户
+                    // 大会员用户 有下载权限
+                    if (window.isMemberAndPower) {
+                      if(mySysIsIos()){
+                        iosShow(url)
+                      } else {
+                        location.href = url
+                      }
+                      return
+                    }
+                    //超级订阅
+                    if (window.vipStatus>0){
+                      //超级订阅新用户
+                      if(window.viper){
+                        // 次数用完提醒联系客服
+                        if (window.fileNum<=0){
+                          vant.Dialog.confirm({
+                            message: '您本月查看机会已经消耗完毕,如需要更多服务,请前往联系客服。',
+                            showCancelButton: true,
+                            confirmButtonText: '联系客服',
+                            confirmButtonColor: '#2ABDD1',
+                            className: 'custom-dialog',
+                            width: 303
+      
+                          }).then(() => {
+                            location.href = '/big/wx/page/customer'
+                          })
+                          .catch(() => {})
+                          return
+                        }
+                      }else{
+                        //超级订阅老用户  提醒升级
+                        vant.Dialog.confirm({
+                          title: '升级超级订阅',
+                          message: '对不起,暂无权限,您可升级超级订阅解锁附件下载',
+                          showCancelButton: true,
+                          confirmButtonText: '前往升级',
+                          confirmButtonColor: '#2ABDD1',
+                          className: 'custom-dialog',
+                          width: 303
+                        }).then(() => {
+                          location.href = '/front/vipsubscribe/upgradePage'
+                        }).catch(() => {})
+                        return
+                      }
+                    }
+                    // 是大会员自定义版本没有下载权限 或 非超级订阅的商机管理用户 (弹框提醒联系客服)
+                    if (window.isNoMember == true || (window.vipStatus <=0 && window.entniche)) {
+                      vant.Dialog.alert({
+                        message: '您未购买此服务,如需使用请联系您的客户经理或客服升级套餐,谢谢!',
+                        className: 'custom-dialog',
+                        confirmButtonText: '我知道了',
+                        confirmButtonColor: '#2ABDD1',
+                        width: 303,
+                      }).then(() => {})
+                      return
+                    }
                   }
                   //
                   gotoFilePage($(this).find('a').text())