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 WriteTrackReport extends Component { // 填写跟踪报告 constructor(props) { super(props); this.state = { item: this.props.navigation.state.params.item, next_time: '', instruction: '', description: '', is_giveup: 0, is_entry: 0, }; }; onSave = () => { if (!this.state.description) { Toast.info('请填写回访情况', 1); return; } 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/addReview', payload: this.state, callback: () => { // 返回,刷新潜客跟踪列表或潜客完善列表 DeviceEventEmitter.emit('backRefesh'); this.props.navigation.goBack(); }, }); }; 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({description: text})} value={this.state.description} multiline={true} numberOfLines={4} maxLength={1000} placeholder={'请填写回访情况'} /> this.setState({instruction: text})} value={this.state.instruction} multiline={true} numberOfLines={4} maxLength={1000} placeholder={'支援或放弃'} /> 是否进店 this.setState({is_entry: id})} style={ComponentsStyles.radioStyle} innerStyle={{ width: 50, }} > 是否放弃 this.setState({is_giveup: id})} style={ComponentsStyles.radioStyle} innerStyle={{ width: 50, }} > 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 WriteTrackReport;