Advertisement
Guest User

3765298365983298

a guest
Jun 26th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.79 KB | None | 0 0
  1. <template xmlns:v-slot="http://www.w3.org/1999/XSL/Transform">
  2. <LayoutAuthUs>
  3. <v-content id="page">
  4. <v-container fluid>
  5. <v-layout>
  6. <v-flex xs12 md12>
  7. <v-card width="400px" class="usinfo">
  8. <v-card-title>
  9. <div>
  10. <span>ФИО: {{ User.Info.Fio }}</span><br>
  11. <span>Описание: {{ User.Info.Info }}</span>
  12. </div>
  13. </v-card-title>
  14. </v-card>
  15. </v-flex>
  16. </v-layout>
  17. <v-layout>
  18. <v-flex xs12 md6 pa-3>
  19. <h2 class="my-3">Созданные маршруты</h2>
  20. <v-data-iterator
  21. :items="User.Routes"
  22. content-tag="v-layout"
  23. wrap
  24. >
  25. <template v-slot:item="props">
  26. <v-expansion-panel focusable>
  27. <v-expansion-panel-content>
  28. <template v-slot:header>
  29. <div>{{ props.item.Name }}</div>
  30. </template>
  31. <div class="mx-4 font-weight-bold">
  32. {{ props.item.Disc }}
  33. </div>
  34. <v-timeline class="mx-4">
  35. <v-timeline-item
  36. v-for="point in User.Points"
  37. :key="id"
  38. color="red lighten-2"
  39. large
  40. >
  41. <template v-slot:opposite>
  42. <span>{{ point.Name }}</span>
  43. </template>
  44. <v-card class="elevation-2">
  45. <v-card-text>
  46. {{ point.Disc }}
  47. </v-card-text>
  48. </v-card>
  49. </v-timeline-item>
  50. </v-timeline>
  51. </v-expansion-panel-content>
  52. </v-expansion-panel>
  53. </template>
  54. </v-data-iterator>
  55.  
  56. </v-flex>
  57. <v-flex xs12 md6 pa-3>
  58. <h2 class="my-3">Сохраненные маршруты</h2>
  59. <v-data-iterator
  60. :items="Saved.Routes"
  61. content-tag="v-layout"
  62. wrap
  63. >
  64. <template v-slot:item="props">
  65. <v-expansion-panel focusable>
  66. <v-expansion-panel-content>
  67. <template v-slot:header>
  68. <div>{{ props.item.Name }}</div>
  69. </template>
  70. <div class="mx-4 font-weight-bold">
  71. {{ props.item.Disc }}
  72. </div>
  73. <v-timeline class="mx-4">
  74. <v-timeline-item
  75. v-for="point in Saved.Points"
  76. :key="id"
  77. color="red lighten-2"
  78. large
  79. >
  80. <template v-slot:opposite>
  81. <span>{{ point.Name }}</span>
  82. </template>
  83. <v-card class="elevation-2">
  84. <v-card-text>
  85. {{ point.Disc}}
  86. </v-card-text>
  87. </v-card>
  88. </v-timeline-item>
  89. </v-timeline>
  90. </v-expansion-panel-content>
  91. </v-expansion-panel>
  92. </template>
  93. </v-data-iterator>
  94. </v-flex>
  95. </v-layout>
  96. </v-container>
  97. </v-content>
  98. </LayoutAuthUs>
  99. </template>
  100.  
  101. <script>
  102. import LayoutAuthUs from '@/components/layouts/LayoutAuthUs'
  103. import Service from '../../services/Service'
  104. export default {
  105. components: {
  106. LayoutAuthUs
  107. },
  108. data () {
  109. return {
  110. Saved: {
  111. Routes: [],
  112. Points: []
  113. },
  114. User: {
  115. Routes: [],
  116. Points: [],
  117. Info: {}
  118. }
  119. }
  120. },
  121. methods: {
  122. async insertData () {
  123. const response = await Service.ProfileInfo()
  124. this.User.Routes = response.data.author
  125. this.User.Info = response.data.profile
  126. this.Saved.Routes = response.data.likes
  127.  
  128.  
  129. for (let index = 0, len = this.User.Routes.length; index < len; ++index){
  130. const response = await Service.getRoute({id: this.User.Routes[index]._id})
  131. this.User.Points.push(response.data.routepoints)
  132. }
  133.  
  134. for (let index = 0, len = this.User.Routes.length; index < len; ++index){
  135. const response = await Service.getRoute({id: this.User.Routes[index]._id})
  136. this.Saved.Points.push(response.data.routepoints)
  137. }
  138. }
  139. },
  140. mounted () {
  141. this.insertData()
  142. }
  143. }
  144.  
  145. </script>
  146.  
  147. <style scoped>
  148. </style>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement