From fa2af2981e8e0cc264a73e8588a0be8619a95b78 Mon Sep 17 00:00:00 2001 From: wangsongsole Date: Mon, 18 Jul 2022 10:11:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=95=86=E5=93=81=E5=9B=BE?= =?UTF-8?q?=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/exchangecode/product/add.js | 13 ++++++++----- src/pages/plan/product/add.js | 14 +++++++++----- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/pages/exchangecode/product/add.js b/src/pages/exchangecode/product/add.js index 94d78d77..5b4ccd5d 100644 --- a/src/pages/exchangecode/product/add.js +++ b/src/pages/exchangecode/product/add.js @@ -257,22 +257,25 @@ export default class adduserinfo extends React.Component { let picItem = window.goods.find((item) => { return item.id == cur_product.product_category_id }) - console.log(picItem) + + const productItem = picItem.products.find( + (item) => item.id == cur_product.id + ) + const obj1 = [] const obj2 = [] - - picItem?.describe_url.map((item, index) => { + productItem?.pic.map((item, index) => { obj1.push({ src: item, id: item, type: 'add', - name: picItem.name + index + name: productItem.title + index }) obj2.push({ url: item, id: item, type: 'add', - name: picItem.name + index + name: productItem.title + index }) }) console.log(' picItem =>', picItem) diff --git a/src/pages/plan/product/add.js b/src/pages/plan/product/add.js index 189dded4..31ffc251 100644 --- a/src/pages/plan/product/add.js +++ b/src/pages/plan/product/add.js @@ -256,16 +256,20 @@ export default class adduserinfo extends React.Component { const obj1 = [] const obj2 = [] - picItem?.describe_url.map((item, index) => { + const productItem = picItem.products.find( + (item) => item.id == cur_product.id + ) + + productItem?.pic.map((item, index) => { obj1.push({ src: item, - name: item + index, - id: item + id: item, + name: productItem.title + index }) obj2.push({ url: item, - name: item + index, - id: item + id: item, + name: productItem.title + index }) }) model2.describe_url = obj1