修复商品图片编辑不能删除

This commit is contained in:
wangsongsole 2022-07-15 11:49:19 +08:00
parent c81a0e4683
commit 470f85e40d
2 changed files with 5 additions and 4 deletions

View File

@ -112,15 +112,16 @@ export default class adduserinfo extends React.Component {
for (let i = 0; i < pics.length; i++) { for (let i = 0; i < pics.length; i++) {
let obj = {} let obj = {}
let nameArr = pics[i].split('/') let nameArr = pics[i].split('/')
obj.name = nameArr[5] || nameArr[2] obj.name = nameArr[5] + i || nameArr[2] + i
obj.src = pics[i] obj.src = pics[i]
defaultPic.push(obj) defaultPic.push(obj)
let obj2 = { let obj2 = {
name: nameArr[5] || nameArr[2], name: nameArr[5] + i || nameArr[2] + i,
url: pics[i] url: pics[i]
} }
temp_productpic.push(obj2) temp_productpic.push(obj2)
} }
this.setState({ temp_productpic }) this.setState({ temp_productpic })
model.describe_url = defaultPic model.describe_url = defaultPic
model.stock = model_temp.stock model.stock = model_temp.stock

View File

@ -104,11 +104,11 @@ export default class adduserinfo extends React.Component {
for (let i = 0; i < pics.length; i++) { for (let i = 0; i < pics.length; i++) {
let obj = {} let obj = {}
let nameArr = pics[i].split('/') let nameArr = pics[i].split('/')
obj.name = nameArr[5] || nameArr[2] obj.name = nameArr[5] + i || nameArr[2] + i
obj.src = pics[i] obj.src = pics[i]
defaultPic.push(obj) defaultPic.push(obj)
let obj2 = { let obj2 = {
name: nameArr[5] || nameArr[2], name: nameArr[5] + i || nameArr[2] + i,
url: pics[i] url: pics[i]
} }
temp_productpic.push(obj2) temp_productpic.push(obj2)