import i18n from '../i18n'; import * as Linking from 'expo-linking'; // import { Toast, ModalIndicator, PopoverPicker } from 'teaset'; import { Platform } from 'react-native'; function connect(navigation) { 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, } ) { navigation.navigate('Modal', { screen: 'Promot', params, }); } function alert( navigation, params = { msg: '', submitEvent: (val) => {}, submitText: '', hasCancel: true, } ) { 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, };