Jelajahi Sumber

feat: app端认领按钮添加权限判断

cuiyalong 2 tahun lalu
induk
melakukan
600fdf620c

+ 22 - 1
src/jfw/modules/app/src/web/staticres/jyapp/big-member/js/client_portrayal.js

@@ -145,6 +145,10 @@ var vNode = {
           getNewMsgObj: {},
           getNewMsgObj: {},
           isSC: 0, //0未收藏 1收藏
           isSC: 0, //0未收藏 1收藏
           idx: [],
           idx: [],
+          // isAdd返回数据
+          powerInfo: {
+            isEntService: false
+          },
           list:[]
           list:[]
       }
       }
   },
   },
@@ -205,6 +209,9 @@ var vNode = {
         }
         }
         return text
         return text
       },
       },
+      claimShow: function () {
+        return this.powerInfo.isEntService || this.newEntNiche
+      },
       noAuth () {
       noAuth () {
         var usage = this.usageInfo
         var usage = this.usageInfo
         var hasCount = usage.surplus > 0
         var hasCount = usage.surplus > 0
@@ -240,7 +247,7 @@ var vNode = {
     }
     }
   },
   },
   created () {
   created () {
-    // this.getPowerInfo()
+    this.getPowerInfo()
     this.getNewEntNiche()
     this.getNewEntNiche()
     this.getUsage(); // 超级订阅用户剩余次数
     this.getUsage(); // 超级订阅用户剩余次数
     this.getNewMsg(); // 中标动态
     this.getNewMsg(); // 中标动态
@@ -265,6 +272,20 @@ var vNode = {
     window.removeEventListener("resize", this.init,20);
     window.removeEventListener("resize", this.init,20);
   },
   },
   methods: {
   methods: {
+      getPowerInfo: function () {
+        var _this = this
+        $.ajax({
+          type: 'POST',
+          url: '/bigmember/use/isAdd',
+          success: function (res) {
+            if (res.error_code == 0 && res.data) {
+              Object.assign(_this.powerInfo, res.data)
+            } else {
+              console.log(res.error_msg)
+            }
+          }
+        })
+      },
       // 查询商机管理使用次数
       // 查询商机管理使用次数
       getUsage: function () {
       getUsage: function () {
         var _this = this
         var _this = this

+ 12 - 11
src/jfw/modules/app/src/web/staticres/jyapp/me/js/mine.js

@@ -1,6 +1,7 @@
 entUserInfo = {}
 entUserInfo = {}
 var mine = {
 var mine = {
     pageUserInfo: pageUserInfo,
     pageUserInfo: pageUserInfo,
+    powerInfo: {},
     init: function () {
     init: function () {
         this.iosBackInvoke()
         this.iosBackInvoke()
 
 
@@ -48,12 +49,9 @@ var mine = {
         type: "post",
         type: "post",
         url: '/entnicheNew/buy/whetherbuy',
         url: '/entnicheNew/buy/whetherbuy',
         success: function(res) {
         success: function(res) {
-          console.log(res)
           if(res.error_code == 0) {
           if(res.error_code == 0) {
             entUserInfo = res.data
             entUserInfo = res.data
-            if(res.data.isNew) {
-              $('.customer-follow').show()
-            }
+            _this.setEntServicePower()
             _this.setBigVipState()
             _this.setBigVipState()
           }
           }
         }
         }
@@ -116,7 +114,6 @@ var mine = {
     },
     },
     // 设置用户头像
     // 设置用户头像
     setUserImg: function () {
     setUserImg: function () {
-        console.log(pageUserInfo)
         if(pageUserInfo.headimageurl){
         if(pageUserInfo.headimageurl){
             pageUserInfo.headimageurl = pageUserInfo.headimageurl.replace(/^http:\/\//,"https://");
             pageUserInfo.headimageurl = pageUserInfo.headimageurl.replace(/^http:\/\//,"https://");
         }
         }
@@ -287,6 +284,8 @@ var mine = {
             url: '/bigmember/use/isAdd?t=' + Date.now(),
             url: '/bigmember/use/isAdd?t=' + Date.now(),
             success: function (res) {
             success: function (res) {
                 if (res && res.data) {
                 if (res && res.data) {
+                    Object.assign(_this.powerInfo, res.data)
+                    _this.setEntServicePower()
                     if (res.data.memberStatus != null || res.data.memberStatus != undefined) {
                     if (res.data.memberStatus != null || res.data.memberStatus != undefined) {
                         pageUserInfo.bigMemberStatus = res.data.memberStatus
                         pageUserInfo.bigMemberStatus = res.data.memberStatus
                     }
                     }
@@ -333,19 +332,21 @@ var mine = {
                     if (res.data.viper) {
                     if (res.data.viper) {
                         $('.ent-search').show().attr('data-href', '/jyapp/vipsubscribe/entSearch')
                         $('.ent-search').show().attr('data-href', '/jyapp/vipsubscribe/entSearch')
                     }
                     }
-                    //_this.setBigVipState()
                 }
                 }
             }
             }
         })
         })
     },
     },
+    setEntServicePower: function () {
+      if(entUserInfo.isNew || this.powerInfo.isEntService) {
+        $('.project-follow').attr('data-href', '/jyapp/big/page/client_follow_list')
+        $('.customer-follow').show()
+      } else {
+        $('.project-follow').attr('data-href', '/jyapp/big/page/pro_follow_list')
+      }
+    },
     setBigVipState: function () {
     setBigVipState: function () {
         // 设置企业关注->企业情报
         // 设置企业关注->企业情报
         var power = pageUserInfo.power || []
         var power = pageUserInfo.power || []
-        if(entUserInfo.isNew) {
-            $('.project-follow').attr('data-href', '/jyapp/big/page/client_follow_list')
-        } else {
- 			$('.project-follow').attr('data-href', '/jyapp/big/page/pro_follow_list')
-		}
         if ($.isArray(power)) {
         if ($.isArray(power)) {
             // 企业情报-4,12,13
             // 企业情报-4,12,13
             var hasEntFollowVipPower = power.indexOf(4) != -1 || power.indexOf(12) != -1 || power.indexOf(13) != -1
             var hasEntFollowVipPower = power.indexOf(4) != -1 || power.indexOf(12) != -1 || power.indexOf(13) != -1

+ 23 - 9
src/jfw/modules/app/src/web/templates/big-member/page_client_follow_detail.html

@@ -305,6 +305,11 @@
         delimiters: ['${', '}'],
         delimiters: ['${', '}'],
         el: '#v-pro',
         el: '#v-pro',
         data: {
         data: {
+            from: '',
+            powerInfo: {
+                entIsNew: false,
+                isEntService: false
+            },
             bigstatus: 0,//大会员状态
             bigstatus: 0,//大会员状态
             isPayedUser: false,//是否是付费用户
             isPayedUser: false,//是否是付费用户
             careShow: false,
             careShow: false,
@@ -331,11 +336,22 @@
             reportUrl: '',
             reportUrl: '',
             isRequestIng:false,
             isRequestIng:false,
             isExportDialogShow: false,
             isExportDialogShow: false,
-            bmdetail: true,
             cid: '' // 取消认领id
             cid: '' // 取消认领id
         },
         },
+        computed: {
+            bmdetail: function () {
+                var isEntService = this.powerInfo.isEntService
+                var isEntnicheNew = this.powerInfo.entIsNew
+                if (this.from === 'client' || isEntService || isEntnicheNew) {
+                    return false
+                } else {
+                    return true
+                }
+            },
+        },
         created() {
         created() {
             this.isOpening()
             this.isOpening()
+            this.from = utils.getParam('from')
             if (this.showTimes == '去开启') {
             if (this.showTimes == '去开启') {
                 this.isAddClass = false
                 this.isAddClass = false
             } else {
             } else {
@@ -353,9 +369,6 @@
                 this.fid = JSON.parse(sessionStorage.getItem('bigvip-fid')).fid
                 this.fid = JSON.parse(sessionStorage.getItem('bigvip-fid')).fid
                 this.sid = JSON.parse(sessionStorage.getItem('bigvip-fid')).sid
                 this.sid = JSON.parse(sessionStorage.getItem('bigvip-fid')).sid
             }
             }
-            if (utils.getParam('from')) {
-              this.bmdetail = false
-            }
             this.getProDetail()
             this.getProDetail()
         },
         },
         methods: {
         methods: {
@@ -748,11 +761,12 @@
                     url: '/bigmember/use/isAdd',
                     url: '/bigmember/use/isAdd',
                     data: {},
                     data: {},
                     success: function (res) {
                     success: function (res) {
-                        console.log(res)
-                        // res.data.memberStatus = 0
-                        _this.bigstatus = res.data.memberStatus
-                        _this.power = res.data.power
-                        _this.isPayedUser = res.data.memberStatus > 0 || res.data.vipStatus || res.data.entniche
+                        if (res && res.data) {
+                            Object.assign(_this.powerInfo, res.data)
+                            _this.bigstatus = res.data.memberStatus
+                            _this.power = res.data.power
+                            _this.isPayedUser = res.data.memberStatus > 0 || res.data.vipStatus || res.data.entniche
+                        }
                     },
                     },
                     error: function (err) {
                     error: function (err) {
                         console.log(err)
                         console.log(err)

+ 1 - 1
src/jfw/modules/app/src/web/templates/big-member/page_client_portrayal.html

@@ -205,7 +205,7 @@
                     ></span>
                     ></span>
                     <span>${follow?'已关注':'关注'}</span>
                     <span>${follow?'已关注':'关注'}</span>
                   </span>
                   </span>
-          <span class="more-action tooltip" @click.stop.prevent="changeClaimState">
+          <span class="more-action tooltip" @click.stop.prevent="changeClaimState" v-if="claimShow">
                     <span
                     <span
                       class="j-icon"
                       class="j-icon"
                       :class="claim ? 'icon-add-claim' : 'icon-claim'"
                       :class="claim ? 'icon-add-claim' : 'icon-claim'"