Browse Source

fix: 阳光采购详情页隐藏推荐模块

cuiyalong 5 months ago
parent
commit
549a306ed7
1 changed files with 71 additions and 44 deletions
  1. 71 44
      apps/mobile/src/views/article/content.vue

+ 71 - 44
apps/mobile/src/views/article/content.vue

@@ -14,7 +14,7 @@ small-tab
           class="j-main article-content-main"
           class="j-main article-content-main"
           :class="{
           :class="{
             'show-underline': otherModel.hasProject,
             'show-underline': otherModel.hasProject,
-            'no-scroll': showBindPhone
+            'no-scroll': showBindPhone,
           }"
           }"
           @click="onScrollWrapperClick"
           @click="onScrollWrapperClick"
           @scroll.passive="onScroll"
           @scroll.passive="onScroll"
@@ -325,13 +325,13 @@ export default {
   },
   },
   computed: {
   computed: {
     ...mapState({
     ...mapState({
-      preAgentInfo: (state) => state.article.preAgentInfo,
-      content: (state) => state.article.mainModel.content,
-      summary: (state) => state.article.mainModel.summary,
-      mainModel: (state) => state.article.mainModel,
-      expandModel: (state) => state.article.expandModel,
-      otherModel: (state) => state.article.otherModel,
-      bindPhone: (state) => state.article.bindPhone
+      preAgentInfo: state => state.article.preAgentInfo,
+      content: state => state.article.mainModel.content,
+      summary: state => state.article.mainModel.summary,
+      mainModel: state => state.article.mainModel,
+      expandModel: state => state.article.expandModel,
+      otherModel: state => state.article.otherModel,
+      bindPhone: state => state.article.bindPhone
     }),
     }),
     IsCustomTopNet() {
     IsCustomTopNet() {
       return this.content.IsCustomTopNet || false
       return this.content.IsCustomTopNet || false
@@ -340,7 +340,7 @@ export default {
       return this.content.yyszbContent || location.pathname.includes('/yyszb')
       return this.content.yyszbContent || location.pathname.includes('/yyszb')
     },
     },
     toBCustom() {
     toBCustom() {
-      return this.IsCustomTopNet || this.yyszbContent
+      return this.IsCustomTopNet || this.yyszbContent || this.IsSunPublishContent
     },
     },
     showMonitor() {
     showMonitor() {
       return !this.yyszbContent
       return !this.yyszbContent
@@ -373,7 +373,8 @@ export default {
           show: this.content.isCanRead, // 是否展示全部内容
           show: this.content.isCanRead, // 是否展示全部内容
           showContentModule: this.hasPowerToReadSunPublishContent
           showContentModule: this.hasPowerToReadSunPublishContent
         }
         }
-      } else {
+      }
+      else {
         return {
         return {
           show: this.content.isCanRead,
           show: this.content.isCanRead,
           showContentModule: true
           showContentModule: true
@@ -399,10 +400,10 @@ export default {
       return this.mainModel.moduleShow
       return this.mainModel.moduleShow
     },
     },
     advancedModuleShow() {
     advancedModuleShow() {
-      const { tbService, customerRecommend, timeline, zbRecommend } =
-        this.expandModel.moduleShow
-      const toBCustom =
-        this.IsCustomTopNet || this.IsSunPublishContent || this.yyszbContent
+      const { tbService, customerRecommend, timeline, zbRecommend }
+        = this.expandModel.moduleShow
+      const toBCustom
+        = this.IsCustomTopNet || this.IsSunPublishContent || this.yyszbContent
       return Object.assign({}, this.expandModel.moduleShow, {
       return Object.assign({}, this.expandModel.moduleShow, {
         tbService: toBCustom ? false : tbService,
         tbService: toBCustom ? false : tbService,
         customerRecommend: toBCustom ? false : customerRecommend,
         customerRecommend: toBCustom ? false : customerRecommend,
@@ -421,7 +422,8 @@ export default {
       // 如果是有权限用户(权限7),则有数据展示,无数据不展示。无权限7用户则一直展示,展示广告引导
       // 如果是有权限用户(权限7),则有数据展示,无数据不展示。无权限7用户则一直展示,展示广告引导
       if (this.hasCustomerModulePower) {
       if (this.hasCustomerModulePower) {
         return this.advancedModuleShow.customerRecommend
         return this.advancedModuleShow.customerRecommend
-      } else {
+      }
+      else {
         return true
         return true
       }
       }
     },
     },
@@ -489,26 +491,31 @@ export default {
           }
           }
           this.checkNpsView()
           this.checkNpsView()
         })
         })
-      } else {
+      }
+      else {
         try {
         try {
           await this.getPreAgentInfo()
           await this.getPreAgentInfo()
           const { data, msg } = await this.getBaseInfo()
           const { data, msg } = await this.getBaseInfo()
           if (data) {
           if (data) {
             this.finishLoading()
             this.finishLoading()
-          } else {
+          }
+          else {
             this.finishLoading()
             this.finishLoading()
             this.isError = true
             this.isError = true
             // 无效参数 = d解析错误
             // 无效参数 = d解析错误
             // 未查到当前招标信息 = 文章不存在
             // 未查到当前招标信息 = 文章不存在
             if (msg.includes('未查到当前招标信息')) {
             if (msg.includes('未查到当前招标信息')) {
               this.errorText = '由于相关部门要求,该信息已下架,敬请原谅'
               this.errorText = '由于相关部门要求,该信息已下架,敬请原谅'
-            } else {
+            }
+            else {
               this.errorText = '该页面信息不存在'
               this.errorText = '该页面信息不存在'
             }
             }
           }
           }
-        } catch (error) {
+        }
+        catch (error) {
           console.error(error)
           console.error(error)
-        } finally {
+        }
+        finally {
           // console.log('基础接口请求完成')
           // console.log('基础接口请求完成')
         }
         }
         if (this.canReadConf.show) {
         if (this.canReadConf.show) {
@@ -531,7 +538,8 @@ export default {
       let subType = ''
       let subType = ''
       try {
       try {
         subType = this.content?._ob?.subType
         subType = this.content?._ob?.subType
-      } catch (error) {
+      }
+      catch (error) {
         console.log(error)
         console.log(error)
       }
       }
       let prefix = ''
       let prefix = ''
@@ -551,7 +559,8 @@ export default {
             title
             title
           }
           }
         })
         })
-      } catch (e) {
+      }
+      catch (e) {
         console.log(e)
         console.log(e)
       }
       }
     },
     },
@@ -563,7 +572,8 @@ export default {
     },
     },
     appHeaderActions() {
     appHeaderActions() {
       const { $envs } = this
       const { $envs } = this
-      if (!$envs.inApp) return
+      if (!$envs.inApp)
+        return
       if (this.yyszbContent) {
       if (this.yyszbContent) {
         return
         return
       }
       }
@@ -591,9 +601,11 @@ export default {
       // project-name事件委托
       // project-name事件委托
       if (checkUnderline.status) {
       if (checkUnderline.status) {
         this.clickKeywordUnderline(e)
         this.clickKeywordUnderline(e)
-      } else if (e.target.classList.contains('free-view')) {
+      }
+      else if (e.target.classList.contains('free-view')) {
         this.clickFreeView(e)
         this.clickFreeView(e)
-      } else if (e.target.className.includes('third-party-popover')) {
+      }
+      else if (e.target.className.includes('third-party-popover')) {
         this.popup.thirdPartyVerify = true
         this.popup.thirdPartyVerify = true
       }
       }
     },
     },
@@ -603,7 +615,8 @@ export default {
       const checkWinnerName = checkAncestorClass(e, 'winner-name', 3)
       const checkWinnerName = checkAncestorClass(e, 'winner-name', 3)
       if (checkProjectName.status) {
       if (checkProjectName.status) {
         this.goMemberFollowPage()
         this.goMemberFollowPage()
-      } else if (checkWinnerName.status) {
+      }
+      else if (checkWinnerName.status) {
         this.goToEntPortraitPage(checkWinnerName.target)
         this.goToEntPortraitPage(checkWinnerName.target)
       }
       }
     },
     },
@@ -623,7 +636,8 @@ export default {
             industry: _ob ? _ob.buyerClass : undefined
             industry: _ob ? _ob.buyerClass : undefined
           }
           }
         })
         })
-      } else {
+      }
+      else {
         openAppOrWxPage(LINKS.项目详情页)
         openAppOrWxPage(LINKS.项目详情页)
       }
       }
     },
     },
@@ -634,11 +648,12 @@ export default {
         ?.replace(/\?/g, '%3F')
         ?.replace(/\?/g, '%3F')
       if (!id) {
       if (!id) {
         return this.$toast('暂无数据')
         return this.$toast('暂无数据')
-      } else {
-        const noPower =
-          !this.bigMemberPower.includes(4) &&
-          !this.bigMemberPower.includes(12) &&
-          !this.bigMemberPower.includes(13)
+      }
+      else {
+        const noPower
+          = !this.bigMemberPower.includes(4)
+            && !this.bigMemberPower.includes(12)
+            && !this.bigMemberPower.includes(13)
         if (this.isMember && noPower) {
         if (this.isMember && noPower) {
           if (eName) {
           if (eName) {
             this.beforeLeavePage()
             this.beforeLeavePage()
@@ -647,10 +662,12 @@ export default {
               app: LINKS.旧版企业信息前缀.app + eName,
               app: LINKS.旧版企业信息前缀.app + eName,
               h5: LINKS.旧版企业信息前缀.h5 + eName
               h5: LINKS.旧版企业信息前缀.h5 + eName
             })
             })
-          } else {
+          }
+          else {
             return this.$toast('暂无数据')
             return this.$toast('暂无数据')
           }
           }
-        } else {
+        }
+        else {
           this.beforeLeavePage()
           this.beforeLeavePage()
           sessionStorage.removeItem('$data-ent_portrait')
           sessionStorage.removeItem('$data-ent_portrait')
           openAppOrWxPage(LINKS.企业画像页面, {
           openAppOrWxPage(LINKS.企业画像页面, {
@@ -689,12 +706,14 @@ export default {
       if (this.$envs.inWX) {
       if (this.$envs.inWX) {
         try {
         try {
           await this.getShareInfoReq()
           await this.getShareInfoReq()
-        } catch (error) {
+        }
+        catch (error) {
           console.log(error)
           console.log(error)
         }
         }
         await this.calcWxShareInfo()
         await this.calcWxShareInfo()
         this.initShareMixin()
         this.initShareMixin()
-      } else {
+      }
+      else {
         this.getShareInfoReq()
         this.getShareInfoReq()
       }
       }
     },
     },
@@ -731,7 +750,8 @@ export default {
       if (window.location.href.includes('open_infocontent')) {
       if (window.location.href.includes('open_infocontent')) {
         const query = window.location.search.slice(1)
         const query = window.location.search.slice(1)
         link += `${query}`
         link += `${query}`
-      } else {
+      }
+      else {
         link += '&source=wx_infocontentshare'
         link += '&source=wx_infocontentshare'
       }
       }
 
 
@@ -748,19 +768,22 @@ export default {
             subhref = `${add1}/content/${encryptid}${add2}`
             subhref = `${add1}/content/${encryptid}${add2}`
             this.wxShareCache.subhref = subhref
             this.wxShareCache.subhref = subhref
           }
           }
-        } catch (error) {
+        }
+        catch (error) {
           console.warn(error)
           console.warn(error)
         }
         }
       }
       }
 
 
       if (encryptid) {
       if (encryptid) {
         link = subhref
         link = subhref
-      } else {
+      }
+      else {
         link = window.location.href
         link = window.location.href
       }
       }
       if (!link.includes('?')) {
       if (!link.includes('?')) {
         link += '?'
         link += '?'
-      } else {
+      }
+      else {
         link += '&'
         link += '&'
       }
       }
       if (!encryptid) {
       if (!encryptid) {
@@ -805,12 +828,14 @@ export default {
           link += `${location.search}&source=app_infocontentshare&from=${
           link += `${location.search}&source=app_infocontentshare&from=${
             this.shareInfoRes.userId || ''
             this.shareInfoRes.userId || ''
           }`
           }`
-        } else {
+        }
+        else {
           link += `?source=app_infocontentshare&from=${
           link += `?source=app_infocontentshare&from=${
             this.shareInfoRes.userId || ''
             this.shareInfoRes.userId || ''
           }`
           }`
         }
         }
-      } else if (shareType === 3) {
+      }
+      else if (shareType === 3) {
         // 分享到朋友圈
         // 分享到朋友圈
         link += '&qrcodeType=app_infocontent_timeline_z'
         link += '&qrcodeType=app_infocontent_timeline_z'
         shareTitle = this.getRandomShareText()
         shareTitle = this.getRandomShareText()
@@ -822,7 +847,8 @@ export default {
       // this.shareConf.link = link
       // this.shareConf.link = link
       if (this.$envs.inApp && shareToWx) {
       if (this.$envs.inApp && shareToWx) {
         this.refreshShareLink(this.domainConf.wx)
         this.refreshShareLink(this.domainConf.wx)
-      } else {
+      }
+      else {
         this.refreshShareLink()
         this.refreshShareLink()
       }
       }
     },
     },
@@ -845,7 +871,8 @@ export default {
     },
     },
     checkNpsView() {
     checkNpsView() {
       const targetVm = this.$refs.npsCard
       const targetVm = this.$refs.npsCard
-      if (!targetVm) return
+      if (!targetVm)
+        return
       const target = targetVm.$el
       const target = targetVm.$el
       const scrollWrapper = this.$refs.scrollWrapper
       const scrollWrapper = this.$refs.scrollWrapper
       const visible = isElementInScrollArea(target, scrollWrapper)
       const visible = isElementInScrollArea(target, scrollWrapper)