Лайк на главной странице
This commit is contained in:
1 parent
9ace665e0e
commit
480863117b
2 files changed
+74
-38
No files matched your search
@@ -274,14 +274,40 @@
|
||||
min-width="200"
|
||||
height="250"
|
||||
>
|
||||
<v-img
|
||||
<v-card-text class="flex-grow-1 pa-0 d-flex flex-column">
|
||||
<v-row class=" ma-0 flex-grow-0 ">
|
||||
<v-col class="d-flex flex-column pa-0">
|
||||
<v-img
|
||||
class="w-100 h-100 pointer"
|
||||
:src="`${burl}${n.img}`"
|
||||
@click="openImg(n.id)"
|
||||
/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row class=" ma-0 flex-grow-0 align-self-center">
|
||||
<v-col class="pa-0 flex-grow-0">
|
||||
|
||||
<v-btn
|
||||
density="compact"
|
||||
variant="text"
|
||||
size="small"
|
||||
:color="heartIcoAll(n)?'red':'black'"
|
||||
:icon= "heartIcoAll(n)?'mdi-heart':'mdi-heart-outline'"
|
||||
@click = toggleLikeAll(n.id)
|
||||
/>
|
||||
</v-col>
|
||||
<v-col class="pa-0 pt-0 pl-1">
|
||||
{{n.likes.length}}
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<!-- <v-img
|
||||
class="w-100 h-100 pointer"
|
||||
:src="`${burl}${n.img}`"
|
||||
@click="openImg(n.id)"
|
||||
/>
|
||||
|
||||
<v-card-text class="pt-6">
|
||||
<!-- <div class="font-weight-light text-grey text-h6 mb-2">
|
||||
|
||||
<div class="font-weight-light text-grey">
|
||||
For the perfect meal
|
||||
</div> -->
|
||||
|
||||
@@ -290,6 +316,21 @@
|
||||
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
<!-- <v-row class="flex-grow-1 align-self-center d-flex placeIt">
|
||||
<v-col class="pa-0">
|
||||
|
||||
<v-btn
|
||||
density="compact"
|
||||
variant="text"
|
||||
:color="heartIco()?'red':'black'"
|
||||
:icon= "heartIco()?'mdi-heart':'mdi-heart-outline'"
|
||||
@click = toggleLike(n.id)
|
||||
/>
|
||||
</v-col>
|
||||
<v-col class="pa-0 text-overline">
|
||||
{{n.likes.length}}
|
||||
</v-col>
|
||||
</v-row> -->
|
||||
|
||||
|
||||
</v-col>
|
||||
@@ -482,28 +523,20 @@
|
||||
</v-row>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row class="flex-grow-0 mt-4 align-self-center">
|
||||
|
||||
<v-col class="pa-0 flex-grow-0 d-flex">
|
||||
<v-btn
|
||||
density="compact"
|
||||
variant="text"
|
||||
:color="heartIco()?'red':'black'"
|
||||
:icon= "heartIco()?'mdi-heart':'mdi-heart-outline'"
|
||||
@click = toggleLike(galleryimges.id)
|
||||
/>
|
||||
<!-- :color="heart?'red':'black'"
|
||||
:icon="heart?'mdi-heart':'mdi-heart-outline'" -->
|
||||
</v-col>
|
||||
<v-col class="pa-0 flex-grow-0 text-overline">
|
||||
{{galleryimges.likes.length}}
|
||||
|
||||
</v-col>
|
||||
|
||||
|
||||
|
||||
|
||||
</v-row>
|
||||
<v-row class="flex-grow-1 align-self-center d-flex placeIt">
|
||||
<v-col class="pa-0">
|
||||
<v-btn
|
||||
density="compact"
|
||||
variant="text"
|
||||
:color="heartIco()?'red':'black'"
|
||||
:icon= "heartIco()?'mdi-heart':'mdi-heart-outline'"
|
||||
@click = toggleLike(galleryimges.id)
|
||||
/>
|
||||
</v-col>
|
||||
<v-col class="pa-0 text-overline">
|
||||
{{galleryimges.likes.length}}
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<!-- <my-helper :pretext="galleryimges.likes.length"/> -->
|
||||
<!-- -->
|
||||
@@ -720,18 +753,16 @@ export default {
|
||||
}
|
||||
|
||||
const heartIco = () => {
|
||||
return galleryimges.value.likes.filter(e=>e.user==accountStore.user.login).length==1
|
||||
}
|
||||
|
||||
let heart =''
|
||||
if (galleryimges.value.likes.filter(e=>e.user==accountStore.user.login).length==1) {
|
||||
heart = true
|
||||
}
|
||||
else {
|
||||
heart = false
|
||||
}
|
||||
|
||||
|
||||
const heartIcoAll = (image) => {
|
||||
return image.likes.filter(e=>e.user==accountStore.user.login).length==1
|
||||
|
||||
}
|
||||
|
||||
return heart
|
||||
const toggleLikeAll = (id) => {
|
||||
console.log(id, '----------------------');
|
||||
}
|
||||
|
||||
return {
|
||||
@@ -762,7 +793,9 @@ export default {
|
||||
galleryimges,
|
||||
indximg,
|
||||
toggleLike,
|
||||
heartIco
|
||||
heartIco,
|
||||
toggleLikeAll,
|
||||
heartIcoAll
|
||||
|
||||
|
||||
}
|
||||
@@ -810,5 +843,7 @@ export default {
|
||||
|
||||
height: 86vh;
|
||||
}
|
||||
|
||||
.place-it{
|
||||
place-items: center;
|
||||
}
|
||||
</style>
|
||||
@@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<v-row>
|
||||
|
||||
<v-col
|
||||
class="text-h6 text-grey text-center align-self-center text--lighten-1 font-weight-light"
|
||||
>
|
||||
|
||||
Reference in new issue
Block a user