|
@@ -51,6 +51,7 @@ import { creditReportEntSearch, creditReportTime } from '@/api/modules/'
|
|
|
import orderActivityHelper from '@/utils/mixins/modules/order-activity-helper'
|
|
|
import { formatZhimaInfoSubmitParamsOfType, formatZhimaInfo } from '@/views/create-order/components/analysis-report/model/format'
|
|
|
import AnalysisReportProductionSpecCard from '@/views/create-order/components/analysis-report/SpecCard.vue'
|
|
|
+import useAccountInfoModel from './model/account'
|
|
|
|
|
|
export default {
|
|
|
name: 'AnalysisReportProductionCard',
|
|
@@ -60,6 +61,12 @@ export default {
|
|
|
[Field.name]: Field
|
|
|
},
|
|
|
mixins: [orderActivityHelper],
|
|
|
+ setup () {
|
|
|
+ const { zhimaReportAccountInfo } = useAccountInfoModel()
|
|
|
+ return {
|
|
|
+ zhimaReportAccountInfo
|
|
|
+ }
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
conf: {
|
|
@@ -72,8 +79,7 @@ export default {
|
|
|
phone: ''
|
|
|
},
|
|
|
entList: [],
|
|
|
- companyList: [],
|
|
|
- bidCreditReportTime: 0
|
|
|
+ companyList: []
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -92,14 +98,14 @@ export default {
|
|
|
'productSpecInfo'
|
|
|
]),
|
|
|
specList() {
|
|
|
- const idMap = {
|
|
|
+ const themeMap = {
|
|
|
1512: 'monthly-theme',
|
|
|
1513: 'seasonal-theme',
|
|
|
1514: 'year-theme',
|
|
|
}
|
|
|
// 计算卡片价格
|
|
|
return this.productSpecInfoList.map((spec, index) => {
|
|
|
- return {
|
|
|
+ const result = {
|
|
|
id: spec.productId,
|
|
|
productionId: spec.productId,
|
|
|
label: spec.info,
|
|
@@ -110,18 +116,39 @@ export default {
|
|
|
now: fen2Yuan(spec.discountPrice),
|
|
|
tipText: spec._format.tag,
|
|
|
tipType: 'gift', // gift/discount/'' 为空则显示默认的蓝色
|
|
|
+ desc: '',
|
|
|
+ badge: '',
|
|
|
_data: spec,
|
|
|
pack: spec.productId !== 1511,
|
|
|
- packLevel: idMap[spec.productId] || '',
|
|
|
+ packLevel: themeMap[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 () {
|
|
|
let result = formatZhimaInfoSubmitParamsOfType({
|
|
@@ -130,8 +157,10 @@ export default {
|
|
|
})
|
|
|
|
|
|
result.email = this.info.email
|
|
|
- result.is_first = this.isBuyFirst
|
|
|
+ result.is_first = this.isFirstBuy
|
|
|
result.order_phone = this.info.phone
|
|
|
+ result.level = this.productSpecInfo.info
|
|
|
+ result.pack_type = this.specActiveInfo?._extend?.pack_type
|
|
|
return result
|
|
|
}
|
|
|
},
|
|
@@ -143,10 +172,14 @@ export default {
|
|
|
},
|
|
|
mounted() {
|
|
|
this.updatePayAmount()
|
|
|
- this.getCreditReportTime()
|
|
|
this.getUserInfoFun()
|
|
|
+ // 非首购、非会员时选中年卡
|
|
|
+ if (!this.isFirstBuy && !this.useNowState.inPack) {
|
|
|
+ this.updateProductSpecId(1514)
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
+ ...mapMutations('createOrder', ['updateProductSpecId']),
|
|
|
...mapActions('createOrder', [
|
|
|
'setProductInfo',
|
|
|
'changeProductChoiceSpec'
|
|
@@ -157,12 +190,6 @@ export default {
|
|
|
const extend = { spec: 1 }
|
|
|
this.changeProductChoiceSpec({ id, extend })
|
|
|
},
|
|
|
- async getCreditReportTime() {
|
|
|
- const { error_code: code, data } = await creditReportTime()
|
|
|
- if (code === 0) {
|
|
|
- this.bidCreditReportTime = data.bidCreditReport_makeTime
|
|
|
- }
|
|
|
- },
|
|
|
async getUserInfoFun() {
|
|
|
const res = await this.getUserInfo()
|
|
|
if (res?.reportMail) {
|
|
@@ -189,7 +216,7 @@ export default {
|
|
|
'target-before': info.before,
|
|
|
'target-name': info.name,
|
|
|
'target-email': email,
|
|
|
- 'target-level': email,
|
|
|
+ 'target-level': data.level,
|
|
|
report_mold
|
|
|
}))
|
|
|
},
|
|
@@ -234,6 +261,7 @@ export default {
|
|
|
})
|
|
|
return res
|
|
|
}
|
|
|
+ return res
|
|
|
},
|
|
|
clickAssociation(item, type) {
|
|
|
if (type === 'ent') {
|
|
@@ -378,19 +406,6 @@ export default {
|
|
|
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 {
|
|
|
padding: 12px 12px 0;
|