This commit is contained in:
2025-12-22 16:00:26 +08:00
21 changed files with 1086 additions and 463 deletions

View File

@@ -682,10 +682,11 @@ const goToCompanyInfo = () => {
onMounted(() => {
// 获取企业信息
getCompanyInfo();
// pageNull.value = 0;
// 监听退出登录事件,显示微信登录弹窗
uni.$on('showLoginModal', () => {
wxAuthLoginRef.value?.open();
pageNull.value = 0;
});
});
@@ -796,12 +797,14 @@ async function loadData() {
throw err;
}
}
const pageNull = ref(0);
function scrollBottom() {
console.log('scrollBottom------')
if (loadmoreRef.value && typeof loadmoreRef.value.change === 'function') {
loadmoreRef.value.change('loading');
}
if (state.tabIndex === 'all') {
pageNull.value++;
getJobRecommend();
} else {
getJobList();
@@ -983,6 +986,16 @@ function getJobRecommend(type = 'add') {
...conditionSearch.value,
isPublish: 1,
};
// 优先从store获取如果为空则从缓存获取
const storeIsCompanyUser = userInfo.value?.isCompanyUser;
const cachedUserInfo = uni.getStorageSync('userInfo') || {};
const cachedIsCompanyUser = cachedUserInfo.isCompanyUser;
const userType = storeIsCompanyUser !== undefined ? Number(storeIsCompanyUser) : Number(cachedIsCompanyUser);
console.log('---------userType-----', userType)
// 只有企业用户(isCompanyUser=0)才添加current字段
if (userType === 0) {
params.current = pageNull.value;
}
let comd = { recommend: true, jobCategory: '', tip: '确认你的兴趣,为您推荐更多合适的岗位' };
$api.createRequest('/app/job/recommend', params).then((resData) => {
const { data, total } = resData;
@@ -1014,6 +1027,11 @@ function getJobRecommend(type = 'add') {
const reslist = dataToImg(data);
list.value = reslist;
}
if (data.length > 0) {
pageNull.value++;
} else {
$api.msg('没有更多岗位了');
}
// 切换状态
if (loadmoreRef.value && typeof loadmoreRef.value.change === 'function') {
if (data.length < pageState.pageSize) {
@@ -1040,8 +1058,8 @@ function getJobList(type = 'add') {
// waterfallsFlowRef.value.refresh();
if (waterfallsFlowRef.value) waterfallsFlowRef.value.refresh();
}
let params = {
current: pageState.page,
pageSize: pageState.pageSize,
...pageState.search,
// ...conditionSearch.value,
@@ -1073,7 +1091,7 @@ const isFourLevelLinkagePurview=ref(false)
const getIsFourLevelLinkagePurview=()=>{
let userInfo = uni.getStorageSync('userInfo')
if(userInfo){
$api.myRequest('/auth/login2/ks',{userid: userInfo.dwUserid, idcardno: userInfo.idCard},"POST",'9100',{}).then(res=>{
$api.myRequest('/auth/login2/ks',{userid: userInfo.dwUserid, idcardno: userInfo.idCard},"POST",9100,{}).then(res=>{
if(res.code == 200){
uni.setStorageSync('fourLevelLinkage-token',res.data.access_token)
let roleIdList= ['103','106','107']
@@ -1124,7 +1142,7 @@ function goCa(){
if (checkLogin()) {
let userInfo = uni.getStorageSync('userInfo')
storeRc.dispatch('LoginByUserInfo', userInfo).then(res => {
navTo(`/packageCa/search/search?name=${userInfo.name}&idCard=${userInfo.idCard}`);
navTo(`/packageCa/search/search?name=${userInfo.name}&userId=${userInfo.idCard}`);
});
}
}
@@ -1133,7 +1151,7 @@ function goCaAI(){
if (checkLogin()) {
let userInfo = uni.getStorageSync('userInfo')
storeRc.dispatch('LoginByUserInfo', userInfo).then(res => {
navTo(`/packageCa/search/AIAudition?name=${userInfo.name}&idCard=${userInfo.idCard}`);
navTo(`/packageCa/search/AIAudition?name=${userInfo.name}&userId=${userInfo.idCard}`);
});
}
}