Skip to content

Commit

Permalink
Update empresa profile
Browse files Browse the repository at this point in the history
  • Loading branch information
VitorCarvalho67 committed Nov 25, 2024
1 parent 8517efc commit 58c7ac9
Show file tree
Hide file tree
Showing 3 changed files with 266 additions and 135 deletions.
122 changes: 121 additions & 1 deletion client/src/scss/pages/empresa/_dashboard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,11 @@ main {
@include m-screen(760px) {
font-size: 0.9rem;
}

a{
text-decoration: none;
color: $font-color-dark
}
}
}
}
Expand All @@ -332,12 +337,127 @@ main {
margin-top: 60px;
}

.vagas{
width: 100%;
}

.vaga {
@include flex(column, flex-end, start);
width: 70%;
height: 140px;
border-left: solid 5px $secondary-color-orange;
margin-bottom: 10px;

@include m-screen(1000px) {
height: auto;
}

a {
@include flex(row, space-between, start);
width: 100%;
height: 100%;
background-color: $secondary-color-dark;
padding: 15px;
border-radius: 5px;
text-decoration: none;
color: $font-color-dark;

img {
height: 60px;
width: 60px;
object-fit: cover;
border-radius: 50%;
margin-right: 20px;
}

.infoVaga {
@include flex(row, space-between, start);
width: 100%;
height: 100%;
padding-right: 20px;

@include m-screen(1000px) {
@include flex(row, space-between, center);
}

@include m-screen(600px) {
@include flex(column, space-between, start);
}

.who {
color: $primary-color-orange;
margin-right: 10px;
margin-bottom: 10px;
}

.contentVaga {
@include flex(column, flex-start, start);
width: calc(100% - 120px);

@include m-screen(600px) {
width: 100%;
margin-bottom: 10px;
}

.info {
@include flex(row, start, start);
width: 100%;

@include m-screen(1000px) {
@include flex(column, start, start);
margin-top: 5px;
}

label {
@include font-inter(300);
color: $font-color-dark-2;
min-width: 30%;
}

p {
@include font-inter(300);
color: $font-color-dark;
}
}
}

.box-button {
height: 100%;
@include flex(column, center, center);

@include m-screen(600px) {
width: 100%;
@include flex(column, center, end);
}

button {
padding: 10px 20px;
border-radius: 10px;
font-size: 1rem;
border: solid 1px $secondary-color-orange;
background-color: $secondary-color-dark;
color: $secondary-color-orange;

&:hover {
color: $secondary-color-dark;
background-color: $secondary-color-orange;
}
}
}
}

p {
@include font-inter(600);
}
}
}

h2 {
@include font-inter(700);
font-size: 1.5rem;
width: 100%;
color: $secondary-color-orange;
margin: 20px 0px 10px 0px;
margin: 20px 0px 30px 0px;
@include flex(row, space-between, center);

@include m-screen(760px) {
Expand Down
133 changes: 67 additions & 66 deletions client/src/views/aluno/PerfilEmpresa.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,63 @@
</div>
<div class="capa">
<div class="capaProfile">
<img v-if="empresa.banner == 'default'" src="../../assets/imgs/defaultBanner.png"
alt="Capa" />
<img v-if="empresa.banner === 'default'" src="../../assets/imgs/defaultBanner.png" alt="Capa" />
<img v-else :src="empresa.banner" alt="Capa" />
</div>
<div class="infoProfile">
<img v-if="empresa.imagem == 'default'" src="../../assets/icons/artwork.png" />
<img v-if="empresa.imagem === 'default'" src="../../assets/icons/artwork.png" />
<img v-else :src="empresa.imagem" />
<div class="info">
<div class="box1">
<h1 v-text="empresa.nome"></h1>
</div>
<div class="box2">
<p v-text="empresa.email"></p>
<p v-show="mode === 'view'">
<a :href="empresa.site" target="_blank">{{ empresa.site }}</a>
</p>
</div>
</div>
</div>
</div>

<section class="sobreMim">
<h2>
Sobre a Empresa
</h2>
<div>
CNPJ: {{empresa.cnpj}}
Email: {{empresa.email}}
<p v-show="mode === 'view'">Site: <a :href="empresa.site" target="_blanck">{{empresa.site}}</a></p>
</div>
<h2>Nossos Estágios:</h2>
<ul class="vagas">
<li v-if="empresa.vagas && empresa.vagas.length < 1">
<p>Nenhuma vaga cadastrada por esta empresa.</p>
</li>
<li class="vaga" v-for="(vaga, index) in empresa.vagas" :key="index">
<router-link :to="'/vaga/' + vaga.id">
<div class="infoVaga">
<div class="contentVaga name">
<p class="who">{{ vaga.titulo }}</p>

<div class="info">
<label>Salário</label>
<p v-text="vaga.remuneracao"></p>
</div>
<div class="info">
<label>Carga horária</label>
<p v-text="vaga.cargaHoraria"></p>
</div>
<div class="info">
<label>Oferecida por</label>
<p v-text="vaga.empresa"></p>
</div>
<div class="info">
<label>Curso preferencial</label>
<p v-text="vaga.curso"></p>
</div>
</div>
<div class="box-button">
<button>Ver vaga</button>
</div>
</div>
</router-link>
</li>

</ul>
</section>
</div>
</main>
Expand All @@ -46,17 +79,7 @@
import Header from '../../components/Header.vue';
import Footer from '../../components/Footer.vue';
import AsideDashboard from '../../components/aluno/AsideDashboard.vue';
import router from '../../router/index.js'
import { mixinEmpresa } from '../../util/authMixins.js';
import imgLapis from "../../assets/icons/lapis.png";
import imgVerificar from "../../assets/icons/verificar.png";
import imgCruz from "../../assets/icons/cruz.png";
import { getEmpresa } from '../../services/api/shared.js';
import Cookies from 'js-cookie';
import { updateBanner, updateImage, updateSite } from '../../services/api/empresa.js';
import { getEmpresa, getVagas } from '../../services/api/shared.js';
export default {
name: 'PublicPerfilEmpresa',
Expand All @@ -78,68 +101,47 @@ export default {
site: '',
siteSubmit: '',
token: '',
vagas: [],
},
file: "",
fileSelected: false,
linkstatus: 0,
mode: "view",
modeImage: "view",
modeBanner: "view",
imgLapis,
imgVerificar,
imgCruz,
extracurriculares: [],
showAddForm: false,
}
};
},
methods: {
async GetEmpresa(){
async GetEmpresa() {
try {
const response = await getEmpresa(this.empresa.email);
if (response.status >= 200 && response.status < 300) {
this.empresa = response.data;
this.empresa.siteSubmit = response.data.site;
await this.loadVagasEmpresa();
} else {
console.error(
"Erro ao carregar dados da empresa",
response.message,
);
console.error("Erro ao carregar dados da empresa", response.message);
}
} catch (error) {
console.error(
"Erro ao carregar dados da empresa",
error.message,
);
console.error("Erro ao carregar dados da empresa", error.message);
}
},
previewProfileImage(event) {
const file = event.target.files[0];
if (!file) return;
const reader = new FileReader();
reader.onload = (e) => {
this.empresa.imagem = e.target.result;
};
reader.readAsDataURL(file);
},
previewBannerImage(event) {
const file = event.target.files[0];
if (!file) return;
const reader = new FileReader();
reader.onload = (e) => {
this.empresa.banner = e.target.result;
};
reader.readAsDataURL(file);
async loadVagasEmpresa() {
try {
const response = await getVagas();
if (response.status >= 200 && response.status < 300) {
this.empresa.vagas = response.data.filter(
(vaga) => vaga.empresa.toLowerCase() === this.empresa.nome.toLowerCase()
);
} else {
console.error("Erro ao carregar vagas da empresa.");
}
} catch (error) {
console.error("Erro ao carregar vagas da empresa.", error.message);
}
},
},
async created() {
this.empresa.email = this.$route.params.email;
await this.GetEmpresa(this.empresa.email);
await this.GetEmpresa();
}
}
};
</script>

<style lang="scss" scoped>
Expand All @@ -157,7 +159,6 @@ export default {
.content {
flex: 1;
padding: 20px;
overflow-y: auto;
height: 100%;
Expand All @@ -167,4 +168,4 @@ export default {
}
}
}
</style>
</style>
Loading

0 comments on commit 58c7ac9

Please sign in to comment.