api/website/app

This commit is contained in:
henrydays 2019-03-26 04:20:40 +00:00
parent ce66de1783
commit 6431f9afef
14 changed files with 901 additions and 381 deletions

View File

@ -1,3 +1,3 @@
<resources>
<string name="app_name">ENEI 2019</string>
<string name="app_name">ENEI 19</string>
</resources>

View File

@ -147,6 +147,7 @@ const Stack = createStackNavigator({
)
}
}
if (navigation.state.routes[index].routeName == 'Jogo') {
return {
header: (<View style={{backgroundColor:'#CC1A17', padding:15}}>

View File

@ -141,6 +141,7 @@ class Calendar extends React.Component {
render() {
const ThirdRoute = () => (
<ScrollView contentContainerStyle={styles.contentContainer}>
{this.props.events != undefined && (
<Timeline
@ -208,6 +209,7 @@ class Calendar extends React.Component {
</ScrollView>
);
const FirstRoute = () => (
<ScrollView contentContainerStyle={styles.contentContainer}>
{this.props.events != undefined && (
<Timeline
@ -236,6 +238,7 @@ class Calendar extends React.Component {
/>
)}
</ScrollView>
);
const SecondRoute = () => (
<ScrollView contentContainerStyle={styles.contentContainer}>
@ -315,6 +318,7 @@ class Calendar extends React.Component {
</View>
);
}

View File

@ -12,7 +12,7 @@ import {
FlatList,
ActivityIndicator
} from "react-native";
import IconFA from "react-native-vector-icons/FontAwesome5";
import { TabView, TabBar, SceneMap } from "react-native-tab-view";
import rallyImg from "../assets/rallyTascas.jpg";
@ -57,12 +57,33 @@ class Eventos extends React.Component {
const { navigate } = this.props.navigation;
return (
<PTRView onRefresh={this._update}>
<View
style={{
flex: 1,
flexDirection: "row",
alignItems: "center",
alignContent: "center",
alignSelf: "center"
}}
>
<Text
style={{
textAlign: "right",
fontSize: 12,
paddingTop: 10,
marginRight: 5
}}
>
Arrasta o ecrã para atualizar
</Text>
<IconFA name="chevron-circle-down" size={13} color={"#CC1A17"} />
</View>
<View style={styles.container}>
{this.props.eventsInternal == undefined && (
<View
style={{
height: SCREEN_HEIGHT,
marginTop: SCREEN_HEIGHT * 0.27,
//marginTop: SCREEN_HEIGHT * 0.27,
backgroundColor: "white"
}}
>

View File

@ -244,20 +244,37 @@ class Home extends Component {
uri: this.state.img
}}
/>
</View>
{this.props.user != undefined && (
<Text style={styles.userText}>{this.props.user.Name}</Text>
)}
{this.props.user != undefined &&
<Text style={styles.userTextSub}>
{this.props.user.Company}
</Text>
}
{this.props.user != undefined && (
<Text style={styles.userTextSub}>
{this.props.user.Company}
</Text>
)}
</View>
</ImageBackground>
<View
style={{
flex: 1,
flexDirection: "row",
alignItems: "center",
alignContent: "center",
alignSelf:'center'
}}
>
<Text
style={{ textAlign: "right", fontSize: 12, paddingTop:10 , marginRight:5}}
>
Arrasta o ecrã para atualizar
</Text>
<IconFA
name="chevron-circle-down"
size={13}
color={"#CC1A17"}
/>
</View>
<View style={styles.userStats}>
<View style={{ backgroundColor: "orange" }}>
<Text style={styles.userStatsTitle}>

View File

@ -29,13 +29,7 @@ import * as Actions from "../store/actions"; //Import your actionss
class Jogo extends React.Component {
static navigationOptions = ({ navigation }) => ({
header: (
<View style={{backgroundColor:'#CC1A17'}}>
<Text>a</Text>
</View>
)
});
handleClick = (link) => {
@ -271,13 +265,13 @@ class Jogo extends React.Component {
justifyContent: "space-around"
}}
>
<Text style={{ fontWeight: "bold" }}> 1 </Text>
<Text style={{ fontWeight: "bold" }}> { this.props.cromos.pontuacao}</Text>
<ProgressBarAnimated
width={barWidth * 0.7}
value={this.state.progress}
value={this.props.cromos.pontuacao*100/256}
backgroundColorOnComplete="#CC2A17"
/>
<Text style={{ fontWeight: "bold" }}> 2 </Text>
<Text style={{ fontWeight: "bold" }}>256</Text>
</View>
</View>
</View>
@ -300,9 +294,7 @@ class Jogo extends React.Component {
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>{item.pontos}</Text>
<View
style={[styles.triangleNumber, this.props.style]}
/>
<Text style={styles.number}>{item.id-1}</Text>
</ImageBackground>
}
@ -315,9 +307,7 @@ class Jogo extends React.Component {
>
<View style={[styles.triangle, this.props.style]} />
<Text style={styles.points}>{item.pontos}</Text>
<View
style={[styles.triangleNumber, this.props.style]}
/>
<Text style={styles.number}>{item.id-1}</Text>
</ImageBackground>
}

View File

@ -233,10 +233,7 @@ class calendarDetail extends React.Component {
Localização
</Text>
<Divider style={{ backgroundColor: "#000", marginBottom: 10 }} />
<Image
source={require("../assets/img/campus.png")}
style={{ width: SCREEN_WIDTH * 0.9 }}
/>
<Text>Em breve</Text>
</View>
</ScrollView>
<Divider style={{ backgroundColor: "black" }} />

File diff suppressed because it is too large Load Diff

View File

@ -36,7 +36,7 @@ class teamDetail extends React.Component {
this.props.internalToken
);*/
console.log(this.props.locais);
console.log(this.props.locais); ne
}
constructor(props) {
@ -161,6 +161,26 @@ class teamDetail extends React.Component {
</View>
</View>
</View>
<View
style={{
flex: 1,
flexDirection: "row",
alignItems: "center",
alignContent: "center",
alignSelf:'center'
}}
>
<Text
style={{ textAlign: "right", fontSize: 12, paddingTop: 5 , marginRight:5}}
>
Arrasta o ecrã para atualizar
</Text>
<IconFA
name="chevron-circle-down"
size={13}
color={"#CC1A17"}
/>
</View>
<View style={styles.container}>
<View style={{ flex: 1, width: "100%" }}>
{this.props.locais && (

View File

@ -830,28 +830,28 @@ function getCareerPath(sessions) {
code = "IA";
}
if (sessions[key].Name == "IOT") {
careerPath = "Internet of Things";
careerColor = "green";
careerPath = "Internet of things";
careerColor = "#4B266A";
code = "IOT";
}
if (sessions[key].Name == "WEB") {
careerPath = "Web Development";
careerColor = "purple";
careerPath = "Web development";
careerColor = "#FBB81B";
code = "WEB";
}
if (sessions[key].Name == "NET") {
careerPath = "Networking and Security";
careerColor = "blue";
careerColor = "#055CA0";
code = "NET";
}
if (sessions[key].Name == "MOB") {
careerPath = "Mobile Development";
careerColor = "orange";
careerColor = "#0B7D3C";
code = "MOB";
}
if (sessions[key].Name == "DS") {
careerPath = "Data Science";
careerColor = "yellow";
careerColor = "#ED6B33";
code = "DS";
}
}
@ -1167,6 +1167,7 @@ export function getAvailableGuestlists(token) {
*/
export function changeGuestList(token, guestID) {
axios.defaults.baseURL = "https://tickets.enei.pt/internal/api";
console.log("Guest ID: "+ guestID)
return dispatch => {
checkAndRefresh(token)
.then(newToken => {
@ -1186,7 +1187,7 @@ export function changeGuestList(token, guestID) {
// handle success
//console.log(response);
console.log("SUcesso a trocar para :"+ guestID)
var cenas = [];
c = getCareerPath(response.data);
const result = flow(
@ -1374,31 +1375,153 @@ function getE(user, careerPath, token) {
d = [];
//MEU DEUS QUE É ISTO???
if (careerPath != undefined && careerPath.code =="IA") {
if (careerPath != undefined && careerPath.code =="IA" || careerPath.code=="WEB") {
b.push({
Id: 22,
time: "13:30",
description: "Almoço para os career path's de IA e WEB",
day: "13",
name: "Almoço",
place: "Cantina do ISEC"
})
c.push({
Id: 22,
time: "13:30",
description: "Almoço para os career path's de IA e WEB",
day: "14",
name: "Almoço",
place: "Cantina do ISEC"
})
d.push({
Id: 22,
time: "13:30",
description: "Almoço para os career path's de IA e WEB",
day: "15",
name: "Almoço",
place: "Cantina do ISEC"
})
a.push({
Id: 22,
time: "19:00",
description: "Jantar para os career path's de IA",
description: "Jantar para os career path's de IA e WEB",
day: "12",
name: "Jantar",
place: "Cantina do ISEC"
});
}
if (careerPath != undefined && careerPath.code =="IOT") {
a.push({
b.push({
Id: 22,
time: "19:30",
description: "Jantar ",
day: "12",
time: "19:00",
description: "Jantar para os career path's de IA e WEB",
day: "13",
name: "Jantar",
place: "Cantina do ISEC"
});
c.push({
Id: 22,
time: "19:00",
description: "Jantar para os career path's de IA e WEB",
day: "14",
name: "Jantar",
place: "Cantina do ISEC"
});
}
if (careerPath != undefined && careerPath.code =="NET") {
if (careerPath != undefined && careerPath.code =="IOT" || careerPath.code =="NET") {
b.push({
Id: 22,
time: "12:15",
description: "Almoço para os career path's de IOT e NET",
day: "13",
name: "Almoço",
place: "Cantina do ISEC"
})
c.push({
Id: 22,
time: "12:15",
description: "Almoço para os career path's de IOT e NET",
day: "14",
name: "Almoço",
place: "Cantina do ISEC"
})
d.push({
Id: 22,
time: "12:15",
description: "Almoço para os career path's de IOT e NET",
day: "15",
name: "Almoço",
place: "Cantina do ISEC"
})
a.push({
Id: 22,
time: "19:30",
description: "Jantar para os career path's de IOT e NET ",
day: "12",
name: "Jantar",
place: "Cantina do ISEC"
});
b.push({
Id: 22,
time: "19:30",
description: "Jantar para os career path's de IOT e NET",
day: "13",
name: "Jantar",
place: "Cantina do ISEC"
});
c.push({
Id: 22,
time: "19:30",
description: "Jantar para os career path de IOT e NET",
day: "14",
name: "Jantar",
place: "Cantina do ISEC"
});
}
if (careerPath != undefined && careerPath.code =="DS" || careerPath.code=="MOB") {
b.push({
Id: 22,
time: "12:45",
description: "Almoço para os career paths de DS e MOB ",
day: "13",
name: "Jantar",
place: "Cantina do ISEC"
});
c.push({
Id: 22,
time: "12:45",
description: "Almoço para os career paths de DS e MOB ",
day: "13",
name: "Jantar",
place: "Cantina do ISEC"
});
d.push({
Id: 22,
time: "12:45",
description: "Almoço para os career paths de DS e MOB ",
day: "13",
name: "Jantar",
place: "Cantina do ISEC"
});
a.push({
Id: 22,
time: "20:00",
description: "Jantar ",
description: "Jantar para os career paths de DS e MOB ",
day: "12",
name: "Jantar",
place: "Cantina do ISEC"
});
b.push({
Id: 22,
time: "20:00",
description: "Jantar para os career paths de DS e MOB ",
day: "13",
name: "Jantar",
place: "Cantina do ISEC"
});
c.push({
Id: 22,
time: "20:00",
description: "Jantar para os career paths de DS e MOB ",
day: "14",
name: "Jantar",
place: "Cantina do ISEC"
});
}
@ -1429,7 +1552,7 @@ function getE(user, careerPath, token) {
Id: 46,
time: "17:30",
description:
"Sessão de boas vindas ao ENEI'19. Esta sessão conta com a presença do grupo de fados",
"A sessão de abertura vai-se realizar no nosso auditório principal. Poderás ver a apresentação das várias atividades que irão decorrer no evento.",
name: "Sessão de Abertura",
Enrolled: 700,
@ -1439,7 +1562,7 @@ function getE(user, careerPath, token) {
});
b.push({
Id: 49,
time: "8:00",
time: "08:00",
description:
"Pronto para começar o dia em grande? Vem tomar o pequeno-almoço!",
Enrolled: 700,
@ -1448,6 +1571,39 @@ function getE(user, careerPath, token) {
day: "13",
place: "Cantina do ISEC"
});
c.push({
Id: 49,
time: "08:00",
description:
"Pronto para começar o dia em grande? Vem tomar o pequeno-almoço!",
Enrolled: 700,
MaxAttendees: 300,
name: "Pequeno-Almoço",
day: "13",
place: "Cantina do ISEC"
});
d.push({
Id: 49,
time: "08:00",
description:
"Pronto para começar o dia em grande? Vem tomar o pequeno-almoço!",
Enrolled: 700,
MaxAttendees: 300,
name: "Pequeno-Almoço",
day: "13",
place: "Cantina do ISEC"
});
c.push({
Id: 95,
time: "20:00",
description:
"Queres ficar a conhecer pessoalmente algumas das empresas líderes de mercado na área de informática? Então o jantar empresarial é a oportunidade perfeita para ti! Manda-nos o teu CV e habilita-te a ganhar um jantar no hotel Quinta das Lágrimas acompanhado pelas tuas empresas favoritas.",
Enrolled: 700,
MaxAttendees: 300,
name: "Jantar Empresarial",
day: "14",
place: "Hotel Quinta das Lágrimas"
});
for (let key in result["12"]) {
a.push({
Id: result["12"][key].Id,

View File

@ -121,7 +121,8 @@ const apiReducer = (state = apiState, action) => {
internalToken:"eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJuYW1laWQiOiIxIiwidW5pcXVlX25hbWUiOiJjZW5hIiwicm9sZSI6IkFkbWluIiwibmJmIjoxNTUyODcwODcwLCJleHAiOjE1NTU0NTkyNzAsImlhdCI6MTU1Mjg3MDg3MH0.wkBk-CUDMCaU-K9jI0pTRJ794IGCl-C9md39dMfHqa5zTf-gNpD76xEYea3PhIbW2dnUVgo0m1fxR1sW7k9LMg",
cromos: action.payload.apiReducer.cromos,
careerPath: action.payload.apiReducer.careerPath,
locais: action.payload.apiReducer.locais
locais: action.payload.apiReducer.locais,
Blocks: action.payload.apiReducer.Blocks
};
}

82
App/package-lock.json generated
View File

@ -829,46 +829,6 @@
"to-fast-properties": "^2.0.0"
}
},
"@expo/vector-icons": {
"version": "github:expo/vector-icons#d0fb774a001b047d223cfa5e9537220b20591efd",
"from": "github:expo/vector-icons#expo-font-fix",
"requires": {
"lodash": "^4.17.4",
"react-native-vector-icons": "6.0.0"
},
"dependencies": {
"react-native-vector-icons": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/react-native-vector-icons/-/react-native-vector-icons-6.0.0.tgz",
"integrity": "sha512-uF3oWb3TV42uXi2apVOZHw9oy9Nr5SXDVwOo1umQWo/yYCrDzXyVfq14DzezgEbJ9jfc/yghBelj0agkXmOKlg==",
"requires": {
"lodash": "^4.0.0",
"prop-types": "^15.6.2",
"yargs": "^8.0.2"
}
},
"yargs": {
"version": "8.0.2",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-8.0.2.tgz",
"integrity": "sha1-YpmpBVsc78lp/355wdkY3Osiw2A=",
"requires": {
"camelcase": "^4.1.0",
"cliui": "^3.2.0",
"decamelize": "^1.1.1",
"get-caller-file": "^1.0.1",
"os-locale": "^2.0.0",
"read-pkg-up": "^2.0.0",
"require-directory": "^2.1.1",
"require-main-filename": "^1.0.1",
"set-blocking": "^2.0.0",
"string-width": "^2.0.0",
"which-module": "^2.0.0",
"y18n": "^3.2.1",
"yargs-parser": "^7.0.0"
}
}
}
},
"@expo/websql": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@expo/websql/-/websql-1.0.1.tgz",
@ -2958,7 +2918,6 @@
"integrity": "sha512-xo8wZ9/4F3P1xN9nKFSJM3Gb2m0p05aRncjgFF+jxM5XfvKkUrzW0a6FYOY/h/r2r1wyQI7OTBPTiTH/GxuwgA==",
"requires": {
"@babel/runtime": "^7.1.2",
"@expo/vector-icons": "github:expo/vector-icons#d0fb774a001b047d223cfa5e9537220b20591efd",
"@expo/websql": "^1.0.1",
"@types/fbemitter": "^2.0.32",
"@types/invariant": "^2.2.29",
@ -3020,7 +2979,6 @@
"qs": "^6.5.0",
"react-native-branch": "2.2.5",
"react-native-gesture-handler": "~1.0.14",
"react-native-maps": "github:expo/react-native-maps#e6f98ff7272e5d0a7fe974a41f28593af2d77bb2",
"react-native-reanimated": "1.0.0-alpha.11",
"react-native-screens": "1.0.0-alpha.22",
"react-native-svg": "8.0.10",
@ -3030,6 +2988,14 @@
"whatwg-fetch": "^2.0.4"
},
"dependencies": {
"@expo/vector-icons": {
"version": "github:expo/vector-icons#d0fb774a001b047d223cfa5e9537220b20591efd",
"from": "github:expo/vector-icons#d0fb774a001b047d223cfa5e9537220b20591efd",
"requires": {
"lodash": "^4.17.4",
"react-native-vector-icons": "6.0.0"
}
},
"ansi-regex": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
@ -3066,17 +3032,47 @@
},
"react-native-maps": {
"version": "github:expo/react-native-maps#e6f98ff7272e5d0a7fe974a41f28593af2d77bb2",
"from": "github:expo/react-native-maps#v0.22.1-exp.0"
"from": "github:expo/react-native-maps#e6f98ff7272e5d0a7fe974a41f28593af2d77bb2"
},
"react-native-screens": {
"version": "1.0.0-alpha.22",
"resolved": "https://registry.npmjs.org/react-native-screens/-/react-native-screens-1.0.0-alpha.22.tgz",
"integrity": "sha512-kSyAt0AeVU6N7ZonfV6dP6iZF8B7Bce+tk3eujXhzBGsLg0VSLnU7uE9VqJF0xdQrHR91ZjGgVMieo/8df9KTA=="
},
"react-native-vector-icons": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/react-native-vector-icons/-/react-native-vector-icons-6.0.0.tgz",
"integrity": "sha512-uF3oWb3TV42uXi2apVOZHw9oy9Nr5SXDVwOo1umQWo/yYCrDzXyVfq14DzezgEbJ9jfc/yghBelj0agkXmOKlg==",
"requires": {
"lodash": "^4.0.0",
"prop-types": "^15.6.2",
"yargs": "^8.0.2"
}
},
"whatwg-fetch": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz",
"integrity": "sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng=="
},
"yargs": {
"version": "8.0.2",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-8.0.2.tgz",
"integrity": "sha1-YpmpBVsc78lp/355wdkY3Osiw2A=",
"requires": {
"camelcase": "^4.1.0",
"cliui": "^3.2.0",
"decamelize": "^1.1.1",
"get-caller-file": "^1.0.1",
"os-locale": "^2.0.0",
"read-pkg-up": "^2.0.0",
"require-directory": "^2.1.1",
"require-main-filename": "^1.0.1",
"set-blocking": "^2.0.0",
"string-width": "^2.0.0",
"which-module": "^2.0.0",
"y18n": "^3.2.1",
"yargs-parser": "^7.0.0"
}
}
}
},

0
App/{
View File

View File

@ -30,7 +30,7 @@ namespace api.Controllers
// PSOT api/scan
// POST scan de QR code
[HttpPost]
public async Task<ScanReturn> doScan(QRToScan ScanData)
public async Task<IActionResult> doScan(QRToScan ScanData)
{
User usr = await context.Users.FirstOrDefaultAsync(b=>b.QRcode == ScanData.UserQR);
var allUsers = await context.Users.ToListAsync();
@ -45,7 +45,7 @@ namespace api.Controllers
_mapper.Map(userAProcurar,ru);
toReturn.user = ru;
toReturn.tipo=1;
return toReturn;
return Ok(toReturn);
}else{
allCromos.ForEach(delegate(Cromos c){
if(c.QRCode == ScanData.ScanQR){
@ -58,7 +58,7 @@ namespace api.Controllers
}
});
return toReturn;
return Ok(toReturn);
}
//return toReturn;