This commit is contained in:
zhangds 2022-06-24 14:33:34 +08:00
commit c4e6477f17
1 changed files with 17 additions and 6 deletions

View File

@ -255,9 +255,14 @@ export default class adduserinfo extends React.Component {
let picItem = window.goods.find((item) => {
return item.id == cur_product.product_category_id
})
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: '2561a423dsd1231z8r5' })
obj2.push({ url: item, name: '2561a423dsd1231z8r5' })
})
let quantity = this.state.model.quantity
let model2 = {
product_id: cur_product.id,
@ -271,12 +276,12 @@ export default class adduserinfo extends React.Component {
weight: this.state.model.weight,
product_name: cur_product.title,
show_url: picItem ? picItem.pic : '',
describe_url: flir,
describe_url: obj1,
detail_url: '',
map_product_name: cur_product.title,
account_type: cur_product.account_type
}
this.setState({ model: model2 })
this.setState({ model: model2, productpic: obj2 })
}
onTypeChange(e) {
let model2 = this.state.model
@ -348,9 +353,15 @@ export default class adduserinfo extends React.Component {
name: files[i].name,
url: path
}
let obj1 = {
name: files[i].name,
src: path
}
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) => {}
)
@ -604,7 +615,7 @@ export default class adduserinfo extends React.Component {
maxAmount={9}
sortable
onError={this.onUploadError}
defaultFileList={this.state.model.describe_url}
fileList={this.state.model.describe_url}
multiple
onUpload={this.onUpload}
onChange={(e) => {