updates
This commit is contained in:
parent
824fe50c72
commit
483a7216ca
Binary file not shown.
After Width: | Height: | Size: 99 KiB |
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 9.4 KiB |
|
@ -85,7 +85,7 @@ class Home extends Component {
|
|||
//console.log(this.props.token);
|
||||
|
||||
|
||||
// this.props.getUserInfo(this.props.userDetails.token);
|
||||
this.props.getUserInfo(this.props.userDetails.token);
|
||||
|
||||
|
||||
//console.log('logged:'+this.props.logged);
|
||||
|
|
|
@ -14,13 +14,13 @@ import Modal from "react-native-modal";
|
|||
|
||||
import IconF from "react-native-vector-icons/Foundation"
|
||||
import IconFA from "react-native-vector-icons/FontAwesome5"
|
||||
import { ScrollView } from 'react-native-gesture-handler';
|
||||
import { ScrollView, ViewPagerAndroid } from 'react-native-gesture-handler';
|
||||
|
||||
|
||||
const SCREEN_HEIGHT = Dimensions.get("window").height;
|
||||
const SCREEN_WIDTH = Dimensions.get("window").width;
|
||||
|
||||
|
||||
import FitImage from 'react-native-fit-image';
|
||||
export default class Jogo extends React.Component {
|
||||
state = {
|
||||
progress: 20,
|
||||
|
@ -63,15 +63,65 @@ state = {
|
|||
|
||||
<Modal
|
||||
isVisible={this.state.isModalVisible}
|
||||
animationInTiming={2000}
|
||||
animationInTiming={1000}
|
||||
animationOutTiming={800}
|
||||
|
||||
|
||||
>
|
||||
<View style={{ flex: 1 , backgroundColor:'white',margin:50}}>
|
||||
<Text>Hello!</Text>
|
||||
<TouchableOpacity onPress={this._toggleModal}>
|
||||
<Text>Hide me!</Text>
|
||||
</TouchableOpacity>
|
||||
|
||||
|
||||
<View style={{
|
||||
flex:1,
|
||||
|
||||
alignContent:'center',
|
||||
margin :SCREEN_WIDTH*0.1,
|
||||
backgroundColor:'white',
|
||||
marginBottom:SCREEN_HEIGHT*0.1,
|
||||
marginTop:SCREEN_HEIGHT*0.1,
|
||||
maxHeight:400
|
||||
}}>
|
||||
|
||||
<ImageBackground
|
||||
opacity={0.5}
|
||||
source={require('../assets/img/bg_3.jpg')}
|
||||
style={{
|
||||
width:'96%',
|
||||
height:'97.5%',
|
||||
margin:10
|
||||
}}
|
||||
>
|
||||
<View style={{width:'100%' ,margin:-10}}>
|
||||
<View style={{width:30}}><Button
|
||||
|
||||
onPress={this._toggleModal}
|
||||
title="X"
|
||||
color="#CC1A17"
|
||||
accessibilityLabel="Learn more about this purple button"
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
<View style={{flex:1, alignContent:'center', width:'96%', alignItems:'center'}}>
|
||||
<View style={{paddingTop:25,width:'40%',}}>
|
||||
<FitImage
|
||||
source={{ uri: 'https://upload.wikimedia.org/wikipedia/commons/8/8a/CSW_Gradiente_rgb.png' }}
|
||||
style={styles.fitImage}
|
||||
/>
|
||||
</View>
|
||||
<View style={{backgroundColor:'rgba(255,255,255,0.6)', width:'100%', marginTop:35}}>
|
||||
<Text style={{padding:10}}>A CRITICAL Software fornece sistemas e serviços de software para segurança e
|
||||
aplicações essenciais aos negócios, ajudando a garantir que os clientes atendam aos requisitos mais exigentes de qualidade - padrões de segurança, desempenho e fiabilidade</Text>
|
||||
</View>
|
||||
<View style={{width:'100%', marginTop:10}}><TouchableOpacity><Text style={{textAlign:'center', fontWeight:'bold', fontSize:18, color:'#CC1A17'}}>website</Text></TouchableOpacity></View>
|
||||
</View>
|
||||
|
||||
|
||||
</ImageBackground>
|
||||
|
||||
|
||||
|
||||
</View>
|
||||
|
||||
|
||||
</Modal>
|
||||
|
||||
<View style={styles.header}>
|
||||
|
@ -566,6 +616,11 @@ onPress={this._toggleModal}
|
|||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
|
||||
fitImage:{
|
||||
|
||||
|
||||
},
|
||||
points:{
|
||||
marginTop:-25,
|
||||
marginLeft:10,
|
||||
|
@ -591,7 +646,7 @@ const styles = StyleSheet.create({
|
|||
,
|
||||
imageBg:{
|
||||
|
||||
height:'97%',
|
||||
height:190,
|
||||
margin:5
|
||||
},
|
||||
label:{
|
||||
|
@ -657,7 +712,7 @@ const styles = StyleSheet.create({
|
|||
borderRightColor: 'transparent',
|
||||
borderBottomColor: 'white',
|
||||
marginLeft:54,
|
||||
marginTop:155
|
||||
marginTop:156
|
||||
},
|
||||
number:{
|
||||
marginTop:-18,
|
||||
|
|
|
@ -40,6 +40,7 @@ import { Dropdown } from 'react-native-material-dropdown';
|
|||
import {Card, Divider} from 'react-native-elements'
|
||||
import IconF from "react-native-vector-icons/Foundation"
|
||||
|
||||
import LinearGradient from 'react-native-linear-gradient';
|
||||
|
||||
|
||||
const formatObj = (obj) => {
|
||||
|
@ -68,7 +69,8 @@ class choosePath extends React.Component {
|
|||
});
|
||||
|
||||
state = {
|
||||
calendar:{}
|
||||
calendar:{},
|
||||
guest:'9'
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
|
@ -130,9 +132,40 @@ class choosePath extends React.Component {
|
|||
return (
|
||||
<ScrollView style={styles.page}>
|
||||
|
||||
|
||||
{this.state.guest=='9' && <LinearGradient colors={[ '#D95856', '#CC1A17']} style={styles.linearGradient}>
|
||||
<Text style={{margin:15,marginBottom:0, fontWeight:'bold', color:'white'}}> Empresa responsável: </Text>
|
||||
<View style={styles.companyContainer}>
|
||||
|
||||
</View>
|
||||
<View style={styles.companyDescription}>
|
||||
<Text style={{fontSize:16, fontWeight:'bold', margin:6, color:'white'}}>Critical Software</Text>
|
||||
<Text style={{margin:6, marginTop:0, color:'white'}}>A CRITICAL Software fornece sistemas e serviços de software para segurança e
|
||||
aplicações essenciais aos negócios.</Text>
|
||||
</View>
|
||||
<View style={styles.companyLogo}>
|
||||
<FitImage
|
||||
source={{ uri: 'https://upload.wikimedia.org/wikipedia/commons/8/8a/CSW_Gradiente_rgb.png' }}
|
||||
style={styles.fitImage}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
</LinearGradient>}
|
||||
{this.state.guest=='10' && <LinearGradient colors={[ '#5887FF', '#715AFF']} style={styles.linearGradient}>
|
||||
<Text style={{margin:15,marginBottom:0, fontWeight:'bold', color:'white'}}> Empresa responsável: </Text>
|
||||
<View style={styles.companyContainer}>
|
||||
<View style={styles.companyDescription}>
|
||||
<Text style={{fontSize:16, fontWeight:'bold', margin:6, color:'white'}}>Altice</Text>
|
||||
<Text style={{margin:6, marginTop:0, color:'white'}}>Altice é uma multinacional neerlandesa de telecomunicações, conteúdos, media, entretenimento e publicidade.</Text>
|
||||
</View>
|
||||
<View style={styles.companyLogo}>
|
||||
<FitImage
|
||||
source={{ uri: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTuIfl0Km4mTbCGdJSr4bWn_ApFHnOrjYsmJ4VlBL1OkaIlb93t' }}
|
||||
style={styles.fitImage}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
</LinearGradient>}
|
||||
|
||||
|
||||
|
||||
<View style={{flex:1,width:SCREEN_WIDTH*0.7, alignContent:'center'}}>
|
||||
|
||||
|
@ -281,6 +314,20 @@ onChange={() => this.setState({ checkbox1: !this.state.checkbox1 })}
|
|||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
companyLogo:{
|
||||
backgroundColor:'white',
|
||||
margin:20,
|
||||
width:SCREEN_WIDTH*0.35,
|
||||
borderRadius:3,
|
||||
padding:5
|
||||
},
|
||||
companyDescription:{
|
||||
// backgroundColor:'white',
|
||||
margin:20,
|
||||
marginRight:0,
|
||||
width:SCREEN_WIDTH*0.5,
|
||||
borderRadius:3,
|
||||
},
|
||||
sessionInfo:{
|
||||
margin:5
|
||||
},
|
||||
|
@ -315,8 +362,11 @@ const styles = StyleSheet.create({
|
|||
|
||||
companyContainer:{
|
||||
flex:1,
|
||||
backgroundColor:'blue',
|
||||
height:SCREEN_HEIGHT*0.25,
|
||||
// backgroundColor:'blue',
|
||||
|
||||
flexDirection:'row',
|
||||
marginTop:0
|
||||
|
||||
|
||||
},
|
||||
|
||||
|
|
|
@ -130,7 +130,7 @@ export function getAvailableSessions(token){
|
|||
});
|
||||
})
|
||||
.catch(function (error) {
|
||||
// handle error
|
||||
alert("Error a obter sessões disponíveis!!");
|
||||
console.log(error);
|
||||
})
|
||||
.then(function () {
|
||||
|
@ -205,9 +205,7 @@ const saveToken = async token => {
|
|||
obj.access_token = await AsyncStorage.getItem('userToken') || 'none';
|
||||
obj.expirationDateToken = await AsyncStorage.getItem('expirationDateToken') || 'none';
|
||||
obj.refreshToken = await AsyncStorage.getItem('refreshToken') || 'none';
|
||||
|
||||
|
||||
|
||||
} catch (error) {
|
||||
// Error retrieving data
|
||||
console.log(error.message);
|
||||
|
@ -230,12 +228,8 @@ const deleteToken = async () => {
|
|||
|
||||
const renewToken=(refresh)=>{
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
export function login(user, pass){
|
||||
|
||||
return (dispatch)=>{
|
||||
|
@ -252,17 +246,17 @@ export function login(user, pass){
|
|||
|
||||
for (var property in details) {
|
||||
|
||||
var encodedKey = encodeURIComponent(property);
|
||||
var encodedKey = encodeURIComponent(property);
|
||||
|
||||
var encodedValue = encodeURIComponent(details[property]);
|
||||
var encodedValue = encodeURIComponent(details[property]);
|
||||
|
||||
formBody.push(encodedKey + "=" + encodedValue);
|
||||
formBody.push(encodedKey + "=" + encodedValue);
|
||||
|
||||
}
|
||||
|
||||
formBody = formBody.join("&");
|
||||
|
||||
fetch('http://enei2019.uingress.com/internal/api/token', {
|
||||
fetch('https://tickets.enei.pt/internal/api/token', {
|
||||
|
||||
method: 'POST',
|
||||
|
||||
|
@ -276,6 +270,7 @@ export function login(user, pass){
|
|||
}).catch(err=>{
|
||||
|
||||
console.log(err);
|
||||
alert("Erro no login!!");
|
||||
|
||||
alert("error");
|
||||
co
|
||||
|
@ -285,9 +280,6 @@ export function login(user, pass){
|
|||
failedAttempt:true,
|
||||
tokenData:'error'
|
||||
});
|
||||
|
||||
|
||||
|
||||
}).then(res=>res.json()).then(parsed=>{
|
||||
|
||||
if(parsed.error_description=="Provided username and password is incorrect"){
|
||||
|
@ -320,14 +312,8 @@ export function login(user, pass){
|
|||
userDetails: details
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
)
|
||||
|
||||
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
export function hold(){
|
||||
|
@ -374,6 +360,7 @@ export function getUserInfo(token){
|
|||
|
||||
console.log("erro")
|
||||
// dispatch({ type: USER_INFO,onHold:false});
|
||||
alert("Erro a obter a informação pessoal.")
|
||||
})
|
||||
|
||||
|
||||
|
@ -575,7 +562,6 @@ export function checkUser(userDetails){
|
|||
userDetails.username != '' &&
|
||||
userDetails.password != undefined &&
|
||||
userDetails.password != ''
|
||||
|
||||
){
|
||||
|
||||
//verifica a validade do token
|
||||
|
@ -610,22 +596,17 @@ export function checkUser(userDetails){
|
|||
|
||||
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
|
||||
},
|
||||
|
||||
body: formBody
|
||||
|
||||
}).catch(err=>{
|
||||
|
||||
console.log(err);
|
||||
|
||||
alert("error");
|
||||
|
||||
|
||||
alert("Erro a validar o utilizador");
|
||||
|
||||
}).then(res=>res.json()).then(parsed=>{
|
||||
|
||||
if(parsed.error_description=="Provided username and password is incorrect"){
|
||||
|
||||
console.error("cenas da vida")
|
||||
|
||||
alert("Ups, password ou utilizador errada");
|
||||
}
|
||||
else{
|
||||
|
||||
|
@ -640,12 +621,12 @@ export function checkUser(userDetails){
|
|||
|
||||
dispatch({type: CHECK_USER, logged:true, onHold:false, userDetails:u,token:obj});
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
)
|
||||
}else{
|
||||
|
||||
console.log("Tempo restante token: "+ Math.round((userDetails.token.expirationDateToken-Math.round(new Date().getTime()/1000) )/60) +" Minutos");
|
||||
|
||||
//dispatch home
|
||||
|
|
Loading…
Reference in New Issue