bugfix: 没有产品主图时自动选中问题
This commit is contained in:
@@ -313,10 +313,6 @@
|
||||
if (videoItem) listing.prodImageList.push(videoItem)
|
||||
})
|
||||
|
||||
if (!listing.mainProductImage) {
|
||||
listing.mainProductImage =
|
||||
listing.prodImageList.find((item) => item.selected && !item.isVideo)?.url || ""
|
||||
}
|
||||
if (coverFromImageUrl) {
|
||||
listing.coverFrom = resolveCoverSourceFromImageUrl(coverFromImageUrl, listing)
|
||||
}
|
||||
@@ -324,11 +320,7 @@
|
||||
const mainProductIndex = listing.prodImageList.findIndex(
|
||||
(item) => !item.isVideo && item.url === listing.mainProductImage
|
||||
)
|
||||
const selectedIndex =
|
||||
mainProductIndex === -1
|
||||
? listing.prodImageList.findIndex((item) => item.selected && !item.isVideo)
|
||||
: mainProductIndex
|
||||
listing.firstSelectedIndex = selectedIndex === -1 ? null : selectedIndex
|
||||
listing.firstSelectedIndex = mainProductIndex === -1 ? null : mainProductIndex
|
||||
|
||||
listing.productImage = listing.prodImageList.map((item) => item.url)
|
||||
listing.apparelSketch = listing.sketchList
|
||||
|
||||
Reference in New Issue
Block a user