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