Commit de3dccbb by linjinhong

fix:【工厂端】【podcn-待发货】:播种墙打单CB类订单图片不一致#1000641

parent 017d5a98
...@@ -52,6 +52,7 @@ export interface ProductList { ...@@ -52,6 +52,7 @@ export interface ProductList {
variantImage?: string variantImage?: string
podJomallUsNo?: string podJomallUsNo?: string
podJomallCnNo?: string podJomallCnNo?: string
thirdSkuCode?: string
previewImgs?: { sort?: string | number; title?: string; url: string }[] previewImgs?: { sort?: string | number; title?: string; url: string }[]
} }
......
...@@ -463,7 +463,18 @@ watch( ...@@ -463,7 +463,18 @@ watch(
(val) => { (val) => {
if (val && val.productList?.length) if (val && val.productList?.length)
val.productList.forEach((el) => { val.productList.forEach((el) => {
if (!el.previewImgs) el.previewImgs = JSON.parse(el.imageAry || '[]') if (!el.previewImgs) {
if (
el.productMark === 'custom_normal' ||
el.productMark === 'normal'
) {
el.previewImgs = [{ url: el.variantImage || '' }]
} else {
el.previewImgs = el.imageAry
? JSON.parse(el.imageAry)
: [{ url: el.variantImage }]
}
}
}) })
}, },
{ deep: true }, { deep: true },
...@@ -492,7 +503,13 @@ const renderItemBox = (bool: boolean) => { ...@@ -492,7 +503,13 @@ const renderItemBox = (bool: boolean) => {
if (!boxItem) boxItem = { data: { productList: [] } } if (!boxItem) boxItem = { data: { productList: [] } }
const { data } = boxItem const { data } = boxItem
data?.productList?.forEach((el) => { data?.productList?.forEach((el) => {
if (!el.previewImgs) el.previewImgs = JSON.parse(el.imageAry || '[]') if (!el.previewImgs || !el.previewImgs.length) {
if (el.productMark === 'custom_normal' || el.productMark === 'normal') {
el.previewImgs = [{ url: el.variantImage || '' }]
} else {
el.previewImgs = JSON.parse(el.imageAry || '[]')
}
}
}) })
if (!data) { if (!data) {
renderLock = false renderLock = false
...@@ -513,6 +530,7 @@ const renderItemBox = (bool: boolean) => { ...@@ -513,6 +530,7 @@ const renderItemBox = (bool: boolean) => {
} }
} }
if (currentCode) { if (currentCode) {
if (!currentCode.startsWith('JM')) {
const parts = currentCode.split('_') const parts = currentCode.split('_')
currentCode = currentCode =
parts.length > 3 && parts[3].startsWith('CNPSC') parts.length > 3 && parts[3].startsWith('CNPSC')
...@@ -520,8 +538,15 @@ const renderItemBox = (bool: boolean) => { ...@@ -520,8 +538,15 @@ const renderItemBox = (bool: boolean) => {
: parts.length > 1 : parts.length > 1
? parts[1] ? parts[1]
: parts[0] : parts[0]
}
console.log(540, currentCode)
for (const product of productList) { for (const product of productList) {
if (product.podJomallCnNo === currentCode) { if (
product.podJomallCnNo === currentCode ||
product.thirdSkuCode === currentCode
) {
coverImage.value = product.previewImgs?.[0]?.url || '' coverImage.value = product.previewImgs?.[0]?.url || ''
nextTick(() => { nextTick(() => {
tableRef.value?.setCurrentRow(product) tableRef.value?.setCurrentRow(product)
......
...@@ -424,7 +424,10 @@ watch( ...@@ -424,7 +424,10 @@ watch(
if (val && val.productList?.length) if (val && val.productList?.length)
val.productList.forEach((el) => { val.productList.forEach((el) => {
if (!el.previewImgs) { if (!el.previewImgs) {
if (el.productMark === 'custom_normal') { if (
el.productMark === 'custom_normal' ||
el.productMark === 'normal'
) {
el.previewImgs = [{ url: el.variantImage || '' }] el.previewImgs = [{ url: el.variantImage || '' }]
} else { } else {
el.previewImgs = el.imageAry el.previewImgs = el.imageAry
...@@ -456,11 +459,11 @@ const renderItemBox = (bool: boolean) => { ...@@ -456,11 +459,11 @@ const renderItemBox = (bool: boolean) => {
if (!boxItem) boxItem = { data: { productList: [] } } if (!boxItem) boxItem = { data: { productList: [] } }
const { data } = boxItem const { data } = boxItem
data?.productList?.forEach((el) => { data?.productList?.forEach((el) => {
if (!el.previewImgs) { if (!el.previewImgs || !el.previewImgs.length) {
if (el.productMark === 'custom_normal' || el.productMark === 'normal') { if (el.productMark === 'custom_normal' || el.productMark === 'normal') {
el.previewImgs = [{ url: el.variantImage || '' }] el.previewImgs = [{ url: el.variantImage || '' }]
} else { } else {
el.previewImgs = JSON.parse(el.imageAry) el.previewImgs = JSON.parse(el.imageAry || '[]')
} }
} }
}) })
...@@ -483,6 +486,7 @@ const renderItemBox = (bool: boolean) => { ...@@ -483,6 +486,7 @@ const renderItemBox = (bool: boolean) => {
} }
} }
if (currentCode) { if (currentCode) {
if (!currentCode.startsWith('JM')) {
const parts = currentCode.split('_') const parts = currentCode.split('_')
currentCode = currentCode =
parts.length > 3 && parts[3].startsWith('USPSC') parts.length > 3 && parts[3].startsWith('USPSC')
...@@ -490,8 +494,13 @@ const renderItemBox = (bool: boolean) => { ...@@ -490,8 +494,13 @@ const renderItemBox = (bool: boolean) => {
: parts.length > 1 : parts.length > 1
? parts[1] ? parts[1]
: parts[0] : parts[0]
}
console.log(540, currentCode)
for (const product of productList) { for (const product of productList) {
if (product.podJomallUsNo === currentCode) { if (
product.podJomallUsNo === currentCode ||
product.thirdSkuCode === currentCode
) {
coverImage.value = product.previewImgs?.[0]?.url || '' coverImage.value = product.previewImgs?.[0]?.url || ''
console.log(441, coverImage.value) console.log(441, coverImage.value)
......
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