|
@@ -358,7 +358,7 @@ const HbyInfo2 = (props: any) => {
|
|
|
};
|
|
|
|
|
|
type Props = {
|
|
|
- onAfter?: () => {};
|
|
|
+ onAfterHandler?: () => void;
|
|
|
};
|
|
|
export type RedPacketModalProps = {
|
|
|
onClose: () => void;
|
|
@@ -378,14 +378,13 @@ enum Status {
|
|
|
}
|
|
|
|
|
|
const RedPacketModal = forwardRef<RedPacketModalProps, Props>(function RedPacketModal(props, ref) {
|
|
|
- const { onAfter } = props;
|
|
|
+ const { onAfterHandler } = props;
|
|
|
const [visible, setVisible] = useState(false);
|
|
|
const [iconLists, setIconLists] = useState<any>([]);
|
|
|
// 初始状态为is_end, 展示活动详情页
|
|
|
const [status, setStatus] = useState<Status>(Status.is_end);
|
|
|
const packet = useRef<any>({});
|
|
|
|
|
|
- const [redPacketInfo, setRedPacketInfo] = useState<any>({});
|
|
|
const [redAmount, setRedAmount] = useState<any>(0);
|
|
|
const activeIndex = useRef<number>(0);
|
|
|
const token = getToken();
|
|
@@ -450,13 +449,13 @@ const RedPacketModal = forwardRef<RedPacketModalProps, Props>(function RedPacket
|
|
|
const onReciveRed = async () => {
|
|
|
try {
|
|
|
let paramsData = {
|
|
|
- id: redPacketInfo?.id,
|
|
|
- index: redPacketInfo?.index,
|
|
|
+ id: packet.current?.id,
|
|
|
+ index: packet.current?.index,
|
|
|
};
|
|
|
let receiveRedPacketInfo = await receiveRedPacketApi(paramsData);
|
|
|
let redNum = receiveRedPacketInfo.data;
|
|
|
- if (onAfter) {
|
|
|
- onAfter();
|
|
|
+ if (onAfterHandler) {
|
|
|
+ onAfterHandler();
|
|
|
}
|
|
|
setStatus(Status.is_receive);
|
|
|
setRedAmount(redNum?.amount);
|