1234567891011121314151617181920212223242526 |
- import React, {Component} from 'react';
- // import {View, Button, Overlay} from 'react-native';
- import {Toast} from '@ant-design/react-native';
- // 弹出toast层
- //参数 type: 1:默认信息层
- // message:显示的信息
- // const ToastOverlay = Overlay.Toast;
- export const ToastShow = (type, message) => {
- if (type === 1) {
- // return Overlay.show(message);
- return Toast.success(message, 1);
- }
- if (type === 2) {
- return Toast.success(message, 1);
- }
- if (type === 3) {
- return Toast.fail(message);
- }
- if (type === 4) {
- return Toast.info(message, 1);
- }
- if (type === 5) {
- return Toast.offline('Network connection failed !!!');
- }
- };
|