浏览代码

Merge branch 'dev/v1.1.15_yf' of jianyu/web into feature/v1.1.15

yangfeng 1 周之前
父节点
当前提交
52385d9955

+ 46 - 13
apps/bigmember_pc/src/components/zhima/report-guide-banner.vue

@@ -9,12 +9,13 @@ import {
   toRef
   toRef
 } from 'vue'
 } from 'vue'
 import { ajaxGetReportBtnStatus, ajaxReportEquityDeduct } from '@/api/modules'
 import { ajaxGetReportBtnStatus, ajaxReportEquityDeduct } from '@/api/modules'
+import { debounce } from '@/utils/'
 
 
 const that = getCurrentInstance().proxy
 const that = getCurrentInstance().proxy
 
 
 const props = defineProps({
 const props = defineProps({
   // 来源 ent: 企业画像;unit: 采购单位画像;article: 标讯详情 detail: 项目详情
   // 来源 ent: 企业画像;unit: 采购单位画像;article: 标讯详情 detail: 项目详情
-  source: {
+  from: {
     type: String,
     type: String,
     default: ''
     default: ''
   },
   },
@@ -114,6 +115,31 @@ const isPackage = computed(() => {
   return packageInfo.value?.zmStatus && packageInfo.value?.zmStatus > 0
   return packageInfo.value?.zmStatus && packageInfo.value?.zmStatus > 0
 })
 })
 
 
+const discountText = computed(() => {
+  const packageType = packageInfo.value?.zmStatus
+  const expiredDay = packageInfo.value?.expiredDay
+  const balance = packageInfo.value?.zmNumber
+  // const total = packageInfo.value?.zmAllNumber
+  const price = packageInfo.value?.comboOne
+
+  if (packageType > 0) {
+    if (balance > 0) {
+      return `<div class="gray-text">本月剩余报告下载额度:<em class="highlight-text">${balance}</em>份</div>`
+    } else {
+      return `<div class="gray-text">本月免费额度已用完,可享权益特价:<span class="highlight-text">${price}/份</span></div>`
+    }
+  } else {
+    // packageType < 0:套餐过期天数
+    // 其他:首购优惠等
+    if (packageType < 0 && expiredDay) {
+      return `<div class="highlight-text">您的权益已过期${expiredDay}天,开通权益享特惠</div>`
+    } else {
+      return `<div class="highlight-text">${discountMsg.value}</div>`
+    }
+  }
+  return ''
+})
+
 const getReportId = (type, entName) => {
 const getReportId = (type, entName) => {
   let reportId = ''
   let reportId = ''
   switch (type) {
   switch (type) {
@@ -148,7 +174,7 @@ const getReportMold = (type) => {
   return mold
   return mold
 }
 }
 
 
-const handleDownload = (item) => {
+const handleDownload = debounce((item) => {
   if (item.type === 'competitor' && entNameList.value.length > 1) {
   if (item.type === 'competitor' && entNameList.value.length > 1) {
     item.showPopover = !item.showPopover
     item.showPopover = !item.showPopover
     that.$forceUpdate()
     that.$forceUpdate()
@@ -166,9 +192,7 @@ const handleDownload = (item) => {
     } else {
     } else {
       // 买过套餐权益则抵扣次数
       // 买过套餐权益则抵扣次数
       deductPackage(item, (code, data) => {
       deductPackage(item, (code, data) => {
-        console.log(code, data)
-        debugger
-        if (code === 0 && data?.id) {
+        if (code === 0 && data) {
           // 抵扣成功 生成报告id
           // 抵扣成功 生成报告id
           window.open(
           window.open(
             `/swordfish/page_big_pc/report/analysis/detail?id=${data}`
             `/swordfish/page_big_pc/report/analysis/detail?id=${data}`
@@ -187,7 +211,7 @@ const handleDownload = (item) => {
       })
       })
     }
     }
   }
   }
-}
+}, 300)
 const onClickCompetitor = (ent, parent) => {
 const onClickCompetitor = (ent, parent) => {
   if (!entCrnMap.value[ent]) return
   if (!entCrnMap.value[ent]) return
   parent.showPopover = false
   parent.showPopover = false
@@ -217,6 +241,11 @@ const onClickCompetitor = (ent, parent) => {
 // 获取报告入口按钮状态
 // 获取报告入口按钮状态
 const getReportBtnStatus = async () => {
 const getReportBtnStatus = async () => {
   if (!props.bId && !props.buyerName && !props.winnerName) return
   if (!props.bId && !props.buyerName && !props.winnerName) return
+  /**
+   * 项目分析报告需要bidding_id和采购单位名称,同时不是招标类型调接口时则不会传bidding_id,为了区分采购单位画像只需传采购单位的场景(采购单位分析报告),
+   * 如果是项目详情页面且不是招标类型的跳出 不再调用接口
+   */
+  if (props.from === 'detail' && props.topType !== '招标') return
   const { error_code: code, data } = await ajaxGetReportBtnStatus({
   const { error_code: code, data } = await ajaxGetReportBtnStatus({
     bidding_id: props.topType === '招标' ? props.bId : '',
     bidding_id: props.topType === '招标' ? props.bId : '',
     buyer: props.buyerName,
     buyer: props.buyerName,
@@ -303,8 +332,12 @@ const deductPackage = async (item, callback) => {
     project_name: type === 'project' ? props.projectName : '',
     project_name: type === 'project' ? props.projectName : '',
     bidding_id: props.topType === '招标' ? props.bId : ''
     bidding_id: props.topType === '招标' ? props.bId : ''
   }
   }
-  const { error_code: code, data } = await ajaxReportEquityDeduct(params)
-  callback && callback(code, data)
+  try {
+    const { error_code: code, data } = await ajaxReportEquityDeduct(params)
+    callback && callback(code, data)
+  } catch (error) {
+    callback && callback()
+  }
 }
 }
 
 
 onMounted(() => {
 onMounted(() => {
@@ -335,8 +368,8 @@ onUnmounted(() => {
           >{{ statusMap[packageInfo.zmStatus].text }}</span
           >{{ statusMap[packageInfo.zmStatus].text }}</span
         >
         >
       </div>
       </div>
-      <div v-if="discountMsg" class="discount-container">
-        <span :class="{ 'gray-text': isPackage }" v-html="discountMsg"></span>
+      <div v-if="discountText" class="discount-container">
+        <span v-html="discountText"></span>
       </div>
       </div>
     </div>
     </div>
     <div
     <div
@@ -407,9 +440,6 @@ onUnmounted(() => {
     font-size: 12px;
     font-size: 12px;
     line-height: 18px;
     line-height: 18px;
     color: $color_main;
     color: $color_main;
-    .gray-text {
-      color: #999999;
-    }
   }
   }
   .member-status {
   .member-status {
     padding: 2px 8px;
     padding: 2px 8px;
@@ -516,6 +546,9 @@ onUnmounted(() => {
       display: flex;
       display: flex;
       align-items: center;
       align-items: center;
     }
     }
+    .gray-text {
+      color: #999999;
+    }
   }
   }
 }
 }
 </style>
 </style>

+ 4 - 3
apps/bigmember_pc/src/views/project/ProjectInfo.vue

@@ -111,7 +111,7 @@
                 projectContent.isfollow ? '已监控' : '监控'
                 projectContent.isfollow ? '已监控' : '监控'
               }}</span>
               }}</span>
             </div>
             </div>
-            <div
+            <!-- <div
               class="flex-r-c center left down-report"
               class="flex-r-c center left down-report"
               v-if="showProjectReport"
               v-if="showProjectReport"
               @click="goProjectReport"
               @click="goProjectReport"
@@ -119,7 +119,7 @@
               <i class="el-icon-jy-report"></i>
               <i class="el-icon-jy-report"></i>
               <i class="el-icon-jy-report-active"></i>
               <i class="el-icon-jy-report-active"></i>
               <span>项目分析报告</span>
               <span>项目分析报告</span>
-            </div>
+            </div> -->
             <div
             <div
               class="flex-r-c center left down-report"
               class="flex-r-c center left down-report"
               @click="goDownReport"
               @click="goDownReport"
@@ -135,11 +135,12 @@
       </div>
       </div>
       <ZhiMaReportBanner
       <ZhiMaReportBanner
         v-if="projectInfo.projectname"
         v-if="projectInfo.projectname"
+        from="detail"
         :buyerName="projectInfo.buyer"
         :buyerName="projectInfo.buyer"
         :projectName="projectInfo.projectname"
         :projectName="projectInfo.projectname"
         :topType="projectInfo.bidstatus"
         :topType="projectInfo.bidstatus"
         :bId="sid"
         :bId="sid"
-        class="mt-16px"
+        class="m-t-16px"
       />
       />
       <div class="project-content">
       <div class="project-content">
         <el-card class="project-content">
         <el-card class="project-content">

+ 4 - 2
apps/bigmember_pc/src/views/reportDownload/record.vue

@@ -78,7 +78,9 @@
                 zhiMaReportInfo.firstText
                 zhiMaReportInfo.firstText
               }}</span>
               }}</span>
               <!-- <span v-if="zhiMaReportInfo.isFree" class="highlight-text">开通权益卡更优惠</span> -->
               <!-- <span v-if="zhiMaReportInfo.isFree" class="highlight-text">开通权益卡更优惠</span> -->
-              <span v-if="zhiMaReportInfo.endTime" class="light-gray-text"
+              <span
+                v-if="zhiMaReportInfo.packType > 0 && zhiMaReportInfo.endTime"
+                class="light-gray-text"
                 >有效期至:{{ zhiMaReportInfo.endTime }}</span
                 >有效期至:{{ zhiMaReportInfo.endTime }}</span
               >
               >
             </div>
             </div>
@@ -535,7 +537,7 @@ export default {
       },
       },
       zhiMaReportInfo: {
       zhiMaReportInfo: {
         flag: 'analysis',
         flag: 'analysis',
-        id: 4,
+        id: 5,
         firstText: '',
         firstText: '',
         expiredText: '',
         expiredText: '',
         packType: 0,
         packType: 0,