Jelajahi Sumber

feat:add移动端芝麻分析报告权益版功能

yangfeng 1 Minggu lalu
induk
melakukan
35aac40795

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

@@ -442,3 +442,14 @@ export function ajaxGetReportExample() {
     method: 'post'
   })
 }
+
+// 芝麻分析报告套餐扣除
+export function ajaxReportEquityDeduct(data) {
+  data = qs.stringify(data)
+  return request({
+    url: '/subscribepay/zmComboConsumption',
+    method: 'post',
+    noToast: true,
+    data
+  })
+}

TEMPAT SAMPAH
apps/mobile/src/assets/image/icon/crown-month.png


TEMPAT SAMPAH
apps/mobile/src/assets/image/icon/crown-season.png


TEMPAT SAMPAH
apps/mobile/src/assets/image/icon/crown-year.png


+ 158 - 76
apps/mobile/src/views/article/components/ActionDownloadReport.vue

@@ -13,20 +13,16 @@
         :showCredit="showCredit"
         :btnInfo="btnInfo"
         @clickItem="onClickReportItem"
-        @btn="onBtnClick"
       />
       <template #reference>
         <TabActionItem
           showText
           :direction="direction"
           class="action-monitor"
-          @click.native.stop="changePopoverState"
+          @click="changePopoverState"
         >
-          <!-- <van-icon
-            slot="icon"
-            :name="showPopover ? 'custom-report-active' : 'custom-report'"
-          ></van-icon> -->
           <img
+            v-if="btnInfo.isNew"
             slot="tip"
             class="action-new-tip"
             src="@/assets/image/icon/new-img.png"
@@ -87,6 +83,7 @@ import TabActionItem from '@/views/article/ui/TabActionItem.vue'
 import ReportDownloadCard from '@/views/article/ui/ReportDownloadCard.vue'
 import { Popover, Dialog, Icon } from 'vant'
 import { AppIcon } from '@/ui'
+import { ajaxReportEquityDeduct } from '@/api/modules/'
 
 export default {
   name: 'ActionReport',
@@ -153,69 +150,43 @@ export default {
     }
   },
   methods: {
+    showLoading() {
+      return this.$toast.loading({
+        duration: 0,
+        forbidClick: true,
+        message: 'loading...'
+      })
+    },
     onReportRedirect(type) {
-      const {
-        ent_report_ids = {},
-        buyer_report_id = '',
-        project_report_id = ''
-      } = this.btnInfo
       // 判断是否购买过,已购买跳转报告页,未购买跳转购买页
-      if (type === 'project') {
-        const buyerName = this.buyers[0]?.name
-        if (project_report_id) {
-          this.$router.push({
-            path: '/report/analysis/detail',
-            query: {
-              id: project_report_id
-            }
-          })
-        } else {
-          // 项目分析报告 name: 项目名称(下单页展示用),buyer:采购单位名称(下单接口参数用)
-          this.$router.push({
-            path: '/order/create/analysis-report/project',
-            query: {
-              name: this.projectName,
-              id: this.id,
-              buyer: buyerName
-            }
-          })
-        }
-      } else if (type === 'unit') {
-        const buyerName = this.buyers[0]?.name
-        if (buyer_report_id) {
-          this.$router.push({
-            path: '/report/analysis/detail',
-            query: {
-              id: buyer_report_id
-            }
-          })
-        } else {
-          this.$router.push({
-            path: '/order/create/analysis-report/unit',
-            query: {
-              name: buyerName,
-              id: this.id
-            }
-          })
-        }
-      } else if (type === 'competitor') {
-        const entName = this.winners[0]?.name
-        if (Object.keys(ent_report_ids).length > 0 && ent_report_ids[entName]) {
-          this.$router.push({
-            path: '/report/analysis/detail',
-            query: {
-              id: ent_report_ids[entName]
-            }
-          })
-        } else {
-          this.$router.push({
-            path: '/order/create/analysis-report/competitor',
-            query: {
-              name: entName,
-              id: this.id
-            }
-          })
-        }
+      const reportId = this.getReportId(type)
+      if (reportId) {
+        this.$router.push({
+          path: '/report/analysis/detail',
+          query: {
+            id: reportId
+          }
+        })
+      } else {
+        const url = this.getReportOrderUrl(type)
+        const params = this.getDeductParams(type)
+        // console.log(url, params)
+        this.deductPackage(params, (code, data) => {
+          if (code === 0 && data) {
+            // 抵扣成功
+            this.$router.push({
+              path: '/report/analysis/detail',
+              query: {
+                id: data
+              }
+            })
+          } else {
+            // 抵扣失败 || 没开通权益,进购买页
+            this.$router.push({
+              path: url
+            })
+          }
+        })
       }
     },
     onClickReportItem(type) {
@@ -225,9 +196,9 @@ export default {
           // 投标企业信用报告
           location.href = `/jy_mobile/common/pdfview?buyer=${buyerName}`
           break
-        case 'unit':
+        case 'buyer':
           // 采购单位分析
-          this.onReportRedirect('unit')
+          this.onReportRedirect('buyer')
           break
         case 'competitor':
           // 供应商分析
@@ -255,17 +226,36 @@ export default {
           }
         })
       } else {
-        this.$router.push({
-          path: '/order/create/analysis-report/competitor',
-          query: {
-            name: entName,
-            id: this.id
+        this.deductPackage(
+          {
+            type: 'competitor',
+            entName,
+            bId: this.id
+          },
+          (code, data) => {
+            if (code === 0 && data) {
+              // 抵扣成功
+              this.$router.push({
+                path: '/report/analysis/detail',
+                query: {
+                  id: data
+                }
+              })
+            } else {
+              // 抵扣失败 || 没开通权益,进购买页
+              this.$router.push({
+                path: '/order/create/analysis-report/competitor',
+                query: {
+                  name: entName,
+                  id: this.id
+                }
+              })
+            }
           }
-        })
+        )
       }
       this.showDialog = false
     },
-    onBtnClick() {},
     async changePopoverState() {
       this.showPopover = true
     },
@@ -278,6 +268,98 @@ export default {
           await this.changePopoverState()
         }
       }
+    },
+    getReportMold(type) {
+      let mold = 0
+      switch (type) {
+        case 'project':
+          mold = 1
+          break
+        case 'competitor':
+          mold = 2
+          break
+        case 'buyer':
+          mold = 3
+          break
+      }
+      return mold
+    },
+    getReportId(type) {
+      let reportId = ''
+      const {
+        ent_report_ids = {},
+        buyer_report_id = '',
+        project_report_id = ''
+      } = this.btnInfo
+      if (type === 'competitor') {
+        const entName = this.winners[0]?.name
+        reportId = ent_report_ids[entName]
+      } else if (type === 'buyer') {
+        reportId = buyer_report_id
+      } else if (type === 'project') {
+        reportId = project_report_id
+      }
+      return reportId
+    },
+    getReportOrderUrl(type) {
+      let url = ''
+      const winnerName = this.winners[0]?.name
+      const buyerName = this.buyers[0]?.name
+      const projectName = this.projectName
+      const id = this.id
+      if (type === 'competitor') {
+        url = `/order/create/analysis-report/competitor?name=${winnerName}&id=${id}`
+      } else if (type === 'buyer') {
+        url = `/order/create/analysis-report/unit?name=${buyerName}&id=${id}`
+      } else if (type === 'project') {
+        url = `/order/create/analysis-report/project?name=${projectName}&id=${id}&buyer=${buyerName}`
+      }
+      return url
+    },
+    getDeductParams(type) {
+      let params = {}
+      if (type === 'competitor') {
+        params = {
+          type,
+          entName: this.winners[0]?.name,
+          bId: this.id
+        }
+      } else if (type === 'buyer') {
+        params = {
+          type,
+          buyerName: this.buyers[0]?.name,
+          bId: this.id
+        }
+      } else if (type === 'project') {
+        params = {
+          type,
+          projectName: this.projectName,
+          bId: this.id,
+          buyerName: this.buyers[0]?.name
+        }
+      }
+      return params
+    },
+    async deductPackage(
+      { entName, buyerName, projectName, bId, type },
+      callback
+    ) {
+      const params = {
+        ent_name: entName,
+        buyer: buyerName,
+        report_mold: this.getReportMold(type),
+        project_name: projectName,
+        bidding_id: bId
+      }
+      const loading = this.showLoading()
+      try {
+        const { error_code: code, data } = await ajaxReportEquityDeduct(params)
+        loading?.clear()
+        callback && callback(code, data)
+      } catch (error) {
+        loading?.clear()
+        callback && callback()
+      }
     }
   }
 }

+ 44 - 78
apps/mobile/src/views/article/components/ContentAbstract.vue

@@ -31,21 +31,6 @@
       <div v-if="summaryMap.buyer?.value" class="abstract-line">
         <div class="flex flex-items-center justify-between abstract-line-label">
           <span>业主单位</span>
-          <div
-            v-if="showBuyerReportBtn"
-            class="flex flex-items-center report-entry"
-            @click="onReportClick('unit', summaryMap.buyer?.value)"
-          >
-            <AppIcon
-              slot="icon"
-              name="xiazaixiangmubaogao"
-              color="#2ABED1"
-              svg
-              size="20"
-            ></AppIcon>
-            <span>采购单位分析报告</span>
-            <van-icon name="arrow" />
-          </div>
         </div>
         <div class="abstract-line-value">
           <span
@@ -58,6 +43,15 @@
             {{ summaryMap.buyer?.value }}
           </span>
         </div>
+        <ReportModuleEntry
+          v-if="showBuyerReportBtn"
+          class="m-t-8px"
+          type="buyer"
+          :buyerName="summaryMap.buyer?.value"
+          :info="reportBtn"
+          :id="content?.id"
+        >
+        </ReportModuleEntry>
       </div>
       <div class="abstract-line-container">
         <div v-if="summaryMap.totalInvestment?.value" class="abstract-line">
@@ -141,21 +135,6 @@
       <div v-if="summaryMap.buyer?.value" class="abstract-line">
         <div class="flex flex-items-center justify-between abstract-line-label">
           <span>采购单位</span>
-          <div
-            v-if="showBuyerReportBtn"
-            class="flex flex-items-center report-entry"
-            @click="onReportClick('unit', summaryMap.buyer?.value)"
-          >
-            <AppIcon
-              slot="icon"
-              name="xiazaixiangmubaogao"
-              color="#2ABED1"
-              svg
-              size="20"
-            ></AppIcon>
-            <span>采购单位分析报告</span>
-            <van-icon name="arrow" />
-          </div>
         </div>
         <div class="abstract-line-value">
           <span v-if="yyszbContent" class="ellipsis-2">{{
@@ -174,6 +153,15 @@
             {{ summaryMap.buyer?.value }}
           </span>
         </div>
+        <ReportModuleEntry
+          v-if="showBuyerReportBtn"
+          class="m-t-8px"
+          type="buyer"
+          :buyerName="summaryMap.buyer?.value"
+          :info="reportBtn"
+          :id="content?.id"
+        >
+        </ReportModuleEntry>
       </div>
       <div v-if="summaryMap.buyerContactInfo?.value" class="abstract-line">
         <div class="abstract-line-label">采购联系人 / 联系电话</div>
@@ -305,26 +293,7 @@
             class="flex flex-(items-center justify-between) abstract-line-label"
           >
             <span>{{ winner.isCandidate ? '中标候选人' : '中标单位' }}</span>
-            <div
-              v-if="
-                showEntReportBtn &&
-                Object.keys(entCrnMap).length > 0 &&
-                entCrnMap[winner.name]
-              "
-              class="flex flex-items-center report-entry"
-              @click="onReportClick('competitor', winner.name)"
-            >
-              <AppIcon
-                name="xiazaixiangmubaogao"
-                color="#2ABED1"
-                svg
-                size="20"
-              ></AppIcon>
-              <span>供应商分析报告</span>
-              <van-icon name="arrow" />
-            </div>
           </div>
-
           <div
             v-if="IsCustomTopNet || yyszbContent"
             class="abstract-line-value"
@@ -346,6 +315,19 @@
               {{ winner.name }}
             </span>
           </div>
+          <ReportModuleEntry
+            v-if="
+              showEntReportBtn &&
+              Object.keys(entCrnMap).length > 0 &&
+              entCrnMap[winner.name]
+            "
+            class="m-t-8px"
+            type="competitor"
+            :winnerName="winner.name"
+            :info="reportBtn"
+            :id="content?.id"
+          >
+          </ReportModuleEntry>
         </div>
         <div v-if="winner.personTel?.value" class="abstract-line">
           <div class="abstract-line-label">中标联系人 / 联系电话</div>
@@ -386,7 +368,9 @@
         </div>
       </section>
       <div v-if="summaryMap.bidAmount?.value" class="abstract-line">
-        <div class="abstract-line-label">{{hasWaitWinnerState ? '投标' : '中标'}}金额(元)</div>
+        <div class="abstract-line-label">
+          {{ hasWaitWinnerState ? '投标' : '中标' }}金额(元)
+        </div>
         <div class="abstract-line-value">
           <span class="abstract-line-value-text">
             {{ summaryMap.bidAmount?.value || ' ' }}
@@ -408,11 +392,15 @@
       class="abstract-bottom-desc"
       :class="{ transparent: IsSunPublishContent }"
     >
-      <span v-if='hasWaitWinnerState'>*该信息为<span class='highlight-strong-label'>候选人公示</span>,具体<span class='highlight-strong-label'>中标信息未确认</span>,请以实际中标通知为准!如有误差,请</span>
+      <span v-if="hasWaitWinnerState"
+        >*该信息为<span class="highlight-strong-label">候选人公示</span
+        >,具体<span class="highlight-strong-label">中标信息未确认</span
+        >,请以实际中标通知为准!如有误差,请</span
+      >
       <span v-else>*以上摘要信息由剑鱼标讯智能提取。如有误差,请</span>
 
       <span class="highlight-text underline" @click="concatKf">联系客服</span>
-      <span v-if='hasWaitWinnerState'>处理。</span>
+      <span v-if="hasWaitWinnerState">处理。</span>
       <span v-else>进行处理。</span>
     </div>
 
@@ -435,6 +423,7 @@ import { LINKS } from '@/data'
 import { openAppOrWxPage } from '@/utils/'
 import { callPhone } from '@/utils/callFn'
 import { AppIcon } from '@/ui'
+import ReportModuleEntry from './ReportModuleEntry.vue'
 
 export default {
   name: 'ContentAbstract',
@@ -442,7 +431,8 @@ export default {
     ContentSummaryPurchaseList,
     [ActionSheet.name]: ActionSheet,
     [Icon.name]: Icon,
-    AppIcon
+    AppIcon,
+    ReportModuleEntry
   },
   props: {
     customSkip: {
@@ -598,30 +588,6 @@ export default {
           from: encodeURIComponent(location.href)
         }
       })
-    },
-    onReportClick(type, name) {
-      const { ent_report_ids = {}, buyer_report_id = '' } = this.reportBtn
-      if (type === 'unit') {
-        if (buyer_report_id) {
-          this.$router.push({
-            path: `/report/analysis/detail?id=${buyer_report_id}`
-          })
-        } else {
-          this.$router.push({
-            path: `/order/create/analysis-report/unit?name=${name}&id=${this.content?.id}`
-          })
-        }
-      } else if (type === 'competitor') {
-        if (Object.keys(ent_report_ids).length > 0 && ent_report_ids[name]) {
-          this.$router.push({
-            path: `/report/analysis/detail?id=${ent_report_ids[name]}`
-          })
-        } else {
-          this.$router.push({
-            path: `/order/create/analysis-report/competitor?name=${name}&id=${this.content?.id}`
-          })
-        }
-      }
     }
   }
 }
@@ -688,7 +654,7 @@ export default {
     white-space: nowrap;
   }
   .highlight-strong-label {
-    color: #FF3A20;
+    color: #ff3a20;
   }
 }
 .report-entry {

+ 15 - 3
apps/mobile/src/views/article/components/ContentProjectTimeline.vue

@@ -13,14 +13,14 @@
           :name="projectName"
           :beforeLeavePage="beforeLeavePage"
         />
-        <div
+        <!-- <div
           v-if="showProjectButton"
           class="flex items-center action-item"
           @click="onProjectReport"
         >
           <i class="iconfont icon-xiazaixiangmubaogao font-size-20px"></i>
           <span class="action-text">项目分析报告</span>
-        </div>
+        </div> -->
       </div>
       <span class="action-item clickable follow-project">
         <QuickMonitor
@@ -33,6 +33,16 @@
         />
       </span>
     </div>
+    <ReportModuleEntry
+      class="m-r-16px m-l-16px"
+      v-if="showProjectButton"
+      type="project"
+      :info="reportBtn"
+      :id="content?.id"
+      :projectName="projectName"
+      :buyerName="content?._summary.buyers[0]?.name"
+    >
+    </ReportModuleEntry>
     <div class="bg-white">
       <h5 class="project-title">{{ projectName }}</h5>
       <ProjectTimeline :stepList="stepList2" @itemClick="itemClick" />
@@ -57,6 +67,7 @@ import { mapState, mapGetters } from 'vuex'
 import { replaceKeyword, openAppOrWxPage, formatMoney } from '@/utils'
 import { LINKS } from '@/data'
 import LocationMixin from '@/utils/mixins/modules/location-to'
+import ReportModuleEntry from './ReportModuleEntry.vue'
 
 export default {
   name: 'ContentProjectTimeline',
@@ -66,7 +77,8 @@ export default {
     QuickMonitor,
     DownProjectReport,
     ProjectTimeline,
-    ContentModuleCard
+    ContentModuleCard,
+    ReportModuleEntry
   },
   props: {
     beforeLeavePage: Function

+ 222 - 0
apps/mobile/src/views/article/components/ReportModuleEntry.vue

@@ -0,0 +1,222 @@
+<template>
+  <section class="report-module-entry">
+    <div class="flex items-center justify-center report-module-container">
+      <div class="marketing">{{ marketText }}</div>
+      <div
+        class="flex items-center report-module-action"
+        :data-mold="type | formatMold"
+        @click="goReportTarget"
+      >
+        <AppIcon
+          name="xiazaixiangmubaogao"
+          color="#2ABED1"
+          svg
+          size="20"
+        ></AppIcon>
+        <span>{{ type | formatType }}</span>
+        <van-icon name="arrow" />
+      </div>
+    </div>
+  </section>
+</template>
+<script>
+import { Icon } from 'vant'
+import { AppIcon } from '@/ui'
+import { ajaxReportEquityDeduct } from '@/api/modules/'
+export default {
+  name: 'ReportModuleEntry',
+  components: {
+    [Icon.name]: Icon,
+    AppIcon
+  },
+  props: {
+    type: {
+      type: String,
+      default: ''
+    },
+    // 采购单位名称
+    buyerName: {
+      type: String,
+      default: ''
+    },
+    // 供应商/中标单位名称
+    winnerName: {
+      type: String,
+      default: ''
+    },
+    // 项目名称
+    projectName: {
+      type: String,
+      default: ''
+    },
+    // 报告信息
+    info: {
+      type: Object,
+      default: () => ({})
+    },
+    // 标讯id
+    id: {
+      type: String,
+      default: ''
+    }
+  },
+  filters: {
+    formatType(type) {
+      if (type === 'competitor') {
+        return '供应商分析报告'
+      }
+      if (type === 'buyer') {
+        return '采购单位分析报告'
+      }
+      if (type === 'project') {
+        return '项目分析报告'
+      }
+    },
+    formatMold(type) {
+      if (type === 'project') {
+        return 1
+      }
+      if (type === 'competitor') {
+        return 2
+      }
+      if (type === 'buyer') {
+        return 3
+      }
+    }
+  },
+  computed: {
+    // 营销文案
+    marketText() {
+      const { guidingCopy } = this.info
+      const { buyer, ent, project } = guidingCopy
+      guidingCopy['project'] = project
+      guidingCopy['buyer'] = buyer
+      guidingCopy['competitor'] = ent
+      return guidingCopy[this.type]
+    }
+  },
+  methods: {
+    showLoading() {
+      return this.$toast.loading({
+        duration: 0,
+        forbidClick: true,
+        message: 'loading...'
+      })
+    },
+    getReportId() {
+      let reportId = ''
+      const type = this.type
+      const {
+        ent_report_ids = {},
+        buyer_report_id = '',
+        project_report_id = ''
+      } = this.info
+      if (type === 'competitor') {
+        const name = this.winnerName
+        reportId = ent_report_ids[name] || ''
+      } else if (type === 'buyer') {
+        reportId = buyer_report_id
+      } else if (type === 'project') {
+        reportId = project_report_id
+      }
+      return reportId
+    },
+    getReportOrderUrl() {
+      let url = ''
+      const type = this.type
+      if (type === 'competitor') {
+        url = `/order/create/analysis-report/competitor?name=${this.winnerName}&id=${this.id}`
+      } else if (type === 'buyer') {
+        url = `/order/create/analysis-report/unit?name=${this.buyerName}&id=${this.id}`
+      } else if (type === 'project') {
+        url = `/order/create/analysis-report/project?name=${this.projectName}&id=${this.id}&buyer=${this.buyerName}`
+      }
+      return url
+    },
+    goReportTarget() {
+      const reportId = this.getReportId()
+      if (reportId) {
+        this.$router.push({
+          path: `/report/analysis/detail?id=${reportId}`
+        })
+      } else {
+        // 套餐抵扣
+        this.deductPackage((code, data) => {
+          if (code === 0 && data) {
+            this.$router.push({
+              path: `/report/analysis/detail?id=${data}`
+            })
+          } else {
+            const url = this.getReportOrderUrl()
+            this.$router.push({
+              path: url
+            })
+          }
+        })
+      }
+    },
+    async deductPackage(callback) {
+      const params = {
+        ent_name: this.winnerName,
+        buyer: this.buyerName,
+        report_mold: this.getReportMold(),
+        project_name: this.projectName,
+        bidding_id: this.id
+      }
+      console.log(params, 'params')
+      const loading = this.showLoading()
+      try {
+        const { error_code: code, data } = await ajaxReportEquityDeduct(params)
+        loading?.clear()
+        callback && callback(code, data)
+      } catch (error) {
+        loading?.clear()
+        callback && callback()
+      }
+    },
+    getReportMold() {
+      const type = this.type
+      let mold = 0
+      switch (type) {
+        case 'project':
+          mold = 1
+          break
+        case 'competitor':
+          mold = 2
+          break
+        case 'buyer':
+          mold = 3
+          break
+      }
+      return mold
+    }
+  }
+}
+</script>
+<style lang="scss" scoped>
+.report-module-entry {
+  .report-module-container {
+    padding: 7px 0;
+    border: 0.5px solid #87dfea;
+    background: #2abed11f;
+    border-radius: 8px;
+  }
+  .marketing {
+    margin-right: 4px;
+    padding: 2px 8px;
+    border-radius: 8px 2px 8px 2px;
+    background: linear-gradient(101.8deg, #2abed1 0%, #0a6cff 100%);
+    font-size: 11px;
+    line-height: 14px;
+    color: #fff;
+  }
+  .report-module-action {
+    color: $color_main;
+    span {
+      margin: 0 4px;
+      font-size: 14px;
+      line-height: 20px;
+    }
+  }
+}
+</style>

+ 129 - 15
apps/mobile/src/views/article/ui/ReportDownloadCard.vue

@@ -5,10 +5,19 @@
     </div> -->
     <div class="menu-action-item">
       <p class="menu-action-item-title">芝麻信用共建分析报告</p>
+      <p
+        v-if="packageStatus"
+        class="flex items-center justify-center member-container"
+        :class="packageClass"
+      >
+        <span class="member-icon" :class="'member-icon-' + packageClass" />
+        <span class="member-type">{{ packageText }}</span>
+        <span class="member-vip">VIP</span>
+      </p>
       <p
         v-if="showBuyer"
         class="menu-action-item-content clickable"
-        @click="toClickReport('unit')"
+        @click="toClickReport('buyer')"
       >
         采购单位分析报告
       </p>
@@ -26,15 +35,13 @@
       >
         项目分析报告
       </p>
-      <div class="report-tips">{{ tips }}</div>
-      <div
-        v-if="discountText"
-        class="highlight-text inline-flex flex-items-center clickable report-buy-btn"
-        @click.stop="onClickBtn"
-      >
-        <slot name="btnText">{{ discountText }}</slot>
+      <template v-if="discountText">
+        <div
+          class="flex flex-items-center justify-center m-t-12px"
+          v-html="discountText"
+        ></div>
         <!-- <AppIcon name="youbian" svg size="18"></AppIcon> -->
-      </div>
+      </template>
     </div>
   </section>
 </template>
@@ -53,10 +60,6 @@ export default {
       type: Boolean,
       default: false
     },
-    tips: {
-      type: String,
-      default: ''
-    },
     btnInfo: {
       type: Object,
       default: () => ({})
@@ -73,7 +76,60 @@ export default {
       return this.btnInfo?.buyer_report_button
     },
     discountText() {
-      return this.btnInfo?.discount_msg
+      const packageType = this.packageInfo?.zmStatus
+      const balance = this.packageInfo?.zmNumber
+      const total = this.packageInfo?.zmAllNumber
+      const price = this.packageInfo?.comboOne
+      const expiredDay = this.packageInfo?.expiredDay
+      const discountMsg = this.btnInfo?.discount_msg
+      if (packageType > 0) {
+        if (balance > 0) {
+          return `<span class="gray-text">本月报告下载额度:<em class="highlight-text">${balance}</em>/${total}</span>`
+        } else {
+          return `<p class="gray-text">本月免费额度已用完<br>享受会员特价:<span class="highlight-text">${price}/份</span></p>`
+        }
+      } else {
+        // packageType < 0:套餐过期天数
+        // 其他:首购优惠等
+        if (packageType < 0 && expiredDay) {
+          return `<div class="gray-text">您的权益已过期${expiredDay}天,<br>开通权益享特惠</div>`
+        } else {
+          return `<span class="highlight-text report-buy-btn">${discountMsg}</span>`
+        }
+      }
+    },
+    packageType() {
+      return this.packageInfo?.zmStatus
+    },
+    packageInfo() {
+      return this.btnInfo?.zmAnalysis
+    },
+    packageStatus() {
+      return this.packageInfo?.zmStatus && this.packageInfo?.zmStatus > 0
+    },
+    packageText() {
+      const type = this.packageType
+      if (type === 1) {
+        return '月卡'
+      } else if (type === 2) {
+        return '季卡'
+      } else if (type === 3) {
+        return '年卡'
+      } else {
+        return ''
+      }
+    },
+    packageClass() {
+      const type = this.packageType
+      if (type === 1) {
+        return 'month'
+      } else if (type === 2) {
+        return 'season'
+      } else if (type === 3) {
+        return 'year'
+      } else {
+        return ''
+      }
     }
   },
   methods: {
@@ -108,9 +164,62 @@ export default {
 .menu-action-item-content {
   margin-top: 12px;
 }
+.member-container {
+  width: 120px;
+  height: 22px;
+  margin: 12px auto 0;
+  border-radius: 8px 2px 8px 2px;
+  font-weight: 600;
+  .member-icon {
+    width: 12px;
+    height: 10px;
+    background-repeat: no-repeat;
+    background-position: center center;
+    background-size: 100% 100%;
+    margin-right: 4px;
+    &.member-icon-month {
+      background-image: url(@/assets/image/icon/crown-month.png);
+    }
+    &.member-icon-season {
+      background-image: url(@/assets/image/icon/crown-season.png);
+    }
+    &.member-icon-year {
+      background-image: url(@/assets/image/icon/crown-year.png);
+    }
+  }
+  .member-type {
+    margin-right: 4px;
+    font-size: 13px;
+  }
+  .member-vip {
+    font-size: 12px;
+    font-style: italic;
+  }
+  &.month {
+    background: $color_main;
+    color: #fff;
+  }
+  &.season {
+    background: #f1d090;
+    color: #33323a;
+    .member-vip {
+      color: #1b1a2a;
+    }
+  }
+  &.year {
+    background: #1b1a2a;
+    color: #f1d090;
+    .member-vip {
+      color: #fae7ca;
+    }
+  }
+}
+</style>
+<style lang="scss">
 .report-buy-btn {
+  display: inline-block;
   min-width: 106px;
-  margin: 12px auto 0;
+  margin: 0 auto;
   white-space: nowrap;
   background: rgba(42, 190, 209, 0.12);
   padding: 1px 12px;
@@ -118,4 +227,9 @@ export default {
   font-size: 12px;
   line-height: 18px;
 }
+.gray-text {
+  color: #9b9ca3;
+  font-size: 11px;
+  line-height: 16px;
+}
 </style>

+ 1 - 1
apps/mobile/src/views/reportAnalysis/components/listItem.vue

@@ -157,7 +157,7 @@
           class="jy-zhima-logo"
           src="@/assets/image/reportanalysis/jy-zhima-logo.png"
         />
-        <div class="item" v-if="data.biddingId">
+        <div class="item" v-if="data.biddingId && data.biddingTitle">
           <p class="label">目标公告:</p>
           <p
             class="value ellipsis"

+ 137 - 7
apps/mobile/src/views/reportAnalysis/reportDownload.vue

@@ -80,12 +80,37 @@
             class="jy-zhima-logo"
             src="@/assets/image/reportanalysis/jy-zhima-logo.png"
           />
-          <div class="credit_report_btn" @click="goBuy('analysis')">去购买</div>
+          <div
+            v-if="zhiMaInfo.pack_type > 0"
+            class="member-container"
+            :class="zhiMaInfo.pack_type | packageTypeClass"
+          >
+            <span class="member-type">{{
+              zhiMaInfo.pack_type | packageTypeText
+            }}</span>
+            <span class="member-vip">VIP</span>
+          </div>
+          <div v-else class="credit_report_btn" @click="goBuy('analysis')">
+            去购买
+          </div>
         </div>
         <div class="analysis-report-main">
-          <div class="flex credit_report_title mt8px">
-            <span>芝麻共建分析报告</span>
-            <div class="flex-1 justify-between credit_report_action">
+          <div class="flex items-center mt8px">
+            <span class="report-title">芝麻共建分析报告</span>
+            <span
+              class="end-time"
+              v-if="zhiMaInfo.pack_type > 0 && zhiMaInfo.minEndTime"
+              >有效期至:{{
+                dateFormatter(zhiMaInfo.minEndTime, 'yyyy-MM-dd')
+              }}</span
+            >
+            <span v-if="zhiMaInfo.firstMsg" class="report-first">{{
+              zhiMaInfo.firstMsg
+            }}</span>
+            <div
+              v-if="zhiMaInfo.firstMsg"
+              class="flex-1 justify-between credit_report_action"
+            >
               <select-report-example>
                 <span class="credit_report_example">
                   报告样例 <i class="texticon" />
@@ -93,11 +118,28 @@
               </select-report-example>
             </div>
           </div>
-          <!-- <div class="credit_report_content">
+          <div class="credit_report_content">
             <span
               >信用报告通过信用背书、风险预警、政策适配,三大核心作用,成为投标企业参与市场竞争的关键工具‌。</span
             >
-          </div> -->
+          </div>
+          <div
+            v-if="zhiMaInfo.pack_type > 0"
+            class="flex items-center justify-between m-t-8px"
+          >
+            <div class="balance-container">
+              <span class="balance-value"
+                >本月剩余额度:<strong>{{ zhiMaInfo.balance }}</strong></span
+              >
+              <span class="balance-label">份/{{ zhiMaInfo.total }}份</span>
+            </div>
+            <span
+              class="credit_report_example"
+              @click="goDetail('芝麻共建分析报告')"
+            >
+              查明细 <i class="texticon" />
+            </span>
+          </div>
         </div>
       </div>
       <!-- S 投标企业信用报告入口 S -->
@@ -220,7 +262,8 @@ export default {
         emailSendDialog: false,
         fileUrl: '',
         id: ''
-      }
+      },
+      zhiMaInfo: {}
     }
   },
   computed: {
@@ -243,12 +286,35 @@ export default {
       } else if (val === '4' || val === '6') {
         return 'blue2'
       }
+    },
+    packageTypeText(val) {
+      if (val === 1) {
+        return '月卡'
+      } else if (val === 2) {
+        return '季卡'
+      } else if (val === 3) {
+        return '年卡'
+      } else {
+        return ''
+      }
+    },
+    packageTypeClass(val) {
+      if (val === 1) {
+        return 'month'
+      } else if (val === 2) {
+        return 'season'
+      } else if (val === 3) {
+        return 'year'
+      } else {
+        return ''
+      }
     }
   },
   created() {
     this.getcount()
   },
   methods: {
+    dateFormatter,
     viewReportExample() {
       this.$router.push({
         path: '/common/pdfview'
@@ -271,6 +337,7 @@ export default {
         this.market = data.market
         this.buyer = data.buyer
         this.winner = data.winner
+        this.zhiMaInfo = data.zhima
       }
     },
     onLoad() {
@@ -709,6 +776,7 @@ export default {
       font-size: 12px;
       line-height: 18px;
       color: #2abed1;
+      white-space: nowrap;
     }
     .credit_report_btn {
       padding: 2px 17px;
@@ -738,6 +806,68 @@ export default {
         width: 235px;
         height: 24px;
       }
+      .report-title {
+        font-size: 16px;
+        line-height: 24px;
+        color: #171826;
+        flex-shrink: 0;
+      }
+      .report-first {
+        color: $color_main;
+        font-size: 12px;
+        line-height: 18px;
+      }
+      .end-time {
+        margin-left: 8px;
+        font-size: 11px;
+        line-height: 16px;
+        color: #9b9ca3;
+        flex-shrink: 0;
+      }
+      .member-container {
+        padding: 4px 8px;
+        border-radius: 8px 2px 8px 2px;
+        font-weight: 600;
+        .member-type {
+          margin-right: 1px;
+          font-size: 13px;
+        }
+        .member-vip {
+          font-size: 12px;
+          font-style: italic;
+        }
+        &.month {
+          background: $color_main;
+          color: #fff;
+        }
+        &.season {
+          background: #f1d090;
+          color: #33323a;
+          .member-vip {
+            color: #1b1a2a;
+          }
+        }
+        &.year {
+          background: #1b1a2a;
+          color: #f1d090;
+          .member-vip {
+            color: #fae7ca;
+          }
+        }
+      }
+      .balance-container {
+        .balance-value {
+          margin-right: 4px;
+          font-size: 14px;
+          line-height: 20px;
+          color: #171826;
+        }
+        .balance-label {
+          font-size: 12px;
+          line-height: 18px;
+          color: #9b9ca3;
+        }
+      }
     }
   }
 

+ 13 - 3
apps/mobile/src/views/reportAnalysis/reportdownloadDetails.vue

@@ -12,7 +12,12 @@
         <div class="item" v-for="(item, index) in list.value" :key="index">
           <div class="toptitle">
             <div class="time">{{ item.createTime | timeFilter }}</div>
-            <!-- <div class="balance">余额:<span>9份</span></div> -->
+            <div
+              class="balance"
+              v-if="getproductCode === 5 && item.deductionNumb"
+            >
+              余额:<span>{{ item.deductionNumb }}份</span>
+            </div>
           </div>
           <div class="content">
             <!-- 0使用5作废7回收 6分配 1购买 -->
@@ -36,7 +41,10 @@
               <div class="title">
                 {{ nameF(item) }}
               </div>
-              <div class="desc" v-if="item.userType === 1">
+              <div
+                class="desc"
+                v-if="item.userType === 1 && JSON.parse(item.remarks).endTime"
+              >
                 有效期至<span>{{ JSON.parse(item.remarks).endTime }}</span>
               </div>
             </div>
@@ -101,8 +109,10 @@ export default {
         return 1
       } else if (this.type === '业主采购分析报告') {
         return 2
-      } else {
+      } else if (this.type === '市场分析定制报告') {
         return 3
+      } else if (this.type === '芝麻共建分析报告') {
+        return 5
       }
     }
   },