feat: update of partner

This commit is contained in:
eleanor.mao
2025-05-15 01:02:00 +08:00
parent 7aafc3a789
commit d2ac64f20c
52 changed files with 1435 additions and 265 deletions

View File

@ -0,0 +1,3 @@
import { SET_INVITE_CODE } from '../constants';
export const setInviteCode = (value: string) => ({ type: SET_INVITE_CODE, value });

View File

@ -4,3 +4,4 @@ export const SET_LOCATION_INFO = 'SET_LOCATION_INFO';
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';

View File

@ -2,10 +2,12 @@ import { combineReducers } from 'redux';
import appState from './app';
import message from './message';
import partnerInfo from './partner';
import userInfo from './user';
export default combineReducers({
appState,
userInfo,
message,
partnerInfo,
});

View File

@ -0,0 +1,22 @@
import { Action } from 'redux';
import { PartnerInfo } from '@/types/partner';
import { SET_INVITE_CODE } from '../constants';
const INIT_STATE: Partial<PartnerInfo> = {};
const partnerInfo = (state: Partial<PartnerInfo> = INIT_STATE, action: Action): Partial<PartnerInfo> => {
const { type, value } = action as BL.Anything;
switch (type) {
case SET_INVITE_CODE: {
return {
inviteCode: value,
};
}
default:
return state;
}
};
export default partnerInfo;

View File

@ -0,0 +1,5 @@
import { IState } from '@/types/store';
export const selectPartnerInfo = (state: IState) => {
return state.partnerInfo;
};