1
1
<template >
2
2
<v-container >
3
+ <v-row justify =" center" >
4
+ <v-dialog
5
+ v-model =" dialog"
6
+ max-width =" 600px"
7
+ >
8
+ <v-card max-height =" 593" >
9
+ <v-textarea
10
+ v-model =" postItem"
11
+ rows =" 8"
12
+ required
13
+ solo
14
+ no-resize
15
+ post-item
16
+ />
17
+ <v-card-actions >
18
+ <v-btn
19
+ color =" blue darken-1"
20
+ text
21
+ @click =" postCreate"
22
+ >
23
+ Gönder
24
+ </v-btn >
25
+ </v-card-actions >
26
+ </v-card >
27
+ </v-dialog >
28
+ </v-row >
3
29
<v-row >
4
30
<v-col >
5
31
<v-card
6
32
min-height =" 270"
7
33
max-width =" 225"
8
- class =" mt-4 ml-4 justify-start elevation-0 card-border"
34
+ class =" mt-4 justify-start elevation-0 card-border fill-width "
9
35
>
10
36
<v-avatar class =" profile-image" size =" 68" >
11
37
<v-img
12
- :src =" $store.state.usersData .profile_photo"
38
+ :src =" $store.state.auth.user .profile_photo"
13
39
/>
14
40
</v-avatar >
15
41
<v-img
16
- :src =" $store.state.usersData .banner_photo"
42
+ :src =" $store.state.auth.user .banner_photo"
17
43
class =" background-image"
18
44
/>
19
45
<v-card-title class =" mt-8 align-center justify-center" style =" font-size : 16px " >
20
- {{ $store.state.usersData. first_name }} {{ $store.state.usersData .last_name }}
46
+ {{ $store.state.auth.user. first_name }} {{ $store.state.auth.user .last_name }}
21
47
</v-card-title >
22
48
23
49
<v-card-subtitle class =" text-center" style =" font-size : 12px " >
24
- {{ $store.state.usersData .biography }}
50
+ {{ $store.state.auth.user .biography }}
25
51
</v-card-subtitle >
26
52
<v-divider />
27
53
<v-card-text style =" font-size : 12px " >
40
66
<v-row >
41
67
<v-avatar class =" mt-3 ml-4" size =" 48" >
42
68
<v-img
43
- :src =" $store.state.usersData .profile_photo"
69
+ :src =" $store.state.auth?.user .profile_photo"
44
70
/>
45
71
</v-avatar >
46
72
<v-btn
50
76
height =" 48"
51
77
rounded
52
78
color =" rgba(102, 102, 102, 0.60)"
79
+ @click =" dialog = true"
53
80
>
54
81
<v-card-subtitle
55
82
style =" margin-left : -80% ;font-weight : 400 ;color : Gray ;text-transform : none "
86
113
</v-card >
87
114
<v-divider class =" mb-2" />
88
115
<v-card
89
- class =" fill-height elevation-0 card-border"
116
+ v-for =" (item,i) in posts.results"
117
+ :key =" i"
118
+ class =" elevation-0 card-border mb-2"
90
119
>
91
- içerik kısmı
120
+ <div class =" d-flex align-center" >
121
+ <v-avatar class =" mt-3 ml-4" size =" 48" >
122
+ <v-img :src =" item.user.profile_photo" />
123
+ </v-avatar >
124
+ <v-card-title style =" font-size : 16px " >
125
+ {{ item.user.first_name }} {{ item.user.last_name }}
126
+ </v-card-title >
127
+ </div >
128
+ <v-card-text style =" color :black " >
129
+ {{ item.text }}
130
+ </v-card-text >
131
+ <v-divider class =" mb-2" />
132
+ <v-row >
133
+ <v-col
134
+ v-for =" (bar,a) in likeBar"
135
+ :key =" a"
136
+ >
137
+ <v-btn
138
+ text
139
+ class =" ml-1 mb-2"
140
+ >
141
+ <v-icon
142
+ :color =" bar.color"
143
+ >
144
+ {{ bar.icon }}
145
+ </v-icon >
146
+ <v-card-text
147
+ style =" color :rgba (102 , 102 , 102 , 0.60 )"
148
+ class =" text-capitalize pa-0 ml-1"
149
+ >
150
+ {{ bar.text }}
151
+ </v-card-text >
152
+ </v-btn >
153
+ </v-col >
154
+ </v-row >
92
155
</v-card >
93
156
</v-col >
94
157
95
158
<v-col >
96
159
<v-card
97
160
min-height =" 268"
98
- class =" d-flex mt-4 mr-4 justify-start elevation-0 card-border"
161
+ class =" mt-4 mr-4 justify-start elevation-0 card-border"
99
162
width =" 300"
100
163
>
101
164
Footer kısmı
@@ -112,6 +175,32 @@ export default {
112
175
middleware: authControl,
113
176
data () {
114
177
return {
178
+ dialog: false ,
179
+ postItem: ' ' ,
180
+ posts: [],
181
+ media_file: null ,
182
+ likeBar: [
183
+ {
184
+ icon: ' mdi-thumb-up-outline' ,
185
+ color: ' grey' ,
186
+ text: ' Beğen'
187
+ },
188
+ {
189
+ icon: ' mdi-message-text-outline' ,
190
+ color: ' grey' ,
191
+ text: ' Yorum Yap'
192
+ },
193
+ {
194
+ icon: ' mdi-sync' ,
195
+ color: ' grey' ,
196
+ text: ' Paylaş'
197
+ },
198
+ {
199
+ icon: ' mdi-send-variant' ,
200
+ color: ' grey' ,
201
+ text: ' Gönder'
202
+ }
203
+ ],
115
204
postItems: [
116
205
{
117
206
icon: ' mdi-image-outline' ,
@@ -131,7 +220,26 @@ export default {
131
220
]
132
221
}
133
222
},
223
+ mounted () {
224
+ this .postGet ()
225
+ },
134
226
methods: {
227
+ postGet () {
228
+ this .$axios .$get (process .env .POSTS_URL )
229
+ .then ((response ) => {
230
+ this .posts = response
231
+ })
232
+ },
233
+ postCreate () {
234
+ const params = {
235
+ text: this .postItem ,
236
+ media_file: this .media_file
237
+ }
238
+ this .$axios .$post (' /api/pages/post/' , params)
239
+ this .postItem = ' '
240
+ this .media_file = null
241
+ this .dialog = false
242
+ },
135
243
logout () {
136
244
this .$auth .logout ()
137
245
.then (() => {
0 commit comments