v2026.05.19-01 가격 확인·제품 상태 필드 및 별 표시
실제 확인한 가격은 ⭐로 표시하고, 개봉/미개봉 상태를 목록·상세·DB에 반영했다. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -2,6 +2,9 @@ import NSW_DB from '../db/nsw.resale.db.js';
|
||||
|
||||
const SHOW_RECOMMENDED_PRICE_RANGE_BY_DEFAULT = false;
|
||||
|
||||
/** @type {string} 가격 확인 완료 표시 */
|
||||
const VERIFIED_PRICE_MARK = '⭐';
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
// URL에서 게임 번호 가져오기
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
@@ -33,10 +36,12 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
cero: '심의 등급',
|
||||
iarc: '심의 등급',
|
||||
releaseDate: '출시일',
|
||||
suggestedPrice: '추천 판매가',
|
||||
suggestedPrice: '판매가',
|
||||
priceRange: '판매가 범위',
|
||||
pricingBasis: '가격 참고 기준',
|
||||
checkedAt: '기준일',
|
||||
itemCondition: '제품 상태',
|
||||
priceVerified: '가격 확인',
|
||||
extension: '추가 콘텐츠',
|
||||
none: '없음',
|
||||
supported: '대응',
|
||||
@@ -61,6 +66,8 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
priceRange: '価格帯',
|
||||
pricingBasis: '価格参考基準',
|
||||
checkedAt: '確認日',
|
||||
itemCondition: '商品状態',
|
||||
priceVerified: '価格確認',
|
||||
extension: '追加コンテンツ',
|
||||
none: 'なし',
|
||||
supported: '対応',
|
||||
@@ -94,6 +101,30 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
return labels[language][pricingBasis] || '';
|
||||
}
|
||||
|
||||
function formatItemCondition(itemCondition) {
|
||||
if (!itemCondition) {
|
||||
return language === 'ko' ? '미정' : '未設定';
|
||||
}
|
||||
|
||||
const labels = {
|
||||
ko: {
|
||||
SEALED: '미개봉',
|
||||
OPENED: '개봉',
|
||||
},
|
||||
ja: {
|
||||
SEALED: '未開封',
|
||||
OPENED: '開封済',
|
||||
},
|
||||
};
|
||||
|
||||
return labels[language][itemCondition] || itemCondition;
|
||||
}
|
||||
|
||||
function formatPriceVerified(priceVerified) {
|
||||
if (!priceVerified) return '';
|
||||
return language === 'ko' ? '실제 시세 확인 완료' : '実勢価格確認済み';
|
||||
}
|
||||
|
||||
function convertLanguage(value) {
|
||||
if (!value || language !== 'ko') return value;
|
||||
|
||||
@@ -214,8 +245,11 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
|
||||
// 기본 정보 설정
|
||||
document.getElementById('gameImage').src = window.innerWidth < 640 ? game.thumbnail : game.image;
|
||||
document.getElementById('gameTitle').textContent =
|
||||
language === 'ko' ? game.koTitle || game.title : game.title;
|
||||
const displayTitle = language === 'ko' ? game.koTitle || game.title : game.title;
|
||||
const gameTitleEl = document.getElementById('gameTitle');
|
||||
gameTitleEl.className =
|
||||
'text-3xl font-bold tracking-tight text-gray-900 sm:text-4xl flex items-center justify-center gap-2';
|
||||
gameTitleEl.innerHTML = `${game.sale?.priceVerified ? VERIFIED_PRICE_MARK : ''}<span>${game.no}. ${displayTitle}</span>`;
|
||||
document.getElementById('gameTags').textContent = convertTags(game.tags);
|
||||
document.getElementById('infoTitle').textContent = currentTexts.infoTitle;
|
||||
document.getElementById('purchaseTitle').textContent = currentTexts.purchaseTitle;
|
||||
@@ -294,6 +328,8 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
? [{ value: priceRange, label: currentTexts.priceRange }]
|
||||
: []),
|
||||
{ value: formatPricingBasis(game.sale.pricingBasis), label: currentTexts.pricingBasis },
|
||||
{ value: formatItemCondition(game.itemCondition), label: currentTexts.itemCondition },
|
||||
{ value: formatPriceVerified(game.sale.priceVerified), label: currentTexts.priceVerified },
|
||||
{ value: game.sale.checkedAt, label: currentTexts.checkedAt },
|
||||
];
|
||||
|
||||
|
||||
@@ -3,6 +3,9 @@ import NSW_DB from '../db/nsw.resale.db.js';
|
||||
const SHOW_SOLD_BY_DEFAULT = false;
|
||||
const SHOW_RECOMMENDED_PRICE_RANGE_BY_DEFAULT = false;
|
||||
|
||||
/** @type {string} 가격 확인 완료 표시 */
|
||||
const VERIFIED_PRICE_MARK = '⭐ ';
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const gameList = document.getElementById('gameList');
|
||||
const gameCount = document.getElementById('gameCount');
|
||||
@@ -24,6 +27,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
info: '판매가',
|
||||
status: '판매 상태',
|
||||
role: '가격 범위',
|
||||
itemCondition: '제품 상태',
|
||||
location: '지역',
|
||||
},
|
||||
sortOptions: {
|
||||
@@ -54,6 +58,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
info: '販売価格',
|
||||
status: '販売状態',
|
||||
role: '価格帯',
|
||||
itemCondition: '商品状態',
|
||||
location: '地域',
|
||||
},
|
||||
sortOptions: {
|
||||
@@ -104,10 +109,12 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
headers[0].textContent = texts.tableHeaders.title;
|
||||
headers[1].textContent = texts.tableHeaders.info;
|
||||
headers[2].textContent = texts.tableHeaders.status;
|
||||
headers[3].textContent = texts.tableHeaders.role;
|
||||
headers[3].textContent = SHOW_RECOMMENDED_PRICE_RANGE_BY_DEFAULT
|
||||
? texts.tableHeaders.role
|
||||
: texts.tableHeaders.itemCondition;
|
||||
headers[4].textContent = texts.tableHeaders.location;
|
||||
headers[3].classList.toggle('sm:table-cell', SHOW_RECOMMENDED_PRICE_RANGE_BY_DEFAULT);
|
||||
headers[3].classList.toggle('sm:hidden', !SHOW_RECOMMENDED_PRICE_RANGE_BY_DEFAULT);
|
||||
headers[3].classList.add('sm:table-cell');
|
||||
headers[3].classList.remove('sm:hidden');
|
||||
|
||||
// 로딩 텍스트 업데이트
|
||||
loading.textContent = texts.loading;
|
||||
@@ -597,9 +604,29 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
formattedPricingBasis: formatPricingBasis(game.sale?.pricingBasis),
|
||||
formattedConfidenceDescription: formatConfidenceDescription(game.sale?.confidence),
|
||||
formattedSaleStatus: formatSaleStatus(game.status),
|
||||
formattedItemCondition: formatItemCondition(game.itemCondition),
|
||||
};
|
||||
}
|
||||
|
||||
function formatItemCondition(itemCondition) {
|
||||
if (!itemCondition) {
|
||||
return filterState.language === 'ko' ? '미정' : '未設定';
|
||||
}
|
||||
|
||||
const labels = {
|
||||
ko: {
|
||||
SEALED: '미개봉',
|
||||
OPENED: '개봉',
|
||||
},
|
||||
ja: {
|
||||
SEALED: '未開封',
|
||||
OPENED: '開封済',
|
||||
},
|
||||
};
|
||||
|
||||
return labels[filterState.language][itemCondition] || itemCondition;
|
||||
}
|
||||
|
||||
function formatKRW(value) {
|
||||
if (typeof value !== 'number') return '';
|
||||
return `${value.toLocaleString('ko-KR')}원`;
|
||||
@@ -667,6 +694,17 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
}
|
||||
}
|
||||
|
||||
function getItemConditionClass(itemCondition) {
|
||||
switch (itemCondition) {
|
||||
case 'SEALED':
|
||||
return 'bg-amber-100 text-amber-800';
|
||||
case 'OPENED':
|
||||
return 'bg-slate-100 text-slate-700';
|
||||
default:
|
||||
return 'bg-gray-100 text-gray-500';
|
||||
}
|
||||
}
|
||||
|
||||
function getCountryClass(country) {
|
||||
return country === 'JPN'
|
||||
? 'text-red-600 hover:text-red-900'
|
||||
@@ -689,8 +727,8 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
<img class="h-10 w-10 rounded-xl object-cover" src="${game.thumbnail}" alt="" />
|
||||
</div>
|
||||
<div class="ml-4 min-w-0 flex-1">
|
||||
<div class="font-medium leading-5 text-gray-900">
|
||||
${game.no}. ${game.formattedTitle}
|
||||
<div class="font-medium leading-5 text-gray-900 flex items-center gap-1">
|
||||
${game.sale?.priceVerified ? VERIFIED_PRICE_MARK : ''}<span>${game.no}. ${game.formattedTitle}</span>
|
||||
</div>
|
||||
<div class="mt-1 max-w-lg text-xs leading-5 text-gray-500">
|
||||
${game.formattedConfidenceDescription}
|
||||
@@ -705,6 +743,11 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
)}">
|
||||
${game.formattedSaleStatus}
|
||||
</span>
|
||||
<span class="rounded-full px-2 text-xs font-semibold leading-5 ${getItemConditionClass(
|
||||
game.itemCondition,
|
||||
)}">
|
||||
${game.formattedItemCondition}
|
||||
</span>
|
||||
</div>
|
||||
<div class="text-xs leading-5 text-gray-500">
|
||||
${game.formattedPricingBasis}
|
||||
@@ -740,7 +783,13 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
<div class="whitespace-nowrap text-gray-900">${game.formattedPriceRange || '-'}</div>
|
||||
<div class="mt-1 line-clamp-2 text-xs text-gray-400">${game.sale?.checkedAt || ''}</div>
|
||||
</td>`
|
||||
: ''
|
||||
: `<td class="hidden w-28 px-3 py-4 text-sm text-gray-500 sm:table-cell">
|
||||
<div class="flex justify-center whitespace-nowrap rounded-full px-2 text-xs font-semibold leading-5 ${getItemConditionClass(
|
||||
game.itemCondition,
|
||||
)}">
|
||||
${game.formattedItemCondition}
|
||||
</div>
|
||||
</td>`
|
||||
}
|
||||
<td class="hidden py-4 pl-3 pr-4 text-right text-sm font-medium sm:table-cell">
|
||||
<div class="${getCountryClass(game.country)}">
|
||||
|
||||
Reference in New Issue
Block a user