perfect voucher
This commit is contained in:
@@ -18,7 +18,8 @@ export default class ModalVouchersComponent extends React.Component {
|
||||
selectedOption: '',
|
||||
hidden:'inline',
|
||||
skuName:'',
|
||||
skuPrice:'0'
|
||||
skuPrice:'0',
|
||||
buttonDisbaled:true
|
||||
};
|
||||
this.defaultState = Object.assign({}, this.state);
|
||||
this.http = props.appstate.http;
|
||||
@@ -94,7 +95,8 @@ export default class ModalVouchersComponent extends React.Component {
|
||||
console.log(points[0].price,'points',points[0].name);
|
||||
this.setState({
|
||||
skuName :points[0].name,
|
||||
skuPrice : points[0].price
|
||||
skuPrice : points[0].price,
|
||||
buttonDisbaled:false
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -103,7 +105,7 @@ export default class ModalVouchersComponent extends React.Component {
|
||||
}}
|
||||
>
|
||||
{data.sku.map((item, index) => {
|
||||
return <Option value={item.id}><div style={{display:'flex',justifyContent:'space-between', width:'100%'}}><span>{item.name}</span> <span style={{color:'#FF6F00', display:this.state.hidden}}><NumberFormat value={(item.price)} displayType={'text'} thousandSeparator={true}/> </span></div></Option>
|
||||
return <Option value={item.id}><div style={{display:'flex',justifyContent:'space-between', width:'100%'}}><span>{item.name}</span> <span style={{color:'#FF6F00', display:this.state.hidden}}><NumberFormat value={(+item.price).toFixed(0)} displayType={'text'} thousandSeparator={true}/> </span></div></Option>
|
||||
// return <Option value={item.id}>{item.price}</Option>
|
||||
})}
|
||||
</Select>
|
||||
@@ -111,7 +113,7 @@ export default class ModalVouchersComponent extends React.Component {
|
||||
<div className={'costContainerModal'}>
|
||||
<div className={'costLeftPaneModal'}>
|
||||
<p className={'costTitleModal'}>Points</p>
|
||||
<p className={'costValueModal'}><NumberFormat value={(this.state.skuPrice)} displayType={'text'} thousandSeparator={true}/> </p>
|
||||
<p className={'costValueModal'}><NumberFormat value={(+this.state.skuPrice).toFixed(0)} displayType={'text'} thousandSeparator={true}/> </p>
|
||||
</div>
|
||||
<div className={'costRightPaneModal'}>
|
||||
<Route render={({ history}) => (
|
||||
@@ -124,7 +126,7 @@ export default class ModalVouchersComponent extends React.Component {
|
||||
history.push(LINKS.VERIFY_VOUCHERS);
|
||||
}
|
||||
}
|
||||
type="primary" size={"large"} block>Buy</Button>
|
||||
type="primary" disabled={this.state.buttonDisbaled} size={"large"} block>Buy</Button>
|
||||
)} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user