reset password

This commit is contained in:
henrydays 2019-03-12 22:52:12 +00:00
parent 2239ad99db
commit 3d2f5bb1cc
3 changed files with 74 additions and 7 deletions

View File

@ -87,7 +87,9 @@ class App extends Component {
UI_loginScannerActive: false,
userDetails: { username: "", password: "" },
isConnected: true,
modalOpen: false
modalOpen: false,
modalResetPassword:false,
resetText:''
};
}
_print = () => {
@ -127,6 +129,9 @@ class App extends Component {
this.handleConnectivityChange
);
}
_toggle=()=>{
this.setState({modalResetPassword:false})
}
_keyboardDidShow() {
//alert('Keyboard Shown');
@ -182,6 +187,39 @@ class App extends Component {
/>
</View>
</Modal>
<Modal
isVisible={this.state.modalResetPassword}
onBackdropPress={this._toggle}
onBackButtonPress={this._toggle}
>
<View style={{ backgroundColor: "white" , padding:20,paddingBottom:0, alignItems:'center'}}>
<View>
<Text style={{textAlign:'center',fontSize:23, fontWeight:'bold', color:'#CC1A17', margin:30}}>Reset Password</Text>
<Text style={{textAlign:'center', }}>Deves introduzir o email com o qual efectuaste a compra do bilhete.</Text>
<TextInput
style={styles.resetPassword}
onFocus={this._print}
maxLength={10}
blurOnSubmit={true}
secureTextEntry={true}
onChangeText={r => this.setState({ resetText })}
clearButtonMode="always"
value={this.state.resetText}
clearTextOnFocus={true}
onSubmitEditing={Keyboard.dismiss}
placeholder="geral@enei.pt"
/>
<Button
onPress={this._toggle}
title={"Enviar"}
color={"#CC1A17"}
></Button>
<Text style={{textAlign:'center', fontSize:12, margin:10,marginBottom:0}}> Caso tenhas problemas com este processo deves contactar a comissão atravês do email geral.</Text>
</View>
</View>
</Modal>
<View
style={{
width: "100%",
@ -261,7 +299,7 @@ class App extends Component {
<View style={styles.textRow}>
<RkText rkType="primary3">Não sabes a password?</RkText>
<RkButton rkType="clear" onPress={this.onSignUpButtonPressed}>
<TouchableOpacity onPress={() => <resetPassword></resetPassword>}>
<TouchableOpacity onPress={() => {this.setState({modalResetPassword:true})}}>
<RkText style={{ color: "red" }} kType="header6">
Recuperar Password
</RkText>
@ -292,6 +330,26 @@ const styles = {
cameraContainer: {
height: Dimensions.get('window').height ,
},
resetPassword:{
borderRadius: 90,
borderColor: "#bfbdbd",
borderWidth: 1,
margin:20,
marginTop: 60,
marginBottom: 60,
width: SCREEN_WIDTH * 0.8,
backgroundColor: "white",
borderRadius: 90,
height: SCREEN_HEIGHT * 0.08,
borderColor: "#bfbdbd",
borderWidth: 1,
paddingLeft: SCREEN_WIDTH * 0.05
},
passwordInput: {
borderRadius: 90,

View File

@ -325,7 +325,7 @@ class choosePath extends React.Component {
{this._verifySession(item[index].Id) && (
<TouchableOpacity
onPress={() => {
this.props.waitChangeGuest()
this.props.removeSession(
this.props.user,
this.props.userDetails.token,
@ -347,7 +347,7 @@ class choosePath extends React.Component {
<TouchableOpacity
onPress={() => {
this.props.getUserInfo(this.props.userDetails.token)
//this.props.waitChangeGuest()
this.props.waitChangeGuest()
this.props.signSession(
this.props.user,
this.props.userDetails.token,

View File

@ -294,6 +294,9 @@ export function signSession(user, token, idSession) {
//se não existir erro na chamada...
.then(a => {
if (a.data.Success) {
axios.defaults.headers.common = {
Authorization: `bearer ${token.access_token}`
};
axios
.get("/Attendee/AvailableSessions")
@ -315,7 +318,7 @@ export function signSession(user, token, idSession) {
"Sucesso",
"Inscrição na sessão efectuada com sucesso"
);
console.log("aqui1")
//obter informações pessoais:
axios
.get("/Attendee/Detail")
@ -324,6 +327,7 @@ export function signSession(user, token, idSession) {
alert(error);
})
.then(sucess => {
console.log("aqui2")
var result = getE(user);
dispatch({
type: SIGN_SESSION,
@ -453,7 +457,7 @@ export function changeGuestList(token, guestID) {
axios
.get(full)
.then(function(response) {
console.log(response);
axios.defaults.baseURL = "http://enei2019.uingress.com/internal/api";
axios.defaults.headers.common = {
@ -464,7 +468,9 @@ export function changeGuestList(token, guestID) {
.get("/Attendee/AvailableSessions")
.then(function(response) {
// handle success
//console.log(response);
var cenas = [];
@ -476,11 +482,14 @@ export function changeGuestList(token, guestID) {
)(response.data);
for (let key in result) {
result[key].option = 0;
cenas.push(result[key]);
console.log();
}
console.log("-.-.-..-.-.-.-.-.-.")
console.log(cenas);
console.log("-.-.-..-.-.-.-.-.-.")
dispatch({
type: CHANGE_GUEST,
sessions: response.data,