add blank judgement; fixed setstate in render bug

This commit is contained in:
Dawn_Ocean
2024-03-15 14:28:26 +08:00
parent 6b554196b3
commit b41498976e
8 changed files with 123 additions and 94 deletions
+27
View File
@@ -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 {