Галерея v1

This commit is contained in:
iriska-gri committed 2023-12-04 15:16:09 +03:00
1 parent a3ded8373d
commit 9550a5ff10
2 files changed
+80 -21

No files matched your search

+80 -20
View File
@@ -293,14 +293,47 @@
<v-row> <v-row>
<v-col <v-col
class="d-flex pa-1 flex-column"
v-for="n in x.gallery" v-for="n in x.gallery"
:key="n" :key="n"
class="d-flex child-flex"
> >
<!-- <vue-masonry-gallery :imgsArr="`${burl}${n.img}`"></vue-masonry-gallery> -->
<v-card
class="ma-auto d-flex flex-column w-100 elevation-0 flex-wrap"
min-width="200"
height="250"
>
<v-img
class="w-100 h-100"
:src="`${burl}${n.img}`"
@click="openImg(n.img)"
>
</v-img>
<v-card-text class="pt-6">
<!-- <div class="font-weight-light text-grey text-h6 mb-2">
For the perfect meal
</div> -->
</v-card-text>
</v-card>
<!-- <v-img <!-- <v-img
:src="`${burl}${n.img}`" :src="`${burl}${n.img}`"
@@ -308,6 +341,7 @@
aspect-ratio="0" aspect-ratio="0"
cover cover
class="bg-grey-lighten-2" class="bg-grey-lighten-2"
@click="openImg(n.img)"
> >
<template v-slot:placeholder> <template v-slot:placeholder>
<v-row <v-row
@@ -325,8 +359,7 @@
</v-img> --> </v-img> -->
</v-col> </v-col>
</v-row> </v-row>
<!-- <div v-html=formatText(x.text)>
</div> -->
@@ -454,6 +487,34 @@
</v-card-actions> </v-card-actions>
</v-card> </v-card>
</v-dialog> </v-dialog>
<v-dialog
v-model="dialogfoto"
width="w-100"
height="900"
class="flex-column "
>
<v-card class="pa-4">
<v-img
class="d-flex "
:src="`${burl}${imgsrc}`"
>
</v-img>
<!-- <v-btn color="primary" block @click="dialogfoto = false">Close Dialog</v-btn> -->
</v-card>
</v-dialog>
</v-row> </v-row>
@@ -472,6 +533,7 @@ import { useRoute } from 'vue-router'
import { spravURL } from '@/utils/axios-api' import { spravURL } from '@/utils/axios-api'
const accountStore = useAccountStore() const accountStore = useAccountStore()
export default { export default {
@@ -487,19 +549,17 @@ export default {
const newss=ref([]) const newss=ref([])
const items =ref ([ { content: 'First', height: 150 },
{ content: 'http://127.0.0.1:8000/media/newsgallery/2023/12/01/world-of-warcraft-wow-znak.jpg', height: 300 },
{ content: 'Third', height: 150 },
{ content: 'Fourth', height: 450 }])
const imgsArr=ref([{src: 'world-of-warcraft-wow-znak.jpg', href: 'http://127.0.0.1:8000/media/newsgallery/2023/12/01/world-of-warcraft-wow-znak.jpg'}])
const dialogCommentShow = ref(false) const dialogCommentShow = ref(false)
const gallery = ref(false) const gallery = ref(false)
const dialogfoto = ref(false)
const burl = baseURL.slice(0,-1) const burl = baseURL.slice(0,-1)
const textcomment = ref('') const textcomment = ref('')
const idnews = ref(0) const idnews = ref(0)
const page = ref(1) const page = ref(1)
const selecnews = ref(2) const selecnews = ref(2)
const route = useRoute() const route = useRoute()
const imgsrc = ref('')
let str = `api/navigation/news/?name=${route.path}&page=${page.value-1}&selected=${selecnews.value}` let str = `api/navigation/news/?name=${route.path}&page=${page.value-1}&selected=${selecnews.value}`
@@ -538,6 +598,14 @@ export default {
} }
const openImg = (img) => {
imgsrc.value = ''
dialogfoto.value = true
imgsrc.value = img
}
const addComment = () => { const addComment = () => {
axiosApiInstance.post(`api/navigation/news/`, {news: idnews.value, text: textcomment.value}).then(result => { axiosApiInstance.post(`api/navigation/news/`, {news: idnews.value, text: textcomment.value}).then(result => {
console.log('----------------111111111111111111111111111111111'); console.log('----------------111111111111111111111111111111111');
@@ -583,15 +651,6 @@ export default {
} }
}, {deep:true}) }, {deep:true})
// watch(()=>newss ,(newValue,oldValue)=>{
// if(newValue){
// console.log('111111111');
// }
// else {
// console.log('2222222222222');
// }
// }
// )
const dateformat = (datas) => { const dateformat = (datas) => {
return format(new Date(datas), 'dd.MM.yyyy HH:mm') return format(new Date(datas), 'dd.MM.yyyy HH:mm')
@@ -648,8 +707,9 @@ export default {
spravURL, spravURL,
formatText, formatText,
gallery, gallery,
imgsArr, openImg,
items dialogfoto,
imgsrc
-1
View File
@@ -1 +0,0 @@
declare module 'vue-masonry-gallery'