97 lines
4.0 KiB
JavaScript
97 lines
4.0 KiB
JavaScript
/** 상품 목록·필터·모달 관련 상수 */
|
|
|
|
export const ITEMS_PER_PAGE = 20;
|
|
|
|
// export const VISIBILITY_CONFIG = {
|
|
// showUnlisted: false,
|
|
// showSold: true,
|
|
// };
|
|
|
|
export const SORT_CONFIG = {
|
|
PUSH_SOLD_OUT_TO_END: false, // 판매완료를 뒤로 보낼지 여부 (테스트 시 false)
|
|
PUSH_NON_SALE_TO_END: false, // 미판매를 뒤로 보낼지 여부 (테스트 시 false)
|
|
};
|
|
|
|
export const STATUS_META = {
|
|
미판매: {
|
|
selectable: false, // 체크박스 선택 불가
|
|
isDefaultActive: false, // 초기 로드 시 미체크 상태
|
|
isSystemVisible: true, // 아예 리스트/필터에서 제외 (완전 숨김)
|
|
soldOut: false,
|
|
},
|
|
판매예정: {
|
|
selectable: false,
|
|
isDefaultActive: true,
|
|
isSystemVisible: true,
|
|
soldOut: false,
|
|
},
|
|
판매중: {
|
|
selectable: true,
|
|
isDefaultActive: true,
|
|
isSystemVisible: true,
|
|
soldOut: false,
|
|
},
|
|
판매완료: {
|
|
selectable: false,
|
|
isDefaultActive: false, // 초기에는 안 보이지만, 사용자가 필터 클릭하면 보임
|
|
isSystemVisible: true,
|
|
soldOut: true,
|
|
},
|
|
};
|
|
|
|
// STATUS_FILTERS를 수동으로 만들지 않고 META에서 자동으로 생성합니다.
|
|
export const STATUS_FILTERS = Object.keys(STATUS_META)
|
|
.filter(key => STATUS_META[key].isSystemVisible) // 시스템 가시성이 true인 것만 필터 칩 생성
|
|
.map(key => ({
|
|
key: key,
|
|
label: key === '판매예정' ? '판매 예정' : key,
|
|
defaultActive: STATUS_META[key].isDefaultActive
|
|
}));
|
|
|
|
export const STATUS_ORDER = {
|
|
판매중: 0,
|
|
판매예정: 1,
|
|
미판매: 2,
|
|
판매완료: 3,
|
|
};
|
|
|
|
export const STATUS_COLOR = {
|
|
판매중: 'bg-primary/10 text-primary border-primary/30',
|
|
판매예정: 'bg-amber-400/10 text-amber-600 border-amber-400/30',
|
|
판매완료: 'bg-slate-400/10 text-slate-500 border-slate-400/30',
|
|
미판매: 'bg-slate-200/10 text-slate-400 border-slate-300/30',
|
|
};
|
|
|
|
/** 모달 커스텀 태그(customTag) 키워드별 뱃지 스타일 */
|
|
export const TAG_STYLES = {
|
|
완전생산한정판: 'bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400',
|
|
특전포함: 'bg-pink-100 text-pink-700 dark:bg-pink-900/30 dark:text-pink-400',
|
|
미개봉: 'bg-orange-100 text-orange-700 dark:bg-orange-900/30 dark:text-orange-400',
|
|
무료배송: 'bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400',
|
|
풀윤활완료: 'bg-emerald-100 text-emerald-700 dark:bg-emerald-900/30 dark:text-emerald-400',
|
|
급매: 'bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400',
|
|
정품: 'bg-sky-100 text-sky-700 dark:bg-sky-900/30 dark:text-sky-400',
|
|
풀옵션: 'bg-teal-100 text-teal-700 dark:bg-teal-900/30 dark:text-teal-400',
|
|
};
|
|
|
|
export const TAG_DEFAULT_STYLE = 'bg-indigo-100 text-indigo-700 dark:bg-indigo-900/30 dark:text-indigo-400';
|
|
|
|
export const SEARCH_CONFIG = {
|
|
USE_TITLE: true, // 상품명 검색
|
|
USE_CUSTOM_TAG: true, // 커스텀 태그 검색
|
|
USE_TAGS: true, // 태그 배열 검색
|
|
USE_DESCRIPTION: true, // 요약 설명 검색
|
|
USE_FULL_DESCRIPTION: false, // 상세 설명 배열 검색
|
|
};
|
|
|
|
/** 상품 컨디션(specs.condition) 정의 */
|
|
export const PRODUCT_CONDITIONS = {
|
|
BRAND_NEW: { label: 'Brand New (미개봉)', color: 'text-emerald-600', level: 'S' },
|
|
LIKE_NEW: { label: 'Like New (단순개봉)', color: 'text-blue-600', level: 'A+' },
|
|
EXCELLENT: { label: 'Excellent (최상급)', color: 'text-sky-600', level: 'A' },
|
|
GOOD: { label: 'Good (보통/사용감)', color: 'text-slate-600', level: 'B' },
|
|
INCOMPLETE: { label: 'Incomplete (구성품 누락)', color: 'text-amber-600', level: 'C' },
|
|
DAMAGED: { label: 'Damaged (하자/파손)', color: 'text-orange-600', level: 'D' },
|
|
JUNK: { label: 'Junk (동작불가/부품용)', color: 'text-red-600', level: 'F' },
|
|
OTHER: { label: '기타 (상세설명 참고)', color: 'text-indigo-600', level: '-' }
|
|
}; |