add loading indicator

This commit is contained in:
Dawn1Ocean
2024-03-27 14:58:35 +08:00
parent e6ffd7d5d7
commit 7b62c5e473
8 changed files with 98 additions and 11 deletions
@@ -9,7 +9,7 @@ import {
import pt from '@/plain-text';
import { RequestState } from '@/service';
import { getTicketInfo } from '@/service/ticketsInfo';
import { AtCard, AtSteps } from 'taro-ui';
import { AtActivityIndicator, AtCard, AtSteps, AtToast } from 'taro-ui';
import NoteList from '../NoteList/NoteList';
interface StepItemData {
@@ -66,9 +66,20 @@ export default class DetailFramework extends Component<
render(): ReactNode {
if (this.state.rs.loading) {
return <View>Loading</View>;
return (
<AtActivityIndicator
mode='center'
content={pt.get().actIndicator.loading}
></AtActivityIndicator>
);
} else if (!this.state.rs.success) {
return <View>Request failed</View>;
return (
<AtToast
isOpened
text={pt.get().toast.error}
icon='close-circle'
></AtToast>
);
}
const elements: ShowElements = {