@@ -1,4 +1,4 @@ | |||
#Sat Jan 08 15:18:35 IST 2022 | |||
#Sat Jan 08 20:40:28 IST 2022 | |||
base.0=D\:\\downlooad\\desihealth_customer (1)\\android\\app\\build\\intermediates\\dex\\release\\mergeDexRelease\\out\\classes.dex | |||
path.1=classes2.dex | |||
renamed.1=classes2.dex | |||
@@ -176,7 +176,7 @@ document.getElementById(id).style.display = 'none'; | |||
<span class="mdl-layout-title">Lint Report: No errors or warnings</span> | |||
<div class="mdl-layout-spacer"></div> | |||
<nav class="mdl-navigation mdl-layout--large-screen-only"> | |||
Check performed at Sat Jan 08 15:18:27 IST 2022 </nav> | |||
Check performed at Sat Jan 08 20:40:21 IST 2022 </nav> | |||
</div> | |||
</header> | |||
<div class="mdl-layout__drawer"> | |||
@@ -143,14 +143,10 @@ class AddressEnter extends Component<Props> { | |||
register = async () => { | |||
this.handleUserNavigation(); | |||
Keyboard.dismiss(); | |||
// await this.checkValidate(); | |||
// if (this.state.validation) | |||
// this.props.serviceActionPending(); | |||
// let countries = Country.getAllCountries(); | |||
// console.log(countries[0].name); | |||
await axios | |||
.post( | |||
`${api_url1}/clients/address/add`, | |||
`${api_url1}/clients/address`, | |||
{ | |||
addressLine1: this.state.address, | |||
@@ -170,49 +166,49 @@ class AddressEnter extends Component<Props> { | |||
// login() | |||
// console.log(response); | |||
alert("Address Added"); | |||
this.props.navigation.navigate("AddressList"); | |||
this.props.navigation.navigate("More"); | |||
}) | |||
.catch((error) => { | |||
console.log(error); | |||
}); | |||
}; | |||
get_blood_list = async () => { | |||
await axios({ | |||
method: "get", | |||
url: api_url + get_blood_list, | |||
}) | |||
.then(async (response) => { | |||
this.setState({ blood_group_list: response.data.result }); | |||
}) | |||
.catch((error) => { | |||
alert("Sorry, something went wrong!"); | |||
}); | |||
}; | |||
saveData = async () => { | |||
if (this.props.status == 1) { | |||
try { | |||
await AsyncStorage.setItem("user_id", this.props.data.id.toString()); | |||
await AsyncStorage.setItem( | |||
"username", | |||
this.props.data.customer_name.toString() | |||
); | |||
await AsyncStorage.setItem( | |||
"number", | |||
this.props.data.phone_number.toString() | |||
); | |||
await AsyncStorage.setItem("email", this.props.data.email.toString()); | |||
global.id = await this.props.data.id; | |||
global.username = await this.props.data.customer_name; | |||
global.number = await this.props.data.phone_number; | |||
global.email = await this.props.data.email; | |||
await this.home(); | |||
} catch (e) {} | |||
} else { | |||
alert(this.props.message); | |||
} | |||
}; | |||
// get_blood_list = async () => { | |||
// await axios({ | |||
// method: "get", | |||
// url: api_url + get_blood_list, | |||
// }) | |||
// .then(async (response) => { | |||
// this.setState({ blood_group_list: response.data.result }); | |||
// }) | |||
// .catch((error) => { | |||
// alert("Sorry, something went wrong!"); | |||
// }); | |||
// }; | |||
// saveData = async () => { | |||
// if (this.props.status == 1) { | |||
// try { | |||
// await AsyncStorage.setItem("user_id", this.props.data.id.toString()); | |||
// await AsyncStorage.setItem( | |||
// "username", | |||
// this.props.data.customer_name.toString() | |||
// ); | |||
// await AsyncStorage.setItem( | |||
// "number", | |||
// this.props.data.phone_number.toString() | |||
// ); | |||
// await AsyncStorage.setItem("email", this.props.data.email.toString()); | |||
// global.id = await this.props.data.id; | |||
// global.username = await this.props.data.customer_name; | |||
// global.number = await this.props.data.phone_number; | |||
// global.email = await this.props.data.email; | |||
// await this.home(); | |||
// } catch (e) {} | |||
// } else { | |||
// alert(this.props.message); | |||
// } | |||
// }; | |||
checkValidate=()=> { | |||
if( | |||
@@ -7,7 +7,7 @@ import { | |||
Image, | |||
TouchableOpacity, | |||
} from "react-native"; | |||
import { Container, Left, Icon, Footer, Col,Right } from "native-base"; | |||
import { Container, Left, Icon, Footer, Col, Right } from "native-base"; | |||
import { Button } from "react-native-elements"; | |||
import axios from "axios"; | |||
import { connect } from "react-redux"; | |||
@@ -52,15 +52,15 @@ class AddressList extends Component<Props> { | |||
this.getProfile(); | |||
} | |||
async componentDidMount() { | |||
componentDidMount() { | |||
this.getProfile(); | |||
this._unsubscribe = this.props.navigation.addListener("focus", () => { | |||
this.address_list(); | |||
}); | |||
// this._unsubscribe = this.props.navigation.addListener("focus", () => { | |||
// this.address_list(); | |||
// }); | |||
} | |||
componentWillUnmount() { | |||
this._unsubscribe(); | |||
// this._unsubscribe(); | |||
} | |||
getProfile = async () => { | |||
await axios | |||
@@ -70,86 +70,93 @@ class AddressList extends Component<Props> { | |||
.then((res) => { | |||
this.setState({ order2: res.data.data.addressess }); | |||
console.log(res.data.data.addressess); | |||
// alert(this.state.order2)profilePicture | |||
// this.setState({ | |||
// // customer_name: res.data.data.username, | |||
// // phone_number: res.data.data.number, | |||
// // email: res.data.data.email, | |||
// // blood_group:res.data.data.blood_group | |||
// }) | |||
}) | |||
.catch((res) => { | |||
console.log(res); | |||
}); | |||
}; | |||
address_list = async () => { | |||
this.setState({ isLoding: true }); | |||
this.setState({ dialogVisible: false }); | |||
this.props.deleteServiceActionPending(); | |||
await axios({ | |||
method: "post", | |||
url: api_url + address_list, | |||
data: { customer_id: global.id }, | |||
}) | |||
.then(async (response) => { | |||
//alert(JSON.stringify(response)); | |||
this.setState({ | |||
isLoding: false, | |||
result: response.data.result, | |||
api_status: 1, | |||
}); | |||
await this.props.deleteServiceActionSuccess(response.data); | |||
}) | |||
.catch((error) => { | |||
this.setState({ isLoding: false }); | |||
this.props.deleteServiceActionError(error); | |||
}); | |||
}; | |||
// address_list = async () => { | |||
// this.setState({ isLoding: true }); | |||
// this.setState({ dialogVisible: false }); | |||
// this.props.deleteServiceActionPending(); | |||
// await axios({ | |||
// method: "post", | |||
// url: api_url + address_list, | |||
// data: { customer_id: global.id }, | |||
// }) | |||
// .then(async (response) => { | |||
// //alert(JSON.stringify(response)); | |||
// this.setState({ | |||
// isLoding: false, | |||
// result: response.data.result, | |||
// api_status: 1, | |||
// }); | |||
// await this.props.deleteServiceActionSuccess(response.data); | |||
// }) | |||
// .catch((error) => { | |||
// this.setState({ isLoding: false }); | |||
// this.props.deleteServiceActionError(error); | |||
// }); | |||
// }; | |||
address_delete = async () => { | |||
this.setState({ isLoding: true }); | |||
this.setState({ dialogVisible: false }); | |||
this.props.deleteServiceActionPending(); | |||
await axios({ | |||
method: "post", | |||
url: api_url + address_delete, | |||
data: { customer_id: global.id, address_id: this.state.deleting_address }, | |||
}) | |||
address_delete = async (id) => { | |||
//eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYxZDhiOGU3MDA5MWUyMDAxNjEzYWVkOSIsImlhdCI6MTY0MTg3OTYwNSwiZXhwIjoxNjUwNTE5NjA1fQ.Dc4VQba1h21Xj-PFI7ln--n1o-l7ilQgv8GlkASziCM | |||
// await axios | |||
// .delete( | |||
// `${api_url1}/clients/address/`, | |||
// { _id: id }, | |||
// { headers: { Authorization: `Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYxZDhiOGU3MDA5MWUyMDAxNjEzYWVkOSIsImlhdCI6MTY0MTg3OTYwNSwiZXhwIjoxNjUwNTE5NjA1fQ.Dc4VQba1h21Xj-PFI7ln--n1o-l7ilQgv8GlkASziCM` } } | |||
// //{ headers: { Authorization: `Bearer ${global.fcm_token}` } } | |||
// ) | |||
// .then((res) => { | |||
// alert(res); | |||
// }); | |||
await axios | |||
.delete( | |||
`${api_url1}/clients/address`, | |||
{ headers: { Authorization: `Bearer ${global.fcm_token}` } } | |||
, { _id: id } | |||
) | |||
.then(async (response) => { | |||
this.setState({ isLoding: false }); | |||
await this.props.deleteServiceActionSuccess(response.data); | |||
await this.setState({ deleting_address: 0 }); | |||
// console.log(response); | |||
alert('address deleted'); | |||
this.getProfile(); | |||
}) | |||
.catch((error) => { | |||
this.setState({ isLoding: false }); | |||
this.props.deleteServiceActionError(error); | |||
}); | |||
// this.setState({ isLoding: true }); | |||
// this.setState({ dialogVisible: false }); | |||
// this.props.deleteServiceActionPending(); | |||
// await axios.delete(), | |||
// url: api_url + address_delete, | |||
// data: {address_id: id }, | |||
// }) | |||
// .then(async (response) => { | |||
// // this.setState({ isLoding: false }); | |||
// // await this.props.deleteServiceActionSuccess(response.data); | |||
// // await this.setState({ deleting_address: 0 }); | |||
// }) | |||
// .catch((error) => { | |||
// this.setState({ isLoding: false }); | |||
// this.props.deleteServiceActionError(error); | |||
// }); | |||
}; | |||
open_popup(id) { | |||
this.setState({ dialogVisible: true, deleting_address: id }); | |||
} | |||
// open_popup(id) { | |||
// this.setState({ dialogVisible: true, deleting_address: id }); | |||
// } | |||
close_popup() { | |||
this.setState({ dialogVisible: false, deleting_address: 0 }); | |||
} | |||
// close_popup() { | |||
// this.setState({ dialogVisible: false, deleting_address: 0 }); | |||
// } | |||
handleBackButtonClick = () => { | |||
this.props.navigation.goBack(null); | |||
}; | |||
add_address = () => { | |||
RNAndroidLocationEnabler.promptForEnableLocationIfNeeded({ | |||
interval: 10000, | |||
fastInterval: 5000, | |||
}) | |||
.then((data) => { | |||
this.props.navigation.navigate("AddressMap"); | |||
}) | |||
.catch((err) => { | |||
alert("Please enable your location"); | |||
}); | |||
this.props.navigation.navigate("AddressMap"); | |||
}; | |||
edit_address = (id) => { | |||
@@ -197,45 +204,45 @@ class AddressList extends Component<Props> { | |||
<Text style={styles.add_list_style3}>Address #{key + 1}</Text> | |||
</Left> | |||
</View> | |||
<View style={styles.add_list_style4}> | |||
{/* <View style={styles.add_list_style4}> | |||
<Image | |||
style={styles.add_list_style5} | |||
source={{ uri: img_url + row.static_map }} | |||
/> | |||
</View> | |||
</View> */} | |||
<View style={styles.add_list_style6}> | |||
<Left> | |||
<Text style={styles.add_list_style7}>{row.addressLine1}</Text> | |||
<Text style={styles.add_list_style7}> | |||
{row.city},{row.state},{row.country} | |||
</Text> | |||
<Text style={styles.add_list_style7}>{row.pincode}</Text> | |||
</Left> | |||
</View> | |||
<View style={styles.add_list_style8}> | |||
<Col style={styles.add_list_style9}> | |||
<View | |||
style={{flexDirection:'row',justifyContent:'space-between'}} | |||
> | |||
<Text | |||
<View | |||
style={{ | |||
flexDirection: "row", | |||
justifyContent: "space-between", | |||
}} | |||
> | |||
{/* <Text | |||
// onPress={this.edit_address.bind(this, row.id)} | |||
style={styles.add_list_style10} | |||
> | |||
EDIT | |||
</Text> | |||
<Text | |||
// onPress={this.edit_address.bind(this, row.id)} | |||
style={styles.add_list_style10} | |||
</Text> */} | |||
<TouchableOpacity | |||
onPress={() => { | |||
this.address_delete(row._id); | |||
}} | |||
> | |||
Delete | |||
</Text> | |||
</View> | |||
<Text style={styles.add_list_style10}>Delete</Text> | |||
</TouchableOpacity> | |||
</View> | |||
<Right> | |||
</Right> | |||
<Right /> | |||
</Col> | |||
{/*<Col style={{ width:'25%' }}> | |||
<Text onPress={this.open_popup.bind(this,row.id)} style={styles.btn} >DELETE</Text> | |||
@@ -29,92 +29,22 @@ export default class AddressMap extends Component { | |||
coords: "", | |||
address1: "", | |||
}; | |||
// this.newOne(); | |||
this.handleUserNavigation(); | |||
// this.getData(); | |||
// this.onRegionChange(); | |||
// this.getAddress(this.state.latitude,this.state.longitude); | |||
} | |||
componentDidMount() { | |||
this.handleUserNavigation(); | |||
// this.onRegionChange(); | |||
// this.getAddress(); | |||
// this.newOne(); | |||
} | |||
getAddress = async(ny) => { | |||
// await Geocoder.fallbackToGoogle('AIzaSyB_mBINSZ5m6dVyK6ANTLoEhkZq1nH9dG8'); | |||
// try { | |||
// let res = await Geocoder.geocodePosition(ny); | |||
// let addr = res[0].formattedAddress; | |||
// alert(addr); | |||
// this.setState({ | |||
// address: addr, | |||
// }); | |||
// } catch (err) { | |||
// alert(err); | |||
// } | |||
}; | |||
// newOne=()=>{ | |||
// const ny={lat:this.state.latitude,lng:this.state.latitude} | |||
// this.getAddress(ny); | |||
// } | |||
// getData=()=>{ | |||
// Geocoder.setApiKey('AIzaSyB_mBINSZ5m6dVyK6ANTLoEhkZq1nH9dG8'); | |||
// Geocoder.getFromLatLng(41.89,12.49).then( | |||
// json=>{ | |||
// var address_component=json.results[0].address_component[0] | |||
// alert(address_component.long_name) | |||
// } | |||
// ) | |||
// } | |||
// reverseGeocode = () => { | |||
// const key = "320646a99ec348baa3beb82943516ae6"; | |||
// opencage.geocode({ key, q: this.state.coords }).then((response) => { | |||
// result = response.results[0]; | |||
// console.log("not working", result); | |||
// this.setState({ address1: result.formatted }); | |||
// }); | |||
// }; | |||
// onRegionChange = async () => { | |||
// // this.setState({ address : 'Please wait...' }); | |||
// fetch( | |||
// "https://maps.googleapis.com/maps/api/geocode/json?address=" + | |||
// this.state.latitude + | |||
// "," + | |||
// this.state.longitude + | |||
// "&key=" + | |||
// "AIzaSyB_mBINSZ5m6dVyK6ANTLoEhkZq1nH9dG8" | |||
// ) | |||
// .then((response) => response.json()) | |||
// .then(async (responseJson) => { | |||
// if (responseJson.results[0].formatted_address != undefined) { | |||
// let address = responseJson.results[0].address_components; | |||
// let pin_code = address[address.length - 1].long_name; | |||
// this.setState({ | |||
// // pin_code: pin_code, | |||
// address: responseJson.results[0].formatted_address, | |||
// // latitude: value.latitude, | |||
// // longitude: value.longitude, | |||
// }) | |||
// .then(res=>{console.log(res)}) | |||
// } else { | |||
// this.setState({ address: "Sorry something went wrong" }); | |||
// } | |||
// }); | |||
// }; | |||
handleUserNavigation = async () => { | |||
Geolocation.getCurrentPosition((info) => { | |||
try{ | |||
await Geolocation.getCurrentPosition((info) => { | |||
this.setState({ | |||
latitude: info.coords.latitude, | |||
longitude: info.coords.longitude, | |||
@@ -124,7 +54,8 @@ export default class AddressMap extends Component { | |||
console.log(info); | |||
}); | |||
// alert('gu') | |||
} catch(err){alert(err)} | |||
}; | |||
render() { | |||
return ( | |||
@@ -139,7 +70,7 @@ export default class AddressMap extends Component { | |||
latitude: this.state.latitude, | |||
longitude: this.state.longitude, | |||
latitudeDelta: .001, | |||
longitudeDelta: .05, | |||
longitudeDelta: .03, | |||
}} | |||
> | |||
<Marker | |||