|
@@ -42,23 +42,13 @@ export function useEntModuleInfo(entId, params = {}) {
|
|
|
const { accountInfo, usageInfo, freeEntPort } = params
|
|
|
function fetchModuleInfo(code) {
|
|
|
loadingModule.value = true
|
|
|
- const maskMap = getMaskModuleMap(accountInfo, usageInfo, freeEntPort)
|
|
|
+ const maskModuleMap = getMaskModuleMap({ accountInfo, usageInfo, freeEntPort })
|
|
|
// code分类 base:基本信息;analysis: 中标分析; infomat:经营信息;risk:经营风险; report:年报信息
|
|
|
return getEntPortraitModuleInfo({entId, code}).then(res => {
|
|
|
if (res && res.data) {
|
|
|
if (res.data.list && res.data.list.length > 0) {
|
|
|
res.data.list = res.data.list.map(i => {
|
|
|
- i.tip = {
|
|
|
- name: i.name,
|
|
|
- title: maskModule[i.name]?.title,
|
|
|
- subtitle: maskModule[i.name]?.subtitle || '',
|
|
|
- bg: maskModule[i.name]?.bg || '',
|
|
|
- img: maskModule[i.name]?.img || '',
|
|
|
- button: maskModule[i.name]?.button || '',
|
|
|
- source: maskModule[i.name]?.source || '',
|
|
|
- bgSize: maskModule[i.name]?.bgSize || '',
|
|
|
- moduleName: maskModule[i.name]?.moduleName
|
|
|
- }
|
|
|
+ i.tip = maskModuleMap[i.name]
|
|
|
return i
|
|
|
})
|
|
|
|
|
@@ -121,6 +111,7 @@ const btnStatusText = {
|
|
|
"去开通": []
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
const maskModule = {
|
|
|
"工商变更": {
|
|
|
title: '开通大会员',
|
|
@@ -388,72 +379,76 @@ const maskModule = {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-const getMaskModuleMap = (info, usage, freeEntPort) => {
|
|
|
+/**
|
|
|
+ * 企业画像遮罩信息
|
|
|
+ * @params {*} accountInfo 账号信息(store/user里的info)
|
|
|
+ * @params {*} usageInfo 企业画像使用信息(/subVipPortrait/usage)
|
|
|
+ * @params {*} freeEntPort 免费用户是否有体验次数(isAdd接口)
|
|
|
+ * @returns { title, subtitle, button, source, img, bg, moduleName }
|
|
|
+ */
|
|
|
+const getMaskModuleMap = (params) => {
|
|
|
+ const { accountInfo: info, usageInfo, freeEntPort } = params
|
|
|
const tempMap = maskModule
|
|
|
- const tempPagePowerInfo = usage
|
|
|
const needMember = ['企业通讯录', '工商变更', '竞争图谱', '行政许可']
|
|
|
Object.keys(tempMap).forEach((v) => {
|
|
|
- const isMemberText = tempMap[v].title.indexOf('大会员') !== -1
|
|
|
- const tempTitle = isMemberText ? '开通大会员' : '超级订阅'
|
|
|
let tempButton = ''
|
|
|
if (info.memberStatus > 0) {
|
|
|
+ // 大会员用户
|
|
|
tempButton = info.memberStatus > 0 && info.power.indexOf(4) === -1
|
|
|
? '联系客服'
|
|
|
: '免费体验'
|
|
|
- } else if (info.vipStatus > 0) {
|
|
|
+ } else {
|
|
|
+ // ['企业通讯录', '工商变更', '竞争图谱', '行政许可']模块是大会员功能,非大会员用户都是免费体验
|
|
|
if (needMember.includes(v)) {
|
|
|
tempButton = '免费体验'
|
|
|
} else {
|
|
|
- if (info.viper) {
|
|
|
- // 新超级订阅
|
|
|
- if (tempPagePowerInfo.balance > 0) {
|
|
|
- // 没用完
|
|
|
- if (tempPagePowerInfo.provin === 0) {
|
|
|
- tempButton = '去开通'
|
|
|
- } else if (tempPagePowerInfo.provin === -1) {
|
|
|
- tempButton = '联系客服'
|
|
|
+ if (info.vipStatus > 0) {
|
|
|
+ if (info.viper) {
|
|
|
+ // 新超级订阅
|
|
|
+ if (usageInfo.balance > 0) {
|
|
|
+ // 没用完
|
|
|
+ if (usageInfo.provin === 0) {
|
|
|
+ tempButton = '去开通'
|
|
|
+ } else if (usageInfo.provin === -1) {
|
|
|
+ tempButton = '联系客服'
|
|
|
+ } else {
|
|
|
+ tempButton = '前往升级'
|
|
|
+ }
|
|
|
} else {
|
|
|
- tempButton = '前往升级'
|
|
|
+ if (usageInfo.provin === -1) {
|
|
|
+ tempButton = '联系客服'
|
|
|
+ } else {
|
|
|
+ tempButton = '前往升级'
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
- if (tempPagePowerInfo.provin === -1) {
|
|
|
- tempButton = '联系客服'
|
|
|
- } else {
|
|
|
- tempButton = '前往升级'
|
|
|
- }
|
|
|
+ // 老版超级订阅
|
|
|
+ tempButton = '前往升级'
|
|
|
}
|
|
|
} else {
|
|
|
- tempButton = '前往升级'
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- } else {
|
|
|
- if (needMember.includes(v)) {
|
|
|
- tempButton = '免费体验'
|
|
|
- } else {
|
|
|
- // 免费用户保留解锁体验功能
|
|
|
- if (info.isFree) {
|
|
|
- // 由于免费体验功能已经下掉。此处统一引导去开通超级订阅(采购单位画像同)
|
|
|
- // tempButton = '去开通'
|
|
|
- if (freeEntPort === 0) {
|
|
|
- tempButton = '立即解锁'
|
|
|
- } else if (freeEntPort === -1) {
|
|
|
- // 已体验过
|
|
|
+ // 非超级订阅用户(免费用户/商机管理)
|
|
|
+ // 免费用户保留解锁体验功能
|
|
|
+ if (info.isFree) {
|
|
|
+ if (freeEntPort === 0) {
|
|
|
+ // 未体验过
|
|
|
+ tempButton = '立即解锁'
|
|
|
+ } else if (freeEntPort === -1) {
|
|
|
+ // 已体验过
|
|
|
+ tempButton = '去开通'
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 商机管理用户
|
|
|
tempButton = '去开通'
|
|
|
}
|
|
|
- } else {
|
|
|
- // 商机管理用户
|
|
|
- tempButton = '去开通'
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- tempMap[v].title = tempTitle
|
|
|
tempMap[v].button = tempButton
|
|
|
})
|
|
|
return tempMap
|
|
|
}
|
|
|
|
|
|
-
|
|
|
export {
|
|
|
- getMaskCardImg
|
|
|
+ getMaskCardImg,
|
|
|
+ getMaskModuleMap
|
|
|
}
|