Commit e8c20cc3 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix: 处理新增商品直接点图片上传页面异常问题

parent cae4295a
......@@ -209,7 +209,8 @@ const ProductImageForm: React.FC<{}> = (props) => {
uploadFileSelectRef.current = {}
}
setCommonImageList(fileList)
// @5.10 commodityPic字段异常 表明前面商品信息未完善 使用trycatch捕获
try {
_priceAttributeParams[index||editRowIndexRef.current].commodityPic = fileList
if(!file?.status && file?.status !== 'done'){
let ttt = _priceAttributeParams[index||editRowIndexRef.current].commodityPic.filter(_ => _.status === 'done')
......@@ -220,6 +221,10 @@ const ProductImageForm: React.FC<{}> = (props) => {
setProductAttributeAndImageParams(_priceAttributeParams)
// 保留上传的数据在页面状态 用于处理前面价格变动后不重新更新图片数据
setMaintainImageData(_priceAttributeParams.map(item => item.commodityPic))
} catch(error) {
console.log(error)
// message.error('请先完善前面商品相关信息')
}
}
const onChangeSetImageType = (e) => {
......
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