From bcd41610483dbe33195933099b6721613ebeddcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E6=A3=9A?= <849005670@qq.com> Date: Thu, 25 Nov 2021 11:07:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/exchangecode/commodity/commodity.js | 1 + src/pages/exchangecode/edit/edit.js | 2 +- src/pages/plan/add/step2.js | 4 +-- src/pages/plan/product/add.js | 26 +++++++++++++------ 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/src/pages/exchangecode/commodity/commodity.js b/src/pages/exchangecode/commodity/commodity.js index 0b30588d..2722da64 100644 --- a/src/pages/exchangecode/commodity/commodity.js +++ b/src/pages/exchangecode/commodity/commodity.js @@ -272,6 +272,7 @@ export default class commoditylist extends React.Component{ diff --git a/src/pages/exchangecode/edit/edit.js b/src/pages/exchangecode/edit/edit.js index 34d0bb8f..b38351cf 100644 --- a/src/pages/exchangecode/edit/edit.js +++ b/src/pages/exchangecode/edit/edit.js @@ -531,7 +531,7 @@ export default class adduserinfo extends React.Component{ } visible={this.state.drawerVisible2} onClose={(e) =>{this.setState({drawerVisible2:false})} } - maskClosable + maskClosable = {false} >
diff --git a/src/pages/plan/add/step2.js b/src/pages/plan/add/step2.js index 4b30481c..08a8c360 100644 --- a/src/pages/plan/add/step2.js +++ b/src/pages/plan/add/step2.js @@ -441,8 +441,8 @@ export default class acclist extends React.Component{ { this.onStyleChange(e)} } value={this.state.model.style}> 串码 - 链接 - 二维码 + 链接 + 二维码 diff --git a/src/pages/plan/product/add.js b/src/pages/plan/product/add.js index 13b27fc5..462a86a7 100644 --- a/src/pages/plan/product/add.js +++ b/src/pages/plan/product/add.js @@ -82,6 +82,18 @@ export default class adduserinfo extends React.Component{ async submit(){ if(this.refs.form1.validator()) { + + if(this.state.model.show_url == "") + { + Notify.error(`请上传商品展示图`); + return + } + if(this.state.model.describe_url == "") + { + Notify.error(`请上传商品描述`); + return; + } + let temp = [] if(sessionStorage.getItem("productData")) { @@ -139,7 +151,9 @@ export default class adduserinfo extends React.Component{ console.log(files); }; onUploadChange1(files){ - if(files[0].file) + + + if(files && files[0].file) { let formdata= new FormData(); formdata.append("file",files[0].file) @@ -198,12 +212,7 @@ export default class adduserinfo extends React.Component{ name:[ { type: "required", message: "请输入商品名称"}, ], - show_url:[ - { type: "required", message: "请上传商品展示"}, - ], - describe_url:[ - { type: "required", message: "请上传商品描述"}, - ] + } @@ -286,6 +295,7 @@ export default class adduserinfo extends React.Component{ maxSize={5 * 1024 * 1024} tips="建议尺寸 30*30,图片不超过 500kb" maxAmount={1} + onChange={(e)=>{this.onUploadChange(e)}} onUpload={this.onUpload} value={this.state.model.show_url} @@ -299,7 +309,7 @@ export default class adduserinfo extends React.Component{ maxAmount={1} onChange={(e)=>{this.onUploadChange1(e)}} onUpload={this.onUpload} - value={this.state.model.describe_url} + value={this.state.model.describe_url} />