| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- import i18n from '../i18n';
- import * as Linking from 'expo-linking';
- import { Toast, ModalIndicator, PopoverPicker } from 'teaset';
- import { Platform } from 'react-native';
- function connect(navigation) {
- toastHide();
- navigation.navigate('Modal', {
- screen: 'Alert',
- params: {
- msg: `${i18n.t('tips1')}:0512-109291882?`,
- hasCancel: true,
- submitText: i18n.t('li-ji-bo-da'),
- submitEvent: () => {
- Linking.openURL('tel:+123456789');
- },
- },
- });
- }
- function promot(
- navigation,
- params = {
- title: '',
- submitEvent: (val) => {},
- hasCancel: true,
- tips: '',
- secureTextEntry: false,
- }
- ) {
- toastHide();
- navigation.navigate('Modal', {
- screen: 'Promot',
- params,
- });
- }
- function alert(
- navigation,
- params = {
- msg: '',
- submitEvent: (val) => {},
- submitText: '',
- hasCancel: true,
- }
- ) {
- toastHide();
- navigation.navigate('Modal', {
- screen: 'Alert',
- params,
- });
- }
- function toastShow() {
- if (__DEV__) return;
- ModalIndicator.show(i18n.t('jia-zai-zhong'));
- }
- function toastHide() {
- if (__DEV__) return;
- ModalIndicator.hide();
- }
- function toastSuccess(title) {
- console.log(title);
- toastHide();
- if (__DEV__) return;
- Toast.success(title);
- }
- function toastInfo(title) {
- console.log(title);
- toastHide();
- if (__DEV__) return;
- Toast.message(title);
- }
- function getMoney(money = 0) {
- return money.toFixed(2);
- }
- export {
- connect,
- promot,
- toastShow,
- toastHide,
- toastInfo,
- toastSuccess,
- getMoney,
- alert,
- PopoverPicker,
- };
|