Commit c8d0655b by wusiyi

fix: 修复单件打单主图不显示问题

parent 96bf93d4
......@@ -978,24 +978,36 @@ const getPackingData = async (code: string) => {
boxIndex.value = box as number
if (boxIndex.value == 0) {
podOrderDetailsData.value = data as OrderData
const orderData = data as OrderData
orderData.productList?.forEach((el) => {
if (!el.previewImgs || !el.previewImgs.length) {
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 }]
}
}
})
podOrderDetailsData.value = orderData
podOrderDetailsData.value.fromUser = userStore.user?.id
if (podOrderDetailsData.value.productList?.length) {
const list = podOrderDetailsData.value.productList
coverImage.value = list[0].imageAry
? JSON.parse(list[0].imageAry)[0].url
: list[0].variantImage
const list = podOrderDetailsData.value.productList
if (list?.length) {
await nextTick()
tableRef.value?.setCurrentRow(list[0])
coverImage.value = list[0].previewImgs?.[0]?.url || ''
for (const product of list) {
if (product.count === product.purchaseNumber) {
product.power = true
print(data as OrderData, false, () => {
print(orderData, false, () => {
renderLock = false
})
}
}
nextTick(() => {
tableRef.value?.setCurrentRow(list[0])
})
}
}
} catch (error) {
......
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