ars sms재전송

This commit is contained in:
focp212@naver.com
2025-09-24 13:59:21 +09:00
parent f2337e269d
commit 2ef446f0e7
3 changed files with 98 additions and 14 deletions

View File

@@ -1,6 +1,71 @@
export const ArsResendSmsBottomSheet = () => {
import { BottomSheetMotionDuration, BottomSheetMotionVaiants } from "@/entities/common/model/constant";
import { IMAGE_ROOT } from '@/shared/constants/common';
import { motion } from 'framer-motion';
export interface ArsResendSmsBottomSheetProps {
bottomSheetOn: boolean;
setBottomSheetOn: (bottomSheetOn: boolean) => void;
phoneNumber?: string;
callResendSms: () => void;
};
export const ArsResendSmsBottomSheet = ({
bottomSheetOn,
setBottomSheetOn,
phoneNumber,
callResendSms
}: ArsResendSmsBottomSheetProps) => {
const onClickToClose = () => {
setBottomSheetOn(false);
};
const onCliickToResendSms = () => {
if(callResendSms){
callResendSms();
}
onClickToClose();
};
return (
<></>
<>
{ (bottomSheetOn) &&
<div className="bg-dim"></div>
}
<motion.div
className="bottomsheet"
initial="hidden"
animate={ (bottomSheetOn)? 'visible': 'hidden' }
variants={ BottomSheetMotionVaiants }
transition={ BottomSheetMotionDuration }
>
<div className="bottomsheet-header">
<div className="bottomsheet-title">
<h2>SMS </h2>
<button
className="close-btn"
type="button"
>
<img
src={ IMAGE_ROOT + '/ico_close.svg' }
alt="닫기"
onClick={ () => onClickToClose() }
/>
</button>
</div>
</div>
<div className="bottomsheet-content">
<div className="bottom-section">
<p>[01095800212] SMS를 ?</p>
</div>
</div>
<div className="bottomsheet-footer">
<button
className="btn-50 btn-blue flex-1"
type="button"
onClick={ () => onCliickToResendSms() }
></button>
</div>
</motion.div>
</>
);
};

View File

@@ -1,15 +1,16 @@
import { BottomSheetMotionDuration, BottomSheetMotionVaiants } from '@/entities/common/model/constant';
import { IMAGE_ROOT } from '@/shared/constants/common';
import { motion } from 'framer-motion';
export interface CashReceitPurposeUpdateBottomSheetProps {
setBottomSheetOn: (bottomSheetOn: boolean) => void;
bottomSheetOn: boolean;
setBottomSheetOn: (bottomSheetOn: boolean) => void;
callPurposeUpdate: () => void;
};
export const CashReceitPurposeUpdateBottomSheet = ({
setBottomSheetOn,
bottomSheetOn,
setBottomSheetOn,
callPurposeUpdate
}: CashReceitPurposeUpdateBottomSheetProps) => {
@@ -20,11 +21,6 @@ export const CashReceitPurposeUpdateBottomSheet = ({
callPurposeUpdate();
};
const variants = {
hidden: { y: '100%' },
visible: { y: '0%' },
};
return (
<>
{ (bottomSheetOn) &&
@@ -34,12 +30,12 @@ export const CashReceitPurposeUpdateBottomSheet = ({
className="bottomsheet"
initial="hidden"
animate={ (bottomSheetOn)? 'visible': 'hidden' }
variants={ variants }
transition={{ duration: 0.5 }}
variants={ BottomSheetMotionVaiants }
transition={ BottomSheetMotionDuration }
>
<div className="bottomsheet-header">
<div className="bottomsheet-title">
<h2> </h2>
<h2> </h2>
<button
className="close-btn"
type="button"

View File

@@ -13,9 +13,13 @@ import { NumericFormat } from 'react-number-format';
import { useExtensionArsDetailMutation } from '@/entities/additional-service/api/ars/use-extension-ars-detail-mutation';
import {
ExtensionArsDetailParams,
ExtensionArsDetailResponse
ExtensionArsDetailResponse,
ExtensionArsResendParams,
ExtensionArsResendResponse
} from '@/entities/additional-service/model/ars/types';
import moment from 'moment';
import { ArsResendSmsBottomSheet } from '@/entities/additional-service/ui/ars/resend-sms-bottom-sheet';
import { useExtensionArsResendMutation } from '@/entities/additional-service/api/ars/use-extension-ars-resend-mutation';
export const ArsDetailPage = () => {
const { navigate } = useNavigate();
@@ -26,8 +30,10 @@ export const ArsDetailPage = () => {
const amount = location.state.amount;
const [detail, setDetail] = useState<ExtensionArsDetailResponse>();
const [bottomSheetOn, setBottomSheetOn] = useState<boolean>(false);
const { mutateAsync: extensionArsDetail } = useExtensionArsDetailMutation();
const { mutateAsync: extensionArsResend } = useExtensionArsResendMutation();
const callDetail = () => {
let params: ExtensionArsDetailParams = {
tid: tid,
@@ -51,13 +57,23 @@ export const ArsDetailPage = () => {
}, []);
const onClickToOpenResendBottomSheet = () => {
setBottomSheetOn(true);
};
const getDate = (date?: string) => {
return (date)? moment(date.substr(0, 8)).format('YYYY.MM.DD'): '';
};
const callResendSms = () => {
let params: ExtensionArsResendParams = {
mid: mid,
tid: tid
}
extensionArsResend(params).then((rs: ExtensionArsResendResponse) => {
console.log(rs);
});
};
return (
<>
<main className="full-height">
@@ -136,6 +152,13 @@ export const ArsDetailPage = () => {
</div>
</div>
</main>
<ArsResendSmsBottomSheet
setBottomSheetOn={ setBottomSheetOn }
bottomSheetOn={ bottomSheetOn }
phoneNumber={ detail?.phoneNumber }
callResendSms={ callResendSms }
></ArsResendSmsBottomSheet>
</>
);
};