|
@@ -31,22 +31,23 @@
|
|
</view>
|
|
</view>
|
|
|
|
|
|
<!-- 福利待遇区域 -->
|
|
<!-- 福利待遇区域 -->
|
|
- <view class="section">
|
|
|
|
|
|
+ <!-- <view class="section">
|
|
<view class="section-title">福利待遇</view>
|
|
<view class="section-title">福利待遇</view>
|
|
<view class="benefits-list">
|
|
<view class="benefits-list">
|
|
- <view class="benefit-tag" v-for="(benefit, index) in jobDetail.benefits" :key="index">{{ benefit }}</view>
|
|
|
|
|
|
+ <view class="benefit-tag" >暂无数据</view>
|
|
</view>
|
|
</view>
|
|
- </view>
|
|
|
|
|
|
+ </view> -->
|
|
|
|
|
|
<!-- 岗位介绍区域 -->
|
|
<!-- 岗位介绍区域 -->
|
|
<view class="section">
|
|
<view class="section">
|
|
<view class="section-title">岗位介绍</view>
|
|
<view class="section-title">岗位介绍</view>
|
|
<view class="job-description">
|
|
<view class="job-description">
|
|
- <view class="description-subtitle">{{ jobDetail.description[0].subtitle }}</view>
|
|
|
|
|
|
+ <!-- <view class="description-subtitle">{{ jobDetail.description[0].subtitle }}</view> -->
|
|
<view class="description-content">
|
|
<view class="description-content">
|
|
<view class="description-item" v-for="(item, index) in jobDetail.description[0].items" :key="index">
|
|
<view class="description-item" v-for="(item, index) in jobDetail.description[0].items" :key="index">
|
|
<view class="blue-dot"></view>
|
|
<view class="blue-dot"></view>
|
|
- <text>{{ item }}</text>
|
|
|
|
|
|
+ <text style="color: #333;">{{ item }}</text>
|
|
|
|
+ <!-- <view v-html="item"></view> -->
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -118,7 +119,32 @@ export default {
|
|
});
|
|
});
|
|
|
|
|
|
if (data.code === 2000) {
|
|
if (data.code === 2000) {
|
|
- // 将API返回的数据映射到页面所需的格式
|
|
|
|
|
|
+ // 处理富文本description
|
|
|
|
+ let descriptionItems = [];
|
|
|
|
+ if (data.data.description) {
|
|
|
|
+ // 使用正则表达式提取<li>标签中的文本内容
|
|
|
|
+ const liRegex = /<li[^>]*>(.*?)<\/li>/g;
|
|
|
|
+ const stripTagsRegex = /<[^>]*>/g;
|
|
|
|
+
|
|
|
|
+ let match;
|
|
|
|
+ while ((match = liRegex.exec(data.data.description)) !== null) {
|
|
|
|
+ // 移除剩余的HTML标签,并清理空白字符
|
|
|
|
+ const text = match[1]
|
|
|
|
+ .replace(stripTagsRegex, '')
|
|
|
|
+ .replace(/ /g, ' ')
|
|
|
|
+ .trim();
|
|
|
|
+
|
|
|
|
+ if (text) {
|
|
|
|
+ descriptionItems.push(text);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 如果requirements存在,添加到描述项前面
|
|
|
|
+ if (data.data.requirements) {
|
|
|
|
+ descriptionItems.unshift(data.data.requirements);
|
|
|
|
+ }
|
|
|
|
+
|
|
this.jobDetail = {
|
|
this.jobDetail = {
|
|
title: data.data.title || '',
|
|
title: data.data.title || '',
|
|
salary: data.data.salary_range ? `${data.data.salary_range}/月` : '',
|
|
salary: data.data.salary_range ? `${data.data.salary_range}/月` : '',
|
|
@@ -129,10 +155,7 @@ export default {
|
|
description: [
|
|
description: [
|
|
{
|
|
{
|
|
subtitle: '岗位要求',
|
|
subtitle: '岗位要求',
|
|
- items: [
|
|
|
|
- data.data.requirements || '',
|
|
|
|
- data.data.description || ''
|
|
|
|
- ].filter(item => item) // 过滤掉空值
|
|
|
|
|
|
+ items: descriptionItems
|
|
}
|
|
}
|
|
]
|
|
]
|
|
};
|
|
};
|
|
@@ -358,13 +381,23 @@ export default {
|
|
.description-item {
|
|
.description-item {
|
|
display: flex;
|
|
display: flex;
|
|
margin-bottom: 20rpx;
|
|
margin-bottom: 20rpx;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+/* * {
|
|
|
|
+ background-color: #fff !important;
|
|
|
|
+ color: #333 !important;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ strong {
|
|
|
|
+ font-weight: bold;
|
|
|
|
+ } */
|
|
}
|
|
}
|
|
|
|
|
|
.blue-dot {
|
|
.blue-dot {
|
|
min-width: 16rpx;
|
|
min-width: 16rpx;
|
|
height: 16rpx;
|
|
height: 16rpx;
|
|
border-radius: 50%;
|
|
border-radius: 50%;
|
|
- background-color: #0039b3;
|
|
|
|
|
|
+ background-color: #0039b3 !important;
|
|
margin-right: 10rpx;
|
|
margin-right: 10rpx;
|
|
margin-top: 12rpx;
|
|
margin-top: 12rpx;
|
|
}
|
|
}
|