Commit 9ac27630 by linjinhong

fix:修改工厂端cn跟us生产订单展示页面 产品图片展示问题

parent fc14f49b
......@@ -1177,10 +1177,15 @@
</template>
<template v-else>
<img
:src="item.variantImage"
:src="getNewImageFn(item.variantImage)"
alt="商品图片"
style="cursor: pointer"
@click="handlePictureCardPreview(item.variantImage)"
@click="
handlePictureCardPreview(
item.variantImage,
'variantImage',
)
"
/>
<div class="triangle-container-wrap">
<div class="triangle-container">
......@@ -5792,8 +5797,11 @@ const handleMark = (mark: string) => {
const dialogVisible = ref(false)
const dialogImageUrl = ref('')
const handlePictureCardPreview = (fileUrl: string) => {
const handlePictureCardPreview = (fileUrl: string, type?: string) => {
dialogImageUrl.value = fileUrl
if (type == 'variantImage')
dialogImageUrl.value = getNewImageFn(fileUrl) as string
dialogVisible.value = true
}
// 全局 loading 改为每行 loading map
......@@ -5826,6 +5834,16 @@ const handleStockOut = async (row: PodCnOrderListData) => {
})
}
const getNewImageFn = (img: string) => {
try {
if (img.startsWith('http')) return img
if (img.startsWith('/')) return `https://img.jomalls.com/upload/erp${img}`
return `https://image.jomalls.com/${img}`
} catch (error) {
console.log(error)
}
}
useRouter().beforeEach((to, from, next) => {
handleBeforeRouteLeave(to, from, next)
})
......
......@@ -1260,10 +1260,15 @@
</template>
<template v-else>
<img
:src="item.variantImage"
:src="getNewImageFn(item.variantImage)"
alt="商品图片"
style="cursor: pointer"
@click="handlePictureCardPreview(item.variantImage)"
@click="
handlePictureCardPreview(
item.variantImage,
'variantImage',
)
"
/>
<div class="triangle-container-wrap">
<div class="triangle-container">
......@@ -6574,8 +6579,11 @@ function getQuantityText(qty: number) {
const dialogVisible = ref(false)
const dialogImageUrl = ref('')
const handlePictureCardPreview = (fileUrl: string) => {
const handlePictureCardPreview = (fileUrl: string, type?: string) => {
dialogImageUrl.value = fileUrl
if (type == 'variantImage')
dialogImageUrl.value = getNewImageFn(fileUrl) as string
dialogVisible.value = true
}
// 全局 loading 改为每行 loading map
......@@ -6816,6 +6824,16 @@ const globalProperties =
getCurrentInstance()?.appContext.config.globalProperties // 获取全局挂载
const isPermissionBtn = globalProperties?.$isPermissionBtn
const getNewImageFn = (img: string) => {
try {
if (img.startsWith('http')) return img
if (img.startsWith('/')) return `https://img.jomalls.com/upload/erp${img}`
return `https://image.jomalls.com/${img}`
} catch (error) {
console.log(error)
}
}
useRouter().beforeEach((to, from, next) => {
handleBeforeRouteLeave(to, from, next)
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment