Browse Source

feat: 完善购买样式及业务逻辑文案

zhangyuhan 1 week ago
parent
commit
54db7c0833

+ 8 - 0
apps/bigmember_pc/src/api/modules/pay.js

@@ -193,3 +193,11 @@ export function ajaxGetReportExample() {
     method: 'post'
     method: 'post'
   })
   })
 }
 }
+
+// 获取芝麻报告相关余额信息
+export function ajaxGetReportAccountInfo() {
+  return request({
+    url: '/jypay/pdfExportPack/account',
+    method: 'post'
+  })
+}

+ 1 - 114
apps/bigmember_pc/src/store/order.js

@@ -420,124 +420,11 @@ export default {
         product: true
         product: true
       })
       })
 
 
-      const ttt = {
-        "error_code": 0,
-        "error_msg": "",
-        "data": [
-          {
-            "title": "芝麻信用共建分析报告",
-            "desc": "芝麻信用共建分析报告",
-            "extend": {
-              "151": {
-                "1511": {
-                  "pack_type": 0,
-                  "specsUnit": "份",
-                  "validityYear": 3
-                },
-                "1512": {
-                  "day": 30,
-                  "first": 299,
-                  "id": 1512,
-                  "number": 20,
-                  "pack_type": 1,
-                  "price": 999,
-                  "specsUnit": "份"
-                },
-                "1513": {
-                  "day": 90,
-                  "first": 299,
-                  "id": 1513,
-                  "number": 30,
-                  "pack_type": 2,
-                  "price": 1666,
-                  "specsUnit": "份"
-                },
-                "1514": {
-                  "day": 365,
-                  "first": 299,
-                  "id": 1514,
-                  "number": 40,
-                  "pack_type": 3,
-                  "price": 3888,
-                  "specsUnit": "份"
-                }
-              }
-            },
-            "productId": 151,
-            "sku": [
-              {
-                "productId": 1511,
-                "name": "芝麻信用共建分析报告下载包",
-                "info": "单份",
-                "choosed": false,
-                "lotteryId": 0,
-                "activityId": 0,
-                "originalPrice": 99900,
-                "discountPrice": 29900,
-                "discountAmount": 70000,
-                "activity": null
-              },
-              {
-                "productId": 1512,
-                "name": "芝麻信用共建分析报告下载包",
-                "info": "月卡",
-                "choosed": false,
-                "lotteryId": 0,
-                "activityId": 0,
-                "originalPrice": 199900,
-                "discountPrice": 99900,
-                "discountAmount": 100000,
-                "activity": null
-              },
-              {
-                "productId": 1513,
-                "name": "芝麻信用共建分析报告下载包",
-                "info": "季卡",
-                "choosed": false,
-                "lotteryId": 0,
-                "activityId": 0,
-                "originalPrice": 339900,
-                "discountPrice": 166600,
-                "discountAmount": 173300,
-                "activity": null
-              },
-              {
-                "productId": 1514,
-                "name": "芝麻信用共建分析报告下载包",
-                "info": "年卡",
-                "choosed": false,
-                "lotteryId": 0,
-                "activityId": 0,
-                "originalPrice": 788800,
-                "discountPrice": 388800,
-                "discountAmount": 400000,
-                "activity": null
-              }
-            ],
-            "extend1": {
-              "1511": {
-                "is_first": true
-              },
-              "1512": {
-                "is_first": true
-              },
-              "1513": {
-                "is_first": true
-              },
-              "1514": {
-                "is_first": true
-              }
-            }
-          }
-        ]
-      }
-
       const {
       const {
         data = [],
         data = [],
         error_msg: msg,
         error_msg: msg,
         error_code: code
         error_code: code
-      } = ttt
-      // await ajaxGetProductInfo(params)
+      } = await ajaxGetProductInfo(params)
       if (code === 0 && data) {
       if (code === 0 && data) {
         // 更新产品类型、规格信息
         // 更新产品类型、规格信息
         commit('setProductInfoList', formatProductInfo(data))
         commit('setProductInfoList', formatProductInfo(data))

+ 32 - 27
apps/bigmember_pc/src/views/order/components/analysis-report/info.vue

@@ -2,7 +2,7 @@
   <div class="analysis-report-order-info">
   <div class="analysis-report-order-info">
     <SelectorCard class="analysis-report-list-item" cardType="line">
     <SelectorCard class="analysis-report-list-item" cardType="line">
       <div slot="header" class="vip-sub-item-title">
       <div slot="header" class="vip-sub-item-title">
-        单份购买
+        {{ specList.length > 1 ? '选择规格' : '单份购买' }}
       </div>
       </div>
       <div class="analysis-report-item-content" v-if="specActiveId">
       <div class="analysis-report-item-content" v-if="specActiveId">
         <div class="item-con">
         <div class="item-con">
@@ -58,6 +58,7 @@ import {
   formatZhimaInfo,
   formatZhimaInfo,
   formatZhimaInfoSubmitParamsOfType
   formatZhimaInfoSubmitParamsOfType
 } from '@/views/order/components/analysis-report/model/fomat'
 } from '@/views/order/components/analysis-report/model/fomat'
+import useAccountInfoModel from './model/account'
 
 
 export default {
 export default {
   name: 'analysis-report-order-info',
   name: 'analysis-report-order-info',
@@ -65,6 +66,12 @@ export default {
     OrderSpecList,
     OrderSpecList,
     SelectorCard,
     SelectorCard,
   },
   },
+  setup () {
+    const { zhimaReportAccountInfo } = useAccountInfoModel()
+    return {
+      zhimaReportAccountInfo
+    }
+  },
   data() {
   data() {
     return {
     return {
       // 当前选中的规格ID
       // 当前选中的规格ID
@@ -84,31 +91,19 @@ export default {
     ]),
     ]),
     // 返回当前权益状态
     // 返回当前权益状态
     useNowState () {
     useNowState () {
-      return {
-        // 购买权益包生效中
-        inPack: false,
-        // 权益包余额
-        packCount: -1,
-        packTime: '',
-        // 之前买过权益包并过期
-        isBuyPackExpire: false,
-        buyPackExpireDay: 88,
-        // 是否首次购买优惠
-        isFirstBuy: false
-      }
+      return this.zhimaReportAccountInfo
     },
     },
     isFirstBuy () {
     isFirstBuy () {
-      return this.productInfo?.extend1?.[this.specActiveInfo.id]?.is_first
+      return this.useNowState?.isFirstBuy || false
     },
     },
     // 格式化商品规格
     // 格式化商品规格
     specList() {
     specList() {
-      const idMap = {
+      const themeMap = {
         1512: 'monthly-theme',
         1512: 'monthly-theme',
         1513: 'seasonal-theme',
         1513: 'seasonal-theme',
         1514: 'year-theme',
         1514: 'year-theme',
       }
       }
       return this.productSpecInfoList.map((spec) => {
       return this.productSpecInfoList.map((spec) => {
-        const isFirstBuy = this.productInfo?.extend1?.[spec.productId]?.is_first
         const result = {
         const result = {
           label: spec._format.title,
           label: spec._format.title,
           price: spec.discountPrice,
           price: spec.discountPrice,
@@ -116,17 +111,22 @@ export default {
           tipText: spec._format.tag,
           tipText: spec._format.tag,
           id: spec.productId,
           id: spec.productId,
           pack: spec.productId !== 1511,
           pack: spec.productId !== 1511,
-          packLevel: idMap[spec.productId] || '',
+          packLevel: themeMap[spec.productId] || '',
           _data: spec,
           _data: spec,
           _extend: this.productInfo?.extend[151]?.[spec.productId] || {},
           _extend: this.productInfo?.extend[151]?.[spec.productId] || {},
         }
         }
-        if (isFirstBuy && !result.pack) {
-          result.tipText = '首购推荐'
-          result.tipText = '权益特价'
-          result.activeClass = 'orange-theme'
-        }
-        if (!isFirstBuy && result.packLevel === 'year-theme') {
-          result.tipText = '推荐'
+        if (!result.pack) {
+          if (this.isFirstBuy) {
+            result.tipText = '首购推荐'
+            result.activeClass = 'orange-theme'
+          } else if (this.useNowState.inPack) {
+            result.tipText = '权益特价'
+            result.activeClass = 'orange-theme'
+          }
+        } else {
+          if (!this.isFirstBuy && result.packLevel === 'year-theme') {
+            result.tipText = '推荐'
+          }
         }
         }
         return result
         return result
       })
       })
@@ -165,8 +165,13 @@ export default {
       submitText: '立即购买'
       submitText: '立即购买'
     })
     })
     // 设置默认规格的扩展信息
     // 设置默认规格的扩展信息
-    // 首购优惠时默认选中单份,没有时默认选中年卡
-    this.doSetSpec(1514 || this.productSpecInfo.productId)
+
+    // 非首购、非会员时选中年卡
+    if (!this.isFirstBuy && !this.useNowState.inPack) {
+      this.doSetSpec(1514)
+    } else {
+      this.doSetSpec(this.productSpecInfo.productId)
+    }
   },
   },
   methods: {
   methods: {
     ...mapMutations('order', ['updateUI']),
     ...mapMutations('order', ['updateUI']),
@@ -216,7 +221,7 @@ export default {
       result.email = this.productFormInfo?.email
       result.email = this.productFormInfo?.email
       result.is_first = this.isFirstBuy
       result.is_first = this.isFirstBuy
       result.order_phone = this.productFormInfo?.phone
       result.order_phone = this.productFormInfo?.phone
-
+      result.pack_type = this.specActiveInfo?._extend?.pack_type
       return result
       return result
     },
     },
     saveEchoInfo (orderCode, data) {
     saveEchoInfo (orderCode, data) {

+ 48 - 0
apps/bigmember_pc/src/views/order/components/analysis-report/model/account.js

@@ -0,0 +1,48 @@
+import { ajaxGetReportAccountInfo } from '@/api/modules'
+import { computed, ref } from 'vue'
+
+const TEMP_KEY = '__temp_get_report_account_info__'
+const accountInfoModel = ref({})
+const zhimaReportAccountInfo = computed(() => {
+  const themeMap = {
+    1: 'monthly-theme',
+    2: 'seasonal-theme',
+    3: 'year-theme',
+  }
+  const levelMap = {
+    1: '月卡',
+    2: '季卡',
+    3: '年卡',
+  }
+  return {
+    // 购买权益包生效中
+    inPack: accountInfoModel.value?.total > 0,
+    packLevel: levelMap[accountInfoModel.value?.pack_type] || '',
+    packLevelTheme: themeMap[accountInfoModel.value?.pack_type] || '',
+    // 权益包余额
+    packCount: accountInfoModel.value?.balance,
+    packTime: accountInfoModel.value?.minEndTime?.split(' ')[0],
+    // 之前买过权益包并过期
+    isBuyPackExpire: false,
+    buyPackExpireDay: 88,
+    // 是否首次购买优惠
+    isFirstBuy: accountInfoModel.value?.firstMsg?.length > 0
+  }
+})
+
+function getAccountInfoModel () {
+  ajaxGetReportAccountInfo().then(res => {
+    accountInfoModel.value = res.data.zhima || {}
+  })
+}
+
+export default function useAccountInfoModel () {
+  if (!window[TEMP_KEY]) {
+    window[TEMP_KEY] = Date.now()
+    getAccountInfoModel()
+  }
+  return {
+    zhimaReportAccountInfo,
+    getAccountInfoModel
+  }
+}

+ 140 - 62
apps/bigmember_pc/src/views/order/components/analysis-report/title.vue

@@ -1,35 +1,47 @@
 <template>
 <template>
-  <div class="analysis-report-page-title flex flex-(row justify-between)">
-    <div class="">
-      <div class="flex flex-(row items-center) header-title-container">
-        <h1>{{ pageInfo.title }}</h1>
-        <div class="flex flex-(row items-center) header-logo-container">
-          <img class="jy-logo" src="@/assets/images/logo/jy-logo.png" />
-          <img
-            class="multiply-icon"
-            src="@/assets/images/icon/icon-multiply.png"
-          />
-          <img class="zhima-logo" src="@/assets/images/logo/zhima-logo.png" />
+  <div class='analysis-report-page-title-container'>
+    <div class='analysis-report-page-tip flex flex-(row items-center)' v-if='zhimaReportAccountInfo.inPack'>
+      <span class='vip-label' :class='{ [zhimaReportAccountInfo.packLevelTheme]: true }'>
+        <span>{{zhimaReportAccountInfo.packLevel}}</span>
+        <i class='iconfont icon-vip'></i>
+      </span>
+      <span class='label-number'>剩余份额:{{ zhimaReportAccountInfo.packCount }}</span>
+      <span class='split-line'></span>
+      <span class='label-desc'>当前权益有效期至{{ zhimaReportAccountInfo.packTime }}</span>
+    </div>
+    <div class='analysis-report-page-title flex flex-(row justify-between)'>
+      <div class="">
+        <div class="flex flex-(row items-center) header-title-container">
+          <h1>{{ pageInfo.title }}</h1>
+          <div class="flex flex-(row items-center) header-logo-container">
+            <img class="jy-logo" src="@/assets/images/logo/jy-logo.png" />
+            <img
+              class="multiply-icon"
+              src="@/assets/images/icon/icon-multiply.png"
+            />
+            <img class="zhima-logo" src="@/assets/images/logo/zhima-logo.png" />
+          </div>
         </div>
         </div>
-      </div>
-      <div class="header-desc-container">
+        <div class="header-desc-container">
         <span>{{ pageInfo.desc }}</span
         <span>{{ pageInfo.desc }}</span
         >:
         >:
-        <span>{{ $route.query.name }}</span>
+          <span>{{ $route.query.name }}</span>
+        </div>
       </div>
       </div>
-    </div>
-    <div>
-      <ReportExample placement="bottom-end">
-        <el-button slot="reference" class="header-guide-button" size="small"
+      <div>
+        <ReportExample placement="bottom-end">
+          <el-button slot="reference" class="header-guide-button" size="small"
           >报告样例</el-button
           >报告样例</el-button
-        >
-      </ReportExample>
+          >
+        </ReportExample>
+      </div>
     </div>
     </div>
   </div>
   </div>
 </template>
 </template>
 
 
 <script>
 <script>
 import ReportExample from '@/components/zhima/select-example.vue'
 import ReportExample from '@/components/zhima/select-example.vue'
+import useAccountInfoModel from './model/account'
 
 
 const titleMaps = {
 const titleMaps = {
   project: '项目分析报告',
   project: '项目分析报告',
@@ -52,59 +64,125 @@ export default {
       }
       }
     }
     }
   },
   },
-  methods: {
-    doOpenEx() {}
+  setup () {
+    const { zhimaReportAccountInfo } = useAccountInfoModel()
+    return {
+      zhimaReportAccountInfo
+    }
   }
   }
 }
 }
 </script>
 </script>
 
 
 <style lang="scss" scoped>
 <style lang="scss" scoped>
-.analysis-report-page-title {
-  box-shadow: 0px 4px 8px 0px #00000014;
-  border: 1px solid #87dfea;
-  background: linear-gradient(269.56deg, #f2fffe 0.07%, #fbffff 100%);
-  border-radius: 8px;
-  padding: 20px;
-
-  .header-title-container {
-    font-size: 24px;
-    line-height: 36px;
-    color: #1d1d1d;
-    h1 {
-      margin-right: 20px;
-    }
-  }
-  .header-desc-container {
-    margin-top: 10px;
+.analysis-report-page-title-container {
+  .analysis-report-page-tip {
+    margin: 20px 20px 18px 20px;
     font-size: 16px;
     font-size: 16px;
     line-height: 24px;
     line-height: 24px;
-    color: #686868;
-  }
-  .header-logo-container {
-    .jy-logo {
-      width: 110px;
-      height: 26px;
+    .label-number {
+      color: rgba(255, 58, 32, 1);
     }
     }
-    .multiply-icon {
-      width: 13px;
-      height: 14px;
-      margin: 0 4px;
+    .split-line {
+      display: inline-block;
+      width: 1px;
+      height: 12px;
+      margin: 0 12px;
+      background: #999999;
     }
     }
-    .zhima-logo {
-      width: 112px;
-      height: 24px;
+    .label-desc {
+      color: #aaaaaa;
     }
     }
+
+    .vip-label {
+      display: inline-flex;
+      align-items: center;
+      justify-content: center;
+      margin-right: 12px;
+      background: #2abed1;
+      border-radius: 8px 2px 8px 2px;
+      padding: 1px 8px;
+      padding-right: 0;
+      color: #fff;
+
+      span {
+        font-size: 13px;
+        line-height: 18px;
+        font-weight: 700;
+      }
+
+      &.monthly-theme {}
+      &.seasonal-theme {
+        background: #F1D090;
+        color: #1D1D1D;
+      }
+      &.year-theme {
+        background: #171826;
+        color: #FAE7CA;
+      }
+
+      .icon-vip {
+        margin-left: -6px;
+        display: inline-block;
+        color: inherit;
+        font-size: 18px;
+        transform: scale(0.5);
+      }
+    }
+
   }
   }
-  .header-guide-button {
-    width: 100px;
-    height: 30px;
-    border: 1px solid #2abed1;
-    border-radius: 4px;
-    font-size: 14px;
-    line-height: 30px;
-    color: #2abed1;
-    background-color: transparent;
-    padding: 0;
+  .analysis-report-page-title {
+    box-shadow: 0px 4px 8px 0px #00000014;
+    border: 1px solid #87dfea;
+    background: linear-gradient(269.56deg, #f2fffe 0.07%, #fbffff 100%);
+    border-radius: 8px;
+    padding: 20px;
+
+    .header-title-container {
+      font-size: 24px;
+      line-height: 36px;
+      color: #1d1d1d;
+
+      h1 {
+        margin-right: 20px;
+      }
+    }
+
+    .header-desc-container {
+      margin-top: 10px;
+      font-size: 16px;
+      line-height: 24px;
+      color: #686868;
+    }
+
+    .header-logo-container {
+      .jy-logo {
+        width: 110px;
+        height: 26px;
+      }
+
+      .multiply-icon {
+        width: 13px;
+        height: 14px;
+        margin: 0 4px;
+      }
+
+      .zhima-logo {
+        width: 112px;
+        height: 24px;
+      }
+    }
+
+    .header-guide-button {
+      width: 100px;
+      height: 30px;
+      border: 1px solid #2abed1;
+      border-radius: 4px;
+      font-size: 14px;
+      line-height: 30px;
+      color: #2abed1;
+      background-color: transparent;
+      padding: 0;
+    }
   }
   }
 }
 }
 </style>
 </style>

+ 1 - 113
apps/mobile/src/store/modules/createOrder.js

@@ -441,123 +441,11 @@ export default {
       commit('updateLoadingStatus', {
       commit('updateLoadingStatus', {
         product: true
         product: true
       })
       })
-      const ttt = {
-        "error_code": 0,
-        "error_msg": "",
-        "data": [
-          {
-            "title": "芝麻信用共建分析报告",
-            "desc": "芝麻信用共建分析报告",
-            "extend": {
-              "151": {
-                "1511": {
-                  "pack_type": 0,
-                  "specsUnit": "份",
-                  "validityYear": 3
-                },
-                "1512": {
-                  "day": 30,
-                  "first": 299,
-                  "id": 1512,
-                  "number": 20,
-                  "pack_type": 1,
-                  "price": 999,
-                  "specsUnit": "份"
-                },
-                "1513": {
-                  "day": 90,
-                  "first": 299,
-                  "id": 1513,
-                  "number": 30,
-                  "pack_type": 2,
-                  "price": 1666,
-                  "specsUnit": "份"
-                },
-                "1514": {
-                  "day": 365,
-                  "first": 299,
-                  "id": 1514,
-                  "number": 40,
-                  "pack_type": 3,
-                  "price": 3888,
-                  "specsUnit": "份"
-                }
-              }
-            },
-            "productId": 151,
-            "sku": [
-              {
-                "productId": 1511,
-                "name": "芝麻信用共建分析报告下载包",
-                "info": "单份",
-                "choosed": false,
-                "lotteryId": 0,
-                "activityId": 0,
-                "originalPrice": 99900,
-                "discountPrice": 29900,
-                "discountAmount": 70000,
-                "activity": null
-              },
-              {
-                "productId": 1512,
-                "name": "芝麻信用共建分析报告下载包",
-                "info": "月卡",
-                "choosed": false,
-                "lotteryId": 0,
-                "activityId": 0,
-                "originalPrice": 199900,
-                "discountPrice": 99900,
-                "discountAmount": 100000,
-                "activity": null
-              },
-              {
-                "productId": 1513,
-                "name": "芝麻信用共建分析报告下载包",
-                "info": "季卡",
-                "choosed": false,
-                "lotteryId": 0,
-                "activityId": 0,
-                "originalPrice": 339900,
-                "discountPrice": 166600,
-                "discountAmount": 173300,
-                "activity": null
-              },
-              {
-                "productId": 1514,
-                "name": "芝麻信用共建分析报告下载包",
-                "info": "年卡",
-                "choosed": false,
-                "lotteryId": 0,
-                "activityId": 0,
-                "originalPrice": 788800,
-                "discountPrice": 388800,
-                "discountAmount": 400000,
-                "activity": null
-              }
-            ],
-            "extend1": {
-              "1511": {
-                "is_first": true
-              },
-              "1512": {
-                "is_first": true
-              },
-              "1513": {
-                "is_first": true
-              },
-              "1514": {
-                "is_first": true
-              }
-            }
-          }
-        ]
-      }
       const {
       const {
         data = [],
         data = [],
         error_msg: msg,
         error_msg: msg,
         error_code: code
         error_code: code
-      } = ttt
-//        await ajaxGetProductInfo(params)
+      } = await ajaxGetProductInfo(params)
       if (code === 0 && data) {
       if (code === 0 && data) {
         // 更新产品类型、规格信息
         // 更新产品类型、规格信息
         commit('setProductInfoList', formatProductInfo(data))
         commit('setProductInfoList', formatProductInfo(data))

+ 80 - 0
apps/mobile/src/views/create-order/components/analysis-report/HeaderAdsense.vue

@@ -5,6 +5,17 @@
       src="@/assets/image/reportanalysis/jy-zhima-logo.png"
       src="@/assets/image/reportanalysis/jy-zhima-logo.png"
     />
     />
     <div class="ex-name">{{ name }}</div>
     <div class="ex-name">{{ name }}</div>
+    <div class='analysis-report-page-tip flex flex-(row items-center)' v-if='zhimaReportAccountInfo.inPack'>
+      <span class='vip-label' :class='{ [zhimaReportAccountInfo.packLevelTheme]: true }'>
+        <span>{{zhimaReportAccountInfo.packLevel}}</span>
+        <i class='iconfont icon-vip'></i>
+      </span>
+      <span>
+        {{ zhimaReportAccountInfo.packCount > 0 ? '本月余额' : '您本月的报告下载额度不足'}}
+      </span>:
+      <span class='label-number'>{{ zhimaReportAccountInfo.packCount }}</span>/{{ zhimaReportAccountInfo.packAllCount }}
+    </div>
+    <span class='label-desc' v-if='zhimaReportAccountInfo.inPack'>当前权益有效期至{{ zhimaReportAccountInfo.packTime }}</span>
     <select-report-example :name="reportType">
     <select-report-example :name="reportType">
       <van-button class="ex-button">报告样例</van-button>
       <van-button class="ex-button">报告样例</van-button>
     </select-report-example>
     </select-report-example>
@@ -14,6 +25,7 @@
 import { Button } from 'vant'
 import { Button } from 'vant'
 import { mixinHeader } from '@/utils/mixins/header'
 import { mixinHeader } from '@/utils/mixins/header'
 import SelectReportExample from '@/components/select-report-example/index.vue'
 import SelectReportExample from '@/components/select-report-example/index.vue'
+import useAccountInfoModel from './model/account'
 
 
 const titleMaps = {
 const titleMaps = {
   project: '项目分析报告',
   project: '项目分析报告',
@@ -36,6 +48,12 @@ export default {
       return titleMaps[this.$route.params.type]
       return titleMaps[this.$route.params.type]
     }
     }
   },
   },
+  setup () {
+    const { zhimaReportAccountInfo } = useAccountInfoModel()
+    return {
+      zhimaReportAccountInfo
+    }
+  },
   data() {
   data() {
     return {
     return {
       pageLayoutConf: {
       pageLayoutConf: {
@@ -53,6 +71,68 @@ export default {
   background: linear-gradient(180deg, #FBFFFF 0%, #DAFFFF 100%);
   background: linear-gradient(180deg, #FBFFFF 0%, #DAFFFF 100%);
   padding: 12px 0 24px;
   padding: 12px 0 24px;
 
 
+  .label-desc {
+    display: inline-block;
+    margin-top: 4px;
+    margin-bottom: 8px;
+    color: #9B9CA3;
+    font-size: 11px;
+    line-height: 22px;
+  }
+
+  .analysis-report-page-tip {
+    font-size: 14px;
+    line-height: 20px;
+    .label-number {
+      color: rgba(255, 58, 32, 1);
+    }
+    .split-line {
+      display: inline-block;
+      width: 1px;
+      height: 12px;
+      margin: 0 12px;
+      background: #999999;
+    }
+
+
+    .vip-label {
+      display: inline-flex;
+      align-items: center;
+      justify-content: center;
+      margin-right: 12px;
+      background: #2abed1;
+      border-radius: 8px 2px 8px 2px;
+      padding: 1px 8px;
+      padding-right: 0;
+      color: #fff;
+
+      span {
+        font-size: 13px;
+        line-height: 18px;
+        font-weight: 700;
+      }
+
+      &.monthly-theme {}
+      &.seasonal-theme {
+        background: #F1D090;
+        color: #1D1D1D;
+      }
+      &.year-theme {
+        background: #171826;
+        color: #FAE7CA;
+      }
+
+      .icon-vip {
+        margin-left: -6px;
+        display: inline-block;
+        color: inherit;
+        font-size: 18px;
+        transform: scale(0.5);
+      }
+    }
+
+  }
+
   .jy-zhima-logo {
   .jy-zhima-logo {
     width: 235px;
     width: 235px;
     height: 24px;
     height: 24px;

+ 46 - 31
apps/mobile/src/views/create-order/components/analysis-report/ProductionCard.vue

@@ -51,6 +51,7 @@ import { creditReportEntSearch, creditReportTime } from '@/api/modules/'
 import orderActivityHelper from '@/utils/mixins/modules/order-activity-helper'
 import orderActivityHelper from '@/utils/mixins/modules/order-activity-helper'
 import { formatZhimaInfoSubmitParamsOfType, formatZhimaInfo } from '@/views/create-order/components/analysis-report/model/format'
 import { formatZhimaInfoSubmitParamsOfType, formatZhimaInfo } from '@/views/create-order/components/analysis-report/model/format'
 import AnalysisReportProductionSpecCard from '@/views/create-order/components/analysis-report/SpecCard.vue'
 import AnalysisReportProductionSpecCard from '@/views/create-order/components/analysis-report/SpecCard.vue'
+import useAccountInfoModel from './model/account'
 
 
 export default {
 export default {
   name: 'AnalysisReportProductionCard',
   name: 'AnalysisReportProductionCard',
@@ -60,6 +61,12 @@ export default {
     [Field.name]: Field
     [Field.name]: Field
   },
   },
   mixins: [orderActivityHelper],
   mixins: [orderActivityHelper],
+  setup () {
+    const { zhimaReportAccountInfo } = useAccountInfoModel()
+    return {
+      zhimaReportAccountInfo
+    }
+  },
   data() {
   data() {
     return {
     return {
       conf: {
       conf: {
@@ -72,8 +79,7 @@ export default {
         phone: ''
         phone: ''
       },
       },
       entList: [],
       entList: [],
-      companyList: [],
-      bidCreditReportTime: 0
+      companyList: []
     }
     }
   },
   },
   computed: {
   computed: {
@@ -92,14 +98,14 @@ export default {
       'productSpecInfo'
       'productSpecInfo'
     ]),
     ]),
     specList() {
     specList() {
-      const idMap = {
+      const themeMap = {
         1512: 'monthly-theme',
         1512: 'monthly-theme',
         1513: 'seasonal-theme',
         1513: 'seasonal-theme',
         1514: 'year-theme',
         1514: 'year-theme',
       }
       }
       // 计算卡片价格
       // 计算卡片价格
       return this.productSpecInfoList.map((spec, index) => {
       return this.productSpecInfoList.map((spec, index) => {
-        return {
+        const result = {
           id: spec.productId,
           id: spec.productId,
           productionId: spec.productId,
           productionId: spec.productId,
           label: spec.info,
           label: spec.info,
@@ -110,18 +116,39 @@ export default {
           now: fen2Yuan(spec.discountPrice),
           now: fen2Yuan(spec.discountPrice),
           tipText: spec._format.tag,
           tipText: spec._format.tag,
           tipType: 'gift', // gift/discount/'' 为空则显示默认的蓝色
           tipType: 'gift', // gift/discount/'' 为空则显示默认的蓝色
+          desc: '',
+          badge: '',
           _data: spec,
           _data: spec,
           pack: spec.productId !== 1511,
           pack: spec.productId !== 1511,
-          packLevel: idMap[spec.productId] || '',
+          packLevel: themeMap[spec.productId] || '',
           _extend: this.productInfo?.extend[151]?.[spec.productId] || {},
           _extend: this.productInfo?.extend[151]?.[spec.productId] || {},
         }
         }
+        if (!result.pack) {
+          if (this.isFirstBuy) {
+            result.badge = '首购推荐'
+            result.desc = '购买首份报告享特价 299 元'
+          } else if (this.useNowState.inPack) {
+            result.badge = '权益特价'
+            result.desc = '您正在享受报告权益特价优惠'
+          }
+        } else {
+          if (!this.isFirstBuy && result.packLevel === 'year-theme') {
+            result.badge = '推荐'
+          }
+        }
+        return result
       })
       })
     },
     },
-    oneSpec() {
-      return this.specList[0] || {}
+    // 返回当前权益状态
+    useNowState () {
+      return this.zhimaReportAccountInfo
     },
     },
-    isBuyFirst () {
-      return this.productInfo?.extend1?.[this.oneSpec.id]?.is_first
+    isFirstBuy () {
+      return this.useNowState?.isFirstBuy || false
+    },
+    // 获取当前选中的规格信息
+    specActiveInfo() {
+      return this.specList.find((spec) => spec.id === this.productSpecInfo.productId)
     },
     },
     getProjectParams () {
     getProjectParams () {
       let result = formatZhimaInfoSubmitParamsOfType({
       let result = formatZhimaInfoSubmitParamsOfType({
@@ -130,8 +157,10 @@ export default {
       })
       })
 
 
       result.email = this.info.email
       result.email = this.info.email
-      result.is_first = this.isBuyFirst
+      result.is_first = this.isFirstBuy
       result.order_phone = this.info.phone
       result.order_phone = this.info.phone
+      result.level = this.productSpecInfo.info
+      result.pack_type = this.specActiveInfo?._extend?.pack_type
       return result
       return result
     }
     }
   },
   },
@@ -143,10 +172,14 @@ export default {
   },
   },
   mounted() {
   mounted() {
     this.updatePayAmount()
     this.updatePayAmount()
-    this.getCreditReportTime()
     this.getUserInfoFun()
     this.getUserInfoFun()
+    // 非首购、非会员时选中年卡
+    if (!this.isFirstBuy && !this.useNowState.inPack) {
+      this.updateProductSpecId(1514)
+    }
   },
   },
   methods: {
   methods: {
+    ...mapMutations('createOrder', ['updateProductSpecId']),
     ...mapActions('createOrder', [
     ...mapActions('createOrder', [
       'setProductInfo',
       'setProductInfo',
       'changeProductChoiceSpec'
       'changeProductChoiceSpec'
@@ -157,12 +190,6 @@ export default {
       const extend = { spec: 1 }
       const extend = { spec: 1 }
       this.changeProductChoiceSpec({ id, extend })
       this.changeProductChoiceSpec({ id, extend })
     },
     },
-    async getCreditReportTime() {
-      const { error_code: code, data } = await creditReportTime()
-      if (code === 0) {
-        this.bidCreditReportTime = data.bidCreditReport_makeTime
-      }
-    },
     async getUserInfoFun() {
     async getUserInfoFun() {
       const res = await this.getUserInfo()
       const res = await this.getUserInfo()
       if (res?.reportMail) {
       if (res?.reportMail) {
@@ -189,7 +216,7 @@ export default {
         'target-before':  info.before,
         'target-before':  info.before,
         'target-name': info.name,
         'target-name': info.name,
         'target-email': email,
         'target-email': email,
-        'target-level': email,
+        'target-level': data.level,
         report_mold
         report_mold
       }))
       }))
     },
     },
@@ -234,6 +261,7 @@ export default {
         })
         })
         return res
         return res
       }
       }
+      return res
     },
     },
     clickAssociation(item, type) {
     clickAssociation(item, type) {
       if (type === 'ent') {
       if (type === 'ent') {
@@ -378,19 +406,6 @@ export default {
       margin-bottom: 4px;
       margin-bottom: 4px;
     }
     }
   }
   }
-  .activity-badge {
-    width: 70px;
-    display: flex;
-    align-items: center;
-    padding: 2px 5px;
-    background: linear-gradient(98deg, #ff7c32 0%, #f33838 100%);
-    border-radius: 9px 0px;
-    text-align: center;
-    color: #fff;
-    font-size: 11px;
-    line-height: 14px;
-  }
-
 
 
   .buy-item-list {
   .buy-item-list {
     padding: 12px 12px 0;
     padding: 12px 12px 0;

+ 18 - 6
apps/mobile/src/views/create-order/components/analysis-report/SpecCard.vue

@@ -9,8 +9,11 @@
         <div class='spec-c-label flex flex-(row items-center)'>
         <div class='spec-c-label flex flex-(row items-center)'>
           <span class='spec-name'>{{spec.label}}</span>
           <span class='spec-name'>{{spec.label}}</span>
           <span class='vip-label' :class='{ [spec.packLevel]: true }' v-if='spec.pack'>
           <span class='vip-label' :class='{ [spec.packLevel]: true }' v-if='spec.pack'>
-          <i class='iconfont icon-vip'></i>
-        </span>
+            <i class='iconfont icon-vip'></i>
+          </span>
+          <div class="activity-badge" v-if="spec.badge">
+            <span class="j-icon icon-crown" />&nbsp;{{spec.badge}}
+          </div>
         </div>
         </div>
 
 
         <div>
         <div>
@@ -20,7 +23,7 @@
             <div class='flex-shrink-0'>免费下载:<span>{{spec._extend.number}}{{spec._extend.specsUnit}}</span> /月</div>
             <div class='flex-shrink-0'>免费下载:<span>{{spec._extend.number}}{{spec._extend.specsUnit}}</span> /月</div>
           </div>
           </div>
           <div v-else>
           <div v-else>
-            <span class='spec-i-text'>购买首份报告享特价 299 元</span>
+            <span class='spec-i-text'>{{spec.desc}}</span>
           </div>
           </div>
         </div>
         </div>
 
 
@@ -50,9 +53,6 @@ export default {
       type: Number,
       type: Number,
       default: -1
       default: -1
     }
     }
-  },
-  data () {
-    return {}
   }
   }
 }
 }
 </script>
 </script>
@@ -96,6 +96,18 @@ export default {
       color: #FB483D;
       color: #FB483D;
     }
     }
   }
   }
+  .activity-badge {
+    display: flex;
+    align-items: center;
+    margin-left: 8px;
+    padding: 2px 5px;
+    background: linear-gradient(98deg, #ff7c32 0%, #f33838 100%);
+    border-radius: 9px 0px;
+    text-align: center;
+    color: #fff;
+    font-size: 11px;
+    line-height: 14px;
+  }
   .vip-label {
   .vip-label {
     display: inline-flex;
     display: inline-flex;
     align-items: center;
     align-items: center;

+ 49 - 0
apps/mobile/src/views/create-order/components/analysis-report/model/account.js

@@ -0,0 +1,49 @@
+import { pdfaccount } from '@/api/modules'
+import { computed, ref } from 'vue'
+
+const TEMP_KEY = '__temp_get_report_account_info__'
+const accountInfoModel = ref({})
+const zhimaReportAccountInfo = computed(() => {
+  const themeMap = {
+    1: 'monthly-theme',
+    2: 'seasonal-theme',
+    3: 'year-theme',
+  }
+  const levelMap = {
+    1: '月卡',
+    2: '季卡',
+    3: '年卡',
+  }
+  return {
+    // 购买权益包生效中
+    inPack: accountInfoModel.value?.total > 0,
+    packLevel: levelMap[accountInfoModel.value?.pack_type] || '',
+    packLevelTheme: themeMap[accountInfoModel.value?.pack_type] || '',
+    // 权益包余额
+    packCount: accountInfoModel.value?.balance,
+    packAllCount: accountInfoModel.value?.total,
+    packTime: accountInfoModel.value?.minEndTime?.split(' ')[0],
+    // 之前买过权益包并过期
+    isBuyPackExpire: false,
+    buyPackExpireDay: 88,
+    // 是否首次购买优惠
+    isFirstBuy: accountInfoModel.value?.firstMsg?.length > 0
+  }
+})
+
+function getAccountInfoModel () {
+  pdfaccount().then(res => {
+    accountInfoModel.value = res.data.zhima || {}
+  })
+}
+
+export default function useAccountInfoModel () {
+  if (!window[TEMP_KEY]) {
+    window[TEMP_KEY] = Date.now()
+    getAccountInfoModel()
+  }
+  return {
+    zhimaReportAccountInfo,
+    getAccountInfoModel
+  }
+}