결제정보 카드사 셋팅

This commit is contained in:
focp212@naver.com
2025-10-23 16:07:44 +09:00
parent 0de5dfa1b1
commit 439ea941b0
3 changed files with 33 additions and 32 deletions

View File

@@ -2,6 +2,8 @@ import { motion } from 'framer-motion';
import { IMAGE_ROOT } from '@/shared/constants/common';
import { BottomSheetMotionDuration, BottomSheetMotionVaiants } from '@/entities/common/model/constant';
import { BankFees, CategoryFees, FeeRanges, GeneralTabItems, InstallmentTabItems, MoneyPointTabItems, PaymentFees } from '../model/types';
import { useStore } from '@/shared/model/store';
import { ChangeEvent, useState } from 'react';
export interface CardCommissionBottomSheetProps {
cardCommissionBottomSheetOn: boolean;
@@ -32,6 +34,9 @@ export const CardCommissionBottomSheet = ({
categoryFees,
feeRate
}: CardCommissionBottomSheetProps) => {
const cardList = useStore.getState().CommonStore.creditCardList;
const [selectedCard, setSelectedCard] = useState<string>(cardList[0].desc1);
const onClickToClose = () => {
setCardCommissionBottomSheetOn(false);
@@ -93,8 +98,15 @@ export const CardCommissionBottomSheet = ({
<div className="card-fee-box">
<span className="label"></span>
<div className="field wid-100">
<select>
<option>KB국민</option>
<select
value={ selectedCard }
onChange={ (e: ChangeEvent<HTMLSelectElement>) => setSelectedCard(e.target.value) }
>
{
cardList.map((value, index) => (
<option value={ value.desc1 }>{ value.desc1 }</option>
))
}
</select>
</div>
</div>

View File

@@ -1,6 +1,8 @@
import { motion } from 'framer-motion';
import { IMAGE_ROOT } from '@/shared/constants/common';
import { BottomSheetMotionDuration, BottomSheetMotionVaiants } from '@/entities/common/model/constant';
import { useStore } from '@/shared/model/store';
import { useState } from 'react';
export interface CreditCardListBottomSheetProps {
creditCardListBottomSheetOn: boolean;
@@ -11,6 +13,9 @@ export const CreditCardListBottomSheet = ({
creditCardListBottomSheetOn,
setCreditCardListBottomSheetOn
}: CreditCardListBottomSheetProps) => {
const cardList = useStore.getState().CommonStore.creditCardList;
const [selectedCard, setSelectedCard] = useState<string>(cardList[0].desc1);
const onClickToClose = () => {
setCreditCardListBottomSheetOn(false);
@@ -45,34 +50,14 @@ export const CreditCardListBottomSheet = ({
</div>
<div className="bottomsheet-content">
<div className="card-list">
<div className="card-option selected">
<span className="name">KB국민</span>
<i className="check"></i>
</div>
<div className="card-option">
<span className="name"></span>
<i className="check"></i>
</div>
<div className="card-option">
<span className="name">()</span>
<i className="check"></i>
</div>
<div className="card-option">
<span className="name"></span>
<i className="check"></i>
</div>
<div className="card-option">
<span className="name"></span>
<i className="check"></i>
</div>
<div className="card-option">
<span className="name"></span>
<i className="check"></i>
</div>
<div className="card-option">
<span className="name"></span>
<i className="check"></i>
</div>
{
cardList.map((value, index) => (
<div className={ `card-option ${(value.desc1 === selectedCard)? 'selected': ''}` }>
<span className="name">{ value.desc1 }</span>
<i className="check"></i>
</div>
))
}
</div>
</div>

View File

@@ -2,8 +2,9 @@ import { motion } from 'framer-motion';
import { IMAGE_ROOT } from '@/shared/constants/common';
import { BottomSheetMotionVaiants, BottomSheetMotionDuration } from '@/entities/common/model/constant';
import { InstallmentDetails, PaymentInstallmentDetailResponse } from '../model/types';
import { ChangeEvent } from 'react';
import { ChangeEvent, useState } from 'react';
import { NumericFormat } from 'react-number-format';
import { useStore } from '@/shared/model/store';
export interface NoInterestInfoBottomSheetProps {
noInterestInfoBottomSheetOn: boolean;
@@ -22,7 +23,10 @@ export const NoInterestInfoBottomSheet = ({
installmentDetails,
changeToCardCompany
}: NoInterestInfoBottomSheetProps) => {
const cardList = useStore.getState().CommonStore.creditCardList;
const [selectedCard, setSelectedCard] = useState<string>(cardList[0].desc1);
const onClickToClose = () => {
setNoInterestInfoBottomSheetOn(false);
};