From 607454c5cc70852b58701024e57b70ab32b01eab Mon Sep 17 00:00:00 2001 From: iriska-gri <79623434+iriska-gri@users.noreply.github.com> Date: Thu, 7 Dec 2023 13:22:32 +0300 Subject: [PATCH] =?UTF-8?q?=D0=93=D0=B0=D0=BB=D0=B5=D1=80=D0=B5=D1=8F=206?= =?UTF-8?q?=20=D1=84=D0=BE=D1=82=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/front/src/components/news-list-news.vue | 170 ++++++++++++++------ 1 file changed, 121 insertions(+), 49 deletions(-) diff --git a/src/front/src/components/news-list-news.vue b/src/front/src/components/news-list-news.vue index a9736e66c..756271066 100644 --- a/src/front/src/components/news-list-news.vue +++ b/src/front/src/components/news-list-news.vue @@ -168,6 +168,7 @@ + @@ -245,61 +246,120 @@ - - -
+
- - - + + +
+ + + class=" pointer" + :src="`${burl}${x.gallery[(e-1)+(n-1)*19].img}`" + @click="openImg(x.gallery[(e-1)+(n-1)*19].id)" + /> - - - - - - - {{x.gallery[0].likes.length}} - + + + + + + {{x.gallery[(e-1)+(n-1)*19].likes.length}} + - +
- - - - 3 - 4 + +
- - - - - - - - - 6 - - + +
+ + + + + + + + + + + {{x.gallery[(5)+(n-1)*19].likes.length}} + + +
+
+ + + + + + + + + + + {{x.gallery[(6)+(n-1)*19].likes.length}} + + +
7 @@ -670,7 +730,9 @@ export default { const page = ref(1) const selecnews = ref(2) const route = useRoute() - + const colors = ['bg-pink-lighten-5','bg-red-lighten-5', 'bg-purple-lighten-5', + 'bg-deep-purple-lighten-5','bg-indigo-lighten-5', 'bg-blue-lighten-5' + ] let str = `api/navigation/news/?name=${route.path}&page=${page.value-1}&selected=${selecnews.value}` @@ -688,7 +750,12 @@ export default { newss.value= result.data if (newss.value.result[0].gallery.length > 0) { + newss.value.result[0].gallery.forEach(e=> + e.bg=colors[Math.floor(Math.random() * colors.length)] + + ) gallery.value = true + } @@ -805,6 +872,13 @@ export default { }, {deep:true}) + const imagesIn = () => { + console.log(newss.value.result[0].gallery.length); + return newss.value.result[0].gallery.length + + } + + // Лайки на фотографии const toggleLike = (idimage) => { @@ -814,9 +888,6 @@ export default { }) - - - } const toggleLikeAll = (idimage) => { @@ -872,7 +943,8 @@ export default { toggleLike, heartIco, heartIcoAll, - toggleLikeAll + toggleLikeAll, + imagesIn }