feat: job publish

This commit is contained in:
chashaobao
2025-07-28 23:35:51 +08:00
parent 260e543fe6
commit 1c1bb146fc
15 changed files with 167 additions and 19 deletions

View File

@ -1,3 +1,4 @@
export * from './app';
export * from './user';
export * from './message';
export * from './job';

7
src/store/actions/job.ts Normal file
View File

@ -0,0 +1,7 @@
import { CreateJobInfo } from '@/types/job';
import { CREATE_JOB } from '../constants';
export const cacheCreateJob = (value: CreateJobInfo) => ({ type: CREATE_JOB, value });
export const clearCachedJob = () => ({ type: CREATE_JOB, value: {} });

View File

@ -5,3 +5,4 @@ export const SET_USER_INFO = 'SET_USER_INFO';
export const SET_BIND_PHONE = 'SET_BIND_PHONE';
export const SET_USER_MESSAGE = 'SET_USER_MESSAGE';
export const SET_INVITE_CODE = 'SET_INVITE_CODE';
export const CREATE_JOB = 'CREATE_JOB';

View File

@ -1,6 +1,7 @@
import { combineReducers } from 'redux';
import appState from './app';
import jobState from './job';
import message from './message';
import partnerInfo from './partner';
import userInfo from './user';
@ -10,4 +11,5 @@ export default combineReducers({
userInfo,
message,
partnerInfo,
jobState,
});

19
src/store/reducers/job.ts Normal file
View File

@ -0,0 +1,19 @@
import { Action } from 'redux';
import { CreateJobInfo } from '@/types/job';
import { CREATE_JOB } from '../constants';
const INIT_STATE: Partial<CreateJobInfo> = {};
const userInfo = (state: Partial<CreateJobInfo> = INIT_STATE, action: Action): Partial<CreateJobInfo> => {
const { type, value } = action as BL.Anything;
switch (type) {
case CREATE_JOB:
return value;
default:
return state;
}
};
export default userInfo;

View File

@ -0,0 +1,3 @@
import { IState } from '@/types/store';
export const selectCreatedJob = (state: IState) => state.jobState;