-부가서비스 MID 기준 SelectBox 처리 (추후 수정 가능)

- SMS 재발송 API 수정
This commit is contained in:
HyeonJongKim
2025-10-30 14:46:55 +09:00
parent 9d0b446ae8
commit 1ca06f8e8b
9 changed files with 106 additions and 31 deletions

View File

@@ -4,7 +4,8 @@ import { useSetOnBack } from '@/widgets/sub-layout/use-sub-layout';
import { SingleDatePicker } from '@/shared/ui/filter/single-date-picker';
import { LinkPaymentFormData, LinkPaymentSendMethod } from '@/entities/additional-service/model/link-pay/types';
import { NumericFormat } from 'react-number-format';
import { ChangeEvent } from 'react';
import { useStore } from '@/shared/model/store';
import { useEffect } from 'react';
interface LinkPaymentStep1Props {
formData: LinkPaymentFormData;
@@ -13,11 +14,22 @@ interface LinkPaymentStep1Props {
export const LinkPaymentStep1 = ({ formData, setFormData }: LinkPaymentStep1Props) => {
const { navigate } = useNavigate();
const midOptionsWithoutGids = useStore.getState().UserStore.selectOptionsMidsWithoutGids;
useSetOnBack(() => {
navigate(PATHS.additionalService.linkPayment.shippingHistory);
});
// MID가 비어있고 옵션이 있으면 첫 번째 옵션으로 설정
useEffect(() => {
if (!formData.mid && midOptionsWithoutGids.length > 0) {
const firstMid = midOptionsWithoutGids[0]?.value;
if (firstMid) {
setFormData({ ...formData, mid: firstMid });
}
}
}, []);
const handlePaymentMethodChange = (method: LinkPaymentSendMethod) => {
setFormData({ ...formData, sendMethod: method });
};
@@ -26,12 +38,6 @@ export const LinkPaymentStep1 = ({ formData, setFormData }: LinkPaymentStep1Prop
setFormData({ ...formData, [field]: value });
};
const handleAmountChange = (value: string) => {
const onlyNumbers = value.replace(/[^0-9]/g, '');
const numericValue = onlyNumbers === '' ? 0 : parseInt(onlyNumbers, 10);
setFormData({ ...formData, amount: numericValue });
};
const handleDateChange = (date: string) => {
setFormData({ ...formData, paymentLimitDate: date });
};
@@ -47,7 +53,14 @@ export const LinkPaymentStep1 = ({ formData, setFormData }: LinkPaymentStep1Prop
value={formData.mid}
onChange={(e) => handleInputChange('mid', e.target.value)}
>
<option>nictest00m</option>
{
midOptionsWithoutGids.map((value) => (
<option
key={value.value}
value={value.value}
>{value.name}</option>
))
}
</select>
</div>
</div>
@@ -100,7 +113,7 @@ export const LinkPaymentStep1 = ({ formData, setFormData }: LinkPaymentStep1Prop
thousandSeparator={true}
onValueChange={(values) => {
const { floatValue } = values;
setFormData({...formData, amount: floatValue ?? 0});
setFormData({ ...formData, amount: floatValue ?? 0 });
}}
/>
</div>

View File

@@ -608,7 +608,7 @@ export const ListItem = ({
>{getAlimtalkSendClTypeText(sendCl)}</div>
);
}
else if (additionalServiceCategory === AdditionalServiceCategory.SMSPayment && onResendClick && resendEnabled) {
else if (additionalServiceCategory === AdditionalServiceCategory.SMSPayment && onResendClick) {
rs.push(
<div
key="sms-payment-amount"

View File

@@ -27,7 +27,8 @@ export const SmsPaymentDetailResend = ({
resendMessage({
mid: mid,
tid: tid
tid: tid,
sendMessage: smsDetailData.sendMessage
}).then((rs) => {
console.log("Resend 성공: ", rs);
appBridge.showToast("SMS 발송을 성공하였습니다.");