ars sms재전송
This commit is contained in:
@@ -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>
|
||||
</>
|
||||
);
|
||||
};
|
||||
@@ -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"
|
||||
|
||||
@@ -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>
|
||||
|
||||
</>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user