This commit is contained in:
2026-01-20 09:55:34 +08:00
2 changed files with 19 additions and 4 deletions

View File

@@ -25,7 +25,7 @@
<view class="role-icon">
<uni-icons type="person" size="32" :color="userType === 1 ? '#256BFA' : '#999'"></uni-icons>
</view>
<view class="role-text">我是求职者</view>
<view class="role-text">个人</view>
</view>
<view
class="role-item"
@@ -35,7 +35,7 @@
<view class="role-icon">
<uni-icons type="shop" size="32" :color="userType === 0 ? '#256BFA' : '#999'"></uni-icons>
</view>
<view class="role-text">我是招聘者</view>
<view class="role-text">单位</view>
</view>
</view>
</view>

View File

@@ -636,6 +636,7 @@ const rangeOptions = ref([
{ value: 1, text: '最热' },
{ value: 2, text: '最新发布' },
{ value: 3, text: '疆外' },
{ value: 4, text: '零工市场' }
]);
const isLoaded = ref(false);
const isInitialized = ref(false); // 添加初始化标志
@@ -1039,6 +1040,12 @@ function handelHostestSearch(val) {
isShowJw.value = val.value;
pageState.search.order = val.value;
pageState.search.jobType = val.value === 3 ? 1 : 0;
if(val.value === 4) {
pageState.search.type = 4;
} else {
delete pageState.search.type;
}
if (state.tabIndex === 'all') {
getJobRecommend('refresh');
} else {
@@ -1059,6 +1066,10 @@ function getJobRecommend(type = 'add') {
...conditionSearch.value,
isPublish: 1,
};
// 当选中零工市场(4)或疆外(3)时order参数传递0
if (pageState.search.order === 3 || pageState.search.order === 4) {
params.order = 0;
}
// 优先从store获取如果为空则从缓存获取
const storeIsCompanyUser = userInfo.value?.isCompanyUser;
const cachedUserInfo = uni.getStorageSync('userInfo') || {};
@@ -1137,6 +1148,10 @@ function getJobList(type = 'add') {
...pageState.search,
// ...conditionSearch.value,
};
// 当选中零工市场(4)或疆外(3)时order参数传递0
if (pageState.search.order === 3 || pageState.search.order === 4) {
params.order = 0;
}
$api.createRequest('/app/job/list', params).then((resData) => {
const { rows, total } = resData;
@@ -1724,8 +1739,8 @@ defineExpose({ loadData });
font-weight: 400;
font-size: 32rpx;
color: #666D7F;
margin-right: 24rpx
padding: 0rpx 16rpx
margin-right: 8rpx
padding: 0rpx 6rpx
.active
font-weight: 500;
font-size: 32rpx;