Correction de quelques bugs et recherche d'utilisateur sur la carte
This commit is contained in:
parent
a95dfc6d01
commit
0273273b8a
File diff suppressed because one or more lines are too long
|
@ -628,7 +628,7 @@
|
|||
"LONGUE": "Longue",
|
||||
"ACCIDENT": "Accident",
|
||||
"GROSSESSE": "Grossesse",
|
||||
"ADD_PRESTATION": "Ajouter une prestation",
|
||||
"ADD_PRESTATION": "Ajouter une consultation",
|
||||
"ADD_PRESCRIPTION": "Ajouter une prescription",
|
||||
"VISITE_DOMICILE": "Visite domicile ",
|
||||
"CODE_ACTE": "Code acte ",
|
||||
|
@ -653,7 +653,7 @@
|
|||
"CLASSE_PRESTATAIRE": "Classe de prestataire",
|
||||
"FRAIS_DEPLACEMENT": "Frais de déplacement",
|
||||
"AJOUTER_MEDICAMENT": "Ajouter médicament/appareil",
|
||||
"AJOUTER_EXAMEN": "Ajouter examen",
|
||||
"AJOUTER_EXAMEN": "Ajouter autre acte ou examen",
|
||||
"NAME": "Nom",
|
||||
"POSOLOGIE": "Posologie",
|
||||
"QUANTITE": "Quantité",
|
||||
|
@ -689,8 +689,8 @@
|
|||
"MODIFIER_EXAMEN": "Modifier examen",
|
||||
"EXAMENS_SUCCESSFULLY_MODIFY": "Examen modifié avec succès",
|
||||
"PRESTATION_SUCCESSFULLY_MODIFY": "Prestation modifié avec succès",
|
||||
"MODIFY_PRESTATION": "Modifier une prestation",
|
||||
"LIST_PRESTATION": "Liste des prestations",
|
||||
"MODIFY_PRESTATION": "Modifier une consultation",
|
||||
"LIST_PRESTATION": "Liste des consultations",
|
||||
"NO_CONSULTATION": "Aucune consultation",
|
||||
"NO_EXECUTION": "Aucune exécution",
|
||||
"LISTE_CONSULTATION": "Liste des consultations",
|
||||
|
@ -725,5 +725,17 @@
|
|||
"ECH": "Ech.",
|
||||
"PER": "Per.",
|
||||
"ASSURE_SUSPENDU": "Cet assuré est suspendu",
|
||||
"ASSURE_PRINCIPAL_SUSPENDU": "L'assuré principal est suspendu"
|
||||
"ASSURE_PRINCIPAL_SUSPENDU": "L'assuré principal est suspendu",
|
||||
"CONSULTATION": "Consultation",
|
||||
"ACTE_EXAMEN": "Autre acte et examen",
|
||||
"AMOUNT_FREE": "Montant libre",
|
||||
"DESCRIPTION": "Description",
|
||||
"EXECUTION": "Execution",
|
||||
"UNIT_QUANTITE": "Qté unitaire",
|
||||
"NO_USAGER_CORRESPONDING_TO_SEARCH": "Aucun usager ne correspond à votre recherche",
|
||||
"USAGER_SEARCH": "Recherche d'un usager",
|
||||
"BY_NAME": "Par nom",
|
||||
"BY_QR_CODE": "Par QR Code",
|
||||
"SCAN": "Scanner",
|
||||
"BRING_YOUR_CAMERA_CLOSER_TO_SCAN_QR_CODE": "Approchez votre caméra du QR Code afin de le scanner"
|
||||
}
|
||||
|
|
|
@ -7,6 +7,10 @@ import {
|
|||
GET_OPERATOR_LIST_PENDING,
|
||||
GET_OPERATOR_LIST_RESET,
|
||||
GET_OPERATOR_LIST_SUCCESS,
|
||||
GET_QR_CODE_DETAIL_ERROR,
|
||||
GET_QR_CODE_DETAIL_PENDING,
|
||||
GET_QR_CODE_DETAIL_RESET,
|
||||
GET_QR_CODE_DETAIL_SUCCESS,
|
||||
LINK_CARD_ERROR,
|
||||
LINK_CARD_PENDING,
|
||||
LINK_CARD_RESET,
|
||||
|
@ -19,6 +23,10 @@ import {
|
|||
REATTACH_ACCOUNT_PENDING,
|
||||
REATTACH_ACCOUNT_RESET,
|
||||
REATTACH_ACCOUNT_SUCCESS,
|
||||
SEARCH_USER_ERROR,
|
||||
SEARCH_USER_PENDING,
|
||||
SEARCH_USER_RESET,
|
||||
SEARCH_USER_SUCCESS,
|
||||
WALLET_GET_COMMISSION_ERROR,
|
||||
WALLET_GET_COMMISSION_PENDING,
|
||||
WALLET_GET_COMMISSION_RESET,
|
||||
|
@ -275,4 +283,39 @@ export const fetchPayBillSuccess = (res) => ({
|
|||
export const fetchPayBillError = (error) => ({
|
||||
type: PAY_BILL_ERROR,
|
||||
result: error
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* ---------------------------------------------------
|
||||
*/
|
||||
export const fetchSearchUserPending = () => ({
|
||||
type: SEARCH_USER_PENDING
|
||||
});
|
||||
export const fetchSearchUserReset = () => ({
|
||||
type: SEARCH_USER_RESET
|
||||
});
|
||||
export const fetchSearchUserSuccess = (res) => ({
|
||||
type: SEARCH_USER_SUCCESS,
|
||||
result: res,
|
||||
});
|
||||
export const fetchSearchUserError = (error) => ({
|
||||
type: SEARCH_USER_ERROR,
|
||||
result: error
|
||||
});
|
||||
/**
|
||||
* ---------------------------------------------------
|
||||
*/
|
||||
export const fetchGetQRCodeDetailPending = () => ({
|
||||
type: GET_QR_CODE_DETAIL_PENDING
|
||||
});
|
||||
export const fetchGetQRCodeDetailReset = () => ({
|
||||
type: GET_QR_CODE_DETAIL_RESET
|
||||
});
|
||||
export const fetchGetQRCodeDetailSuccess = (res) => ({
|
||||
type: GET_QR_CODE_DETAIL_SUCCESS,
|
||||
result: res,
|
||||
});
|
||||
export const fetchGetQRCodeDetailError = (error) => ({
|
||||
type: GET_QR_CODE_DETAIL_ERROR,
|
||||
result: error
|
||||
});
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
/**
|
||||
* Project iLinkCity
|
||||
* File GetQRCodeDetailReducer
|
||||
* Path redux/reducers/WalletReducer
|
||||
* Created by BRICE ZELE
|
||||
* Date: 19/08/2021
|
||||
*/
|
||||
import * as WalletType from "../types/WalletType";
|
||||
|
||||
const initialState = {
|
||||
loading: false,
|
||||
result: null,
|
||||
error: null
|
||||
};
|
||||
|
||||
export default (state = initialState, action) => {
|
||||
switch (action.type) {
|
||||
case WalletType.GET_QR_CODE_DETAIL_PENDING:
|
||||
return {
|
||||
...state,
|
||||
loading: true
|
||||
}
|
||||
case WalletType.GET_QR_CODE_DETAIL_SUCCESS:
|
||||
return {
|
||||
...state,
|
||||
loading: false,
|
||||
result: action.result.data,
|
||||
error: null
|
||||
}
|
||||
case WalletType.GET_QR_CODE_DETAIL_ERROR:
|
||||
return {
|
||||
...state,
|
||||
loading: false,
|
||||
result: null,
|
||||
error: action.result
|
||||
}
|
||||
case WalletType.GET_QR_CODE_DETAIL_RESET:
|
||||
return initialState;
|
||||
|
||||
default: {
|
||||
return state;
|
||||
}
|
||||
}
|
||||
};
|
|
@ -0,0 +1,44 @@
|
|||
/**
|
||||
* Project iLinkCity
|
||||
* File SearchUserReducer
|
||||
* Path redux/reducers/WalletReducer
|
||||
* Created by BRICE ZELE
|
||||
* Date: 26/07/2021
|
||||
*/
|
||||
import * as WalletType from "../types/WalletType";
|
||||
|
||||
const initialState = {
|
||||
loading: false,
|
||||
result: null,
|
||||
error: null
|
||||
};
|
||||
|
||||
export default (state = initialState, action) => {
|
||||
switch (action.type) {
|
||||
case WalletType.SEARCH_USER_PENDING:
|
||||
return {
|
||||
...state,
|
||||
loading: true
|
||||
}
|
||||
case WalletType.SEARCH_USER_SUCCESS:
|
||||
return {
|
||||
...state,
|
||||
loading: false,
|
||||
result: action.result.data,
|
||||
error: null
|
||||
}
|
||||
case WalletType.SEARCH_USER_ERROR:
|
||||
return {
|
||||
...state,
|
||||
loading: false,
|
||||
result: null,
|
||||
error: action.result
|
||||
}
|
||||
case WalletType.SEARCH_USER_RESET:
|
||||
return initialState;
|
||||
|
||||
default: {
|
||||
return state;
|
||||
}
|
||||
}
|
||||
};
|
|
@ -54,10 +54,13 @@ import {
|
|||
acceptOrRejectConsultationReducer,
|
||||
activatePaySubscriptionReducer,
|
||||
addBeneficiaryToSubscriptionReducer,
|
||||
addDrugReducer, checkInsuranceCoverageAmountReducer,
|
||||
createConsultationReducer, deleteBeneficiaryeducer,
|
||||
addDrugReducer,
|
||||
checkInsuranceCoverageAmountReducer,
|
||||
createConsultationReducer,
|
||||
deleteBeneficiaryeducer,
|
||||
demandeAutorisationSoinReducer,
|
||||
executionPrescriptionReducer, facturerSoinReducer,
|
||||
executionPrescriptionReducer,
|
||||
facturerSoinReducer,
|
||||
getAmountConsultationReducer,
|
||||
getConsultationReducer,
|
||||
getDrugAppareilReducer,
|
||||
|
@ -66,12 +69,16 @@ import {
|
|||
getProviderClassReducer,
|
||||
getSubscriptionListReducer,
|
||||
getUserByIdQRCodeReducer,
|
||||
getUserByNameOrNumberReducer, insuranceHistoryReducer,
|
||||
getUserByNameOrNumberReducer,
|
||||
insuranceHistoryReducer,
|
||||
insuranceListReducer,
|
||||
modifyPrescriptionReducer, stopSubscriptionReducer,
|
||||
modifyPrescriptionReducer,
|
||||
stopSubscriptionReducer,
|
||||
subscribeInsuranceReducer,
|
||||
uploadInsuranceImagesReducer
|
||||
} from "../insurance/insurance.reducer";
|
||||
import SearchUserReducer from "./SearchUserReducer";
|
||||
import GetQRCodeDetailReducer from "./GetQRCodeDetailReducer";
|
||||
|
||||
const persistConfig = {
|
||||
key: 'root',
|
||||
|
@ -182,7 +189,9 @@ const rootReducer = persistCombineReducers(persistConfig, {
|
|||
deleteBeneficiaryeducer: deleteBeneficiaryeducer,
|
||||
facturerSoinReducer: facturerSoinReducer,
|
||||
insuranceHistoryReducer: insuranceHistoryReducer,
|
||||
checkInsuranceCoverageAmountReducer: checkInsuranceCoverageAmountReducer
|
||||
checkInsuranceCoverageAmountReducer: checkInsuranceCoverageAmountReducer,
|
||||
searchUserReducer: SearchUserReducer,
|
||||
getQRCodeDetailReducer: GetQRCodeDetailReducer,
|
||||
});
|
||||
|
||||
export default rootReducer;
|
||||
|
|
|
@ -56,4 +56,15 @@ export const GET_OPERATOR_LIST_RESET = 'GET_OPERATOR_LIST_RESET';
|
|||
export const PAY_BILL_PENDING = 'PAY_BILL_PENDING';
|
||||
export const PAY_BILL_SUCCESS = 'PAY_BILL_SUCCESS';
|
||||
export const PAY_BILL_ERROR = 'PAY_BILL_ERROR';
|
||||
export const PAY_BILL_RESET = 'PAY_BILL_RESET';
|
||||
export const PAY_BILL_RESET = 'PAY_BILL_RESET';
|
||||
|
||||
|
||||
export const SEARCH_USER_PENDING = 'SEARCH_USER_PENDING';
|
||||
export const SEARCH_USER_SUCCESS = 'SEARCH_USER_SUCCESS';
|
||||
export const SEARCH_USER_ERROR = 'SEARCH_USER_ERROR';
|
||||
export const SEARCH_USER_RESET = 'SEARCH_USER_RESET';
|
||||
|
||||
export const GET_QR_CODE_DETAIL_PENDING = 'GET_QR_CODE_DETAIL_PENDING';
|
||||
export const GET_QR_CODE_DETAIL_SUCCESS = 'GET_QR_CODE_DETAIL_SUCCESS';
|
||||
export const GET_QR_CODE_DETAIL_ERROR = 'GET_QR_CODE_DETAIL_ERROR';
|
||||
export const GET_QR_CODE_DETAIL_RESET = 'GET_QR_CODE_DETAIL_RESET';
|
||||
|
|
|
@ -13,6 +13,7 @@ import {
|
|||
PermissionsAndroid,
|
||||
Platform,
|
||||
ProgressBarAndroid,
|
||||
ScrollView,
|
||||
StatusBar,
|
||||
StyleSheet,
|
||||
Text,
|
||||
|
@ -49,11 +50,23 @@ import MarkerManager from './../../webservice/persistences/MarkerManager'
|
|||
import {bindActionCreators} from 'redux';
|
||||
import getAuthApiKey from '../../webservice/AuthKeyApi';
|
||||
import {connect} from 'react-redux';
|
||||
import getWalletActivated from '../../webservice/WalletApi';
|
||||
import getWalletActivated, {
|
||||
getQRCodeDetailAction,
|
||||
getQRCodeDetailReset,
|
||||
searchUserAction,
|
||||
searchUserReset
|
||||
} from '../../webservice/WalletApi';
|
||||
import {saveOnesignalIdsAction, saveOnesignalIdsReset} from '../../webservice/OnesignalApi';
|
||||
import OneSignal from 'react-native-onesignal';
|
||||
import {saveOnesignalIds} from '../../webservice/IlinkConstants';
|
||||
import {callingCodes} from "@ideditor/country-coder";
|
||||
import TextInput from "../../components/TextInput";
|
||||
import FontAwesome from "react-native-vector-icons/FontAwesome";
|
||||
import FontAwesomeIcon from "react-native-vector-icons/FontAwesome";
|
||||
import {Color} from "../../config/Color";
|
||||
import QRCodeScanner from "react-native-qrcode-scanner";
|
||||
import Dialog from "react-native-dialog";
|
||||
import {Typography} from "../../config/typography";
|
||||
|
||||
const countries = require("./../../utils/country_code.json")
|
||||
|
||||
|
@ -339,6 +352,42 @@ class Home extends BaseScreen {
|
|||
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
if (nextProps.resultSearchUserByName !== null) {
|
||||
this.setState({displayDialogResultSearch: true});
|
||||
}
|
||||
|
||||
if (nextProps.resultGetQRCodeDetail !== null) {
|
||||
if (nextProps.resultGetQRCodeDetail.response !== null) {
|
||||
this.setState({userName: '' + nextProps.resultGetQRCodeDetail.response.phone})
|
||||
}
|
||||
}
|
||||
|
||||
if (nextProps.errorGetQRCodeDetail !== null) {
|
||||
if (typeof nextProps.errorGetQRCodeDetail.data !== 'undefined') {
|
||||
Alert.alert(
|
||||
I18n.t("ERROR_LABEL"),
|
||||
nextProps.errorGetQRCodeDetail.data.error,
|
||||
[
|
||||
{
|
||||
text: I18n.t("OK"), onPress: () => {
|
||||
this.setState({
|
||||
displayPhoneField: false,
|
||||
userName: ''
|
||||
});
|
||||
this.props.searchUserReset();
|
||||
this.props.getQRCodeDetailReset();
|
||||
}
|
||||
}
|
||||
],
|
||||
{cancelable: false}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
async requestCameraPermission() {
|
||||
try {
|
||||
const granted = await PermissionsAndroid.request(
|
||||
|
@ -1119,6 +1168,14 @@ class Home extends BaseScreen {
|
|||
return (<ActionButton
|
||||
buttonColor={theme.accent}
|
||||
>
|
||||
<ActionButton.Item buttonColor='#3498db' title={I18n.t("SEARCH")}
|
||||
onPress={() => {
|
||||
this.setState({dialogSearchUser: true});
|
||||
}}
|
||||
size={48}
|
||||
>
|
||||
<Icon name="search" style={styles.actionButtonIcon}/>
|
||||
</ActionButton.Item>
|
||||
<ActionButton.Item buttonColor='#3498db' title={I18n.t("MY_GROUP")} onPress={() => this.showMyMembers()}
|
||||
size={48}
|
||||
>
|
||||
|
@ -1155,6 +1212,14 @@ class Home extends BaseScreen {
|
|||
>
|
||||
<Icon name="filter-list" style={styles.actionButtonIcon}/>
|
||||
</ActionButton.Item>
|
||||
<ActionButton.Item buttonColor='#3498db' title={I18n.t("SEARCH")}
|
||||
onPress={() => {
|
||||
this.setState({dialogSearchUser: true});
|
||||
}}
|
||||
size={48}
|
||||
>
|
||||
<Icon name="search" style={styles.actionButtonIcon}/>
|
||||
</ActionButton.Item>
|
||||
<ActionButton.Item buttonColor='#3498db' title={I18n.t("REPOSITIONNING")}
|
||||
onPress={() => this.refocusMap(false)}
|
||||
size={48}
|
||||
|
@ -1319,7 +1384,13 @@ class Home extends BaseScreen {
|
|||
dialogNetworkVisible: false,
|
||||
myPositionMarkerText: I18n.t("YOUR_THERE"),
|
||||
isSaveOneSignalOK: false,
|
||||
publicite: null
|
||||
publicite: null,
|
||||
userName: '',
|
||||
isNumeroAssureSearch: false,
|
||||
isPhoneAssureSearch: false,
|
||||
showQRCodeScanner: false,
|
||||
displayDialogResultSearch: false,
|
||||
dialogSearchUser: false
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -1726,6 +1797,9 @@ class Home extends BaseScreen {
|
|||
{this.makeDialogLoader()}
|
||||
{this.makeDistanceDialog()}
|
||||
{this.makeNetworkChangeDialog()}
|
||||
{this.renderSearchUser()}
|
||||
{this.state.showQRCodeScanner && this.renderDialogQRCodeScanner()}
|
||||
{this.state.displayDialogResultSearch && this.renderDialogResultSearchUser()}
|
||||
<SnackBar visible={this.state.snack_visible}
|
||||
textMessage={this.state.snack_text_message}
|
||||
autoHidingTime={5000}
|
||||
|
@ -1992,6 +2066,204 @@ class Home extends BaseScreen {
|
|||
|
||||
}
|
||||
|
||||
|
||||
renderDialogQRCodeScanner() {
|
||||
return (
|
||||
<Dialog.Container contentStyle={{width: responsiveWidth(80)}} useNativeDriver={true}
|
||||
visible={this.state.showQRCodeScanner}>
|
||||
|
||||
<Dialog.Title>{I18n.t('SCAN')}</Dialog.Title>
|
||||
|
||||
<ScrollView style={[styles.blockView, {borderBottomColor: Color.borderColor, maxHeight: 300}]}>
|
||||
<Text>
|
||||
{I18n.t('BRING_YOUR_CAMERA_CLOSER_TO_SCAN_QR_CODE')}
|
||||
</Text>
|
||||
<QRCodeScanner
|
||||
onRead={(result) => {
|
||||
this.setState({
|
||||
showQRCodeScanner: false
|
||||
});
|
||||
this.props.getQRCodeDetailAction(result.data);
|
||||
//fetchGetUserByIdQRCode(result.data);
|
||||
}}
|
||||
flashMode={RNCamera.Constants.FlashMode.off}
|
||||
/>
|
||||
</ScrollView>
|
||||
|
||||
<Dialog.Button bold={true} label={I18n.t('CLOSE')} onPress={() => {
|
||||
this.setState({
|
||||
showQRCodeScanner: false
|
||||
});
|
||||
}}/>
|
||||
</Dialog.Container>
|
||||
)
|
||||
}
|
||||
|
||||
renderSearchUser() {
|
||||
return (
|
||||
<MaterialDialog
|
||||
title={I18n.t("SEARCH")}
|
||||
visible={this.state.dialogSearchUser}
|
||||
onCancel={() => this.setState({dialogSearchUser: false})}
|
||||
onOk={result => {
|
||||
if (this.state.isPhoneAssureSearch) {
|
||||
this.props.searchUserAction({
|
||||
dial_code: this.state.indicatif,
|
||||
phone: this.state.userName,
|
||||
|
||||
}, true);
|
||||
} else {
|
||||
this.props.searchUserAction({
|
||||
dial_code: this.state.indicatif,
|
||||
name: this.state.userName,
|
||||
}, true);
|
||||
}
|
||||
|
||||
this.setState({dialogSearchUser: false});
|
||||
|
||||
}}
|
||||
>
|
||||
<View>
|
||||
<TextInput
|
||||
style={{marginTop: 10, height: 46, borderRadius: 5, borderWidth: 1, borderColor: "#ccc"}}
|
||||
placeholder={this.state.isPhoneAssureSearch ? I18n.t('PHONE') : I18n.t('NAME')}
|
||||
value={this.state.userName}
|
||||
keyboardType={this.state.isPhoneAssureSearch ? 'numeric' : 'default'}
|
||||
onChangeText={(userName) => {
|
||||
this.setState({userName});
|
||||
}}
|
||||
icon={
|
||||
<FontAwesome
|
||||
style={{zIndex: 10}}
|
||||
name={this.state.isPhoneAssureSearch ? 'phone' : 'user'}
|
||||
size={20}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
|
||||
<View style={{
|
||||
flexDirection: 'row',
|
||||
position: 'absolute',
|
||||
top: 22,
|
||||
right: 50,
|
||||
justifyContent: 'space-between',
|
||||
width: 50
|
||||
}}>
|
||||
<FontAwesomeIcon
|
||||
style={{paddingRight: 5}}
|
||||
name='phone'
|
||||
size={20}
|
||||
color={Color.primaryColor}
|
||||
onPress={() => {
|
||||
this.setState({
|
||||
isNumeroAssureSearch: false,
|
||||
isPhoneAssureSearch: true
|
||||
});
|
||||
}}
|
||||
/>
|
||||
<FontAwesomeIcon
|
||||
style={{paddingRight: 5}}
|
||||
name='user'
|
||||
size={20}
|
||||
color={Color.primaryColor}
|
||||
onPress={() => {
|
||||
this.setState({
|
||||
isNumeroAssureSearch: false,
|
||||
isPhoneAssureSearch: false
|
||||
});
|
||||
}}
|
||||
/>
|
||||
<FontAwesomeIcon
|
||||
style={{paddingRight: 5}}
|
||||
name="qrcode"
|
||||
size={20}
|
||||
color={Color.primaryColor}
|
||||
onPress={() => {
|
||||
this.setState({
|
||||
showQRCodeScanner: true
|
||||
});
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
{/* <Fumi iconClass={FontAwesomeIcon}
|
||||
label={I18n.t('NAME')}
|
||||
iconColor={'#f95a25'}
|
||||
iconSize={20}
|
||||
iconName={"user"}
|
||||
value={this.state.userName}
|
||||
onChangeText={(userName) => {
|
||||
this.setState({userName});
|
||||
}}
|
||||
style={styles.input}
|
||||
>
|
||||
</Fumi>*/}
|
||||
|
||||
</MaterialDialog>)
|
||||
|
||||
}
|
||||
|
||||
renderDialogResultSearchUser() {
|
||||
|
||||
const {resultSearchUserByName, errorGetAvisImposition} = this.props;
|
||||
console.log("resultGetAvisImposition", resultSearchUserByName);
|
||||
return (
|
||||
<Dialog.Container contentStyle={{width: responsiveWidth(80)}} useNativeDriver={true}
|
||||
visible={this.state.displayDialogResultSearch}>
|
||||
|
||||
<Dialog.Title>{I18n.t('USAGER_SEARCH')}</Dialog.Title>
|
||||
|
||||
<ScrollView style={[styles.blockView, {borderBottomColor: Color.borderColor, maxHeight: 300}]}>
|
||||
{
|
||||
Array.isArray(resultSearchUserByName.response) && (resultSearchUserByName.response.length) > 0 ?
|
||||
|
||||
resultSearchUserByName.response.map((item) => (
|
||||
<TouchableOpacity onPress={() => {
|
||||
this.props.searchUserReset();
|
||||
this.setState({
|
||||
userName: '',
|
||||
displayDialogResultSearch: false
|
||||
});
|
||||
console.log("Markers", this.state.markers);
|
||||
|
||||
if (this.state.markers.filter((marker) => marker.phone === item.phone).length > 0)
|
||||
this.userChangeMarker(item);
|
||||
else {
|
||||
this.setState({
|
||||
markers: [...this.state.markers, item],
|
||||
}, () => {
|
||||
this.userChangeMarker(item);
|
||||
});
|
||||
this.setState({currentNetworkSize: this.state.currentNetworkSize + 1})
|
||||
}
|
||||
}} style={[styles.paymentItem]}>
|
||||
|
||||
<View style={{flexDirection: 'column'}}>
|
||||
<Text style={styles.title}>{item.lastname}</Text>
|
||||
<Text style={styles.description}>
|
||||
{`${item.phone} | ${item.email} | ${item.adresse}`}
|
||||
</Text>
|
||||
</View>
|
||||
</TouchableOpacity>
|
||||
)) :
|
||||
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
|
||||
<Text style={Typography.body1}>{I18n.t('NO_USAGER_CORRESPONDING_TO_SEARCH')}</Text>
|
||||
</View>
|
||||
|
||||
}
|
||||
</ScrollView>
|
||||
|
||||
<Dialog.Button bold={true} label={I18n.t('OK')} onPress={() => {
|
||||
this.props.searchUserReset();
|
||||
this.setState({
|
||||
displayDialogResultSearch: false
|
||||
});
|
||||
}}/>
|
||||
</Dialog.Container>
|
||||
);
|
||||
}
|
||||
|
||||
renderRow = (row) => (
|
||||
<TouchableOpacity key={row} onPress={() => this.onRowPress(row)}>
|
||||
<View style={styles.rowContainer}>
|
||||
|
@ -2613,13 +2885,28 @@ const mapStateToProps = state => ({
|
|||
loadingSaveOneSignal: state.saveOnesignalReducer.loading,
|
||||
resultSaveOneSignal: state.saveOnesignalReducer.result,
|
||||
errorSaveOneSignal: state.saveOnesignalReducer.error,
|
||||
|
||||
loadingSearchUserByName: state.searchUserReducer.loading,
|
||||
resultSearchUserByName: state.searchUserReducer.result,
|
||||
errorSearchUserByName: state.searchUserReducer.error,
|
||||
|
||||
|
||||
loadingGetQRCodeDetail: state.getQRCodeDetailReducer.loading,
|
||||
resultGetQRCodeDetail: state.getQRCodeDetailReducer.result,
|
||||
errorGetQRCodeDetail: state.getQRCodeDetailReducer.error,
|
||||
});
|
||||
|
||||
const mapDispatchToProps = dispatch => bindActionCreators({
|
||||
getAuthApiKey,
|
||||
getWalletActivated,
|
||||
saveOnesignalIdsAction,
|
||||
saveOnesignalIdsReset
|
||||
saveOnesignalIdsReset,
|
||||
|
||||
searchUserAction,
|
||||
searchUserReset,
|
||||
|
||||
getQRCodeDetailReset,
|
||||
getQRCodeDetailAction
|
||||
}, dispatch);
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(Home);
|
||||
|
|
|
@ -434,7 +434,7 @@ const ExecuterPrescriptionScreen = ({
|
|||
} else {
|
||||
setConsultation({
|
||||
...consultation,
|
||||
prestations: consultation.prestations.map(presta => {
|
||||
prescriptions: consultation.prescriptions.map(presta => {
|
||||
return elementToSetPrice.id === presta.id ? {
|
||||
...presta,
|
||||
unit_price: consultationClone.exams.filter(prestation => prestation.id === elementToSetPrice.id)[0].unit_price
|
||||
|
@ -627,7 +627,7 @@ const ExecuterPrescriptionScreen = ({
|
|||
prescriptions: [
|
||||
{
|
||||
unit_price: values.price,
|
||||
quantity: values.examen_quantity
|
||||
quantity: consultation.prescriptions.filter(prescription => elementToSetPrice.id === prescription.id)[0].quantity
|
||||
}
|
||||
],
|
||||
});
|
||||
|
|
|
@ -84,7 +84,7 @@ import Modal from "react-native-modal";
|
|||
import QRCodeScanner from "react-native-qrcode-scanner";
|
||||
import {RNCamera} from "react-native-camera";
|
||||
import * as Utils from "../../../utils/UtilsFunction";
|
||||
import {cutString, uppercaseFirstLetter} from "../../../utils/UtilsFunction";
|
||||
import {cutString, cutStringWithoutDot, uppercaseFirstLetter} from "../../../utils/UtilsFunction";
|
||||
import {store} from "../../../redux/store";
|
||||
import {Typography} from "../../../config/typography";
|
||||
import DateTimePicker from "@react-native-community/datetimepicker";
|
||||
|
@ -623,8 +623,8 @@ const ModifierFeuilleSoinScreen = ({
|
|||
|
||||
const ModifyNewExamen = Yup.object().shape({
|
||||
examen_name: Yup.string().required(I18n.t('THIS_FIELD_IS_REQUIRED')),
|
||||
examen_quantite: Yup.number(),
|
||||
amount: Yup.number().required(I18n.t('THIS_FIELD_IS_REQUIRED'))
|
||||
examen_quantite: Yup.mixed(),
|
||||
amount: Yup.mixed(),
|
||||
});
|
||||
|
||||
const AddNewMedicament = Yup.object().shape({
|
||||
|
@ -884,7 +884,7 @@ const ModifierFeuilleSoinScreen = ({
|
|||
care_condition: consultation._care_condition
|
||||
});
|
||||
}}
|
||||
editable={false}
|
||||
editable={values.code_acte !== '' ? values.code_acte.billing_type === 'FREE' : true}
|
||||
onBlur={handleBlur('amount_prestation')}
|
||||
success={touched.amount_prestation && !errors.amount_prestation}
|
||||
touched={touched.amount_prestation}
|
||||
|
@ -1690,6 +1690,7 @@ const ModifierFeuilleSoinScreen = ({
|
|||
isSubmitting,
|
||||
}) => (
|
||||
<ScrollView style={{flex: 1}}>
|
||||
{console.log("Errors", errors)}
|
||||
<View
|
||||
style={[styles.containModal, {backgroundColor: Color.containerBackgroundColor}]}>
|
||||
<Modal
|
||||
|
@ -2037,7 +2038,7 @@ const ModifierFeuilleSoinScreen = ({
|
|||
]}
|
||||
key={item.id}>
|
||||
<Text body2 semibold numberOfLines={2}>
|
||||
{`${item.description} ${item.unit_price ? ' - ' + item.unit_price : ''} \n ${item.act.name}`}
|
||||
{`${item.description} ${item.unit_price ? ' - ' + item.unit_price : ''} \n ${cutStringWithoutDot(item.act.name, 50)}`}
|
||||
</Text>
|
||||
<View style={styles.iconRight}>
|
||||
<TouchableOpacity onPress={() => {
|
||||
|
|
|
@ -653,7 +653,7 @@
|
|||
"CLASSE_PRESTATAIRE": "Classe de prestataire",
|
||||
"FRAIS_DEPLACEMENT": "Frais de déplacement",
|
||||
"AJOUTER_MEDICAMENT": "Ajouter médicament/appareil",
|
||||
"AJOUTER_EXAMEN": "Ajouter examen",
|
||||
"AJOUTER_EXAMEN": "Ajouter autre acte ou examen",
|
||||
"NAME": "Nom",
|
||||
"POSOLOGIE": "Posologie",
|
||||
"QUANTITE": "Quantité",
|
||||
|
@ -731,5 +731,11 @@
|
|||
"AMOUNT_FREE": "Montant libre",
|
||||
"DESCRIPTION": "Description",
|
||||
"EXECUTION": "Execution",
|
||||
"UNIT_QUANTITE": "Qté unitaire"
|
||||
"UNIT_QUANTITE": "Qté unitaire",
|
||||
"NO_USAGER_CORRESPONDING_TO_SEARCH": "Aucun usager ne correspond à votre recherche",
|
||||
"USAGER_SEARCH": "Recherche d'un usager",
|
||||
"BY_NAME": "Par nom",
|
||||
"BY_QR_CODE": "Par QR Code",
|
||||
"SCAN": "Scanner",
|
||||
"BRING_YOUR_CAMERA_CLOSER_TO_SCAN_QR_CODE": "Approchez votre caméra du QR Code afin de le scanner"
|
||||
}
|
||||
|
|
|
@ -82,6 +82,11 @@ export const getIlinkBankListUrl = testBaseUrl + '/walletService/wallets/users/b
|
|||
export const linkBankAccountUrl = testBaseUrl + '/walletService/wallets/users/link_bank_account';
|
||||
export const payBillUrl = testBaseUrl + '/walletService/transactions/ilink';
|
||||
|
||||
export const searchUserUrl = testBaseUrl + '/walletService/search/users';
|
||||
export const searchUserHomeUrl = testBaseUrl + '/walletService/agents';
|
||||
export const getQRCodeDetail = testBaseUrl + '/walletService/qrcode/read';
|
||||
|
||||
|
||||
export const facturerSoinUrl = testBaseUrl + '/nanoSanteService/generate-invoice';
|
||||
export const invoiceUrl = testBaseUrl + '/nanoSanteService/invoices';
|
||||
export const getInsuranceListUrl = testBaseUrl + '/nanoSanteService/insurances';
|
||||
|
|
|
@ -2,9 +2,12 @@ import {
|
|||
commissionAmount,
|
||||
getIlinkBankListUrl,
|
||||
getOperatorListUrl,
|
||||
getQRCodeDetail,
|
||||
linkBankAccountUrl,
|
||||
linkCardUrl,
|
||||
payBillUrl,
|
||||
searchUserHomeUrl,
|
||||
searchUserUrl,
|
||||
walletActionUrl,
|
||||
walletDetailUrl,
|
||||
walletUserSimpleActionUrl
|
||||
|
@ -18,6 +21,10 @@ import {
|
|||
fetchGetListOperatorPending,
|
||||
fetchGetListOperatorReset,
|
||||
fetchGetListOperatorSuccess,
|
||||
fetchGetQRCodeDetailError,
|
||||
fetchGetQRCodeDetailPending,
|
||||
fetchGetQRCodeDetailReset,
|
||||
fetchGetQRCodeDetailSuccess,
|
||||
fetchLinkCardError,
|
||||
fetchLinkCardPending,
|
||||
fetchLinkCardReset,
|
||||
|
@ -30,6 +37,10 @@ import {
|
|||
fetchReattachAccountPending,
|
||||
fetchReattachAccountReset,
|
||||
fetchReattachAccountSuccess,
|
||||
fetchSearchUserError,
|
||||
fetchSearchUserPending,
|
||||
fetchSearchUserReset,
|
||||
fetchSearchUserSuccess,
|
||||
fetchWalleGetCommissionError,
|
||||
fetchWalletGetCommissionPending,
|
||||
fetchWalletGetCommissionSuccess,
|
||||
|
@ -351,4 +362,77 @@ export const reattachAccountReset = () => {
|
|||
return dispatch => {
|
||||
dispatch(fetchReattachAccountReset());
|
||||
}
|
||||
};
|
||||
|
||||
export const searchUserAction = (data, searchFromMap = false) => {
|
||||
|
||||
const auth = store.getState().authKeyReducer;
|
||||
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
|
||||
|
||||
return dispatch => {
|
||||
dispatch(fetchSearchUserPending());
|
||||
|
||||
axios({
|
||||
url: searchFromMap ? searchUserHomeUrl : `${searchUserUrl}?name=${data}`,
|
||||
method: searchFromMap ? 'POST' : 'GET',
|
||||
data,
|
||||
headers: {
|
||||
'Authorization': authKey,
|
||||
'X-Localization': I18n.currentLocale()
|
||||
}
|
||||
})
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
dispatch(fetchSearchUserSuccess(response));
|
||||
})
|
||||
.catch(error => {
|
||||
if (error.response)
|
||||
dispatch(fetchSearchUserError(error.response));
|
||||
else if (error.request)
|
||||
dispatch(fetchSearchUserError(error.request));
|
||||
else
|
||||
dispatch(fetchSearchUserError(error.message));
|
||||
});
|
||||
}
|
||||
}
|
||||
export const searchUserReset = () => {
|
||||
return dispatch => {
|
||||
dispatch(fetchSearchUserReset());
|
||||
}
|
||||
};
|
||||
|
||||
export const getQRCodeDetailAction = (id) => {
|
||||
|
||||
const auth = store.getState().authKeyReducer;
|
||||
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
|
||||
|
||||
return dispatch => {
|
||||
dispatch(fetchGetQRCodeDetailPending());
|
||||
|
||||
axios({
|
||||
url: `${getQRCodeDetail}/${id}`,
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Authorization': authKey,
|
||||
'X-Localization': I18n.currentLocale()
|
||||
}
|
||||
})
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
dispatch(fetchGetQRCodeDetailSuccess(response));
|
||||
})
|
||||
.catch(error => {
|
||||
if (error.response)
|
||||
dispatch(fetchGetQRCodeDetailError(error.response));
|
||||
else if (error.request)
|
||||
dispatch(fetchGetQRCodeDetailError(error.request));
|
||||
else
|
||||
dispatch(fetchGetQRCodeDetailError(error.message));
|
||||
});
|
||||
}
|
||||
}
|
||||
export const getQRCodeDetailReset = () => {
|
||||
return dispatch => {
|
||||
dispatch(fetchGetQRCodeDetailReset());
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue