feat: update

This commit is contained in:
chashaobao
2025-10-20 07:58:50 +08:00
parent bc141fcf1b
commit a179654898
32 changed files with 648 additions and 271 deletions

View File

@ -10,4 +10,4 @@ export const changeHomePage = (value: PageType) => ({ type: CHANGE_HOME_PAGE, va
export const setLocationInfo = (value: LocationInfo) => ({ type: SET_LOCATION_INFO, value });
export const setServiceUrls = (value: AppState['serviceUrls']) => ({ type: SET_SERVICE_URLS, value });
export const setCityOperators = (value: AppState['cityOperators']) => ({ type: SET_SERVICE_URLS, value });

View File

@ -23,7 +23,7 @@ const INIT_STATE: AppState = {
roleType: defaultAppMode,
homePageType: defaultAppMode === RoleType.Company ? PageType.Anchor : PageType.JOB,
location: Taro.getStorageSync<LocationInfo>(CacheKey.CACHE_LOCATION_INFO) || DEFAULT_LOCATION,
serviceUrls: [],
cityOperators: [],
};
const appState = (state: AppState = INIT_STATE, action: Action): AppState => {
@ -35,7 +35,7 @@ const appState = (state: AppState = INIT_STATE, action: Action): AppState => {
case CHANGE_HOME_PAGE:
return { ...state, homePageType: value };
case SET_SERVICE_URLS:
return { ...state, serviceUrls: value };
return { ...state, cityOperators: value };
case SET_LOCATION_INFO:
Taro.setStorageSync(CacheKey.CACHE_LOCATION_INFO, value);
return { ...state, location: value };

View File

@ -6,4 +6,4 @@ export const selectHomePageType = (state: IState) => state.appState.homePageType
export const selectLocation = (state: IState) => state.appState.location;
export const selectServiceUrls = (state: IState) => state.appState.serviceUrls || {};
export const selectCityOperators = (state: IState) => state.appState.cityOperators || {};