1212 </div >
1313 <div class =" capa" >
1414 <div class =" capaProfile" >
15- <img v-if =" empresa.banner == 'default'" src =" ../../assets/imgs/defaultBanner.png"
16- alt =" Capa" />
15+ <img v-if =" empresa.banner === 'default'" src =" ../../assets/imgs/defaultBanner.png" alt =" Capa" />
1716 <img v-else :src =" empresa.banner" alt =" Capa" />
1817 </div >
1918 <div class =" infoProfile" >
20- <img v-if =" empresa.imagem == 'default'" src =" ../../assets/icons/artwork.png" />
19+ <img v-if =" empresa.imagem === 'default'" src =" ../../assets/icons/artwork.png" />
2120 <img v-else :src =" empresa.imagem" />
2221 <div class =" info" >
2322 <div class =" box1" >
2423 <h1 v-text =" empresa.nome" ></h1 >
2524 </div >
25+ <div class =" box2" >
26+ <p v-text =" empresa.email" ></p >
27+ <p v-show =" mode === 'view'" >
28+ <a :href =" empresa.site" target =" _blank" >{{ empresa.site }}</a >
29+ </p >
30+ </div >
2631 </div >
2732 </div >
2833 </div >
2934
3035 <section class =" sobreMim" >
31- <h2 >
32- Sobre a Empresa
33- </h2 >
34- <div >
35- CNPJ: {{empresa.cnpj}}
36- Email: {{empresa.email}}
37- <p v-show =" mode === 'view'" >Site: <a :href =" empresa.site" target =" _blanck" >{{empresa.site}}</a ></p >
38- </div >
36+ <h2 >Nossos Estágios:</h2 >
37+ <ul class =" vagas" >
38+ <li v-if =" empresa.vagas && empresa.vagas.length < 1" >
39+ <p >Nenhuma vaga cadastrada por esta empresa.</p >
40+ </li >
41+ <li class =" vaga" v-for =" (vaga, index) in empresa.vagas" :key =" index" >
42+ <router-link :to =" '/vaga/' + vaga.id" >
43+ <div class =" infoVaga" >
44+ <div class =" contentVaga name" >
45+ <p class =" who" >{{ vaga.titulo }}</p >
46+
47+ <div class =" info" >
48+ <label >Salário</label >
49+ <p v-text =" vaga.remuneracao" ></p >
50+ </div >
51+ <div class =" info" >
52+ <label >Carga horária</label >
53+ <p v-text =" vaga.cargaHoraria" ></p >
54+ </div >
55+ <div class =" info" >
56+ <label >Oferecida por</label >
57+ <p v-text =" vaga.empresa" ></p >
58+ </div >
59+ <div class =" info" >
60+ <label >Curso preferencial</label >
61+ <p v-text =" vaga.curso" ></p >
62+ </div >
63+ </div >
64+ <div class =" box-button" >
65+ <button >Ver vaga</button >
66+ </div >
67+ </div >
68+ </router-link >
69+ </li >
70+
71+ </ul >
3972 </section >
4073 </div >
4174 </main >
4679import Header from ' ../../components/Header.vue' ;
4780import Footer from ' ../../components/Footer.vue' ;
4881import AsideDashboard from ' ../../components/aluno/AsideDashboard.vue' ;
49- import router from ' ../../router/index.js'
50- import { mixinEmpresa } from ' ../../util/authMixins.js' ;
51-
52- import imgLapis from " ../../assets/icons/lapis.png" ;
53- import imgVerificar from " ../../assets/icons/verificar.png" ;
54- import imgCruz from " ../../assets/icons/cruz.png" ;
55-
56- import { getEmpresa } from ' ../../services/api/shared.js' ;
57-
58- import Cookies from ' js-cookie' ;
59- import { updateBanner , updateImage , updateSite } from ' ../../services/api/empresa.js' ;
82+ import { getEmpresa , getVagas } from ' ../../services/api/shared.js' ;
6083
6184export default {
6285 name: ' PublicPerfilEmpresa' ,
@@ -78,68 +101,47 @@ export default {
78101 site: ' ' ,
79102 siteSubmit: ' ' ,
80103 token: ' ' ,
104+ vagas: [],
81105 },
82- file: " " ,
83- fileSelected: false ,
84- linkstatus: 0 ,
85106 mode: " view" ,
86- modeImage: " view" ,
87- modeBanner: " view" ,
88- imgLapis,
89- imgVerificar,
90- imgCruz,
91- extracurriculares: [],
92- showAddForm: false ,
93- }
107+ };
94108 },
95109 methods: {
96- async GetEmpresa (){
110+ async GetEmpresa () {
97111 try {
98112 const response = await getEmpresa (this .empresa .email );
99113 if (response .status >= 200 && response .status < 300 ) {
100114 this .empresa = response .data ;
101-
102115 this .empresa .siteSubmit = response .data .site ;
103116
117+ await this .loadVagasEmpresa ();
104118 } else {
105- console .error (
106- " Erro ao carregar dados da empresa" ,
107- response .message ,
108- );
119+ console .error (" Erro ao carregar dados da empresa" , response .message );
109120 }
110121 } catch (error) {
111- console .error (
112- " Erro ao carregar dados da empresa" ,
113- error .message ,
114- );
122+ console .error (" Erro ao carregar dados da empresa" , error .message );
115123 }
116124 },
117- previewProfileImage (event ) {
118- const file = event .target .files [0 ];
119- if (! file) return ;
120-
121- const reader = new FileReader ();
122- reader .onload = (e ) => {
123- this .empresa .imagem = e .target .result ;
124- };
125- reader .readAsDataURL (file);
126- },
127- previewBannerImage (event ) {
128- const file = event .target .files [0 ];
129- if (! file) return ;
130-
131- const reader = new FileReader ();
132- reader .onload = (e ) => {
133- this .empresa .banner = e .target .result ;
134- };
135- reader .readAsDataURL (file);
125+ async loadVagasEmpresa () {
126+ try {
127+ const response = await getVagas ();
128+ if (response .status >= 200 && response .status < 300 ) {
129+ this .empresa .vagas = response .data .filter (
130+ (vaga ) => vaga .empresa .toLowerCase () === this .empresa .nome .toLowerCase ()
131+ );
132+ } else {
133+ console .error (" Erro ao carregar vagas da empresa." );
134+ }
135+ } catch (error) {
136+ console .error (" Erro ao carregar vagas da empresa." , error .message );
137+ }
136138 },
137139 },
138140 async created () {
139141 this .empresa .email = this .$route .params .email ;
140- await this .GetEmpresa (this . empresa . email );
142+ await this .GetEmpresa ();
141143 }
142- }
144+ };
143145 </script >
144146
145147<style lang="scss" scoped>
@@ -157,7 +159,6 @@ export default {
157159
158160 .content {
159161 flex : 1 ;
160- padding : 20px ;
161162 overflow-y : auto ;
162163 height : 100% ;
163164
@@ -167,4 +168,4 @@ export default {
167168 }
168169 }
169170}
170- </style >
171+ </style >
0 commit comments