Merge remote-tracking branch 'origin/master'

This commit is contained in:
M_Kececi
2026-03-15 22:28:25 +03:00
parent 7e98ea66d2
commit f08bbd5e28
2 changed files with 18 additions and 14 deletions

View File

@@ -483,6 +483,7 @@ function resolvePhotoDim1ID(item) {
item?.ItemDim1Code,
item?.itemDim1Code,
item?.ITEMDIM1CODE,
item?.Beden,
item?.RenkID,
item?.Renk_Id
]
@@ -497,7 +498,8 @@ function resolvePhotoDim3ID(item) {
const candidates = [
item?.ItemDim3Code,
item?.itemDim3Code,
item?.ITEMDIM3CODE
item?.ITEMDIM3CODE,
item?.Renk2
]
for (const value of candidates) {
const s = String(value || '').trim()
@@ -567,8 +569,6 @@ function resolveProductImageUrl(item) {
async function resolveProductImageUrlForCarousel(item) {
const resolved = resolveProductImageUrl(item)
const publicUrl = String(resolved.publicUrl || '').trim()
if (publicUrl) return publicUrl
const contentUrl = String(resolved.contentUrl || '').trim()
if (contentUrl) {
try {
@@ -583,7 +583,8 @@ async function resolveProductImageUrlForCarousel(item) {
// fall through to public url
}
}
return String(contentUrl || '').trim()
const publicUrl = String(resolved.publicUrl || '').trim()
return String(publicUrl || contentUrl || '').trim()
}
function getProductImageUrl(code, color, secondColor = '', dim1Id = '', dim3Id = '') {
@@ -653,8 +654,8 @@ async function ensureProductImage(code, color, secondColor = '', dim1Id = '', di
const first = list[0] || null
const resolved = resolveProductImageUrl(first)
productImageCache.value[key] = resolved.publicUrl || resolved.contentUrl || ''
productImageFallbackByKey.value[key] = resolved.publicUrl ? '' : (resolved.contentUrl || '')
productImageCache.value[key] = resolved.contentUrl || resolved.publicUrl || ''
productImageFallbackByKey.value[key] = resolved.contentUrl || ''
} catch (err) {
console.warn('[ProductStockQuery] product image fetch failed', { code, color, err })
productImageCache.value[key] = ''
@@ -1027,7 +1028,8 @@ async function openProductCard(grp1, grp2) {
colorCode,
secondColor,
candidateCount: imageCandidates.length,
imageCount: images.length
imageCount: images.length,
firstImages: images.slice(0, 3)
})
const uniqueImages = Array.from(new Set(images))