11<template >
2- <v-container v-if =" loading" >
2+ <v-container v-if =" $apollo.queries.user. loading" >
33 <v-layout row justify-center >
44 <v-container fill-height >
55 <v-layout row justify-center align-center >
3232 </v-avatar >
3333 </v-col >
3434 <v-col cols =" 12" class =" mt-2 mb-4" >
35- <div class =" overline my-0" >{{ mockUser .username }}</div >
35+ <div class =" overline my-0" >{{ user .username }}</div >
3636 <div v-if =" isSeeder" ><v-chip small outlined class =" my-1" color =" green darken-2" >Emprendedor</v-chip ></div >
3737 <div v-if =" isSponsor" ><v-chip small outlined class =" my-1" color =" pink darken-1" >Patrocinador</v-chip ></div >
3838 <div v-if =" isSeer" ><v-chip small outlined class =" my-1" color =" amber darken-4" >Veedor</v-chip ></div >
9090 </v-col >
9191 <v-col cols =" 6" class =" px-2 py-2" >
9292 <v-text-field
93- :value =" mockUser .lastName"
93+ :value =" user .lastName"
9494 label =" APELLIDO"
9595 readonly
9696 dense
9797 ></v-text-field >
9898 </v-col >
99- </v-row >
100-
101- <v-divider class =" px-0 mx-0" ></v-divider >
102-
103- <v-row no-gutters class =" mt-7" >
104- <v-col cols =" 8" class =" px-2 py-2" >
99+ <v-col cols =" 6" class =" px-2 py-2" >
105100 <v-text-field
106- :value =" mockUser.address "
107- label =" DIRECCIÓN "
108- prepend-icon =" mdi-map-marker "
101+ :value =" user.creationDateTime "
102+ label =" FECHA DE CREACIÓN "
103+ prepend-icon =" mdi-calendar-plus "
109104 readonly
110105 dense
111106 ></v-text-field >
112107 </v-col >
113- <v-col cols =" 4 " class =" px-2 py-2" >
108+ <v-col cols =" 6 " class =" px-2 py-2" >
114109 <v-text-field
115- :value =" mockUser.phone "
116- label =" TELÉFONO "
117- prepend-icon =" mdi-phone "
110+ :value =" user.lastLogin "
111+ label =" ÚLTIMA CONEXIÓN "
112+ prepend-icon =" mdi-update "
118113 readonly
119114 dense
120115 ></v-text-field >
121116 </v-col >
122- <v-col cols =" 6" class =" px-2 py-2" >
117+ </v-row >
118+
119+ <v-divider class =" px-0 mx-0" ></v-divider >
120+
121+ <v-row no-gutters class =" mt-7" >
122+ <v-col cols =" 8" class =" px-2 py-2" >
123123 <v-text-field
124- :value =" mockUser.creationDatetime "
125- label =" FECHA DE CREACIÓN "
126- prepend-icon =" mdi-calendar-plus "
124+ :value =" user.walletAddress "
125+ label =" Wallet "
126+ prepend-icon =" mdi-wallet "
127127 readonly
128128 dense
129129 ></v-text-field >
130130 </v-col >
131- <v-col cols =" 6 " class =" px-2 py-2" >
131+ <v-col cols =" 4 " class =" px-2 py-2" >
132132 <v-text-field
133- :value =" mockUser.lastLogin "
134- label =" ÚLTIMA CONEXIÓN "
135- prepend-icon =" mdi-update "
133+ :value =" mockUser.ethereum "
134+ label =" ETH "
135+ prepend-icon =" mdi-ethereum "
136136 readonly
137137 dense
138138 ></v-text-field >
147147 <v-tabs v-model =" tab" centered color =" primary lighten-3" >
148148 <v-tabs-slider ></v-tabs-slider >
149149 <v-tab href =" #tab-1" >Perfil</v-tab >
150- <v-tab href =" #tab-2" >Transacciones</v-tab >
151- <v-tab href =" #tab-3" v-if =" isSeeder" >Emprendedor</v-tab >
152- <v-tab href =" #tab-4" v-if =" isSponsor" >Patrocinador</v-tab >
153- <v-tab href =" #tab-5" v-if =" isSeer" >Veedor</v-tab >
150+ <v-tab href =" #tab-2" v-if =" isSeeder" >Emprendedor</v-tab >
151+ <v-tab href =" #tab-3" v-if =" isSponsor" >Patrocinador</v-tab >
152+ <v-tab href =" #tab-4" v-if =" isSeer" >Veedor</v-tab >
154153 </v-tabs >
155154
156155 <v-divider class =" mx-7" ></v-divider >
164163 <v-row >
165164 <v-col cols =" 12" class =" my-0 py-0" >
166165 <v-card-title >Descripción</v-card-title >
167- <v-card-text >{{ mockUser.description }}</v-card-text >
168- </v-col >
169- <v-col cols =" 12" class =" my-0 py-0" >
170- <v-card-title >Intereses</v-card-title >
171- <v-card-text >
172- <v-chip
173- v-for =" item in mockUser.interests"
174- :key =" item"
175- outlined
176- class =" mb-2 mr-2"
177- >
178- {{ item }}
179- </v-chip >
180- </v-card-text >
166+ <v-card-text >{{ user.description }}</v-card-text >
181167 </v-col >
182168 <v-col cols =" 12" class =" mt-0 pt-0" v-if =" user.latitude && user.longitude" >
183169 <v-card-title >Ubicación</v-card-title >
189175 <v-col cols =" 12" xl =" 6" >
190176 <v-row >
191177 <v-col cols =" 12" class =" my-0 py-0" >
192- <v-card-title >Proyectos Favoritos </v-card-title >
178+ <v-card-title >Intereses </v-card-title >
193179 <v-card-text >
194- <ProjectsTable :itemsPerPage =" 3" ></ProjectsTable >
180+ <v-chip
181+ v-for =" item in interests"
182+ :key =" item"
183+ outlined
184+ class =" mb-2 mr-2"
185+ >
186+ {{ item }}
187+ </v-chip >
195188 </v-card-text >
196189 </v-col >
197190 <v-col cols =" 12" class =" my-0 py-0" >
198- <v-card-title >Proyectos Consultados </v-card-title >
191+ <v-card-title >Proyectos Favoritos ({{ user.favoriteCount }}) </v-card-title >
199192 <v-card-text >
200- <ProjectsTable :itemsPerPage =" 3" ></ProjectsTable >
193+ <v-data-table
194+ :headers =" favoriteHeaders"
195+ :items =" favorites"
196+ :items-per-page =" 5"
197+ ></v-data-table >
201198 </v-card-text >
202199 </v-col >
203200 </v-row >
207204 </v-card >
208205 </v-tab-item >
209206
210- <v-tab-item value =" tab-2" >
211- <v-card flat >
212- <v-card-text >Transacciones</v-card-text >
213- </v-card >
214- </v-tab-item >
215-
216- <v-tab-item value =" tab-3" v-if =" isSeeder" >
207+ <v-tab-item value =" tab-2" v-if =" isSeeder" >
217208 <v-card flat >
218209 <v-card-text >Emprendedor</v-card-text >
219210 </v-card >
220211 </v-tab-item >
221212
222- <v-tab-item value =" tab-4 " v-if =" isSponsor" >
213+ <v-tab-item value =" tab-3 " v-if =" isSponsor" >
223214 <v-card flat >
224215 <v-card-text >Patrocinador</v-card-text >
225216 </v-card >
226217 </v-tab-item >
227218
228- <v-tab-item value =" tab-5 " v-if =" isSeer" >
219+ <v-tab-item value =" tab-4 " v-if =" isSeer" >
229220 <v-card flat >
230221 <v-card-text >Veedor</v-card-text >
231222 </v-card >
273264
274265<script >
275266import Map from ' @/components/Map'
276- import ProjectsTable from ' @/components/ProjectsTable'
277267import { BLOCK_USER_MUTATION , UNBLOCK_USER_MUTATION , USER_QUERY } from ' @/graphql/graphql'
278268
279269export default {
280270 components: {
281- Map ,
282- ProjectsTable
271+ Map
283272 },
284273
285274 name: ' UserDetail' ,
@@ -288,24 +277,14 @@ export default {
288277 dialog: false ,
289278 tab: null ,
290279 mockUser: {
291- username: ' mgarcia' ,
292- email: ' mgarcia@gmail.com' ,
293- avatar: 0 ,
294- firstName: ' Manuel' ,
295- lastName: ' García' ,
296- description: ' Divulgador científico, blogger y amante de la fotografía.' ,
297- creationDatetime: ' 12-04-2021 18:41' ,
298- lastLogin: ' 25-05-2021 10:12' ,
299- isSeeder: true ,
300- isSponsor: true ,
301- isSeer: true ,
302- address: ' Av. Corrientes 5530, Buenos Aires, Argentina' ,
303- latitude: - 34.5971806 ,
304- longitude: - 58.4432835 ,
305- phone: ' +54 9 11 3271 8283' ,
306- interests: [' Arte' , ' Ciencia' , ' Cine' , ' Comida' , ' Fotografía' , ' Moda' , ' Música' , ' Tecnología' , ' Teatro' ],
307- isBlocked: false
308- }
280+ ethereum: 0.0096
281+ },
282+ favoriteHeaders: [
283+ { text: ' ID' , align: ' start' , sortable: false , value: ' dbId' },
284+ { text: ' Nombre' , sortable: false , value: ' name' },
285+ { text: ' Categoría' , sortable: false , value: ' categoryName' },
286+ { text: ' Favoritos' , align: ' end' , sortable: false , value: ' favoriteCount' }
287+ ]
309288 }),
310289
311290 computed: {
@@ -316,13 +295,19 @@ export default {
316295 return this .user .isBlocked
317296 },
318297 isSeeder () {
319- return this .mockUser .isSeeder
298+ return this .user .isSeeder
320299 },
321300 isSponsor () {
322- return this .mockUser .isSponsor
301+ return this .user .isSponsor
323302 },
324303 isSeer () {
325- return this .mockUser .isSeer
304+ return this .user .isSeer
305+ },
306+ interests () {
307+ return this .user ? .interests ? .edges ? .map (i => i? .node ? .name ) || []
308+ },
309+ favorites () {
310+ return this .user ? .favoritedProjects ? .edges ? .map (i => i? .node ) || []
326311 },
327312 items () {
328313 return [{
@@ -331,12 +316,9 @@ export default {
331316 href: ' ../users'
332317 },
333318 {
334- text: this .mockUser .username ,
319+ text: this .user .username ,
335320 disabled: true
336321 }]
337- },
338- loading () {
339- return this .user === undefined
340322 }
341323 },
342324
0 commit comments