|
@@ -431,26 +431,15 @@ const sliceImage = (urlString: string, width: number, height = width) => {
|
|
|
const extractedString = urlString.replace(/^https?:\/\/[^/]+/, '')
|
|
|
const resizedImageUrl = `https://mediahub.promocollection.com.au/fit-in/${width}x${height}${extractedString}`
|
|
|
return resizedImageUrl
|
|
|
- } else {
|
|
|
- return ''
|
|
|
}
|
|
|
}
|
|
|
-const formatURL = (url: string) => {
|
|
|
- console.log(url, 'url')
|
|
|
- return url.length
|
|
|
- ? url
|
|
|
- .replace('.JPG', '.jpg')
|
|
|
- .replace('.PNG', '.png')
|
|
|
- .replace('.JPEG', '.jpeg')
|
|
|
- : ''
|
|
|
-}
|
|
|
|
|
|
const mainPicture = computed(() => {
|
|
|
if (
|
|
|
Array.isArray(productInfo.product_image) &&
|
|
|
productInfo.product_image.length
|
|
|
) {
|
|
|
- return formatURL(productInfo.product_image[0] || '')
|
|
|
+ return productInfo.product_image[0]
|
|
|
}
|
|
|
return ''
|
|
|
})
|
|
@@ -459,7 +448,7 @@ const mainPicture2 = computed(() => {
|
|
|
Array.isArray(productInfo.product_image) &&
|
|
|
productInfo.product_image.length
|
|
|
) {
|
|
|
- return formatURL(sliceImage(productInfo.product_image[0], 1000))
|
|
|
+ return sliceImage(productInfo.product_image[0], 1000)
|
|
|
}
|
|
|
return ''
|
|
|
})
|
|
@@ -468,7 +457,7 @@ const otherPicture = computed(() => {
|
|
|
Array.isArray(productInfo.product_image) &&
|
|
|
productInfo.product_image.length > 1
|
|
|
) {
|
|
|
- return productInfo.product_image.slice(1).map((i:string) => formatURL(i))
|
|
|
+ return productInfo.product_image.slice(1)
|
|
|
}
|
|
|
return []
|
|
|
})
|
|
@@ -479,7 +468,7 @@ const otherPicture2 = computed(() => {
|
|
|
) {
|
|
|
return productInfo.product_image
|
|
|
.slice(1)
|
|
|
- .map((i: string) => formatURL(sliceImage(i, 1000)))
|
|
|
+ .map((i: string) => sliceImage(i, 1000))
|
|
|
}
|
|
|
return []
|
|
|
})
|