Jelajahi Sumber

fix: 优化运营商专版采购意向详情

cuiyalong 8 bulan lalu
induk
melakukan
812ce0c850

+ 15 - 2
apps/mobile/src/views/article/components/ContentHeader.vue

@@ -1,6 +1,10 @@
 <template>
   <section class="content-title-container bg-white">
-    <span v-if="showHeaderType" class="page-tag red fixed-header-top-left" :class="{ 'rectangle-tag': IsSunPublishContent }">
+    <span
+      v-if="showHeaderType"
+      class="page-tag red fixed-header-top-left"
+      :class="{ 'rectangle-tag': IsSunPublishContent }"
+    >
       {{ headerType }}
     </span>
     <!-- <span class="forecast fixed-header-right" v-if="otherModel.forecastShow">
@@ -46,7 +50,7 @@
         <span class="relationship-text">找人脉</span>
       </div>
     </div>
-    <div class="sub-info-line" v-if="!IsSunPublishContent">
+    <div v-if="showRenMaiButton2" class="sub-info-line">
       <div class="sub-info-line-l" />
       <div class="sub-info-line-r">
         <!-- 有参标人时候另起一行 -->
@@ -94,6 +98,9 @@ export default {
       IsSunPublishContent() {
         return this.content.IsSunPublishContent || false
       },
+      yyszbContent() {
+        return this.content.yyszbContent
+      },
       showHeaderType() {
         if (!this.headerType) {
           return false
@@ -135,8 +142,14 @@ export default {
       if (this.IsSunPublishContent) {
         return ''
       }
+      if (this.yyszbContent) {
+        return
+      }
       return articleTypeArr.includes(this.content?._ob?.topType)
     },
+    showRenMaiButton2() {
+      return !(this.IsSunPublishContent || this.yyszbContent)
+    },
     collectionTags() {
       return this.otherModel.collectionTags
     }

+ 33 - 15
apps/mobile/src/views/article/components/ContentMainText.vue

@@ -1,46 +1,58 @@
 <template>
-  <ContentModuleCard title="公告正文" class="content-main-text-container" :class="{ 'mask-content': showMask }">
+  <ContentModuleCard
+    title="公告正文"
+    class="content-main-text-container"
+    :class="{ 'mask-content': showMask }"
+  >
     <template v-if="showMask">
       <div class="content-text-mask-container">
-        <img src="@/assets/image/mask/bg/article-content-mask-card@2x.png" alt="">
-        <div class="click-to-get" @click="toUnlockContent"></div>
-        <div class="mask-feedback" @click="feedback"></div>
+        <img
+          src="@/assets/image/mask/bg/article-content-mask-card@2x.png"
+          alt=""
+        />
+        <div class="click-to-get" @click="toUnlockContent" />
+        <div class="mask-feedback" @click="feedback" />
       </div>
     </template>
     <template v-else>
       <section class="content-main-text">
-        <pre v-html="content.contentHighlighted"></pre>
+        <pre v-html="content.contentHighlighted" />
       </section>
       <AttachmentDownloadCard class="attachment-download-section" />
-      <div></div>
+      <div />
       <Reward
-        :beforeLeavePage="beforeLeavePage"
         v-if="rewardShow"
         :id="content.id"
+        :before-leave-page="beforeLeavePage"
       />
       <section class="others-footer">
         <div class="origin-link-container">
-          <OriginLink :id="content.id" v-if="content.originalShow" />
+          <OriginLink v-if="content.originalShow" :id="content.id" />
         </div>
         <button class="feedback-button clickable" @click="feedback">
           意见反馈
         </button>
       </section>
       <section class="others-footer">
-        <div class="origin-link-suffix" v-if="showGetInLibTip">
-          <span class="origin-link-text">由于该企业要求必须入库供应商才可以参与报价,请点击入库链接,进行入库申请</span>
-          <button class="u-origin-link-button" @click="clickViewOriginalLink">点击入库</button>
+        <div v-if="showGetInLibTip" class="origin-link-suffix">
+          <span class="origin-link-text"
+            >由于该企业要求必须入库供应商才可以参与报价,请点击入库链接,进行入库申请</span
+          >
+          <button class="u-origin-link-button" @click="clickViewOriginalLink">
+            点击入库
+          </button>
         </div>
       </section>
     </template>
   </ContentModuleCard>
 </template>
+
 <script>
+import { mapGetters, mapState } from 'vuex'
 import ContentModuleCard from '@/views/article/ui/ContentModuleCard.vue'
 import AttachmentDownloadCard from '@/views/article/components/AttachmentDownloadCard.vue'
 import OriginLink from '@/views/article/components/OriginLink.vue'
 import Reward from '@/views/article/components/Reward.vue'
-import { mapState, mapGetters } from 'vuex'
 import { LINKS } from '@/data'
 import { openAppOrWxPage } from '@/utils/'
 import EventBus from '@/utils/eventBus'
@@ -73,11 +85,17 @@ export default {
     IsSunPublishContent() {
       return this.content.IsSunPublishContent || false
     },
+    yyszbContent() {
+      return this.content.yyszbContent
+    },
+    toBCustom() {
+      return this.yyszbContent || this.IsSunPublishContent
+    },
     showGetInLibTip() {
       if (!this.hasPowerToReadSunPublishContent) {
         return false
       }
-      if (this.IsSunPublishContent) {
+      if (this.toBCustom) {
         if (this.content?._summary) {
           return this.content.originalShow && !this.content._summary?.buyerTel
         } else {
@@ -244,14 +262,14 @@ export default {
   display: flex;
   align-items: center;
   justify-content: space-between;
-  background-color: #F7F9FA;
+  background-color: #f7f9fa;
   border-radius: 8px;
   .origin-link-text {
     margin-right: 8px;
     flex: 1;
     font-size: 12px;
     line-height: 18px;
-    color: #9B9CA3;
+    color: #9b9ca3;
   }
 }
 

+ 7 - 10
apps/mobile/src/views/article/content.vue

@@ -51,7 +51,7 @@ small-tab
             <van-tab v-if="baseModuleShow.summary" key="abstract" title="摘要">
               <div class="tab-module">
                 <ContentAbstract
-                  :custom-skip="IsCustomTopNet"
+                  :custom-skip="toBCustom"
                   class="content-abstract-module"
                   :before-leave-page="beforeLeavePage"
                 />
@@ -352,7 +352,7 @@ export default {
       return this.content.IsSunPublishContent || false
     },
     showContentHeaderBannerTip() {
-      if (this.IsSunPublishContent) {
+      if (this.toBCustom) {
         return false
       }
       return this.content.recommendedService
@@ -405,9 +405,9 @@ export default {
         this.IsCustomTopNet || this.IsSunPublishContent || this.yyszbContent
       return Object.assign({}, this.expandModel.moduleShow, {
         tbService: toBCustom ? false : tbService,
-        customerRecommend: this.IsSunPublishContent ? false : customerRecommend,
-        timeline: this.IsSunPublishContent ? false : timeline,
-        zbRecommend: this.IsSunPublishContent ? false : zbRecommend
+        customerRecommend: toBCustom ? false : customerRecommend,
+        timeline: toBCustom ? false : timeline,
+        zbRecommend: toBCustom ? false : zbRecommend
       })
     },
     // 客户推荐模块是否展示
@@ -415,10 +415,7 @@ export default {
       if (this.IsCustomTopNet) {
         return false
       }
-      if (this.IsSunPublishContent) {
-        return false
-      }
-      if (this.yyszbContent) {
+      if (this.toBCustom) {
         return false
       }
       // 如果是有权限用户(权限7),则有数据展示,无数据不展示。无权限7用户则一直展示,展示广告引导
@@ -634,7 +631,7 @@ export default {
     clickFreeView() {
       this.beforeLeavePage()
       let source = 'peugeot_view_infor'
-      if (this.IsSunPublishContent) {
+      if (this.toBCustom) {
         source = `${this.$env.platform}_sunlight_viewdetails`
       }
       openAppOrWxPage(LINKS.留资, {

+ 111 - 64
data/data-models/modules/article/transform/summary2.js

@@ -1,5 +1,5 @@
-import BaseModel from '../../../core/base'
 import { dateFormatter, formatMoney, splitMoney } from '@jy/util'
+import BaseModel from '../../../core/base'
 
 /**
  * 摘要 Item 基础类
@@ -47,15 +47,19 @@ class Buyer extends Unit {
   constructor(name, id, { seoId, link }) {
     super(name, id)
     this.link = link
-    this.type ='buyer'
+    this.type = 'buyer'
     this.seoId = seoId || ''
   }
 }
 class Winner extends Unit {
-  constructor(name, id, { seoId, winnerPerson, winnerTel, link, isCandidate, personTel }) {
+  constructor(
+    name,
+    id,
+    { seoId, winnerPerson, winnerTel, link, isCandidate, personTel }
+  ) {
     super(name, id)
 
-    this.type ='winner'
+    this.type = 'winner'
     this.seoId = seoId || ''
     this.winnerPerson = winnerPerson || ''
     this.winnerTel = winnerTel || ''
@@ -65,12 +69,7 @@ class Winner extends Unit {
   }
 }
 
-
 class SummaryModel extends BaseModel {
-  constructor(config) {
-    super(config)
-  }
-
   createModel() {
     return {
       // 是否超前项目
@@ -85,31 +84,31 @@ class SummaryModel extends BaseModel {
     }
   }
 
-  formatModel(data, isInit = false) {
-    const { baseInfo, abstract } = data
-    const isProposed = this.isProposedCheck(baseInfo?.subType)
-    const model = isProposed
-      ? this.tranSummaryOfProposed(abstract.proposed, baseInfo)
-      : this.tranSummaryOfDefault(abstract.default, baseInfo)
-    model.isProposed = isProposed
+  formatModel(data) {
+    const model = this.getSummaryContentObject(data)
     return model
   }
 
   getSummaryContentObject(data) {
     const { baseInfo, abstract } = data
     const isProposed = this.isProposedCheck(baseInfo?.subType)
-    const model = isProposed ? abstract.proposed : abstract.default
+
+    const model = isProposed
+      ? this.tranSummaryOfProposed(abstract.proposed, baseInfo)
+      : this.tranSummaryOfDefault(abstract.default, baseInfo)
     return model
   }
 
   isProposedCheck(type) {
-    return type === '拟建' || type === '采购意向'
+    return type === '拟建'
+    // return type === '拟建' || type === '采购意向'
   }
 
   formatTime(time, fmt = 'yyyy-MM-dd') {
     if (time) {
       return dateFormatter(time * 1000, fmt)
-    } else {
+    }
+    else {
       return time
     }
   }
@@ -121,9 +120,10 @@ class SummaryModel extends BaseModel {
   formatTel(name, tel) {
     if (name === 'freeView' || tel === 'freeView') {
       return 'freeView'
-    } else {
+    }
+    else {
       const arr = [name, tel]
-      return arr.filter((item) => !!item).join(' / ')
+      return arr.filter(item => !!item).join(' / ')
     }
   }
 
@@ -145,59 +145,91 @@ class SummaryModel extends BaseModel {
     list.push(buyerInfo)
     if (summary?.buyer) {
       result.buyers.push(
-        new Buyer(summary?.buyer, summary?.buyer, { seoId: baseInfo?.buyerSeoId, link: summary?.buyerPortraitShow })
+        new Buyer(summary?.buyer, summary?.buyer, {
+          seoId: baseInfo?.buyerSeoId,
+          link: summary?.buyerPortraitShow
+        })
       )
     }
 
     // 采购人/联系电话
-    const buyerContactInfoValue = this.formatTel(summary?.buyerPerson, summary?.buyerTel)
-    const buyerContactInfo = new PersonTelSummaryItem('buyerContactInfo', '采购联系人/电话', buyerContactInfoValue, summary?.buyerTel, buyerInfo)
+    const buyerContactInfoValue = this.formatTel(
+      summary?.buyerPerson,
+      summary?.buyerTel
+    )
+    const buyerContactInfo = new PersonTelSummaryItem(
+      'buyerContactInfo',
+      '采购联系人/电话',
+      buyerContactInfoValue,
+      summary?.buyerTel,
+      buyerInfo
+    )
     list.push(buyerContactInfo)
 
     // 招标代理机构
-    list.push(
-      new SummaryItem('agency', '招标代理机构', summary?.agency)
-    )
+    list.push(new SummaryItem('agency', '招标代理机构', summary?.agency))
 
     // 代理联系人
-    const agencyContactInfoValue = this.formatTel(summary?.agencyPerson, summary?.agencyTel)
-    const agencyContactInfo = new PersonTelSummaryItem('agencyContactInfo', '代理联系人/电话', agencyContactInfoValue, summary?.agencyTel)
+    const agencyContactInfoValue = this.formatTel(
+      summary?.agencyPerson,
+      summary?.agencyTel
+    )
+    const agencyContactInfo = new PersonTelSummaryItem(
+      'agencyContactInfo',
+      '代理联系人/电话',
+      agencyContactInfoValue,
+      summary?.agencyTel
+    )
     list.push(agencyContactInfo)
 
     // 截止日期
     if (IsSunPublishContent) {
       list.push(
-        new SummaryItem('signEndTime', '报名截止日期', this.formatTime(summary?.signEndTime, 'yyyy-MM-dd HH:mm'))
+        new SummaryItem(
+          'signEndTime',
+          '报名截止日期',
+          this.formatTime(summary?.signEndTime, 'yyyy-MM-dd HH:mm')
+        )
       )
-    } else {
+    }
+    else {
       list.push(
-        new SummaryItem('signEndTime', '报名截止日期', this.formatTime(summary?.signEndTime))
+        new SummaryItem(
+          'signEndTime',
+          '报名截止日期',
+          this.formatTime(summary?.signEndTime)
+        )
       )
     }
     // 投标截止日期
     if (IsSunPublishContent) {
       // do something...
-    } else {
+    }
+    else {
       list.push(
-        new SummaryItem('bidEndTime', '投标截止日期', this.formatTime(summary?.bidEndTime))
+        new SummaryItem(
+          'bidEndTime',
+          '投标截止日期',
+          this.formatTime(summary?.bidEndTime)
+        )
       )
     }
-    
 
     // 中标单位
     if (Array.isArray(summary.winnerInfos) && summary.winnerInfos.length > 0) {
       const winnerList = []
-      const winnerSummaryList = []
+      // const winnerSummaryList = []
       // 列表中是否有中标候选人
       let hasWaitWinner = false
       const winnerInfos = summary.winnerInfos
       let circularList = []
-      const waitWinnerList = winnerInfos.filter((w) => w.isCandidate)
+      const waitWinnerList = winnerInfos.filter(w => w.isCandidate)
       if (Array.isArray(waitWinnerList) && waitWinnerList.length > 0) {
         // 有中标候选人,则循环中标候选人
         hasWaitWinner = true
         circularList = waitWinnerList.slice(0, 1)
-      } else {
+      }
+      else {
         // 无中标候选人,则循环原始数据
         circularList = winnerInfos
       }
@@ -206,7 +238,7 @@ class SummaryModel extends BaseModel {
         const w = circularList[i]
         const index = i
         // 有中标候选人,则“中标单位”文案修改为”中标候选人“,仅展示排名第1的中标候选人,其他候选人不展示;
-        const labelText = hasWaitWinner ? '中标候选人' : '中标单位';
+        const labelText = hasWaitWinner ? '中标候选人' : '中标单位'
 
         const summaryWinner = new SummaryItem('winner', labelText, w.winner)
         // 是否可跳转
@@ -214,7 +246,13 @@ class SummaryModel extends BaseModel {
         summaryWinner.addKey('id', w.winnerId)
 
         const wContactInfoValue = this.formatTel(w?.winnerPerson, w?.winnerTel)
-        const winnerContactInfo = new PersonTelSummaryItem(`winnerContactInfo-${index}`, '中标联系人/电话', wContactInfoValue, w?.winnerTel, summaryWinner)
+        const winnerContactInfo = new PersonTelSummaryItem(
+          `winnerContactInfo-${index}`,
+          '中标联系人/电话',
+          wContactInfoValue,
+          w?.winnerTel,
+          summaryWinner
+        )
 
         list.push(summaryWinner)
         list.push(winnerContactInfo)
@@ -239,40 +277,38 @@ class SummaryModel extends BaseModel {
     }
 
     // 中标金额
-    const bidAmountFormat = summary?.bidAmount ? this.formatMoney(summary?.bidAmount) : ''
+    const bidAmountFormat = summary?.bidAmount
+      ? this.formatMoney(summary?.bidAmount)
+      : ''
     this.formatMoney()
-    list.push(
-      new SummaryItem('bidAmount', '中标金额(元)', bidAmountFormat)
-    )
+    list.push(new SummaryItem('bidAmount', '中标金额(元)', bidAmountFormat))
 
     // 项目地区
     const pArea = baseInfo?.area || ''
     const pCity = baseInfo?.city || ''
-    const pDistrict = baseInfo?.district|| ''
+    const pDistrict = baseInfo?.district || ''
     const projectArea = `${pArea}${pCity}${pDistrict}` || ''
-    list.push(
-      new SummaryItem('projectArea', '项目地区', projectArea)
-    )
+    list.push(new SummaryItem('projectArea', '项目地区', projectArea))
 
     // 交付地点
     const jArea = summary?.deliverArea || ''
     const jCity = summary?.deliverCity || ''
-    const jDistrict = summary?.deliverDistrict|| ''
+    const jDistrict = summary?.deliverDistrict || ''
     const jDetail = summary?.deliverDetail || ''
     const jfArea = `${jArea}${jCity}${jDistrict}` || ''
-    list.push(
-      new SummaryItem('jfArea', '交付地点', `${jfArea}${jDetail}`)
-    )
+    list.push(new SummaryItem('jfArea', '交付地点', `${jfArea}${jDetail}`))
 
-    result.list = list.filter((s) => !!s.value)
+    result.list = list.filter(s => !!s.value)
     result.originMap = summary
 
     // 项目清单
     result._s = summary
     result.purchasingList = summary.purchasingList
     if (Array.isArray(result.purchasingList)) {
-      result.purchasingList = result.purchasingList.map(item => {
-        const numberUnit = item.number ? `${item.number}${item.unitName || ''}` : ''
+      result.purchasingList = result.purchasingList.map((item) => {
+        const numberUnit = item.number
+          ? `${item.number}${item.unitName || ''}`
+          : ''
         return {
           ...item,
           numberUnit
@@ -284,9 +320,9 @@ class SummaryModel extends BaseModel {
 
   tranSummaryOfProposed(summary, baseInfo = {}) {
     const result = this.createModel()
-    if (!summary) {
-      return result
-    }
+    // if (!summary) {
+    //   return result
+    // }
 
     const list = []
 
@@ -311,10 +347,16 @@ class SummaryModel extends BaseModel {
       const label = summaryMap[key]
       let s = null
       if (key === 'buyerClass') {
-        s = new SummaryItem(key, label, summary?.buyerClass === '其它' ? '' : summary?.buyerClass)
-      } else if (key === 'totalInvestment') {
+        s = new SummaryItem(
+          key,
+          label,
+          summary?.buyerClass === '其它' ? '' : summary?.buyerClass
+        )
+      }
+      else if (key === 'totalInvestment') {
         s = new SummaryItem(key, label, formatMoney(summary[key]))
-      } else {
+      }
+      else {
         s = new SummaryItem(key, label, summary[key] || '')
       }
 
@@ -322,12 +364,17 @@ class SummaryModel extends BaseModel {
         s.addKey('link', summary?.buyerPortraitShow) // 是否可进行跳转
         if (summary?.buyer) {
           result.buyers.push(
-            new Buyer(summary?.buyer, summary?.buyer, { seoId: baseInfo?.buyerSeoId, link: summary?.buyerPortraitShow })
+            new Buyer(summary?.buyer, summary?.buyer, {
+              seoId: baseInfo?.buyerSeoId,
+              link: summary?.buyerPortraitShow
+            })
           )
         }
-      } else if (key === 'address') {
+      }
+      else if (key === 'address') {
         s.addKey('row', true)
-      } else if (key === 'content') {
+      }
+      else if (key === 'content') {
         s.addKey('row', true)
       }