| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- /* eslint-disable no-use-before-define */
- /* eslint-disable no-console */
- import React from 'react';
- import { Modal } from '@ant-design/react-native';
- import { Linking } from 'expo';
- import Text from '../components/Text';
- import { navigate } from '../navigation/RootNavigation';
- export function alert(title, content, submitEvent) {
- Modal.alert(
- <Text size="s1" bold center>
- {title || '提示'}
- </Text>,
- <Text type="error" center>
- {content}
- </Text>,
- [
- {
- text: '取消',
- onPress: () => console.log('cancel'),
- style: { color: '#000', fontSize: 12, lineHeight: 30 },
- },
- {
- text: '确定',
- onPress: () => {
- if (submitEvent) {
- submitEvent();
- }
- },
- style: { color: '#FFC21C', fontSize: 12, lineHeight: 30 },
- },
- ]
- );
- }
- export function operation() {
- Modal.operation([
- { text: '标为未读', onPress: () => console.log('标为未读被点击了') },
- { text: '置顶聊天', onPress: () => console.log('置顶聊天被点击了') },
- ]);
- }
- export function connectKefu(orderId) {
- Modal.alert(
- '',
- <Text style={{ marginHorizontal: 15 }} more>
- 感谢您对我们的信任,我们将竭尽所能
- 的为您解决问题。您的每一个建议和反馈都对我们至关重要
- </Text>,
- [
- {
- text: '客服电话',
- onPress: connectKefuOn,
- style: { color: '#000', fontSize: 12, lineHeight: 30 },
- },
- {
- text: '我要投诉',
- onPress: () => {
- navigate('Complaint', { orderId });
- },
- style: { color: '#FFC21C', fontSize: 12, lineHeight: 30 },
- },
- ]
- );
- }
- export function connectKefuOn() {
- Linking.openURL('tel:+123456789');
- }
- export function prompt(title, plac, defaultValue, callBack) {
- Modal.prompt(
- title || '',
- '',
- (val) => {
- if (callBack) callBack(val);
- },
- 'default',
- defaultValue || '',
- [plac || '']
- );
- }
|