浏览代码

feat: 移动端详情页企业列表模块优化

cuiyalong 1 年之前
父节点
当前提交
d0f440803d

+ 2 - 0
apps/mobile/src/api/modules/article.js

@@ -16,6 +16,7 @@ export function getArticleBaseInfo(data) {
   return request({
     url: '/publicapply/detail/baseInfo',
     method: 'post',
+    noToast: true,
     data
   })
 }
@@ -35,6 +36,7 @@ export function getArticleShareInfo(data) {
   return request({
     url: '/publicapply/detail/shareInfo',
     method: 'post',
+    noToast: true,
     data
   })
 }

+ 1 - 0
apps/mobile/src/store/modules/article.js

@@ -265,6 +265,7 @@ export default {
         } else {
           console.log(msg)
         }
+        return data
       } catch (error) {
         console.error(error)
       }

+ 3 - 1
apps/mobile/src/views/article/components/AbstractEnt.vue

@@ -25,7 +25,9 @@
         </span>
       </div>
       <div class="abstract-ent-info label-value">
-        <span class="ent-info-label">合作企业</span>
+        <span class="ent-info-label">{{
+          entType === 'buyer' ? '合作企业' : '合作客户'
+        }}</span>
         <span class="ent-info-value">
           <i class="value-number">{{ cooperateCount }}</i> 个
         </span>

+ 4 - 3
apps/mobile/src/views/article/components/ContentAbstract.vue

@@ -192,13 +192,14 @@
             >
               <span class="j-icon icon-phone-blue"></span>
             </span>
-            <span
+            <!-- 代理联系人不展示更多联系人 -->
+            <!-- <span
               class="abstract-line-value-action more-tel clickable"
               v-if="summaryMap.buyer?.link && summaryMap.agencyContactInfo?.tel"
             >
               <span class="a-l-v-a-text">更多联系人</span>
               <van-icon name="arrow" />
-            </span>
+            </span> -->
           </span>
         </div>
       </div>
@@ -237,7 +238,7 @@
             </span>
           </div>
         </div>
-        <div class="abstract-line" v-if="summaryMap.personTel?.value">
+        <div class="abstract-line" v-if="winner.personTel?.value">
           <div class="abstract-line-label">中标联系人 / 联系电话</div>
           <div class="abstract-line-value">
             <span

+ 28 - 7
apps/mobile/src/views/article/components/ContentAbstractEntList.vue

@@ -3,6 +3,7 @@
     <AbstractEnt
       class="abstract-ent-item"
       v-for="(ent, index) in entDetailList"
+      v-show="ent.totalNum > 0"
       :entType="ent.type"
       :title="ent.name"
       :key="index"
@@ -39,28 +40,48 @@ export default {
     }),
     entList() {
       const { winners, buyers } = this.summary
-      return buyers.concat(winners)
+      let winners3 = []
+      if (Array.isArray(winners) && winners.length > 3) {
+        winners3 = winners.slice(0, 3)
+      } else {
+        winners3 = winners
+      }
+      return buyers.concat(winners3).filter((b) => b.link)
     },
     entDetailList() {
       return this.entList.map((e) => {
         const detail = this.req[e.id] || {}
         return {
           ...e,
+          totalNum: this.calcTotalNum(detail),
           detail
         }
       })
     }
   },
   watch: {
-    entList(eList) {
-      if (Array.isArray(eList) && eList.length > 0) {
-        eList.forEach((ent) => {
-          this.getEntInfo(ent.type, ent.id)
-        })
+    entList: {
+      immediate: true,
+      handler(eList) {
+        if (Array.isArray(eList) && eList.length > 0) {
+          eList.forEach((ent) => {
+            this.getEntInfo(ent.type, ent.id)
+          })
+        }
       }
     }
   },
   methods: {
+    calcTotalNum(item = {}) {
+      const amountCount = item.bidamountCount || 0
+      const biddingCount = item.biddingCount || 0
+      const contactCount = item.contactCount || 0
+      const cooperate = item.cooperate || 0
+      const projectCount = item.projectCount || 0
+      return (
+        amountCount + biddingCount + contactCount + cooperate + projectCount
+      )
+    },
     async getEntInfo(type, id) {
       const { data, error_code: code } = await ajaxGetMiniEntInfo(type, id)
       if (code === 0 && data) {
@@ -87,7 +108,7 @@ export default {
       }
       openAppOrWxPage(LINKS.大会员超级订阅采购单位画像页面, {
         query: {
-          entName: item.value
+          entName: item.id
         }
       })
     },

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

@@ -1,5 +1,5 @@
 <template>
-  <ContentModuleCard title="正文" class="content-main-text-container">
+  <ContentModuleCard title="公告正文" class="content-main-text-container">
     <section class="content-main-text">
       <pre v-html="content.contentHighlighted"></pre>
     </section>

+ 8 - 2
apps/mobile/src/views/article/components/TabActions.vue

@@ -112,6 +112,8 @@ export default {
 </script>
 
 <style lang="scss" scoped>
+$height: 48px;
+
 ::v-deep {
   .action-text {
     font-size: 10px;
@@ -122,11 +124,15 @@ export default {
   display: flex;
   align-items: center;
   justify-content: space-between;
-  height: 48px;
   box-shadow: 0px -2px 8px 0px rgba(54, 147, 179, 0.05);
+  ::v-deep {
+    .tab-action-item {
+      height: $height;
+    }
+  }
 }
 .tab-action {
   flex: 1;
-  height: 100%;
+  height: $height;
 }
 </style>