Запись в базу данных

This commit is contained in:
iriska-gri committed 2023-12-06 11:15:33 +03:00
1 parent afaaf5137a
commit 2f91b3355a
3 files changed
+64 -73

No files matched your search

+37 -71
View File
@@ -236,41 +236,6 @@
</v-col>
</v-row>
<!-- <v-row class="ma-0 my-3 overflow-auto h-0" v-else>
<v-col>
<v-row>
<v-col
v-for="n in x.gallery"
:key="n"
class="d-flex child-flex"
cols="4"
>
<v-img
:src="`${burl}${n.img}`"
:lazy-src="`${burl}${n.img}`"
aspect-ratio="1"
cover
class="bg-grey-lighten-2"
>
<template v-slot:placeholder>
<v-row
class="fill-height ma-0"
align="center"
justify="center"
>
<v-progress-circular
indeterminate
color="grey-lighten-5"
></v-progress-circular>
</v-row>
</template>
</v-img>
</v-col>
</v-row>
</v-col>
</v-row> -->
</v-card>
</v-col>
</v-row>
@@ -327,29 +292,6 @@
</v-card>
<!-- <v-img
:src="`${burl}${n.img}`"
:lazy-src="`${burl}${n.img}`"
aspect-ratio="0"
cover
class="bg-grey-lighten-2"
@click="openImg(n.img)"
>
<template v-slot:placeholder>
<v-row
class="fill-height ma-0"
align="center"
justify="center"
>
<v-progress-circular
indeterminate
color="grey-lighten-5"
></v-progress-circular>
</v-row>
</template>
</v-img> -->
</v-col>
</v-row>
@@ -540,25 +482,25 @@
</v-row>
</v-col>
</v-row>
<v-row class="flex-grow-0 align-self-center">
<v-row class="flex-grow-0 mt-4 align-self-center">
<v-col class="pa-0 flex-grow-0">
<v-col class="pa-0 flex-grow-0 d-flex">
<v-btn
density="compact"
variant="text"
:color="galleryimges.likes.length>0?'red':'black'"
:icon="galleryimges.likes.length>0?galleryimges.likes[0].user==accountStore.user.login?'mdi-heart':'mdi-heart-outline':'mdi-heart-outline'"
/>
@click = toggleLike(galleryimges.id)
/>
</v-col>
<span class="text-overline pa-0"> {{galleryimges.likes.length}}</span>
<!-- <span class="pa-0">·</span> -->
<!-- <v-col class="pa-0 flex-grow-0 text-overline">
</v-col> -->
<v-col class="pa-0 flex-grow-0 text-overline">
{{galleryimges.likes.length}}
</v-col>
<my-helper :pretext="galleryimges"/>
</v-row>
@@ -751,6 +693,29 @@ export default {
}, {deep:true})
// Лайки на фотографии
const toggleLike = (idimage) => {
axiosApiInstance.post(`api/navigation/gallery/`, {image: idimage}).then(result => {
console.log(result);
console.log(galleryimges.value);
})
console.log(idimage);
// let mark = likes.filter(e=>e.user==accountStore.user.login)
// if (mark.length > 0) {
// console.log(mark, 'likes>0');
// }
// else {
// console.log('0');
// }
}
return {
newss,
burl,
@@ -777,7 +742,8 @@ export default {
openImg,
dialogfoto,
galleryimges,
indximg
indximg,
toggleLike
}