This commit is contained in:
姜棚 2021-11-25 11:07:46 +08:00
parent e69a659ebe
commit bcd4161048
4 changed files with 22 additions and 11 deletions

View File

@ -272,6 +272,7 @@ export default class commoditylist extends React.Component{
<Drawer
className="draw"
width={"60%"}
maskClosable = {false}
title={"新建商品"}
footer={
<div style={{ textAlign: 'center' }}>

View File

@ -531,7 +531,7 @@ export default class adduserinfo extends React.Component{
}
visible={this.state.drawerVisible2}
onClose={(e) =>{this.setState({drawerVisible2:false})} }
maskClosable
maskClosable = {false}
>
<div className="draw2">
<Card style={{ width:'90%',"margin":"10px auto" }} >

View File

@ -441,8 +441,8 @@ export default class acclist extends React.Component{
<FormItem labelname=" key样式" prop="style" id="style">
<RadioGroup onChange={(e)=>{ this.onStyleChange(e)} } value={this.state.model.style}>
<RadioButton value={1}>串码</RadioButton>
<RadioButton value={2}>链接</RadioButton>
<RadioButton value={3}>二维码</RadioButton>
<RadioButton value={2} disabled>链接</RadioButton>
<RadioButton value={3} disabled>二维码</RadioButton>
</RadioGroup>
</FormItem>

View File

@ -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}
/>
</FormItem>