更新key商品

This commit is contained in:
姜棚 2022-01-24 17:12:47 +08:00
parent cae83883ce
commit 5795992c2a
6 changed files with 56 additions and 22 deletions

View File

@ -96,6 +96,17 @@ export default class acclist extends React.Component{
componentDidMount(e){ componentDidMount(e){
let batch_id=sessionStorage.getItem("keybatch_id") let batch_id=sessionStorage.getItem("keybatch_id")
let copyOpearo=sessionStorage.getItem("copyOpearo") let copyOpearo=sessionStorage.getItem("copyOpearo")
//key样式
let keystyle = sessionStorage.getItem("keyStyle")
if(keystyle == 1)
{
let model = this.state.model;
model.style = 6
this.setState({model:model})
this.setState({white_visible:true})
}
//编辑 //编辑
if(batch_id > 0||copyOpearo==2) if(batch_id > 0||copyOpearo==2)
{ {
@ -603,6 +614,7 @@ export default class acclist extends React.Component{
this.setState({tempdata:temp}) this.setState({tempdata:temp})
this.setState({drawerVisible:true}) this.setState({drawerVisible:true})
} }
@ -886,7 +898,11 @@ export default class acclist extends React.Component{
this.setState({audit_visible:true}) this.setState({audit_visible:true})
} }
} }
keyProductClick(row,index){
this.setState({drawerVisible2:true})
this.setState({productData:row})
this.setState({product_title:"编辑商品"})
}
render(){ render(){
const Column = [ const Column = [
{ {
@ -996,20 +1012,13 @@ export default class acclist extends React.Component{
type: "slot", type: "slot",
width:'auto', width:'auto',
}, },
{ {
title: '商品Logo', title: '操作',
prop: 'show_url', prop: 'edit',
name: 'show_url', name: 'edit',
type: "slot", type: "slot",
width:'auto', width:'auto',
}, }
{
title: '商品图',
prop: 'describe_url',
name: 'describe_url',
type: "slot",
width:'auto',
},
]; ];
@ -1094,10 +1103,10 @@ export default class acclist extends React.Component{
</FormItem> </FormItem>
<FormItem labelname="key样式" prop="style" id="style"> <FormItem labelname="key样式" prop="style" id="style">
<RadioGroup onChange={(e)=>{ this.onStyleChange(e)} } value={this.state.model.style} disabled={this.state.isEdit} > <RadioGroup onChange={(e)=>{ this.onStyleChange(e)} } value={this.state.model.style} disabled={this.state.isEdit} >
<RadioButton value={1}>串码</RadioButton> <RadioButton value={1} disabled= {this.state.model.style == 6}>串码</RadioButton>
<RadioButton value={2} >链接</RadioButton> <RadioButton value={2} disabled= {this.state.model.style == 6}>链接</RadioButton>
<RadioButton value={4} >二维码</RadioButton> <RadioButton value={4} disabled= {this.state.model.style == 6}>二维码</RadioButton>
<RadioButton value={6} >白名单</RadioButton> <RadioButton value={6} disabled={this.state.model.style != 6}>白名单</RadioButton>
</RadioGroup> </RadioGroup>
</FormItem> </FormItem>
@ -1356,6 +1365,10 @@ export default class acclist extends React.Component{
value={rowData.describe_url} value={rowData.describe_url}
/> />
} }
if(com == "edit")
{
return <span onClick={(e)=>{this.keyProductClick(rowData,rowIndex)}} style={{color:"#2B66F2"}} >编辑</span>
}
}} }}

View File

@ -62,6 +62,7 @@ export default class adduserinfo extends React.Component{
//获取商品信息 //获取商品信息
if(this.props.data) if(this.props.data)
{ {
let model_temp = this.props.data; let model_temp = this.props.data;

View File

@ -286,6 +286,7 @@ export default class acclist extends React.Component{
} }
addProduct(){ addProduct(){
this.setState({drawerVisible2:true}) this.setState({drawerVisible2:true})
this.setState({productData:null})
} }
async productSubmit(){ async productSubmit(){
@ -828,13 +829,13 @@ export default class acclist extends React.Component{
} }
keyProductClick(row,index){ keyProductClick(row,index){
this.setState({drawerVisible2:true}) this.setState({drawerVisible2:true})
this.setState({productData:row})
this.setState({product_title:"编辑商品"})
} }
render(){ render(){
const Column = [ const Column = [
{ {
title: '兑换名称', title: '兑换名称',
@ -1264,7 +1265,7 @@ export default class acclist extends React.Component{
</Drawer> </Drawer>
<Drawer <Drawer
className="draw" className="draw"
width={"60%"} width={"86%"}
title={"新建商品"} title={"新建商品"}
footer={ footer={
<div style={{ textAlign: 'center' }}> <div style={{ textAlign: 'center' }}>

View File

@ -255,6 +255,21 @@ export default class acclist extends React.Component{
]}] ]}]
sessionStorage.setItem("keybatch_id","") sessionStorage.setItem("keybatch_id","")
sessionStorage.setItem("copyOpearo",0) sessionStorage.setItem("copyOpearo",0)
//白名单状态为6
if(this.state.distdata.length > 0 && this.state.distdata[0].style == 6)
{
sessionStorage.setItem("keyStyle",1)
}
else{
sessionStorage.setItem("keyStyle",0)
}
console.log("红",this.state.distdata)
sessionStorage.setItem('breakchangenav',JSON.stringify(activerou)); sessionStorage.setItem('breakchangenav',JSON.stringify(activerou));
} }
aboutFn(e,row){ aboutFn(e,row){

View File

@ -84,6 +84,7 @@ export default class adduserinfo extends React.Component{
} }
async submit(){ async submit(){
console.log("提交78789")
if(this.refs.form1.validator()) if(this.refs.form1.validator())
{ {

View File

@ -58,8 +58,11 @@ export default class adduserinfo extends React.Component{
} }
componentWillMount(e){ componentWillMount(e){
console.log("商品数据",666)
if(this.props.data) if(this.props.data)
{ {
let model_temp = this.props.data; let model_temp = this.props.data;
let model = this.state.model; let model = this.state.model;
model.product_id = model_temp.product_id; model.product_id = model_temp.product_id;