|
@@ -1,11 +1,7 @@
|
|
|
-import BaseModel from '../../../core/base'
|
|
|
import { dateFormatter, formatMoney, getQueryParam } from '@jy/util'
|
|
|
+import BaseModel from '../../../core/base'
|
|
|
|
|
|
class CommonContentModel extends BaseModel {
|
|
|
- constructor(config) {
|
|
|
- super(config)
|
|
|
- }
|
|
|
-
|
|
|
createModel() {
|
|
|
const contentModel = {
|
|
|
id: '',
|
|
@@ -45,7 +41,7 @@ class CommonContentModel extends BaseModel {
|
|
|
return contentModel
|
|
|
}
|
|
|
|
|
|
- formatModel(data, isInit = false) {
|
|
|
+ formatModel(data) {
|
|
|
const result = this.createModel()
|
|
|
const { baseInfo, detailInfo } = data
|
|
|
result.id = baseInfo.id ? decodeURIComponent(baseInfo.id) : ''
|
|
@@ -86,6 +82,7 @@ class CommonContentModel extends BaseModel {
|
|
|
isNiJianCheck(type) {
|
|
|
return type === '拟建'
|
|
|
}
|
|
|
+
|
|
|
isCaigouyixiangCheck(type) {
|
|
|
return type === '采购意向'
|
|
|
}
|
|
@@ -95,7 +92,7 @@ class CommonContentModel extends BaseModel {
|
|
|
const defaultURL = 'javascript:void(0);'
|
|
|
|
|
|
const area = [baseInfo?.area, baseInfo?.city, baseInfo?.district]
|
|
|
- .filter((v) => v)
|
|
|
+ .filter(v => v)
|
|
|
.join('-')
|
|
|
|
|
|
const typeItem = {
|
|
@@ -108,7 +105,7 @@ class CommonContentModel extends BaseModel {
|
|
|
}
|
|
|
|
|
|
const amountItem = {
|
|
|
- label: formatMoney(baseInfo?.bidAmount ?? baseInfo?.budget ?? ''),
|
|
|
+ label: formatMoney(baseInfo?.bidAmount || baseInfo?.budget || ''),
|
|
|
link: defaultURL
|
|
|
}
|
|
|
|
|
@@ -127,7 +124,7 @@ class CommonContentModel extends BaseModel {
|
|
|
},
|
|
|
// amount
|
|
|
amountItem
|
|
|
- ].filter((v) => v.label)
|
|
|
+ ].filter(v => v.label)
|
|
|
|
|
|
return tags.map((t) => {
|
|
|
return {
|
|
@@ -146,18 +143,21 @@ class CommonContentModel extends BaseModel {
|
|
|
let keysList = []
|
|
|
|
|
|
// 移动端订阅预览等跳转过来传的词
|
|
|
- if (/^(subkey_)/.test(s_words)) {
|
|
|
- keysList = s_words.replace(/^(subkey_)/, '').split('_')
|
|
|
+ const subKeyReg = /^subkey_/
|
|
|
+ if (subKeyReg.test(s_words)) {
|
|
|
+ keysList = s_words.replace(subKeyReg, '').split('_')
|
|
|
let keyListArr = []
|
|
|
keysList.forEach((v) => {
|
|
|
const vArr = v.split('+')
|
|
|
keyListArr = keyListArr.concat(vArr)
|
|
|
})
|
|
|
- } else {
|
|
|
- const reg = /[_\+\s+]/ // 匹配 _+空格
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ const reg = /[_+\s]/ // 匹配 _+空格
|
|
|
if (reg.test(s_words)) {
|
|
|
keysList = s_words.split(reg).filter(w => !!w)
|
|
|
- } else {
|
|
|
+ }
|
|
|
+ else {
|
|
|
keysList.push(s_words)
|
|
|
}
|
|
|
}
|