Prechádzať zdrojové kódy

feat:移动端商机情报详情页接口联调

zhangsiya 1 rok pred
rodič
commit
db15f77338

+ 1 - 2
apps/bigmember_pc/src/views/business/detail.vue

@@ -41,7 +41,7 @@
               <span class="poten_label"
                 ><span class="point"></span>预测线索</span
               >
-              <span class="poten_name">{{ info.title ? info.title.substring(info.title.indexOf('】') + 1) : '' }}</span>
+              <span class="poten_name">{{ info.title && info.title.indexOf('】' ? info.title.substring(info.title.indexOf('】') + 1) :  info.title }}</span>
             </div>
             <div class="poten_unit mt8">
               <span class="poten_label"
@@ -146,7 +146,6 @@ export default {
       const id = this.$route.params?.id || ''
       const { error_code: code, data = {} } = await getBusinessDetails({ id })
       if(code === 0 && data) {
-        console.log(data)
         this.info = data
       }
     },

+ 11 - 0
apps/mobile/src/api/modules/business.js

@@ -0,0 +1,11 @@
+import request from '@/api'
+import qs from 'qs'
+
+export function getBusinessDetails(data) {
+  data = qs.stringify(data)
+  return request({
+    url: '/bigmember/project/businessDetails',
+    method: 'POST',
+    data
+  })
+}

+ 1 - 0
apps/mobile/src/api/modules/index.js

@@ -24,3 +24,4 @@ export * from './ent'
 export * from './dataSmt'
 export * from './jyPoints'
 export * from './invoice'
+export * from './business'

+ 132 - 111
apps/mobile/src/views/business/Detail.vue

@@ -1,12 +1,12 @@
 <template>
-<!--  商机情报详情页-->
+  <!--  商机情报详情页-->
   <div class="j-container business-detail-page">
     <div class="j-main">
       <div class="business-header">
-        <div class="title">【商机情报】国家广播电视总局广播电视卫星直播管理中心异地灾备数据中心应用软件维护项目中标公告</div>
+        <div class="title">{{ info.title }}</div>
         <div class="business-sub-row">
           <div class="common-time">
-            {{ dateFromNow(new Date('2024-01-01').getTime()) }}
+            {{ dateFromNow(new Date(publishtime).getTime()) }}
           </div>
           <div class="business_option">
             <div class="potential-col">
@@ -15,7 +15,7 @@
           </div>
         </div>
       </div>
-      <section class="collect-info-tip">
+      <section class="collect-info-tip" v-if="info.isSubmit">
         【商机情报】想获得更精准商机情报?立即<em class="handle-em" @click="completeInfo">完善信息</em>。您也可以<em class="handle-em" @click="openCustomer">联系客服</em>进行相关咨询。
       </section>
       <div class="business-content">
@@ -27,22 +27,22 @@
           <div class="box-con">
             <div class="unit_row">
               <span class="unit_label">采购单位</span>
-              <span class="list_pur_name">{{ info.buyer || '北京市工商行政管理局朝阳分局' }}</span>
+              <span class="list_pur_name">{{ info.buyer }}</span>
             </div>
             <div class="unit_row">
               <span class="unit_label"><span class="point"></span>预测线索</span>
-              <span class="poten_name">{{ info.title ||  '淮安市高级职业技术学校台式电脑采购项目招标公告'}}</span>
+              <span class="poten_name">{{ info.title && info.title.indexOf('】') ? info.title.substring(info.title.indexOf('】') + 1) : info.title }}</span>
             </div>
             <div class="unit_row mt8">
               <span class="unit_label"><span class="point"></span>预测采购内容</span>
               <span class="poten_name">
-              <span>{{ info.purchasing || '该单位将采购钢筋、水泥、隔热板、大理石砖、玻璃、木材、钢筋、水泥、隔热板、大理石砖、玻璃' }}</span>
+              <span>{{ info.purchasing }}</span>
             </span>
             </div>
             <div class="unit_row mt8">
               <span class="unit_label">
                 <span class="point"></span>预测采购时间:
-                <span style="color: #1d1d1d;">{{info.yuceendtime || '2023-01-01' }}</span>
+                <span style="color: #1d1d1d;">{{ dateFormatter(info.yuceendtime, 'yyyy-MM-dd') }}</span>
               </span>
             </div>
           </div>
@@ -55,20 +55,20 @@
           <div class="box-con">
             <div class="unit_row">
               <span class="unit_label">同类项目:</span>
-              <span class="unit_name similar_project clickable" @click="goProjectDetail(info.p_id,info.p_orther)">
-                {{ info.p_orther || '关于泉州市第一医院内HIS系统改造项目'}}
-                <van-icon name="arrow" color="#C0C4CC"/>
+              <span class="unit_name similar_project clickable" @click="goProjectDetail(similarProject.p_id, similarProject.p_orther)">
+                {{ similarProject.p_orther }}
+                <van-icon name="arrow" color="#C0C4CC" v-if="similarProject.p_orther"/>
               </span>
             </div>
             <div class="unit_row mt8">
               <span class="unit_label">联系人:</span>
-              <span class="unit_name">{{ info.p_person || '王女士'}}</span>
+              <span class="unit_name">{{ similarProject.p_person }}</span>
             </div>
             <div class="unit_row mt8">
               <span class="unit_label">联系电话:</span>
               <span class="unit_name phone">
-                {{ info.p_phone || '15111111111' }}
-                <i class="icon_phone" @click="telHandle(info.p_phone)"></i>
+                {{ similarProject.p_phone }}
+                <i class="icon_phone" @click="telHandle(similarProject.p_phone)"></i>
               </span>
             </div>
           </div>
@@ -79,8 +79,8 @@
 </template>
 
 <script>
-import { dateFromNow, callPhone } from '@/utils'
-import { projectFollowCheck } from '@/api/modules/'
+import { dateFromNow, callPhone, dateFormatter } from '@/utils'
+import { projectFollowCheck, getBusinessDetails } from '@/api/modules/'
 import { Icon } from 'vant'
 import { mapGetters } from 'vuex'
 export default {
@@ -98,9 +98,29 @@ export default {
       'power',
       'isMember',
     ]),
+    publishtime () {
+      return this.info.publishtime ? this.info.publishtime * 1000 : Date.now()
+    },
+    yuceendtime () {
+      return this.info.yuceendtime ? this.info.yuceendtime * 1000 : Date.now()
+    },
+    similarProject () {
+      return this.info.results && this.info.results[0] ? this.info.results[0] : {}
+    }
+  },
+  created() {
+    this.getDetailInfo()
   },
   methods: {
     dateFromNow,
+    dateFormatter,
+    async getDetailInfo() {
+      const id = this.$route.params?.id || ''
+      const { error_code: code, data = {} } = await getBusinessDetails({ id })
+      if(code === 0 && data) {
+        this.info = data
+      }
+    },
     // 跳转潜在项目预测(无权限用户引导大会员留资,大会员引导跳转到潜在项目预测页面。)
     goPotentialPage () {
       if(this.isMember) {
@@ -150,6 +170,7 @@ export default {
     },
     // 电话
     telHandle (phone) {
+      if(!phone) return
       callPhone(phone)
     },
     // 联系客服
@@ -165,112 +186,112 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-  .business-detail-page{
-    .business-header{
-      background: #fff;
-      padding: 24px 16px 16px;
-      margin-bottom: 8px;
+.business-detail-page{
+  .business-header{
+    background: #fff;
+    padding: 24px 16px 16px;
+    margin-bottom: 8px;
 
-      .title{
-        font-size:20px;
-        line-height:30px;
-        color: #171826;
-        margin-bottom:12px;
-      }
-      .business-sub-row{
-        display: flex;
-        justify-content: space-between;
-        align-items: center;
+    .title{
+      font-size:20px;
+      line-height:30px;
+      color: #171826;
+      margin-bottom:12px;
+    }
+    .business-sub-row{
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
 
-        .common-time{
-          font-size:12px;
-          color: #9B9CA3;
-        }
-        .potential-col {
-          padding: 4px 8px;
-          border-radius: 4px;
-          border: 0.5px solid #87DFEA;
-          background: #EAF8FA;
-          font-size:12px;
-        }
-        .icon_right {
-          display: inline-block;
-          width: 10px;
-          height: 10px;
-          background: url('@/assets/image/icon/icon-right2.png') no-repeat center;
-          background-size: contain;
-          margin-left: 4px;
-        }
+      .common-time{
+        font-size:12px;
+        color: #9B9CA3;
+      }
+      .potential-col {
+        padding: 4px 8px;
+        border-radius: 4px;
+        border: 0.5px solid #87DFEA;
+        background: #EAF8FA;
+        font-size:12px;
+      }
+      .icon_right {
+        display: inline-block;
+        width: 10px;
+        height: 10px;
+        background: url('@/assets/image/icon/icon-right2.png') no-repeat center;
+        background-size: contain;
+        margin-left: 4px;
       }
     }
-    .collect-info-tip {
-      font-size:13px;
-      color: #1D1D1D;
-      line-height:20px;
-      padding: 8px 47px 8px 16px;
-      background: #fff url('@/assets/image/business/tip-bg.png')  no-repeat center right;
-      background-size:contain;
-      margin-bottom:8px;
+  }
+  .collect-info-tip {
+    font-size:13px;
+    color: #1D1D1D;
+    line-height:20px;
+    padding: 8px 47px 8px 16px;
+    background: #fff url('@/assets/image/business/tip-bg.png')  no-repeat center right;
+    background-size:contain;
+    margin-bottom:8px;
+  }
+  .business-content{
+    .poten-box, .similar-box{
+      background: #fff;
     }
-    .business-content{
-      .poten-box, .similar-box{
-        background: #fff;
+    .box-title{
+      padding: 16px 0 6px 16px;
+      font-size:18px;
+      line-height: 20px;
+      color: #171826;
+      display: flex;
+      align-items: center;
+      .left-line{
+        display: inline-block;
+        background: #2ABED1;
+        width: 3px;
+        height:16px;
+        border-radius: 11px;
+        margin-right: 8px;
       }
-      .box-title{
-        padding: 16px 0 6px 16px;
-        font-size:18px;
-        line-height: 20px;
-        color: #171826;
+    }
+    .box-con{
+      padding: 16px;
+      font-size:14px;
+      color: #171826;
+      line-height:20px;
+      .unit_row {
+        display: flex;
+        flex-direction: column;
+      }
+      .unit_label{
+        font-size: 12px;
+        line-height: 18px;
+        color: #9B9CA3;
+      }
+      .similar_project{
         display: flex;
+        justify-content: space-between;
         align-items: center;
-        .left-line{
-          display: inline-block;
-          background: #2ABED1;
-          width: 3px;
-          height:16px;
-          border-radius: 11px;
-          margin-right: 8px;
-        }
       }
-      .box-con{
-        padding: 16px;
-        font-size:14px;
-        color: #171826;
-        line-height:20px;
-        .unit_row {
-          display: flex;
-          flex-direction: column;
-        }
-        .unit_label{
-          font-size: 12px;
-          line-height: 18px;
-          color: #9B9CA3;
-        }
-        .similar_project{
-          display: flex;
-          justify-content: space-between;
-          align-items: center;
-        }
-        .phone{
-          display: flex;
-          align-items: center;
-        }
-        .icon_phone{
-          display: inline-block;
-          width: 24px;
-          height: 24px;
-          background: url('@/assets/image/icon/icon-phone.png') no-repeat center;
-          background-size: contain;
-          margin-left: 12px;
-        }
+      .phone{
+        display: flex;
+        align-items: center;
+      }
+      .icon_phone{
+        display: inline-block;
+        width: 24px;
+        height: 24px;
+        background: url('@/assets/image/icon/icon-phone.png') no-repeat center;
+        background-size: contain;
+        margin-left: 12px;
       }
     }
-    .handle-em{
-      color:#2ABED1 !important;
-    }
-    .mt8{
-      margin-top:8px;
-    }
   }
+  .handle-em{
+    color:#2ABED1 !important;
+  }
+  .mt8{
+    margin-top:8px;
+  }
+}
 
 </style>