dev_aliyun2
杨树林 5 years ago committed by harry
parent 21b9b56f31
commit 19f3541e44

@ -20,6 +20,25 @@ class Paperreview_itemModel extends Component {
})
}
setDownloadysl=()=>{
var re = /^[0-9]+.?[0-9]*$/; //判断字符串是否为数字 //判断正整数 /^[1-9]+[0-9]*]*$/
var nubmer = this.state.value;
if (!re.test(nubmer)) {
this.props.showNotification(`必须为数值`);
return;
}
try {
if(nubmer<1){
this.props.showNotification(`不能小于0`);
return;
}
}catch (e) {
}
this.props.setDownloady(this.state.value)
}
render() {
return(
@ -56,7 +75,7 @@ width: 124px !important;
</div>
<div className="clearfix mt30 edu-txt-center">
<a className="task-btn mr30 w80" onClick={()=>this.props.Singlemagazine("",false)}>取消</a>
<a className="task-btn task-btn-orange w80" onClick={()=>this.props.setDownloady(this.state.value)}>确定</a>
<a className="task-btn task-btn-orange w80" onClick={()=>this.setDownloadysl()}>确定</a>
</div>
</div>
</Modal>

@ -21,6 +21,28 @@ class Paperreview_itemModels extends Component {
})
}
setDownloadysl=()=>{
var re = /^[0-9]+.?[0-9]*$/; //判断字符串是否为数字 //判断正整数 /^[1-9]+[0-9]*]*$/
var nubmer = this.state.value;
if (!re.test(nubmer)) {
this.props.showNotification(`必须为数值`);
return;
}
try {
if(nubmer<1){
this.props.showNotification(`不能小于0`);
return;
}
}catch (e) {
}
console.log("必须为数值s");
this.props.setDownloadys(this.state.value);
}
render() {
return(
@ -57,7 +79,7 @@ width: 124px !important;
</div>
<div className="clearfix mt30 edu-txt-center">
<a className="task-btn mr30 w80" onClick={()=>this.props.Singlemagazines(false,null)}>取消</a>
<a className="task-btn task-btn-orange w80" onClick={()=>this.props.setDownloadys(this.state.value)}>确定</a>
<a className="task-btn task-btn-orange w80" onClick={()=>this.setDownloadysl()}>确定</a>
</div>
</div>
</Modal>

Loading…
Cancel
Save