diff --git a/brand/LAUNCH-PROGRESS.md b/brand/LAUNCH-PROGRESS.md index 5040e7c..87d552e 100644 --- a/brand/LAUNCH-PROGRESS.md +++ b/brand/LAUNCH-PROGRESS.md @@ -99,6 +99,13 @@ - **월별 예산 + 전월/다음달 복사** — budget에 year/month 추가, 기존 예산은 현재 월로 1회 이관 - 내역추가 **전체화면 모달**(바깥 닫힘 방지) / 분류 **아코디언**(대분류 삼각형) / 계좌 셀렉트 정리(종류별 안내·이름만) - 구글 로그인 **Play 서명 SHA-1 등록**(Google Cloud Android OAuth 클라 추가) +- **UI 전면 개편 (2026-07-04)** — 모든 입력 모달 전체화면 슬라이드업(AppModal) 적용: + - 공통 `CategoryPicker.vue` 컴포넌트 — 대분류/소분류 아코디언 칩 + 인라인 추가 (가계부·고정지출·예산 공통) + - `AccountView` 계좌종류·구분 셀렉트→뱃지, 분류→CategoryPicker + - `RecurringView` 구분·주기 셀렉트→뱃지, 계좌/카드→뱃지, 분류→CategoryPicker + - `AccountWalletView` 카드종류·상환방식 셀렉트→뱃지 + - `BudgetView` 비고정/고정 라디오→뱃지, 카테고리→CategoryPicker + - `CategoryView` 리스트 UI → **칩 그리드 관리 모드** (CategoryPicker admin prop): ✏ 이름수정·✕ 삭제·⠿ 순서변경(토글 후 드래그) --- @@ -124,9 +131,12 @@ ## 🔨 빌드 상태 - **v2** (versionCode 2, 1.0.1): 비공개 테스트 게시·검토통과 - **v3** (versionCode 3): 위 'v2 이후 추가' 반영 — 빌드 후 비공개 트랙 업로드 (테스터에게 최신본 제공, 14일 카운트 리셋 안 됨) + - ⚠️ 서버 `.env`에 `SQL_INIT_MODE=always` 추가 필요 (budget_onetime 테이블 자동 생성) + - ⚠️ 가계부 내역 오류 미해결 — 서버 로그 + DevTools 확인 필요 --- ## 다음 세션 재개 지점 -**테스터 12명 opt-in 진행상황 확인**(업체 의뢰) → 12명 + 14일 연속 충족되면 **프로덕션 액세스 신청**(`production-access-draft.md`). -v3 AAB를 비공개 트랙에 업로드해 테스터가 최신본을 받게. +1. **테스터 12명 opt-in 진행상황 확인**(업체 의뢰) → 12명 + 14일 연속 충족되면 **프로덕션 액세스 신청**(`production-access-draft.md`) +2. **가계부 내역 오류 디버깅** — 서버 로그(`journalctl -u sb-backend`) + DevTools Network 탭 +3. v3 AAB를 비공개 트랙에 업로드해 테스터가 최신본을 받게 diff --git a/src/api/accountApi.js b/src/api/accountApi.js index 45f1ebc..75f296f 100644 --- a/src/api/accountApi.js +++ b/src/api/accountApi.js @@ -104,6 +104,19 @@ const realApi = { removeBudget(id) { return http.delete(`/account/budgets/${id}`) }, + // 1회성 예산 + onetimeBudgets() { + return http.get('/account/budgets/onetime') + }, + createOnetimeBudget(payload) { + return http.post('/account/budgets/onetime', payload) + }, + updateOnetimeBudget(id, payload) { + return http.put(`/account/budgets/onetime/${id}`, payload) + }, + removeOnetimeBudget(id) { + return http.delete(`/account/budgets/onetime/${id}`) + }, createWallet(payload) { return http.post('/account/wallets', payload) }, diff --git a/src/components/ui/AppModal.vue b/src/components/ui/AppModal.vue new file mode 100644 index 0000000..0068566 --- /dev/null +++ b/src/components/ui/AppModal.vue @@ -0,0 +1,88 @@ + + + + + diff --git a/src/components/ui/CategoryPicker.vue b/src/components/ui/CategoryPicker.vue new file mode 100644 index 0000000..c395f15 --- /dev/null +++ b/src/components/ui/CategoryPicker.vue @@ -0,0 +1,533 @@ + + + + + diff --git a/src/views/account/AccountView.vue b/src/views/account/AccountView.vue index e0adf2d..ffb4e0d 100644 --- a/src/views/account/AccountView.vue +++ b/src/views/account/AccountView.vue @@ -6,6 +6,7 @@ import { useAuthStore } from '@/stores/auth' import { useDialog } from '@/composables/dialog' import { appLock } from '@/composables/appLock' import IconBtn from '@/components/ui/IconBtn.vue' +import CategoryPicker from '@/components/ui/CategoryPicker.vue' import { imageToBlob, parseReceiptText } from '@/utils/receiptOcr' import { cardNotif } from '@/native/cardNotif' import { CARD_NOTIF_ENABLED } from '@/config/features' @@ -290,12 +291,19 @@ async function loadWallets() { // 계좌 종류(콤보) → 해당 종류만 목록에 const WALLET_KINDS = [ - { value: 'BANK', label: '계좌' }, - { value: 'CASH', label: '현금' }, - { value: 'CARD', label: '카드' }, - { value: 'LOAN', label: '대출' }, + { value: 'BANK', label: '계좌' }, + { value: 'CASH', label: '현금' }, + { value: 'CARD', label: '카드' }, + { value: 'LOAN', label: '대출' }, + { value: 'MINUS', label: '마이너스' }, { value: 'INVEST', label: '증권' }, ] +const TYPES = [ + { value: 'EXPENSE', label: '지출', cls: 'chip-expense' }, + { value: 'INCOME', label: '수입', cls: 'chip-income' }, + { value: 'TRANSFER', label: '이체', cls: 'chip-transfer' }, + { value: 'REPAYMENT', label: '상환/납부', cls: 'chip-repay' }, +] const walletsOfKind = computed(() => wallets.value.filter((w) => w.type === form.walletKind)) const toWalletsOfKind = computed(() => wallets.value.filter((w) => w.type === form.toWalletKind)) // 선택한 계좌 종류 라벨(계좌/현금/카드/대출/증권) — 셀렉트 안내문에 사용 @@ -327,111 +335,12 @@ async function loadCategories() { categories.value = [] } } -// ===== 분류: 대분류 아코디언 → 소분류 선택 ===== -const categoryMajor = ref('') // 펼쳐진 대분류 이름 -// 현재 구분의 대분류 객체 목록 -const majorOptionsData = computed(() => - categories.value.filter((c) => c.type === form.type && c.parentId == null) -) -// 대분류를 4개씩 행으로 묶음 -const majorRows = computed(() => { - const items = majorOptionsData.value - const rows = [] - for (let i = 0; i < items.length; i += 4) rows.push(items.slice(i, i + 4)) - return rows -}) -// 현재 펼쳐진 대분류 객체 -const selectedMajorObj = computed(() => - majorOptionsData.value.find((m) => m.name === categoryMajor.value) ?? null -) - -// 특정 대분류의 소분류 목록 -function subsByMajor(majorId) { - return categories.value.filter((c) => c.parentId === majorId) -} -// 대분류 클릭: 소분류 있으면 펼침 토글, 없으면 바로 선택 -function onMajorClick(major) { - if (categoryMajor.value === major.name) { - categoryMajor.value = '' - form.category = '' - } else { - categoryMajor.value = major.name - if (!subsByMajor(major.id).length) form.category = major.name - else form.category = '' - } -} -// form.category 로부터 대분류 추론 (편집 진입 시) -function syncCategoryMajor() { - const cur = form.category - if (!cur) { - categoryMajor.value = '' - return - } - const c = categories.value.find((x) => x.type === form.type && x.name === cur) - if (c && c.parentId != null) { - const parent = categories.value.find((x) => x.id === c.parentId) - categoryMajor.value = parent ? parent.name : cur - } else { - categoryMajor.value = cur - } -} - // 필터용 전체 분류명 (중복 제거) const allCategoryNames = computed(() => [...new Set(categories.value.map((c) => c.name))]) -// 모달 내 분류 인라인 추가 -const addingCategory = ref(false) -const addingAsMajor = ref(true) // true=대분류 추가, false=소분류 추가 -const newCategoryName = ref('') -const catSubmitting = ref(false) -function startAddMajorCategory() { - categoryMajor.value = '' - form.category = '' - newCategoryName.value = '' - addingAsMajor.value = true - addingCategory.value = true -} -function startAddSubCategory() { - newCategoryName.value = '' - addingAsMajor.value = false - addingCategory.value = true -} -function cancelAddCategory() { - addingCategory.value = false - newCategoryName.value = '' -} -async function confirmAddCategory() { - const name = newCategoryName.value.trim() - if (!name) return - catSubmitting.value = true - // 대분류가 선택돼 있으면 그 아래 소분류로 추가, 아니면 대분류로 추가 - const parent = categories.value.find( - (c) => c.type === form.type && c.parentId == null && c.name === categoryMajor.value, - ) - const parentId = parent ? parent.id : null - try { - await accountApi.createCategory({ type: form.type, name, parentId }) - await loadCategories() - form.category = name - if (!parentId) categoryMajor.value = name // 새 대분류면 대분류로 선택 - cancelAddCategory() - } catch (e) { - if (e.response?.status === 409) { - // 이미 있는 분류면 그대로 선택 - form.category = name - syncCategoryMajor() - cancelAddCategory() - } else { - alert(e.response?.data?.message || '분류 추가에 실패했습니다.') - } - } finally { - catSubmitting.value = false - } -} // 구분(수입/지출/이체) 변경 시 분류 초기화 function onTypeChange() { form.category = '' - categoryMajor.value = '' } // 태그 (태그 관리에 등록된 태그 선택) @@ -563,8 +472,6 @@ function openCreate() { editingPending.value = false Object.assign(form, { entryDate: todayStr(), type: 'EXPENSE', category: '', amount: null, memo: '', walletKind: 'BANK', walletId: '', toWalletKind: '', toWalletId: '', principal: null, interest: null, annualFee: null, installmentMonths: '', currency: 'KRW', foreignAmount: null, rate: null }) selectedTagIds.value = [] - syncCategoryMajor() - cancelAddCategory() formError.value = null formInfo.value = '' formOpen.value = true @@ -598,8 +505,6 @@ function openEdit(e) { const nameToId = {} tagOptions.value.forEach((t) => (nameToId[t.name] = t.id)) selectedTagIds.value = (e.tags || []).map((n) => nameToId[n]).filter(Boolean) - syncCategoryMajor() - cancelAddCategory() pasteDetected.value = null pasteModalOpen.value = false pasteText.value = '' @@ -1084,7 +989,7 @@ onMounted(async () => { - +
- - +
-
- 계좌 종류 -
- -
+ 구분 +
+ +
+
+ +
+ 계좌 종류 +
+
- - -
+
{{ w.issuer }} - @@ -647,43 +772,6 @@ button.primary { color: #c0392b; } -/* 모달 */ -.modal-backdrop { - position: fixed; - inset: 0; - z-index: 1000; - display: flex; - align-items: center; - justify-content: center; - background: rgba(0, 0, 0, 0.5); - padding: 1rem; -} -.modal { - position: relative; - width: 100%; - max-width: 380px; - padding: 1.75rem 1.5rem 1.5rem; - background: var(--color-background); - border: 1px solid var(--color-border); - border-radius: 8px; - box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); -} -.modal .close { - position: absolute; - top: 0.5rem; - right: 0.6rem; - width: 2rem; - height: 2rem; - border: 0; - background: transparent; - font-size: 1.5rem; - line-height: 1; -} -.modal h2 { - margin-bottom: 1rem; - font-size: 1.2rem; - text-align: center; -} .budget-form { display: flex; flex-direction: column; @@ -703,17 +791,42 @@ button.primary { background: var(--color-background-soft); color: var(--color-text); } -.mode { +/* 배지형 선택 */ +.field { display: flex; - gap: 1rem; - font-size: 0.85rem; - padding: 0.25rem 0; + flex-direction: column; + gap: 0.3rem; } -.radio { - flex-direction: row !important; - align-items: center; - gap: 0.3rem !important; +.field-label { + font-size: 0.82rem; + opacity: 0.7; +} +.field-hint { + font-size: 0.75rem; + opacity: 0.7; +} +.chip-group { + display: flex; + flex-wrap: wrap; + gap: 0.35rem; +} +.chip { + padding: 0.28rem 0.75rem; + border: 1.5px solid var(--color-border); + border-radius: 100px; + background: var(--color-background-soft); + color: var(--color-text); + font-size: 0.82rem; + font-weight: 500; cursor: pointer; + line-height: 1.4; + transition: border-color 0.12s, background 0.12s, color 0.12s; +} +.chip:disabled { opacity: 0.45; cursor: not-allowed; } +.chip.active { + border-color: hsla(160, 100%, 37%, 1); + background: hsla(160, 100%, 37%, 1); + color: #fff; } .fixed-base { display: flex; @@ -741,12 +854,92 @@ button.primary { gap: 0.5rem; margin-top: 0.5rem; } -.fade-enter-active, -.fade-leave-active { - transition: opacity 0.18s ease; +/* 1회성 예산 */ +.onetime-section { + margin-top: 2rem; + border-top: 2px solid var(--color-border); + padding-top: 1.25rem; } -.fade-enter-from, -.fade-leave-to { - opacity: 0; +.onetime-header { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 1rem; +} +.onetime-title { + font-size: 1rem; + font-weight: 700; +} +.onetime-list { + list-style: none; + padding: 0; + margin: 0; +} +.onetime-row { + padding: 0.85rem 0; + border-bottom: 1px solid var(--color-border); +} +.ot-top { + display: flex; + align-items: baseline; + gap: 0.5rem; + margin-bottom: 0.4rem; +} +.ot-name { + font-weight: 600; + flex: 1; + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +.ot-status { + font-size: 0.7rem; + border-radius: 3px; + padding: 0.05rem 0.35rem; + border: 1px solid; + white-space: nowrap; +} +.ot-status.active { color: #2e7d32; border-color: #2e7d32; } +.ot-status.upcoming { color: #1565c0; border-color: #1565c0; } +.ot-status.ended { opacity: 0.5; } +.ot-amounts { + font-size: 0.9rem; + white-space: nowrap; +} +.ot-amounts .neg { color: #c0392b; font-weight: 600; } +.ot-sep { opacity: 0.5; margin: 0 0.2rem; } +.ot-bottom { + display: flex; + align-items: center; + gap: 0.6rem; + margin-top: 0.35rem; + font-size: 0.8rem; + flex-wrap: wrap; +} +.ot-date { opacity: 0.65; } +.ot-cat { + background: var(--color-background-mute); + border-radius: 3px; + padding: 0.05rem 0.35rem; + font-size: 0.75rem; +} +.ot-remain { opacity: 0.85; } +.ot-remain.neg { color: #c0392b; opacity: 1; } +.ot-empty { opacity: 0.6; } + +/* 날짜 범위 입력 */ +.date-range { + display: flex; + align-items: flex-end; + gap: 0.4rem; +} +.date-range label { + flex: 1; +} +.range-sep { + padding-bottom: 0.55rem; + opacity: 0.6; + font-size: 0.9rem; } diff --git a/src/views/account/CategoryView.vue b/src/views/account/CategoryView.vue index c0ab56f..ef7f118 100644 --- a/src/views/account/CategoryView.vue +++ b/src/views/account/CategoryView.vue @@ -1,19 +1,23 @@ @@ -608,16 +585,7 @@ onMounted(async () => { .more-trades:hover { border-color: var(--color-border-hover); } -/* 전체보기 모달: 매매목록 아래 매수 모달이 위에 오도록 한 단계 낮게 */ -.modal-backdrop.trades-backdrop { - z-index: 1090; -} -.trades-modal { - max-width: 420px; -} .modal-trades { - max-height: 60vh; - overflow-y: auto; margin-top: 0.5rem; } .trade-list { @@ -662,44 +630,6 @@ onMounted(async () => { line-height: 1; } -/* 모달 (계좌 관리와 동일 톤) */ -.modal-backdrop { - position: fixed; - inset: 0; - z-index: 1100; - display: flex; - align-items: center; - justify-content: center; - background: rgba(0, 0, 0, 0.5); - padding: 1rem; -} -.modal { - position: relative; - width: 100%; - max-width: 340px; - padding: 1.75rem 1.5rem 1.5rem; - background: var(--color-background); - border: 1px solid var(--color-border); - border-radius: 8px; - box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); -} -.modal .close { - position: absolute; - top: 0.5rem; - right: 0.6rem; - width: 2rem; - height: 2rem; - border: 0; - background: transparent; - font-size: 1.5rem; - line-height: 1; - cursor: pointer; -} -.modal h2 { - margin-bottom: 1rem; - font-size: 1.1rem; - text-align: center; -} .pf-form { display: flex; flex-direction: column; @@ -741,15 +671,6 @@ onMounted(async () => { border-color: hsla(160, 100%, 37%, 1); color: hsla(160, 100%, 37%, 1); } -.fade-enter-active, -.fade-leave-active { - transition: opacity 0.18s ease; -} -.fade-enter-from, -.fade-leave-to { - opacity: 0; -} - /* ===== 모바일: 매매이력 2줄, 글자 세로쪼개짐 방지 ===== */ @media (max-width: 768px) { .hold-row { diff --git a/src/views/account/RecurringView.vue b/src/views/account/RecurringView.vue index 97b41e6..7ac781f 100644 --- a/src/views/account/RecurringView.vue +++ b/src/views/account/RecurringView.vue @@ -3,6 +3,8 @@ import { computed, onMounted, reactive, ref } from 'vue' import { accountApi } from '@/api/accountApi' import { useDialog } from '@/composables/dialog' import IconBtn from '@/components/ui/IconBtn.vue' +import AppModal from '@/components/ui/AppModal.vue' +import CategoryPicker from '@/components/ui/CategoryPicker.vue' const dialog = useDialog() @@ -36,30 +38,25 @@ const submitting = ref(false) const formError = ref(null) const DOW = ['', '월', '화', '수', '목', '금', '토', '일'] -const categoryOptions = computed(() => { - const names = categories.value.filter((c) => c.type === form.type).map((c) => c.name) - if (form.category && !names.includes(form.category)) names.unshift(form.category) - return names -}) -// 대분류로 그룹핑 (소분류=optgroup 옵션 / 자식없는 대분류=단독 옵션) -const categoryGroups = computed(() => { - const list = categories.value.filter((c) => c.type === form.type) - const groups = [] - if (form.category && !list.some((c) => c.name === form.category)) { - groups.push({ key: '_cur', label: null, options: [form.category] }) - } - for (const m of list.filter((c) => c.parentId == null)) { - const children = list.filter((c) => c.parentId === m.id) - if (children.length) groups.push({ key: 'g' + m.id, label: m.name, options: children.map((c) => c.name) }) - else groups.push({ key: 'i' + m.id, label: null, options: [m.name] }) - } - return groups -}) -// 계좌/카드 — 종류(계좌/카드)를 라디오로 고르고, 그 종류만 셀렉트로 노출 + +const TYPES = [ + { value: 'EXPENSE', label: '지출', cls: 'chip-expense' }, + { value: 'INCOME', label: '수입', cls: 'chip-income' }, + { value: 'TRANSFER', label: '이체', cls: 'chip-transfer' }, +] +const FREQS = [ + { value: 'DAILY', label: '매일' }, + { value: 'WEEKLY', label: '매주' }, + { value: 'MONTHLY', label: '매월' }, + { value: 'YEARLY', label: '매년' }, +] + +// 계좌/카드 종류 const WALLET_KINDS = [ - { value: 'BANK', label: '계좌' }, - { value: 'CASH', label: '현금' }, - { value: 'CARD', label: '카드' }, + { value: 'BANK', label: '계좌' }, + { value: 'CASH', label: '현금' }, + { value: 'CARD', label: '카드' }, + { value: 'MINUS', label: '마이너스' }, ] const walletsOfKind = computed(() => wallets.value.filter((w) => w.type === form.walletKind)) const toWalletsOfKind = computed(() => wallets.value.filter((w) => w.type === form.toWalletKind)) @@ -67,16 +64,11 @@ function walletKindOf(id) { const w = wallets.value.find((x) => x.id === id) return w ? w.type : '' } -function onWalletKindChange() { - form.walletId = '' -} -function onToWalletKindChange() { - form.toWalletId = '' -} +function onWalletKindChange() { form.walletId = '' } +function onToWalletKindChange() { form.toWalletId = '' } +function onTypeChange() { form.category = '' } -function won(n) { - return (n ?? 0).toLocaleString('ko-KR') -} +function won(n) { return (n ?? 0).toLocaleString('ko-KR') } function typeLabel(t) { return t === 'INCOME' ? '수입' : t === 'TRANSFER' ? '이체' : '지출' } @@ -87,18 +79,16 @@ function freqLabel(r) { return `매년 ${r.monthOfYear}/${r.dayOfMonth}` } -// 결제일 정렬 키 (작을수록 먼저): 매일<매주(요일)<매월(일) / 매년(월·일) function payKey(r) { if (r.frequency === 'DAILY') return 0 if (r.frequency === 'WEEKLY') return r.dayOfWeek || 0 if (r.frequency === 'YEARLY') return (r.monthOfYear || 0) * 100 + (r.dayOfMonth || 0) - return r.dayOfMonth || 0 // MONTHLY + return r.dayOfMonth || 0 } -// 월간/년간 분리 → 카테고리별 그룹 → 결제일순 정렬 → 소계·합계 (활성 건만 합산, 중지 건은 표시만) const PERIODS = [ { key: 'MONTH', label: '월간 거래', freqs: ['DAILY', 'WEEKLY', 'MONTHLY'] }, - { key: 'YEAR', label: '년간 거래', freqs: ['YEARLY'] }, + { key: 'YEAR', label: '년간 거래', freqs: ['YEARLY'] }, ] const grouped = computed(() => PERIODS.map((p) => { @@ -111,7 +101,6 @@ const grouped = computed(() => catMap[cat].minKey = Math.min(catMap[cat].minKey, payKey(r)) if (r.active) catMap[cat].subtotal += r.amount || 0 } - // 카테고리 안 항목은 결제일순, 카테고리도 가장 이른 결제일순으로 정렬 const cats = Object.values(catMap) cats.forEach((c) => c.items.sort((a, b) => payKey(a) - payKey(b))) cats.sort((a, b) => a.minKey - b.minKey || a.category.localeCompare(b.category, 'ko')) @@ -119,6 +108,7 @@ const grouped = computed(() => return { ...p, cats, total, count: items.length } }).filter((g) => g.count > 0), ) + function todayStr() { const d = new Date() return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}` @@ -157,7 +147,8 @@ function openCreate() { editId.value = null Object.assign(form, { title: '', type: 'EXPENSE', amount: null, category: '', memo: '', - walletKind: '', walletId: '', toWalletKind: '', toWalletId: '', frequency: 'MONTHLY', dayOfMonth: 1, dayOfWeek: 1, + walletKind: '', walletId: '', toWalletKind: '', toWalletId: '', + frequency: 'MONTHLY', dayOfMonth: 1, dayOfWeek: 1, monthOfYear: 1, startDate: todayStr(), endDate: '', active: true, }) formError.value = null @@ -168,7 +159,8 @@ function openEdit(r) { Object.assign(form, { title: r.title, type: r.type, amount: r.amount, category: r.category || '', memo: r.memo || '', walletKind: walletKindOf(r.walletId), walletId: r.walletId || '', - toWalletKind: walletKindOf(r.toWalletId), toWalletId: r.toWalletId || '', frequency: r.frequency, + toWalletKind: walletKindOf(r.toWalletId), toWalletId: r.toWalletId || '', + frequency: r.frequency, dayOfMonth: r.dayOfMonth || 1, dayOfWeek: r.dayOfWeek || 1, monthOfYear: r.monthOfYear || 1, startDate: r.startDate, endDate: r.endDate || '', active: r.active, }) @@ -178,22 +170,13 @@ function openEdit(r) { async function submit() { formError.value = null - if (!form.title.trim()) { - formError.value = '이름을 입력하세요.' - return - } - if (!form.amount || form.amount <= 0) { - formError.value = '금액을 입력하세요.' - return - } + if (!form.title.trim()) { formError.value = '이름을 입력하세요.'; return } + if (!form.amount || form.amount <= 0) { formError.value = '금액을 입력하세요.'; return } if (form.type === 'TRANSFER' && (!form.walletId || !form.toWalletId || form.walletId === form.toWalletId)) { formError.value = '이체는 서로 다른 출금/입금 계좌를 선택하세요.' return } - if (!form.startDate) { - formError.value = '시작일을 입력하세요.' - return - } + if (!form.startDate) { formError.value = '시작일을 입력하세요.'; return } submitting.value = true const payload = { title: form.title.trim(), @@ -238,7 +221,7 @@ onMounted(load) @@ -391,20 +380,6 @@ onMounted(load) max-width: 640px; margin: 0 auto; } -.head { - display: flex; - align-items: center; - justify-content: space-between; - flex-wrap: wrap; - gap: 0.5rem; -} -.head-actions { - display: flex; - gap: 0.5rem; -} -h1 { - font-size: 1.5rem; -} .hint { font-size: 0.85rem; opacity: 0.7; @@ -424,24 +399,12 @@ button { color: var(--color-text); cursor: pointer; } -button:disabled { - opacity: 0.5; - cursor: not-allowed; -} -button.danger { - border-color: #c0392b; - color: #c0392b; -} -button.primary { - border-color: hsla(160, 100%, 37%, 1); - color: hsla(160, 100%, 37%, 1); -} -.recur-groups { - margin-top: 0.5rem; -} -.period-group { - margin-bottom: 1.5rem; -} +button:disabled { opacity: 0.5; cursor: not-allowed; } +button.danger { border-color: #c0392b; color: #c0392b; } +button.primary { border-color: hsla(160, 100%, 37%, 1); color: hsla(160, 100%, 37%, 1); } + +.recur-groups { margin-top: 0.5rem; } +.period-group { margin-bottom: 1.5rem; } .period-head { display: flex; align-items: baseline; @@ -450,18 +413,9 @@ button.primary { border-bottom: 2px solid var(--color-border); margin-bottom: 0.5rem; } -.period-head h2 { - font-size: 1.1rem; - font-weight: 700; -} -.period-total { - font-size: 0.95rem; - font-weight: 700; - color: hsla(160, 100%, 37%, 1); -} -.cat-group { - margin-bottom: 0.6rem; -} +.period-head h2 { font-size: 1.1rem; font-weight: 700; } +.period-total { font-size: 0.95rem; font-weight: 700; color: hsla(160, 100%, 37%, 1); } +.cat-group { margin-bottom: 0.6rem; } .cat-head { display: flex; align-items: baseline; @@ -470,20 +424,9 @@ button.primary { background: var(--color-background-soft); border-radius: 4px; } -.cat-name { - font-size: 0.88rem; - font-weight: 600; -} -.cat-subtotal { - font-size: 0.82rem; - font-weight: 600; - opacity: 0.8; -} -.recur-list { - list-style: none; - padding-left: 0; - margin: 0; -} +.cat-name { font-size: 0.88rem; font-weight: 600; } +.cat-subtotal { font-size: 0.82rem; font-weight: 600; opacity: 0.8; } +.recur-list { list-style: none; padding-left: 0; margin: 0; } .recur-row { display: flex; align-items: flex-start; @@ -492,104 +435,27 @@ button.primary { padding: 0.7rem 0; border-bottom: 1px solid var(--color-border); } -.info { - flex: 1; - min-width: 0; -} -.recur-row.inactive { - opacity: 0.55; -} -.line1 { - display: flex; - align-items: center; - gap: 0.4rem; -} -.title { - font-weight: 600; -} +.info { flex: 1; min-width: 0; } +.recur-row.inactive { opacity: 0.55; } +.line1 { display: flex; align-items: center; gap: 0.4rem; } +.title { font-weight: 600; } .type-badge { font-size: 0.72rem; border: 1px solid var(--color-border); border-radius: 3px; padding: 0.05rem 0.35rem; } -.type-badge.income { - color: #2e7d32; - border-color: #2e7d32; -} -.type-badge.expense { - color: #c0392b; - border-color: #c0392b; -} -.off { - font-size: 0.72rem; - opacity: 0.6; -} -.sub { - font-size: 0.83rem; - opacity: 0.75; - margin-top: 0.15rem; -} -.next { - font-size: 0.78rem; - opacity: 0.6; - margin-top: 0.1rem; -} -.actions { - display: flex; - gap: 0.4rem; - flex-shrink: 0; -} -.actions button { - padding: 0.2rem 0.55rem; - font-size: 0.82rem; -} -.msg { - margin: 0.75rem 0; -} -.msg.error { - color: #c0392b; -} +.type-badge.income { color: #2e7d32; border-color: #2e7d32; } +.type-badge.expense { color: #c0392b; border-color: #c0392b; } +.off { font-size: 0.72rem; opacity: 0.6; } +.sub { font-size: 0.83rem; opacity: 0.75; margin-top: 0.15rem; } +.next { font-size: 0.78rem; opacity: 0.6; margin-top: 0.1rem; } +.actions { display: flex; gap: 0.4rem; flex-shrink: 0; } +.actions button { padding: 0.2rem 0.55rem; font-size: 0.82rem; } +.msg { margin: 0.75rem 0; } +.msg.error { color: #c0392b; } -/* 모달 */ -.modal-backdrop { - position: fixed; - inset: 0; - z-index: 1000; - display: flex; - align-items: center; - justify-content: center; - background: rgba(0, 0, 0, 0.5); - padding: 1rem; -} -.modal { - position: relative; - width: 100%; - max-width: 360px; - max-height: 90vh; - overflow-y: auto; - padding: 1.75rem 1.5rem 1.5rem; - background: var(--color-background); - border: 1px solid var(--color-border); - border-radius: 8px; - box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); -} -.modal .close { - position: absolute; - top: 0.5rem; - right: 0.6rem; - width: 2rem; - height: 2rem; - border: 0; - background: transparent; - font-size: 1.5rem; - line-height: 1; -} -.modal h2 { - margin-bottom: 1rem; - font-size: 1.2rem; - text-align: center; -} +/* 폼 */ .recur-form { display: flex; flex-direction: column; @@ -601,11 +467,7 @@ button.primary { gap: 0.25rem; font-size: 0.85rem; } -.recur-form label.row { - flex-direction: row; - align-items: center; - gap: 0.4rem; -} +.recur-form label.row { flex-direction: row; align-items: center; gap: 0.4rem; } .recur-form input, .recur-form select { padding: 0.5rem 0.7rem; @@ -614,66 +476,45 @@ button.primary { background: var(--color-background-soft); color: var(--color-text); } -.recur-form label.row input { - padding: 0; -} -/* 계좌/카드 라디오 선택 */ +.recur-form label.row input { padding: 0; } + +/* 배지형 선택 */ .field { display: flex; flex-direction: column; gap: 0.3rem; } -.field-row { +.field-label { font-size: 0.82rem; opacity: 0.7; } +.type-chips, +.wallet-chips { display: flex; - align-items: center; - gap: 0.9rem; -} -.field-label { - font-size: 0.85rem; - flex-shrink: 0; -} -.wallet-radios { - display: flex; - flex: 1; - min-width: 0; flex-wrap: wrap; - gap: 0.4rem 0.9rem; - padding: 0.1rem 0; + gap: 0.35rem; } -.wallet-radios .radio { - display: flex; - flex-direction: row; - align-items: center; - gap: 0.3rem; - font-size: 0.85rem; +.chip { + padding: 0.28rem 0.75rem; + border: 1.5px solid var(--color-border); + border-radius: 100px; + background: var(--color-background-soft); + color: var(--color-text); + font-size: 0.82rem; + font-weight: 500; cursor: pointer; + line-height: 1.4; + transition: border-color 0.12s, background 0.12s, color 0.12s; } -.wallet-radios .radio input { - padding: 0; - width: auto; - margin: 0; -} -.r-issuer { - margin-left: 0.2rem; - font-size: 0.72rem; - opacity: 0.6; -} -.empty-hint { - font-size: 0.78rem; - opacity: 0.6; -} +.chip:disabled { opacity: 0.45; cursor: not-allowed; } +/* 기본 active (계좌/주기) */ +.chip.active { border-color: hsla(160, 100%, 37%, 1); background: hsla(160, 100%, 37%, 1); color: #fff; } +/* 구분 배지 type별 색상 */ +.chip-expense.active { border-color: #c0392b; background: #c0392b; } +.chip-income.active { border-color: #2e7d32; background: #2e7d32; } +.chip-transfer.active { border-color: #1565c0; background: #1565c0; } + .buttons { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.5rem; } -.fade-enter-active, -.fade-leave-active { - transition: opacity 0.18s ease; -} -.fade-enter-from, -.fade-leave-to { - opacity: 0; -}