From 81236ab66b40649ccccea1b666b63563932656ea Mon Sep 17 00:00:00 2001 From: wangsongsole Date: Fri, 24 Jun 2022 14:33:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=85=91=E6=8D=A2=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/exchangecode/product/add.js | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/pages/exchangecode/product/add.js b/src/pages/exchangecode/product/add.js index 10aa5fa7..34027557 100644 --- a/src/pages/exchangecode/product/add.js +++ b/src/pages/exchangecode/product/add.js @@ -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) => {