Commit a9c42920 by wusiyi

fix: 修复扫码后图片展示有误bug

parent 666bd325
...@@ -532,7 +532,7 @@ const podBoxList = computed(() => { ...@@ -532,7 +532,7 @@ const podBoxList = computed(() => {
}) })
const coverImage = ref<string>('') const coverImage = ref<string>('')
watch(coverImage, (value) => { watch(coverImage, (value) => {
console.log('🍉🍉🍉🍉🍉🍉🍉coverImage changed:', value) console.log('🍡🍡🍡🍡🍡coverImage changed:', value)
}) })
let currentCode = '' let currentCode = ''
const tableRef = ref() const tableRef = ref()
...@@ -737,7 +737,7 @@ const renderItemBox = (bool: boolean) => { ...@@ -737,7 +737,7 @@ const renderItemBox = (bool: boolean) => {
currentCode = '' currentCode = ''
} else { } else {
// 切换箱子,默认展示第一张图片 // 切换箱子,默认展示第一张图片
coverImage.value = productList[0]?.previewImgs?.[0]?.url || '' // coverImage.value = productList[0]?.previewImgs?.[0]?.url || ''
} }
podOrderDetailsData.value = data podOrderDetailsData.value = data
...@@ -1000,6 +1000,7 @@ const getPackingData = async (code: string) => { ...@@ -1000,6 +1000,7 @@ const getPackingData = async (code: string) => {
} }
} }
coverImage.value = product.previewImgs?.[0]?.url || '' coverImage.value = product.previewImgs?.[0]?.url || ''
console.log('🍉🍉🍉🍉getPackingData', coverImage.value)
break break
} }
} }
...@@ -1169,8 +1170,10 @@ const initOrderDetailBox = async (type: 'scan' | 'manual' = 'manual') => { ...@@ -1169,8 +1170,10 @@ const initOrderDetailBox = async (type: 'scan' | 'manual' = 'manual') => {
} }
} }
}) })
coverImage.value = if (type !== 'scan') {
podOrderDetailsData.value?.productList?.[0]?.previewImgs?.[0].url || '' coverImage.value =
podOrderDetailsData.value?.productList?.[0]?.previewImgs?.[0].url || ''
}
if ( if (
podOrderDetailsData.value && podOrderDetailsData.value &&
...@@ -1458,6 +1461,7 @@ const handleRowClick = (row: ProductList) => { ...@@ -1458,6 +1461,7 @@ const handleRowClick = (row: ProductList) => {
const handleCurrentChange = (url: string) => { const handleCurrentChange = (url: string) => {
if (url) { if (url) {
coverImage.value = url || '' coverImage.value = url || ''
console.log('🍉🍉🍉🍉handleCurrentChange', coverImage.value)
} }
} }
const warehouseId = ref<string | number>('') const warehouseId = ref<string | number>('')
......
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