1) 增加图片name

This commit is contained in:
zhangds 2022-06-24 16:00:31 +08:00
parent bea8c996ff
commit 5d76ccdf7a
1 changed files with 8 additions and 7 deletions

View File

@ -259,11 +259,12 @@ export default class adduserinfo extends React.Component {
const obj1 = []
const obj2 = []
if(picItem.describe_url){
picItem?.describe_url.map((item) => {
obj1.push({ src: item, id: '2561a423dsd1231z8r5', type:"add" })
obj2.push({ url: item, id: '2561a423dsd1231z8r5', type:"add" })
obj1.push({ src: item, id: `${new Date().getTime()}`, type:"add", name:`${picItem.name}`})
obj2.push({ url: item, id: `${new Date().getTime()}`, type:"add", name:`${picItem.name}` })
})
}
console.log(" picItem =>", picItem);
let quantity = this.state.model.quantity
@ -323,7 +324,7 @@ export default class adduserinfo extends React.Component {
onUploadChange1(files, e) {
console.log("编辑 ==>files", files)
let arr = _.map(files, (o) => {
return o.name
return o.id
})
if (mySwiper !== 0) {
mySwiper.destroy()
@ -341,7 +342,7 @@ export default class adduserinfo extends React.Component {
//新增
for (let i = 0; i < arr.length; i++) {
let index = this.state.productpic.findIndex((o) => {
return o.name == arr[i]
return o.id == arr[i]
})
if (index < 0) {
let path = ''