Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -1078,10 +1078,24 @@ async function openProductCard(grp1, grp2) {
|
|||||||
|
|
||||||
await ensureProductImage(productCode, colorCode, secondColor)
|
await ensureProductImage(productCode, colorCode, secondColor)
|
||||||
let list = Array.isArray(productImageListByCode.value[listKey]) ? productImageListByCode.value[listKey] : []
|
let list = Array.isArray(productImageListByCode.value[listKey]) ? productImageListByCode.value[listKey] : []
|
||||||
|
console.info('[ProductStockByAttributes][openProductCard] request', {
|
||||||
|
productCode,
|
||||||
|
colorCode,
|
||||||
|
secondColor,
|
||||||
|
listKey,
|
||||||
|
cachedListCount: list.length
|
||||||
|
})
|
||||||
if (!list.length && codeTrim) {
|
if (!list.length && codeTrim) {
|
||||||
try {
|
try {
|
||||||
list = await fetchProductImageList(codeTrim, colorTrim, secondTrim)
|
list = await fetchProductImageList(codeTrim, colorTrim, secondTrim)
|
||||||
productImageListByCode.value[listKey] = list
|
productImageListByCode.value[listKey] = list
|
||||||
|
console.info('[ProductStockByAttributes][openProductCard] refetch', {
|
||||||
|
productCode: codeTrim,
|
||||||
|
dim1: colorTrim,
|
||||||
|
dim3: secondTrim,
|
||||||
|
fetchedCount: list.length,
|
||||||
|
fileNames: list.map((x) => String(x?.file_name || x?.FileName || '').trim()).filter(Boolean)
|
||||||
|
})
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.warn('[ProductStockByAttributes] product card image list refetch failed', {
|
console.warn('[ProductStockByAttributes] product card image list refetch failed', {
|
||||||
code: codeTrim,
|
code: codeTrim,
|
||||||
@@ -1096,6 +1110,13 @@ async function openProductCard(grp1, grp2) {
|
|||||||
list.map((item) => resolveProductImageUrlForCarousel(item))
|
list.map((item) => resolveProductImageUrlForCarousel(item))
|
||||||
)
|
)
|
||||||
const images = imageCandidates.filter((x) => String(x || '').trim() !== '')
|
const images = imageCandidates.filter((x) => String(x || '').trim() !== '')
|
||||||
|
console.info('[ProductStockByAttributes][openProductCard] render', {
|
||||||
|
productCode,
|
||||||
|
colorCode,
|
||||||
|
secondColor,
|
||||||
|
candidateCount: imageCandidates.length,
|
||||||
|
imageCount: images.length
|
||||||
|
})
|
||||||
const uniqueImages = Array.from(new Set(images))
|
const uniqueImages = Array.from(new Set(images))
|
||||||
|
|
||||||
if (!uniqueImages.length) {
|
if (!uniqueImages.length) {
|
||||||
|
|||||||
@@ -950,10 +950,24 @@ async function openProductCard(grp1, grp2) {
|
|||||||
|
|
||||||
await ensureProductImage(productCode, colorCode, secondColor)
|
await ensureProductImage(productCode, colorCode, secondColor)
|
||||||
let list = Array.isArray(productImageListByCode.value[listKey]) ? productImageListByCode.value[listKey] : []
|
let list = Array.isArray(productImageListByCode.value[listKey]) ? productImageListByCode.value[listKey] : []
|
||||||
|
console.info('[ProductStockQuery][openProductCard] request', {
|
||||||
|
productCode,
|
||||||
|
colorCode,
|
||||||
|
secondColor,
|
||||||
|
listKey,
|
||||||
|
cachedListCount: list.length
|
||||||
|
})
|
||||||
if (!list.length && codeTrim) {
|
if (!list.length && codeTrim) {
|
||||||
try {
|
try {
|
||||||
list = await fetchProductImageList(codeTrim, colorTrim, secondTrim)
|
list = await fetchProductImageList(codeTrim, colorTrim, secondTrim)
|
||||||
productImageListByCode.value[listKey] = list
|
productImageListByCode.value[listKey] = list
|
||||||
|
console.info('[ProductStockQuery][openProductCard] refetch', {
|
||||||
|
productCode: codeTrim,
|
||||||
|
dim1: colorTrim,
|
||||||
|
dim3: secondTrim,
|
||||||
|
fetchedCount: list.length,
|
||||||
|
fileNames: list.map((x) => String(x?.file_name || x?.FileName || '').trim()).filter(Boolean)
|
||||||
|
})
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.warn('[ProductStockQuery] product card image list refetch failed', {
|
console.warn('[ProductStockQuery] product card image list refetch failed', {
|
||||||
code: codeTrim,
|
code: codeTrim,
|
||||||
@@ -968,6 +982,13 @@ async function openProductCard(grp1, grp2) {
|
|||||||
list.map((item) => resolveProductImageUrlForCarousel(item))
|
list.map((item) => resolveProductImageUrlForCarousel(item))
|
||||||
)
|
)
|
||||||
const images = imageCandidates.filter((x) => String(x || '').trim() !== '')
|
const images = imageCandidates.filter((x) => String(x || '').trim() !== '')
|
||||||
|
console.info('[ProductStockQuery][openProductCard] render', {
|
||||||
|
productCode,
|
||||||
|
colorCode,
|
||||||
|
secondColor,
|
||||||
|
candidateCount: imageCandidates.length,
|
||||||
|
imageCount: images.length
|
||||||
|
})
|
||||||
const uniqueImages = Array.from(new Set(images))
|
const uniqueImages = Array.from(new Set(images))
|
||||||
|
|
||||||
if (!uniqueImages.length) {
|
if (!uniqueImages.length) {
|
||||||
|
|||||||
Reference in New Issue
Block a user