결제정보 카드사 셋팅

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

View File

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

View File

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