add blank judgement; fixed setstate in render bug
This commit is contained in:
@@ -152,7 +152,34 @@ export default class RepairPage extends Component<{}, RepairPageState> {
|
||||
}
|
||||
|
||||
onSubmit() {
|
||||
this.setState({
|
||||
isDisable: true,
|
||||
});
|
||||
if (
|
||||
this.state.description == '' ||
|
||||
this.state.device == '' ||
|
||||
this.state.deviceModel == '' ||
|
||||
this.state.owner == '' ||
|
||||
this.state.phone == '' ||
|
||||
this.state.checkedList.length === 0
|
||||
) {
|
||||
Taro.atMessage({
|
||||
message: pt.get().button.submitText.blank,
|
||||
type: 'error',
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.setState({
|
||||
isDisable: false,
|
||||
});
|
||||
}, submitInterval);
|
||||
return;
|
||||
}
|
||||
submitTicket(this);
|
||||
setTimeout(() => {
|
||||
this.setState({
|
||||
isDisable: false,
|
||||
});
|
||||
}, submitInterval);
|
||||
}
|
||||
|
||||
render(): ReactNode {
|
||||
|
||||
Reference in New Issue
Block a user