Эх сурвалжийг харах

feat: 修复画像页面权限判断及返回组件未刷新问题

zhangyuhan 4 жил өмнө
parent
commit
fa04dea431

+ 9 - 6
src/jfw/modules/app/src/web/staticres/jyapp/big-member/js/ent_portrait.js

@@ -183,10 +183,10 @@ var vNode = {
                         }
                         if(_this.powerInfo.memberStatus <= 0) {
                             // 不是大会员点击中标信息使用次数加一
-                            if(!_this.entvisit.visited) {
-                                _this.entvisit.usage++
-                                _this.entvisit.visited = true
-                            }
+                            // if(!_this.entvisit.visited) {
+                            //     _this.entvisit.usage++
+                            //     _this.entvisit.visited = true
+                            // }
                         }
                         _this.gotTab2 = true
                     }
@@ -205,10 +205,13 @@ var vNode = {
         },
         // 查看次数为零,显示遮罩
         getStatus: function () {
-            return (!this.conf._4 && !this.isVip) || (this.entvisit.total < this.entvisit.usage && this.powerInfo.memberStatus <= 0 && !this.entvisit.visited)
+            return (!this.conf._4 && !this.isVip) || (this.entvisit.total <= this.entvisit.usage && this.powerInfo.memberStatus <= 0 && !this.entvisit.visited)
+        },
+        isMember () {
+          return this.powerInfo.memberStatus <= 0
         },
         surplus: function () {
-            return this.entvisit.total > this.entvisit.usage
+            return this.entvisit.total <= this.entvisit.usage
         }
     },
     methods: {

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

@@ -260,7 +260,7 @@
                 <div class="bg-white tab-card cell-list history-list" v-if="conf._4 && tabActiveName == '2' && !getStatus">
                     <hispro-component :type="portrait" :id="entInfo.id"></hispro-component>
                 </div>
-                <div class="vip_component" v-if="getStatus" style="height:11.36rem;background:url('/common-module/collection/image/bg/vip_bg_9.png') no-repeat;background-size:100% 100%">
+                <div class="vip_component" v-if="isMember" style="height:11.36rem;background:url('/common-module/collection/image/bg/vip_bg_9.png') no-repeat;background-size:100% 100%">
                     <vip-component @tabactive="tabActive" type="item_9" :entvisit="entvisit" imgurl='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/collection/image/bg/vip_ex_9.png'></vip-component>
                 </div>
                 <div class="bg-white tab-card charts" v-if="conf._4 && tabActiveName == '2' && annualData.rows.length !== 0 && !getStatus">

+ 9 - 6
src/web/staticres/common-module/collection/js/ent_portrait.js

@@ -182,10 +182,10 @@ var vNode = {
                         }
                         if(_this.powerInfo.memberStatus <= 0) {
                             // 不是大会员点击中标信息使用次数加一
-                            if(!_this.entvisit.visited) {
-                                _this.entvisit.usage++
-                                _this.entvisit.visited = true
-                            }
+                            // if(!_this.entvisit.visited) {
+                            //     _this.entvisit.usage++
+                            //     _this.entvisit.visited = true
+                            // }
                         }
                         _this.gotTab2 = true
                     }
@@ -204,10 +204,13 @@ var vNode = {
         },
         // 查看次数为零,显示遮罩
         getStatus: function () {
-            return (!this.conf._4 && !this.isVip) || (this.entvisit.total < this.entvisit.usage && this.powerInfo.memberStatus <= 0 && !this.entvisit.visited)
+            return (!this.conf._4 && !this.isVip) || (this.entvisit.total <= this.entvisit.usage && this.powerInfo.memberStatus <= 0 && !this.entvisit.visited)
+        },
+        isMember () {
+          return this.powerInfo.memberStatus <= 0
         },
         surplus: function () {
-            return this.entvisit.total > this.entvisit.usage
+            return this.entvisit.total <= this.entvisit.usage
         }
     },
     methods: {

+ 59 - 51
src/web/staticres/common-module/collection/js/vip-dialog.js

@@ -1,8 +1,8 @@
 var vipDialog = `
 <div class="vip_openDialog">
   <div class="vip_head">
-      <span>{{titleText}}</span>
-      <span class="vip_extend"><span>{{headText.top}}</span><br/>{{headText.bot}}</span>
+      <span>{{getTextMap.titleText}}</span>
+      <span class="vip_extend"><span>{{getTextMap.headText.top}}</span><br/>{{getTextMap.headText.bot}}</span>
   </div>
   <div class="vip_content">
     <div class="vip_content_div">
@@ -11,7 +11,7 @@ var vipDialog = `
     </div>
   </div>
   <div class="openBtn">
-      <button class="goBtn" @click="goOpen">{{btnText}}</button>
+      <button class="goBtn" @click="goOpen">{{getTextMap.btnText}}</button>
   </div>
 </div>
 `
@@ -59,92 +59,100 @@ var vipComponent = {
       }
     }
   },
-  created () {
-    this.setVisitStatus()
-  },
-  methods: {
-    setVisitStatus: function () {
-      if (this.entvisit.total == this.entvisit.usage || this.vipststus > 0) {
+  computed: {
+    getTextMap () {
+      var textMap = {
+        titleText: '开通超级订阅',
+        btnText: '去开通',
+        headText: {
+          top: '通过实时监控项目的招标、中标、合同等',
+          bot: '信息,全面挖掘更多潜在商机!'
+        }
+      }
+      if (this.entvisit.total <= this.entvisit.usage || this.vipststus > 0) {
         if (this.entvisit.provin == 0) {
-          this.btnText = '去开通'
+          textMap.btnText = '去开通'
         } else if (this.entvisit.provin != -1) {
-          this.titleText = '超级订阅'
-          this.btnText = '去升级'
+          textMap.titleText = '超级订阅'
+          textMap.btnText = '去升级'
         } else if(this.entvisit.provin == -1) {
-          this.titleText = '超级订阅'
-          this.btnText = '联系客服'
+          textMap.titleText = '超级订阅'
+          textMap.btnText = '联系客服'
         }
       }
       switch (this.type) {
-        // 项目动态
+          // 项目动态
         case 'item_1': {
-          this.headText.top = '通过实时监控项目的招标、中标、合同等'
-          this.headText.bot = '信息,全面挖掘更多潜在商机!'
+          textMap.headText.top = '通过实时监控项目的招标、中标、合同等'
+          textMap.headText.bot = '信息,全面挖掘更多潜在商机!'
           break
         }
-        // 年度项目统计
+          // 年度项目统计
         case 'item_2': {
-          this.headText.top = '年度项目规模、增长趋势一目了然,'
-          this.headText.bot = '快速分析市场!'
+          textMap.headText.top = '年度项目规模、增长趋势一目了然,'
+          textMap.headText.bot = '快速分析市场!'
           break
         }
-        // 月度中标金额统计
+          // 月度中标金额统计
         case 'item_3': {
-          this.headText.top = '纵向对比采购单位近三年月度采购规模,'
-          this.headText.bot = '不错过任何商机!'
+          textMap.headText.top = '纵向对比采购单位近三年月度采购规模,'
+          textMap.headText.bot = '不错过任何商机!'
           break
         }
-        // 市场区域分布
+          // 市场区域分布
         case 'item_4': {
-          this.headText.top = '通过企业市场规模、市场格局,'
-          this.headText.bot = '分析企业的市场发展现状!'
+          textMap.headText.top = '通过企业市场规模、市场格局,'
+          textMap.headText.bot = '分析企业的市场发展现状!'
           break
         }
-        // 各类客户平均折扣率
+          // 各类客户平均折扣率
         case 'item_5': {
-          this.headText.top = '通过近3年各类客户平均折扣率范围,'
-          this.headText.bot = '透视企业的行业盈利能力!'
+          textMap.headText.top = '通过近3年各类客户平均折扣率范围,'
+          textMap.headText.bot = '透视企业的行业盈利能力!'
           break
         }
-        // 客户类型分布
+          // 客户类型分布
         case 'item_6': {
-          this.headText.top = '通过企业主要客户类型分析,'
-          this.headText.bot = '洞悉企业业务模式、经营状况!'
+          textMap.headText.top = '通过企业主要客户类型分析,'
+          textMap.headText.bot = '洞悉企业业务模式、经营状况!'
           break
         }
-        // 重点客户
+          // 重点客户
         case 'item_7': {
-          this.headText.top = '通过挖掘企业重点客户,直观了解采购单位'
-          this.headText.bot = '与供应商关系远近,辅助投标决策!'
+          textMap.headText.top = '通过挖掘企业重点客户,直观了解采购单位'
+          textMap.headText.bot = '与供应商关系远近,辅助投标决策!'
           break
         }
-        // 企业情报历史记录
+          // 企业情报历史记录
         case 'item_8': {
-          this.titleText = '开通大会员'
-          this.headText.top = '快速查询全国企业工商信息、法人信息、'
-          this.headText.bot = '联系方式,全面掌控企业动态!'
+          textMap.titleText = '开通大会员'
+          textMap.headText.top = '快速查询全国企业工商信息、法人信息、'
+          textMap.headText.bot = '联系方式,全面掌控企业动态!'
           break
         }
-        // 历史项目联系方式
+          // 历史项目联系方式
         case 'item_9': {
-          this.titleText = '开通大会员'
-          this.headText.top = '获取企业历史项目联系人信息,'
-          this.headText.bot = '直接与甲方或渠道商项目负责人对接!'
+          textMap.titleText = '开通大会员'
+          textMap.headText.top = '获取企业历史项目联系人信息,'
+          textMap.headText.bot = '直接与甲方或渠道商项目负责人对接!'
           break
         }
         default: {
-          this.headText.top = '通过实时监控项目的招标、中标、合同等'
-          this.headText.bot = '信息,全面挖掘更多潜在商机!'
+          textMap.headText.top = '通过实时监控项目的招标、中标、合同等'
+          textMap.headText.bot = '信息,全面挖掘更多潜在商机!'
           break
         }
       }
+      return textMap
     },
+  },
+  methods: {
     goOpen: function() {
       // 点击按钮保存tabActiveName值
       this.$emit('tabactive', 'save')
       let isWeixin = utils.isWeiXinBrowser
       if(!isWeixin) {
-        if (this.btnText == '去开通') {
+        if (this.getTextMap.btnText == '去开通') {
           if(this.type == 'item_9' || this.type == 'item_8') {
             // 跳转到大会员
             location.href = '/jyapp/big/page/buy_commit'
@@ -152,15 +160,15 @@ var vipComponent = {
             // 跳转到超级订阅
             location.href = '/jyapp/vipsubscribe/vipsubscribe_new'
           }
-        } else if (this.btnText == '去升级') {
+        } else if (this.getTextMap.btnText == '去升级') {
           location.href = '/jyapp/vipsubscribe/upgradePage'
-        } else if(this.btnText == '联系客服') {
+        } else if(this.getTextMap.btnText == '联系客服') {
           location.href = '/jyapp/free/customer'
         } else {
           location.href = '/jyapp/vipsubscribe/vipsubscribe_new'
         }
       } else {
-        if (this.btnText == '去开通') {
+        if (this.getTextMap.btnText == '去开通') {
           if(this.type == 'item_9' || this.type == 'item_8') {
             // 跳转到大会员
             location.href = '/big/wx/page/buy_commit'
@@ -168,9 +176,9 @@ var vipComponent = {
             // 跳转到超级订阅
             location.href = '/front/vipsubscribe/vipsubscribe_new'
           }
-        } else if (this.btnText == '去升级') {
+        } else if (this.getTextMap.btnText == '去升级') {
           location.href = '/front/vipsubscribe/upgradePage'
-        } else if(this.btnText == '联系客服') {
+        } else if(this.getTextMap.btnText == '联系客服') {
           location.href = '/big/wx/page/customer'
         } else {
           location.href = '/front/vipsubscribe/vipsubscribe_new'

+ 1 - 1
src/web/templates/frontRouter/wx/collection/sess/ent_portrait.html

@@ -265,7 +265,7 @@
                 <div class="bg-white tab-card cell-list history-list" v-if="conf._4 && tabActiveName == '2' && !getStatus">
                     <hispro-component :type="portrait" :id="entInfo.id"></hispro-component>
                 </div>
-                <div class="vip_component" v-if="getStatus" style="height:11.36rem;background:url('/common-module/collection/image/bg/vip_bg_9.png') no-repeat;background-size:100% 100%">
+                <div class="vip_component" v-if="isMember" style="height:11.36rem;background:url('/common-module/collection/image/bg/vip_bg_9.png') no-repeat;background-size:100% 100%">
                     <vip-component @tabactive="tabActive" type="item_9" :entvisit="entvisit" imgurl='{{Msg "seo" "cdn"}}/common-module/collection/image/bg/vip_ex_9.png'></vip-component>
                 </div>
                 <div class="bg-white tab-card charts" v-if="conf._4 && tabActiveName == '2' && annualData.rows.length !== 0  && !getStatus">