|
|
@@ -27,8 +27,6 @@ export default class DealSeoData {
|
|
|
keys = Object.keys(typeList)
|
|
|
break
|
|
|
case "JobListSeoDetail":
|
|
|
- let { workType, cityId, occupationId, directionId } = this.recruitData
|
|
|
- workType = Number(workType), cityId = Number(cityId), occupationId = Number(occupationId), directionId = Number(directionId)
|
|
|
break
|
|
|
}
|
|
|
//3 * 3 * n的循环 n < 100
|
|
|
@@ -122,7 +120,7 @@ export default class DealSeoData {
|
|
|
const typeList = this.typeList
|
|
|
const { city, citySlug, cityName = "", direction, directionName = "", directionSlug, directionSmall, directionSmallName = "", directionSmallSlug } = this.selected
|
|
|
let job = directionSmall || direction
|
|
|
- let jobName = directionSmallName || directionName
|
|
|
+ let jobName = directionSmallName === "全部" ? directionName : (directionSmallName || directionName)
|
|
|
let jobSlug = directionSmallSlug || directionSlug
|
|
|
const { headers: { host } } = this.req
|
|
|
let footer = {
|
|
|
@@ -138,45 +136,68 @@ export default class DealSeoData {
|
|
|
}
|
|
|
if (city && job) {
|
|
|
//兼职城市&岗位页 ${jobName}兼职招聘>${cityName}${jobName}兼职招聘,并赋予对应的url
|
|
|
- footer.link[ 0 ].name = "热门城市岗位兼职招聘"
|
|
|
- // footer.link[ 1 ].name = `${cityName}岗位兼职招聘`
|
|
|
+ footer.link[ 0 ].name = `热门城市${jobName}兼职招聘`
|
|
|
footer.link[ 0 ].data = typeList.city.list.map((item) => {
|
|
|
- return { name: `${item.name}岗位兼职招聘`, url: `/job/${item.slug}/` }
|
|
|
+ return { name: `${item.name}${jobName}兼职招聘`, url: `/job/${jobSlug}/${item.slug}/` }
|
|
|
+ })
|
|
|
+ footer.link[ 1 ].name = `${cityName}热门岗位兼职招聘`
|
|
|
+ footer.link[ 1 ].data = []
|
|
|
+ typeList.direction.list.forEach((item) => {
|
|
|
+ footer.link[ 1 ].data.push({ name: `${cityName}${item.name}兼职招聘`, url: `/job/${citySlug}/${item.slug}/` })
|
|
|
+ if (Array.isArray(item.children)) {
|
|
|
+ item.children.forEach(item1 => {
|
|
|
+ footer.link[ 1 ].data.push({ name: `${cityName}${item1.name}兼职招聘`, url: `/job/${citySlug}/${item1.slug}/` })
|
|
|
+ })
|
|
|
+ }
|
|
|
})
|
|
|
- // footer.link[ 1 ].data = typeList.industry.map((item) => {
|
|
|
- // return { name: `${cityName}${item.name}岗位兼职招聘`, url: `/job/${city}/${item.slug}/` }
|
|
|
- // })
|
|
|
} else if (city && !job) {
|
|
|
//兼职城市
|
|
|
- footer.link[ 0 ].name = "热门城市岗位兼职招聘"
|
|
|
- // footer.link[ 1 ].name = `热门城市${industryName}岗位兼职招聘`
|
|
|
- footer.link[ 0 ].data = typeList.direction.list.map((item) => {
|
|
|
- return { name: `${item.name}岗位兼职招聘`, url: `/job/${item.slug}/` }
|
|
|
+ footer.link[ 0 ].name = "热门城市兼职招聘"
|
|
|
+ footer.link[ 0 ].data = typeList.city.list.map((item) => {
|
|
|
+ return { name: `${item.name}兼职招聘`, url: `/job/${item.slug}/` }
|
|
|
+ })
|
|
|
+ footer.link[ 1 ].name = `${cityName}热门岗位兼职招聘`
|
|
|
+ footer.link[ 1 ].data = []
|
|
|
+ typeList.direction.list.forEach((item) => {
|
|
|
+ footer.link[ 1 ].data.push({ name: `${cityName}${item.name}兼职招聘`, url: `/job/${citySlug}/${item.slug}/` })
|
|
|
+ if (Array.isArray(item.children)) {
|
|
|
+ item.children.forEach(item1 => {
|
|
|
+ footer.link[ 1 ].data.push({ name: `${cityName}${item1.name}兼职招聘`, url: `/job/${citySlug}/${item1.slug}/` })
|
|
|
+ })
|
|
|
+ }
|
|
|
})
|
|
|
- // footer.link[ 1 ].data = typeList.city.map((item) => {
|
|
|
- // return { name: `${item.name}${industryName}岗位兼职招聘`, url: `/job/${item.slug}/${industry}/` }
|
|
|
- // })
|
|
|
}
|
|
|
else if (!city && job) {
|
|
|
//岗位页
|
|
|
- footer.link[ 0 ].name = `其他岗位兼职招聘`
|
|
|
- // footer.link[ 1 ].name = `热门城市${techTypeName}岗位兼职招聘`
|
|
|
- footer.link[ 0 ].data = typeList.direction.list.map((item) => {
|
|
|
- return { name: `${item.name}${directionName}岗位兼职招聘`, url: `/job/${item.slug}/${techType}/` }
|
|
|
+ footer.link[ 0 ].name = "热门岗位兼职招聘"
|
|
|
+ footer.link[ 0 ].data = []
|
|
|
+ typeList.direction.list.forEach((item) => {
|
|
|
+ footer.link[ 0 ].data.push({ name: `${item.name}兼职招聘`, url: `/job/${item.slug}/` })
|
|
|
+ if (Array.isArray(item.children)) {
|
|
|
+ item.children.forEach(item1 => {
|
|
|
+ footer.link[ 0 ].data.push({ name: `${item1.name}兼职招聘`, url: `/job/${item1.slug}/` })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ footer.link[ 1 ].name = `热门城市${jobName}兼职招聘`
|
|
|
+ footer.link[ 1 ].data = typeList.city.list.map((item) => {
|
|
|
+ return { name: `${item.name}${jobName}兼职招聘`, url: `/job/${jobSlug}/${item.slug}/` }
|
|
|
})
|
|
|
- // footer.link[ 1 ].data = typeList.city.map((item) => {
|
|
|
- // return { name: `${item.name}${techTypeName}岗位兼职招聘`, url: `/job/${techType}/${item.slug}/` }
|
|
|
- // })
|
|
|
} else {
|
|
|
//非特定的url
|
|
|
footer.link[ 0 ].name = "热门城市兼职招聘"
|
|
|
- footer.link[ 1 ].name = "热门岗位兼职招聘"
|
|
|
- console.log(typeList.city)
|
|
|
footer.link[ 0 ].data = typeList.city.list.map((item) => {
|
|
|
- return { name: `${item.name}岗位兼职招聘`, url: `/job/${item.slug}/` }
|
|
|
+ return { name: `${item.name}兼职招聘`, url: `/job/${item.slug}/` }
|
|
|
})
|
|
|
- footer.link[ 1 ].data = typeList.direction.list.map((item) => {
|
|
|
- return { name: `${item.name}岗位兼职招聘`, url: `/job/${item.slug}/` }
|
|
|
+ footer.link[ 1 ].name = "热门岗位兼职招聘"
|
|
|
+ footer.link[ 1 ].data = []
|
|
|
+ typeList.direction.list.forEach((item) => {
|
|
|
+ footer.link[ 1 ].data.push({ name: `${item.name}兼职招聘`, url: `/job/${item.slug}/` })
|
|
|
+ if (Array.isArray(item.children)) {
|
|
|
+ item.children.forEach(item1 => {
|
|
|
+ footer.link[ 1 ].data.push({ name: `${item1.name}兼职招聘`, url: `/job/${item1.slug}/` })
|
|
|
+ })
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
return footer
|