Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

ProfileView.vue 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <template lang="pug">
  2. main.view--profile.f-col.start.w-full
  3. header
  4. h2 Profile Page
  5. article(v-if="!loading")
  6. h3 name: {{ profile.user_name }}
  7. span(v-if="profile.profile_prefs?.pronouns") &nbsp;({{ profile.profile_prefs?.pronouns.val }})
  8. p(v-if="profile.user_email") {{ profile.user_email }}
  9. p I am looking for a&nbsp;
  10. span {{ profile.profile_prefs?.presence?.val }}&nbsp;
  11. span {{ profile.profile_prefs?.role?.val }}&nbsp;
  12. span role&nbsp;
  13. span no further than {{ profile.profile_prefs?.distance?.val }} miles away&nbsp;
  14. span from {{ profile.profile_prefs?.zipcode?.val }}
  15. p I am {{ profile.profile_prefs?.urgency?.val.split("_").join(" ") }}.
  16. img(v-if="profile.reveal.map(t => t.description).includes('image')" :src="profile.profile_media[0]" alt="profile-avatar" style="max-height: 200px; width: auto;")
  17. h3(v-else) image not revealed
  18. p About: {{ profile.profile_description}}
  19. p reveal: {{ profile.reveal.map(t => t.description) }}
  20. p tags: {{ profile.tags.map(t => t.description) }}
  21. p images: {{ profile.profile_media }}
  22. p responses: {{ profile.responses.length }}
  23. button(@click="$router.go(-1)") back
  24. p(v-else) Loading...
  25. MainNav(@show-sidebar="$emit('show-sidebar')")
  26. </template>
  27. <script>
  28. import { fetchProfileByProfileId } from '../services'
  29. export default {
  30. name: 'ProfileView',
  31. data: () => ({
  32. loading: true,
  33. profile: {},
  34. }),
  35. created() {
  36. this.getProfile()
  37. },
  38. methods: {
  39. async getProfile() {
  40. this.loading = true
  41. try {
  42. this.profile = await fetchProfileByProfileId(
  43. this.$route.params.pid,
  44. )
  45. } catch (err) {
  46. console.error(err)
  47. }
  48. this.loading = false
  49. },
  50. },
  51. }
  52. </script>