This commit is contained in:
zhangds 2022-06-24 15:51:32 +08:00
commit bea8c996ff
1 changed files with 37 additions and 6 deletions

View File

@ -253,16 +253,29 @@ export default class adduserinfo extends React.Component {
model2.product_name = cur_product.title
model2.account_type = cur_product.account_type
model2.show_url = picItem ? picItem.pic : ''
const flir = picItem?.describe_url.map((item) => {
return { src: item, name: 'xx' }
const obj1 = []
const obj2 = []
picItem?.describe_url.map((item) => {
obj1.push({
src: item,
name: 'xxx.png',
id: new Date().getTime()
})
model2.describe_url = flir
obj2.push({
url: item,
name: 'xxx.png',
id: new Date().getTime()
})
})
model2.describe_url = obj1
model2.map_product_name = cur_product.title
model2.detail_url = ''
this.setState({ model: model2 })
this.setState({
show_url: picItem ? [{ src: picItem.pic, id: new Date().getTime() }] : []
show_url: picItem ? [{ src: picItem.pic, id: new Date().getTime() }] : [],
productpic: obj2
})
}
onTypeChange(e) {
@ -371,12 +384,20 @@ export default class adduserinfo extends React.Component {
(req, msg) => {
path = req.path
let obj = {
id: files[i].id,
name: files[i].name,
url: path
}
let obj1 = {
name: files[i].name,
src: path,
id: files[i].id
}
const model = this.state.model
model.describe_url.push(obj1)
let arr = this.state.productpic
arr.push(obj)
this.setState({ arr })
this.setState({ productpic: arr, model })
},
(err) => {}
)
@ -409,7 +430,17 @@ export default class adduserinfo extends React.Component {
temp_arr[i] = temp
}
this.setState({ productpic: temp_arr })
let left_temp_arr = temp_arr.map((item) => {
return {
...item,
src: item.url
}
})
let models = this.state.model
models.describe_url = left_temp_arr
this.setState({ model: models })
}
// if(this.mySwiper)
// {
// // this.refs.swiperwrapper
@ -628,7 +659,7 @@ export default class adduserinfo extends React.Component {
this.onUploadChange3(e)
}}
sortable
defaultFileList={this.state.model.describe_url}
fileList={this.state.model.describe_url}
multiple
ref='product_describe'
/>