From 9c7161d08bf1c1ad3a09b774c4ae97c9f3e089ce Mon Sep 17 00:00:00 2001 From: Brice Zele Date: Tue, 10 May 2022 14:43:21 +0100 Subject: [PATCH] Gestion de l'historique des paiements --- .../wallet/agent/SaisirFeuilleSoinScreen.js | 6 + .../user/HistoriqueNanoSanteUserScreen.js | 155 ++++++++++++++++-- utils/i18n/fr.json | 4 +- 3 files changed, 146 insertions(+), 19 deletions(-) diff --git a/screens/wallet/agent/SaisirFeuilleSoinScreen.js b/screens/wallet/agent/SaisirFeuilleSoinScreen.js index 963c941c..4705b872 100644 --- a/screens/wallet/agent/SaisirFeuilleSoinScreen.js +++ b/screens/wallet/agent/SaisirFeuilleSoinScreen.js @@ -11,6 +11,7 @@ import { Alert, Dimensions, FlatList, + Image, Keyboard, KeyboardAvoidingView, Platform, @@ -317,6 +318,7 @@ const SaisirFeuilleSoinScreen = ({ const [modalExamen, setModalExamen] = useState(false); const [modalListAssure, setModalListAssure] = useState(false); const [modalListMedicament, setModalListMedicament] = useState(false); + const [photo, setPhoto] = useState(null); const [modalVisible, setModalVisible] = useState(false); @@ -1814,6 +1816,10 @@ const SaisirFeuilleSoinScreen = ({ title: I18n.t('PATIENT'), content: ( + + + { + let re = moment.tz(date, moment.tz.guess()).format(); + return moment(re).fromNow(); + } + const renderPaymentDetail = () => ( + + + { + setModalPaymentDetail(false); + }} + swipeDirection={['down']} + style={styles.bottomModal}> + + + + + + {I18n.t('PAYMENTS')} + + index} + renderItem={({item, index}) => { + return ( + + + + {`${I18n.t('AMOUNT')}: ${item.amount} - ${getDateToHumanFormat(item.created_at)}`} + + + + ) + }}/> + + + + + + + + ) + const renderModalHistoryDetail = () => ( @@ -518,6 +581,19 @@ const HistoriqueNanoSanteUserScreen = ({ style={[Typography.caption1, Color.grayColor]}>{moment(historyItemDetail.next_payment_deadline).format('YYYY-MM-DD')} + + + {I18n.t('PAYMENTS')} + + + { + setModalPaymentDetail(true); + }}> + {I18n.t('SEE_MORE')} + + + + @@ -905,18 +981,7 @@ const HistoriqueNanoSanteUserScreen = ({ } - style={{ - paddingRight: 10, - width: 120, - borderTopRightRadius: 0, - borderBottomRightRadius: 0, - borderTopLeftRadius: 0, - borderBottomLeftRadius: 0, - borderRightWidth: 1, - borderRightColor: Color.whiteColor, - borderLeftWidth: 1, - borderLeftColor: Color.whiteColor - }} + style={{width: 110, borderTopLeftRadius: 0, borderBottomLeftRadius: 0,}} onPress={() => { dispatch(fetchGetConsultationReset()); setPage(1); @@ -928,7 +993,10 @@ const HistoriqueNanoSanteUserScreen = ({ }}> {` ${I18n.t('DEMANDES')}`} - + + + } style={{ @@ -936,12 +1004,8 @@ const HistoriqueNanoSanteUserScreen = ({ width: 120, borderTopRightRadius: 0, borderBottomRightRadius: 0, - borderTopLeftRadius: 0, - borderBottomLeftRadius: 0, borderRightWidth: 1, - borderRightColor: Color.whiteColor, - borderLeftWidth: 1, - borderLeftColor: Color.whiteColor + borderRightColor: Color.whiteColor }} onPress={() => { dispatch(fetchGetConsultationReset()); @@ -998,6 +1062,7 @@ const HistoriqueNanoSanteUserScreen = ({ /> )} {displayModalHistory && renderModalHistoryDetail()} + {modalPaymentDetail && renderPaymentDetail()} ) @@ -1071,4 +1136,58 @@ const styles = StyleSheet.create({ paddingVertical: 10, 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', + }, }); diff --git a/utils/i18n/fr.json b/utils/i18n/fr.json index c3610121..bb4d8538 100755 --- a/utils/i18n/fr.json +++ b/utils/i18n/fr.json @@ -757,5 +757,7 @@ "LAST_PAYMENT": "Dernier paiement", "AMOUNT_PER_SPLIT": "Montant par échéance", "ETAT_ASSURANCE": "Etat assurance", - "PRIME_BASE": "Prime de base" + "PRIME_BASE": "Prime de base", + "PAYMENTS": "Paiements", + "SEE_MORE": "Voir plus" }