From 77f9accc648a1149c7745ce0d3df5fca559c1ec4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Sat, 22 Jan 2022 14:20:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/exchangecode/add/add.js | 5 ++--- src/pages/exchangecode/product/add.js | 29 ++++++++++++++++++++++----- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/src/pages/exchangecode/add/add.js b/src/pages/exchangecode/add/add.js index d9f15e5b..707bbd93 100644 --- a/src/pages/exchangecode/add/add.js +++ b/src/pages/exchangecode/add/add.js @@ -515,8 +515,7 @@ export default class acclist extends React.Component{ Notify.success("成功发起审批"); setTimeout(()=>{ - - this.props.history.push('/home/key-list/'); + this.props.history.push('/home/key-list/'); },2000) },(err)=>{ @@ -1182,7 +1181,7 @@ export default class acclist extends React.Component{ diff --git a/src/pages/exchangecode/product/add.js b/src/pages/exchangecode/product/add.js index 6baf1078..ad320402 100644 --- a/src/pages/exchangecode/product/add.js +++ b/src/pages/exchangecode/product/add.js @@ -79,17 +79,36 @@ export default class adduserinfo extends React.Component{ let arr = [] - let temp_productpic = this.state.productpic - for(let i = 0;i < model_temp.describe_url.length;i++) + let temp_productpic = this.state.productpic + let pics = "" + console.log("描述图",model_temp.describe_url) + if(Array.isArray(model_temp.describe_url)) + { + pics = model_temp.describe_url + } + else{ + if(model_temp.describe_url !="" && model_temp.describe_url!=undefined) + { + pics = model_temp.describe_url.split(',') + } + else{ + pics = [] + } + + } + + + + for(let i = 0;i < pics.length;i++) { let obj = {} - let nameArr = model_temp.describe_url[i].split('/'); + let nameArr = pics[i].split('/'); obj.name = nameArr[5] - obj.src = model_temp.describe_url[i]; + obj.src = pics[i]; defaultPic.push(obj) let obj2={ name:nameArr[5], - url:model_temp.describe_url[i] + url:pics[i] } temp_productpic.push(obj2) }