import React, {Component} from 'react'; import { View, Text, StatusBar, DeviceEventEmitter, StyleSheet, TextInput, ScrollView, } from 'react-native'; import {Provider, Toast, Button, List} from '@ant-design/react-native'; import {connect} from 'react-redux'; import DatePicker from 'react-native-datepicker'; import FormateDate from '../../components/FormateDate'; import {ComponentsStyles} from '../../components/ComponentsStyles'; import RadioModal from '../../components/RadioModal'; @connect(customer => ({...customer})) class CheckCustomer extends Component { // 跟踪审核 constructor(props) { super(props); const item = this.props.navigation.state.params.item; this.state = { item: this.props.navigation.state.params.item, next_time: item.next_time_f, check_comment: '', check_status: 1, }; }; onSave = () => { if (!this.state.next_time) { Toast.info('请填写下次回访日期', 1); return; } const date = new Date(); const today = FormateDate(date, 'YYYY-MM-DD'); if (this.state.next_time < today) { Toast.info('下次回访日期不能早于今天', 1); return; } this.props.dispatch({ type: 'customer/checkReview', payload: this.state, callback: () => { // 返回审核列表 Toast.info('审核成功!', 1, () => { DeviceEventEmitter.emit('backRefesh'); this.props.navigation.navigate('CheckCustomerList'); }); }, }); }; render() { const {loading} = this.props.customer; return ( {this.state.item.name}} arrow="empty"> 姓名 {this.state.item.tel}} arrow="empty"> 电话 {this.state.item.project_text}} arrow="empty"> 项目 审核状态 this.setState({check_status: id})} style={ComponentsStyles.radioStyle} innerStyle={{ width: 70, }} > 继续跟踪 放弃 this.setState({check_comment: text})} value={this.state.check_comment} multiline={true} numberOfLines={4} maxLength={1000} placeholder={'请填审核批示'} /> this.setState({next_time: datetime})} /> } > 下次回访日期 ); } } const styles = StyleSheet.create({ dateInput: { borderWidth: 0, alignItems: 'flex-end', }, infoContent: { marginTop: 5, backgroundColor: '#fff', }, infoItem: { flexDirection: 'row', paddingVertical: 10, borderBottomWidth: 1, borderColor: '#eaeaea', justifyContent: 'space-between', }, infoItemLeft: {color: '#000', fontSize: 19}, infoItemRight: {fontSize: 15, paddingTop: 2}, modelItem: { borderBottomWidth: 1, borderColor: '#eaeaea', textAlign: 'center', paddingVertical: 8, fontSize: 18, color: '#000', }, }); export default CheckCustomer;