Browse Source

feat: 支持定制化客户 拓普 详情页需求

zhangyuhan 1 year ago
parent
commit
aaf0822e3a

+ 23 - 2
apps/bigmember_pc/src/composables/attachment-download/component/AttachmentDownload.vue

@@ -5,7 +5,7 @@
         <span class="left-icon flex flex-items-center">
           <span class="file-attachment-text text-nowrap">附件下载</span>
         </span>
-        <div class="right-content flex flex-items-center">
+        <div class="right-content flex flex-items-center" v-if="canShowTip">
           <!-- 免费用户,无体验次数(没体验过) -->
           <template v-if="isFree && freeFileNum === 0">
             <span class="attachment-tag text-nowrap">
@@ -58,6 +58,7 @@
 <script>
 import { mapState, mapGetters } from 'vuex'
 import { useGetContentAttachment } from '@/composables/attachment-download/'
+import { IsCustomTopNet } from '@/views/article-content/composables/useContentStore'
 
 export default {
   name: 'AttachmentDownload',
@@ -158,6 +159,13 @@ export default {
           type: a.fileType
         }
       })
+    },
+    canShowTip() {
+      // 定制化用户不展示提示和留资
+      if (IsCustomTopNet.value) {
+        return false
+      }
+      return true
     }
   },
   created() {
@@ -209,6 +217,10 @@ export default {
       )
     },
     async startDownloadFile(file) {
+      // 定制化用户直接下载
+      if (IsCustomTopNet.value) {
+        return this.downloadFile(file)
+      }
       // 大客户直接下载
       if (location.pathname.indexOf('entservice') !== -1) {
         return this.downloadFile(file)
@@ -309,7 +321,16 @@ export default {
       // downUrl: 原始url
       // fileUrl: 下载地址
       const { downUrl, fileUrl } = await this.getAttachmentInfo(file)
-      this.refreshResourcePackCount()
+
+      let skipRefresh = false
+      // 定制化用户不展示提示和留资
+      if (IsCustomTopNet.value) {
+        skipRefresh = true
+      }
+
+      if (!skipRefresh) {
+        this.refreshResourcePackCount()
+      }
 
       if (downUrl && fileUrl) {
         location.href = fileUrl

+ 7 - 3
apps/bigmember_pc/src/views/article-content/components/ContentSummary.vue

@@ -1,7 +1,10 @@
 <script setup>
 import { computed, getCurrentInstance, ref } from 'vue'
 import CollectInfo from '@/components/collect-info/CollectInfo.vue'
-import { SummaryModel } from '@/views/article-content/composables/useContentStore'
+import {
+  IsCustomTopNet,
+  SummaryModel
+} from '@/views/article-content/composables/useContentStore'
 import { chunk, fill, padEnd } from 'lodash'
 import {
   doOpenBuyerPage,
@@ -33,7 +36,9 @@ const contentSummaryTable = computed(() => {
     const item = list[i]
     let type = item?.type || ''
     if (item?.link) {
-      type = 'unit'
+      if (!IsCustomTopNet.value) {
+        type = 'unit'
+      }
     }
     if (type === 'contact') {
       if (!item?.expand || item?.expand?.link === false) {
@@ -143,7 +148,6 @@ function doOpenItem(item, type = '') {
         <i class="iconfont icon-more"></i>
       </div>
     </div>
-
     <el-table
       class="summary-table"
       :span-method="arraySpanMethod"

+ 8 - 2
apps/bigmember_pc/src/views/article-content/composables/useContentStore.js

@@ -47,6 +47,10 @@ const ContentId = computed(() => {
   return ContentModel.value.id
 })
 
+const IsCustomTopNet = computed(() => {
+  return ContentModel.value.IsCustomTopNet
+})
+
 const SummaryModel = computed(() => {
   return Content.model.summary
 })
@@ -96,7 +100,8 @@ async function useContentStore() {
     ContentId,
     ContentExpandsModel,
     ContentPageLoading,
-    ContentPageExpandsLoading
+    ContentPageExpandsLoading,
+    IsCustomTopNet
   }
 }
 
@@ -107,5 +112,6 @@ export {
   ContentId,
   ContentExpandsModel,
   ContentPageLoading,
-  ContentPageExpandsLoading
+  ContentPageExpandsLoading,
+  IsCustomTopNet
 }

+ 6 - 1
apps/bigmember_pc/src/views/article-content/pages/Article.vue

@@ -30,6 +30,7 @@ import {
   ContentExpandsModel,
   ContentModel,
   ContentId,
+  IsCustomTopNet,
   ContentPageLoading,
   ContentPageExpandsLoading,
   SummaryModel
@@ -106,6 +107,10 @@ const tabContentShow = computed(() => {
     公告摘要: SummaryModel.value.list.filter((v) => v.value).length > 0,
     公告正文: ContentModel.value.content
   }
+  if (IsCustomTopNet.value) {
+    computedState['投标服务'] = false
+    computedState['客户推荐'] = false
+  }
   const result = Object.assign({}, tabContentState.value, computedState)
   handleScroll()
   return result
@@ -466,7 +471,7 @@ function doClickFreeView() {
                 v-if="tabContentShow['公告摘要']"
               >
                 <content-summary />
-                <recommend-ent />
+                <recommend-ent v-if="!IsCustomTopNet" />
               </div>
 
               <div

+ 1 - 0
data/data-models/modules/article/transform/content.js

@@ -69,6 +69,7 @@ class CommonContentModel extends BaseModel {
     result.isNiJian = this.isNiJianCheck(baseInfo?.subType)
     result.isCaigouyixiang = this.isCaigouyixiangCheck(baseInfo?.subType)
     result.isCanRead = data?.canRead || false
+    result.IsCustomTopNet = data?.topnet || false
 
     // TDK
     result.tdk.title = baseInfo.title

+ 1 - 1
data/data-models/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@jy/data-models",
-  "version": "0.0.2",
+  "version": "0.0.3",
   "description": "聚合API接口,对外提供业务数据模型",
   "main": "index.js",
   "files": [