增加零工市场

This commit is contained in:
francis_fh
2026-01-19 19:09:14 +08:00
parent 9cf5905d5f
commit 7dcfbd35fe
2 changed files with 19 additions and 4 deletions

View File

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

View File

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