- ars,SMS,KeyIn 수정

This commit is contained in:
HyeonJongKim
2025-10-28 20:29:34 +09:00
parent 84ade896c4
commit 7a8cafe7bb
16 changed files with 153 additions and 96 deletions

View File

@@ -11,13 +11,17 @@ import {
useSetFooterMode,
useSetOnBack
} from '@/widgets/sub-layout/use-sub-layout';
import { ArsPaymentMethod, ExtensionArsApplyParams } from '@/entities/additional-service/model/ars/types';
import { ArsPaymentMethod, ExtensionArsApplyParams, ExtensionArsApplyResponse } from '@/entities/additional-service/model/ars/types';
import { ArsRequestSuccessPage } from './request-success-page';
import { useStore } from '@/shared/model/store';
import { snackBar } from '@/shared/lib';
export const ArsRequestPage = () => {
const { navigate } = useNavigate();
const location = useLocation();
const midOptions = useStore.getState().UserStore.selectOptionsMids
const { mid: receivedMid } = location.state || {};
const { mutateAsync: arsApply } = useExtensionArsApplyMutation();
@@ -26,7 +30,7 @@ export const ArsRequestPage = () => {
const [moid, setMoid] = useState<string>('');
const [goodsName, setGoodsName] = useState<string>('');
const [amount, setAmount] = useState<number>(0);
const [instmntMonth, setInstmntMonth] = useState<string>('');
const [instmntMonth, setInstmntMonth] = useState<string>('00');
const [buyerName, setBuyerName] = useState<string>('');
const [phoneNumber, setPhoneNumber] = useState<string>('');
const [email, setEamil] = useState<string>('');
@@ -53,15 +57,18 @@ export const ArsRequestPage = () => {
email: email,
arsPaymentMethod: arsPaymentMethod,
};
arsApply(arsApplyParams).then((rs) => {
console.log(rs)
setResultMessage('결제 신청이 완료되었습니다');
setSuccessPageOn(true);
}).catch(() => {
}).finally(() => {
});
arsApply(arsApplyParams)
.then((rs: ExtensionArsApplyResponse) => {
if (rs.status === true) {
setSuccessPageOn(true);
} else {
const errorMessage = rs.error?.message || '신청을 실패하였습니다.';
snackBar(`[실패] ${errorMessage}`);
}
})
.catch((error) => {
snackBar(`[실패] ${error?.response?.data?.message || error?.response?.data?.error?.message}` || '[실패] 신청을 실패하였습니다.')
})
};
@@ -116,10 +123,19 @@ export const ArsRequestPage = () => {
<div className="billing-row">
<div className="billing-label"> <span>*</span></div>
<div className="billing-field">
<input
type="text"
<select
value={mid}
/>
onChange={(e: ChangeEvent<HTMLSelectElement>) => setMid(e.target.value)}
>
{
midOptions.map((value) => (
<option
key={value.value}
value={value.value}
>{value.name}</option>
))
}
</select>
</div>
</div>
@@ -164,9 +180,12 @@ export const ArsRequestPage = () => {
<div className="billing-row">
<div className="billing-label"> <span>*</span></div>
<div className="billing-field">
<select disabled>
<option selected></option>
<option></option>
<select
disabled
value={instmntMonth}
onChange={(e: ChangeEvent<HTMLSelectElement>) => setInstmntMonth(e.target.value)}
>
<option value="00"></option>
</select>
</div>
</div>