Gestion de l'historique des paiements
This commit is contained in:
parent
4ece538416
commit
9c7161d08b
|
@ -11,6 +11,7 @@ import {
|
||||||
Alert,
|
Alert,
|
||||||
Dimensions,
|
Dimensions,
|
||||||
FlatList,
|
FlatList,
|
||||||
|
Image,
|
||||||
Keyboard,
|
Keyboard,
|
||||||
KeyboardAvoidingView,
|
KeyboardAvoidingView,
|
||||||
Platform,
|
Platform,
|
||||||
|
@ -317,6 +318,7 @@ const SaisirFeuilleSoinScreen = ({
|
||||||
const [modalExamen, setModalExamen] = useState(false);
|
const [modalExamen, setModalExamen] = useState(false);
|
||||||
const [modalListAssure, setModalListAssure] = useState(false);
|
const [modalListAssure, setModalListAssure] = useState(false);
|
||||||
const [modalListMedicament, setModalListMedicament] = useState(false);
|
const [modalListMedicament, setModalListMedicament] = useState(false);
|
||||||
|
const [photo, setPhoto] = useState(null);
|
||||||
|
|
||||||
const [modalVisible, setModalVisible] = useState(false);
|
const [modalVisible, setModalVisible] = useState(false);
|
||||||
|
|
||||||
|
@ -1814,6 +1816,10 @@ const SaisirFeuilleSoinScreen = ({
|
||||||
title: I18n.t('PATIENT'),
|
title: I18n.t('PATIENT'),
|
||||||
content: (
|
content: (
|
||||||
<View>
|
<View>
|
||||||
|
<View style={{alignItems: 'center'}}>
|
||||||
|
<Image source={photo === null ? require('./../../../datas/img/users/man.png') : {uri: photo}}
|
||||||
|
style={{width: 92, height: 92}}/>
|
||||||
|
</View>
|
||||||
<TextInput
|
<TextInput
|
||||||
style={{marginTop: 10}}
|
style={{marginTop: 10}}
|
||||||
placeholder={I18n.t('NOM_CLIENT')}
|
placeholder={I18n.t('NOM_CLIENT')}
|
||||||
|
|
|
@ -51,6 +51,8 @@ import Tag from "../../../components/Tag";
|
||||||
import FontAwesome5 from "react-native-vector-icons/FontAwesome5";
|
import FontAwesome5 from "react-native-vector-icons/FontAwesome5";
|
||||||
import MaterialCommunityIcons from "react-native-vector-icons/MaterialCommunityIcons";
|
import MaterialCommunityIcons from "react-native-vector-icons/MaterialCommunityIcons";
|
||||||
import {store} from "../../../redux/store";
|
import {store} from "../../../redux/store";
|
||||||
|
import Modal from "react-native-modal";
|
||||||
|
import Button from "../../../components/Button";
|
||||||
|
|
||||||
|
|
||||||
let moment = require('moment-timezone');
|
let moment = require('moment-timezone');
|
||||||
|
@ -76,6 +78,7 @@ const HistoriqueNanoSanteUserScreen = ({
|
||||||
const [loadMore, setLoadMore] = useState(false);
|
const [loadMore, setLoadMore] = useState(false);
|
||||||
const [historyResult, setHistoryResult] = useState([]);
|
const [historyResult, setHistoryResult] = useState([]);
|
||||||
const [wallet] = useState(store.getState().walletDetailReducer.result.response);
|
const [wallet] = useState(store.getState().walletDetailReducer.result.response);
|
||||||
|
const [modalPaymentDetail, setModalPaymentDetail] = useState(false);
|
||||||
|
|
||||||
let dropDownAlertRef: any = null;
|
let dropDownAlertRef: any = null;
|
||||||
|
|
||||||
|
@ -206,6 +209,66 @@ const HistoriqueNanoSanteUserScreen = ({
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getDateToHumanFormat = (date) => {
|
||||||
|
let re = moment.tz(date, moment.tz.guess()).format();
|
||||||
|
return moment(re).fromNow();
|
||||||
|
}
|
||||||
|
const renderPaymentDetail = () => (
|
||||||
|
<ScrollView style={{flex: 1}}>
|
||||||
|
<View style={[styles.containModal, {backgroundColor: Color.containerBackgroundColor}]}>
|
||||||
|
<Modal
|
||||||
|
isVisible={modalPaymentDetail}
|
||||||
|
onSwipeComplete={() => {
|
||||||
|
setModalPaymentDetail(false);
|
||||||
|
}}
|
||||||
|
swipeDirection={['down']}
|
||||||
|
style={styles.bottomModal}>
|
||||||
|
<View
|
||||||
|
style={[
|
||||||
|
styles.contentFilterBottom,
|
||||||
|
{backgroundColor: Color.containerBackgroundColor},
|
||||||
|
]}>
|
||||||
|
<View style={styles.contentSwipeDown}>
|
||||||
|
<View style={styles.lineSwipeDown}/>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<Text body2 style={{marginTop: 10}}>{I18n.t('PAYMENTS')}</Text>
|
||||||
|
|
||||||
|
<FlatList data={historyItemDetail.payments}
|
||||||
|
extraData={historyItemDetail.payments}
|
||||||
|
keyExtractor={(item, index) => index}
|
||||||
|
renderItem={({item, index}) => {
|
||||||
|
return (
|
||||||
|
<View style={{
|
||||||
|
alignItems: 'flex-start',
|
||||||
|
}}>
|
||||||
|
<View
|
||||||
|
style={[
|
||||||
|
styles.contentActionModalBottom,
|
||||||
|
{borderBottomColor: Color.borderColor, width: "100%"},
|
||||||
|
]}
|
||||||
|
key={item.id}>
|
||||||
|
<Text body2 semibold>
|
||||||
|
{`${I18n.t('AMOUNT')}: ${item.amount} - ${getDateToHumanFormat(item.created_at)}`}
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
}}/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
full
|
||||||
|
style={{marginTop: 10, marginBottom: 20}}
|
||||||
|
onPress={() => setModalPaymentDetail(false)}>
|
||||||
|
{I18n.t('OK')}
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
</View>
|
||||||
|
</Modal>
|
||||||
|
</View>
|
||||||
|
</ScrollView>
|
||||||
|
)
|
||||||
|
|
||||||
const renderModalHistoryDetail = () => (
|
const renderModalHistoryDetail = () => (
|
||||||
<Dialog.Container useNativeDriver={true} visible={displayModalHistory}>
|
<Dialog.Container useNativeDriver={true} visible={displayModalHistory}>
|
||||||
|
|
||||||
|
@ -518,6 +581,19 @@ const HistoriqueNanoSanteUserScreen = ({
|
||||||
style={[Typography.caption1, Color.grayColor]}>{moment(historyItemDetail.next_payment_deadline).format('YYYY-MM-DD')}</Text>
|
style={[Typography.caption1, Color.grayColor]}>{moment(historyItemDetail.next_payment_deadline).format('YYYY-MM-DD')}</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
<View style={{flexDirection: 'row', marginTop: 10}}>
|
||||||
|
<View style={{flex: 1}}>
|
||||||
|
<Text style={[styles.body2]}>{I18n.t('PAYMENTS')}</Text>
|
||||||
|
</View>
|
||||||
|
<View style={{flex: 1, alignItems: 'flex-end'}}>
|
||||||
|
<TouchableOpacity onPress={()=>{
|
||||||
|
setModalPaymentDetail(true);
|
||||||
|
}}>
|
||||||
|
<Text style={{color: "blue", textDecorationLine: 'underline', fontWeight: 'bold'}}>{I18n.t('SEE_MORE')}</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
</View>
|
||||||
|
|
||||||
</View>
|
</View>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
@ -905,18 +981,7 @@ const HistoriqueNanoSanteUserScreen = ({
|
||||||
<Tag primary
|
<Tag primary
|
||||||
icon={<FontAwesome5 name='file' size={20} color={Color.whiteColor}
|
icon={<FontAwesome5 name='file' size={20} color={Color.whiteColor}
|
||||||
style={{marginLeft: 15}}/>}
|
style={{marginLeft: 15}}/>}
|
||||||
style={{
|
style={{width: 110, borderTopLeftRadius: 0, borderBottomLeftRadius: 0,}}
|
||||||
paddingRight: 10,
|
|
||||||
width: 120,
|
|
||||||
borderTopRightRadius: 0,
|
|
||||||
borderBottomRightRadius: 0,
|
|
||||||
borderTopLeftRadius: 0,
|
|
||||||
borderBottomLeftRadius: 0,
|
|
||||||
borderRightWidth: 1,
|
|
||||||
borderRightColor: Color.whiteColor,
|
|
||||||
borderLeftWidth: 1,
|
|
||||||
borderLeftColor: Color.whiteColor
|
|
||||||
}}
|
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
dispatch(fetchGetConsultationReset());
|
dispatch(fetchGetConsultationReset());
|
||||||
setPage(1);
|
setPage(1);
|
||||||
|
@ -928,6 +993,9 @@ const HistoriqueNanoSanteUserScreen = ({
|
||||||
}}>
|
}}>
|
||||||
{` ${I18n.t('DEMANDES')}`}
|
{` ${I18n.t('DEMANDES')}`}
|
||||||
</Tag>
|
</Tag>
|
||||||
|
</View>
|
||||||
|
<View style={{flexDirection: 'row', alignItems: 'center', justifyContent: 'center', paddingBottom: 10}}>
|
||||||
|
|
||||||
<Tag primary
|
<Tag primary
|
||||||
icon={<FontAwesome5 name='file-alt' size={20} color={Color.whiteColor}
|
icon={<FontAwesome5 name='file-alt' size={20} color={Color.whiteColor}
|
||||||
style={{marginLeft: 15}}/>}
|
style={{marginLeft: 15}}/>}
|
||||||
|
@ -936,12 +1004,8 @@ const HistoriqueNanoSanteUserScreen = ({
|
||||||
width: 120,
|
width: 120,
|
||||||
borderTopRightRadius: 0,
|
borderTopRightRadius: 0,
|
||||||
borderBottomRightRadius: 0,
|
borderBottomRightRadius: 0,
|
||||||
borderTopLeftRadius: 0,
|
|
||||||
borderBottomLeftRadius: 0,
|
|
||||||
borderRightWidth: 1,
|
borderRightWidth: 1,
|
||||||
borderRightColor: Color.whiteColor,
|
borderRightColor: Color.whiteColor
|
||||||
borderLeftWidth: 1,
|
|
||||||
borderLeftColor: Color.whiteColor
|
|
||||||
}}
|
}}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
dispatch(fetchGetConsultationReset());
|
dispatch(fetchGetConsultationReset());
|
||||||
|
@ -998,6 +1062,7 @@ const HistoriqueNanoSanteUserScreen = ({
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{displayModalHistory && renderModalHistoryDetail()}
|
{displayModalHistory && renderModalHistoryDetail()}
|
||||||
|
{modalPaymentDetail && renderPaymentDetail()}
|
||||||
</View>
|
</View>
|
||||||
</ScreenComponent>
|
</ScreenComponent>
|
||||||
)
|
)
|
||||||
|
@ -1071,4 +1136,58 @@ const styles = StyleSheet.create({
|
||||||
paddingVertical: 10,
|
paddingVertical: 10,
|
||||||
borderBottomWidth: 0.5,
|
borderBottomWidth: 0.5,
|
||||||
},
|
},
|
||||||
|
lineSeparator: {
|
||||||
|
borderWidth: 1,
|
||||||
|
width: '40%',
|
||||||
|
height: 1,
|
||||||
|
alignSelf: 'center',
|
||||||
|
},
|
||||||
|
line: {
|
||||||
|
width: 1,
|
||||||
|
height: 14,
|
||||||
|
backgroundColor: Color.grayColor,
|
||||||
|
marginLeft: 10,
|
||||||
|
},
|
||||||
|
contentModeView: {
|
||||||
|
width: 30,
|
||||||
|
height: '100%',
|
||||||
|
alignItems: 'flex-end',
|
||||||
|
justifyContent: 'center',
|
||||||
|
},
|
||||||
|
contentFilter: {
|
||||||
|
flexDirection: 'row',
|
||||||
|
alignItems: 'center',
|
||||||
|
marginLeft: 10,
|
||||||
|
},
|
||||||
|
bottomModal: {
|
||||||
|
justifyContent: 'flex-end',
|
||||||
|
margin: 0,
|
||||||
|
},
|
||||||
|
contentFilterBottom: {
|
||||||
|
width: "100%",
|
||||||
|
borderTopLeftRadius: 8,
|
||||||
|
borderTopRightRadius: 8,
|
||||||
|
paddingHorizontal: 20
|
||||||
|
},
|
||||||
|
contentSwipeDown: {
|
||||||
|
paddingTop: 10,
|
||||||
|
alignItems: 'center',
|
||||||
|
},
|
||||||
|
lineSwipeDown: {
|
||||||
|
width: 30,
|
||||||
|
height: 2.5,
|
||||||
|
backgroundColor: Color.dividerColor,
|
||||||
|
},
|
||||||
|
contentActionModalBottom: {
|
||||||
|
flexDirection: 'row',
|
||||||
|
paddingVertical: 15,
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
borderBottomWidth: 1,
|
||||||
|
},
|
||||||
|
containModal: {
|
||||||
|
paddingVertical: 10,
|
||||||
|
paddingHorizontal: 20,
|
||||||
|
flexDirection: 'row',
|
||||||
|
justifyContent: 'space-between',
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -757,5 +757,7 @@
|
||||||
"LAST_PAYMENT": "Dernier paiement",
|
"LAST_PAYMENT": "Dernier paiement",
|
||||||
"AMOUNT_PER_SPLIT": "Montant par échéance",
|
"AMOUNT_PER_SPLIT": "Montant par échéance",
|
||||||
"ETAT_ASSURANCE": "Etat assurance",
|
"ETAT_ASSURANCE": "Etat assurance",
|
||||||
"PRIME_BASE": "Prime de base"
|
"PRIME_BASE": "Prime de base",
|
||||||
|
"PAYMENTS": "Paiements",
|
||||||
|
"SEE_MORE": "Voir plus"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue