商品详情字段补全

This commit is contained in:
姜棚 2022-01-24 19:26:10 +08:00
parent 074ef8f1cf
commit e6b888225e
7 changed files with 17 additions and 27 deletions

View File

@ -438,6 +438,7 @@ export default class acclist extends React.Component{
obj.quantity = item.quantity; obj.quantity = item.quantity;
obj.show_url = item.show_url; obj.show_url = item.show_url;
obj.describe_url = item.describe_url; obj.describe_url = item.describe_url;
obj.detail_url = item.detail_url;
obj.map_product_name = item.map_product_name; obj.map_product_name = item.map_product_name;
return obj return obj
}) })

View File

@ -32,6 +32,7 @@ export default class exchangedit extends React.Component{
product_name:"", product_name:"",
show_url:"", show_url:"",
describe_url:"", describe_url:"",
detail_url:""
}, },
codeInfo:{ //数据模型不可少 codeInfo:{ //数据模型不可少
code_name:"", code_name:"",

View File

@ -27,6 +27,7 @@ export default class adduserinfo extends React.Component{
product_name:"", product_name:"",
show_url:"", show_url:"",
describe_url:[], describe_url:[],
detail_url:"",
stock:"", stock:"",
usage:"", usage:"",
detail_url:"", detail_url:"",
@ -278,11 +279,7 @@ export default class adduserinfo extends React.Component{
console.log(files) console.log(files)
if(files.length > 0 ) if(files.length > 0 )
{ {
if(files[0].file.size > 20000)
{
Notify.error(`图片大小不能超过 20KB`);
return;
}
let formdata= new FormData(); let formdata= new FormData();
formdata.append("file",files[0].file) formdata.append("file",files[0].file)
formdata.append("path","common_image") formdata.append("path","common_image")

View File

@ -447,6 +447,7 @@ export default class acclist extends React.Component{
obj.quantity = item.quantity; obj.quantity = item.quantity;
obj.show_url = item.show_url; obj.show_url = item.show_url;
obj.describe_url = item.describe_url; obj.describe_url = item.describe_url;
obj.detail_url = item.detail_url
obj.map_product_name = item.map_product_name obj.map_product_name = item.map_product_name
return obj return obj
}) })

View File

@ -24,6 +24,7 @@ export default class adduserinfo extends React.Component{
product_name:"", product_name:"",
show_url:"", show_url:"",
describe_url:"", describe_url:"",
detail_url:"",
map_product_name:'' map_product_name:''
}, },
cur_product:null, cur_product:null,
@ -122,6 +123,7 @@ export default class adduserinfo extends React.Component{
map_product_name:cur_product.title, map_product_name:cur_product.title,
show_url:this.state.show_url ? this.state.show_url : "", show_url:this.state.show_url ? this.state.show_url : "",
describe_url:this.state.describe_url ? this.state.describe_url : "", describe_url:this.state.describe_url ? this.state.describe_url : "",
detail_url:""
} }
this.setState({model:model2}) this.setState({model:model2})

View File

@ -294,11 +294,7 @@ export default class adduserinfo extends React.Component{
console.log(files) console.log(files)
if(files.length > 0 ) if(files.length > 0 )
{ {
if(files[0].file.size > 20000)
{
Notify.error(`图片大小不能超过 20KB`);
return;
}
let formdata= new FormData(); let formdata= new FormData();
formdata.append("file",files[0].file) formdata.append("file",files[0].file)
formdata.append("path","common_image") formdata.append("path","common_image")
@ -323,11 +319,6 @@ export default class adduserinfo extends React.Component{
if(files.length > 0 ) if(files.length > 0 )
{ {
if(files[0].file.size > 20000)
{
Notify.error(`图片大小不能超过 20KB`);
return;
}
let formdata= new FormData(); let formdata= new FormData();
formdata.append("file",files[0].file) formdata.append("file",files[0].file)
formdata.append("path","common_image") formdata.append("path","common_image")
@ -581,7 +572,7 @@ export default class adduserinfo extends React.Component{
<ImageUpload <ImageUpload
className="zent-image-upload-demo" className="zent-image-upload-demo"
maxSize={5 * 1024 * 1024} maxSize={5 * 1024 * 1024}
tips="建议尺寸 30*30图片不超过 20KB" tips="图片不超过 2M"
maxAmount={1} maxAmount={1}
onError={this.onUploadError} onError={this.onUploadError}
onChange={(e)=>{this.onUploadChange(e)}} onChange={(e)=>{this.onUploadChange(e)}}
@ -590,9 +581,6 @@ export default class adduserinfo extends React.Component{
value={this.state.model.show_url} value={this.state.model.show_url}
/> />
</FormItem> </FormItem>
<FormItem prop="describe_url" labelname="商品图" id="describe_url" > <FormItem prop="describe_url" labelname="商品图" id="describe_url" >
<ImageUpload <ImageUpload