SystemUtils.ts 912 B

123456789101112131415161718192021222324252627282930313233343536
  1. import i18n from '../i18n';
  2. import * as Linking from 'expo-linking';
  3. // import { Toast, ModalIndicator } from 'teaset';
  4. import { Platform } from 'react-native';
  5. function connect(navigation) {
  6. navigation.navigate('AlertModal', {
  7. msg: `${i18n.t('tips1')}:0512-109291882?`,
  8. hasCancel: true,
  9. submitText: i18n.t('li-ji-bo-da'),
  10. submitEvent: () => {
  11. Linking.openURL('tel:+123456789');
  12. },
  13. });
  14. }
  15. function toastShow() {
  16. if (Platform.OS === 'web') return;
  17. ModalIndicator.show(i18n.t('jia-zai-zhong'));
  18. }
  19. function toastHide() {
  20. if (Platform.OS === 'web') return;
  21. ModalIndicator.hide();
  22. }
  23. function toastSuccess(title) {
  24. if (Platform.OS === 'web') return;
  25. Toast.success(title);
  26. }
  27. function toastInfo(title) {
  28. if (Platform.OS === 'web') return;
  29. Toast.message(title);
  30. }
  31. export { connect, toastShow, toastHide, toastInfo, toastSuccess };