Карточки для новостей

This commit is contained in:
iriska-gri committed 2023-12-13 09:42:54 +03:00
1 parent 46ed1e68e0
commit 4431232ffa
2 files changed
+13 -98

No files matched your search

+11 -7
View File
@@ -1,10 +1,10 @@
<template> <template>
<v-card <v-card
class="rounded-0 h-100 flex-column d-flex" class="rounded-0 h-100 flex-column d-flex"
min-height="404" min-height="412"
max-height="404" max-height="412"
> >
<v-card-title class="pt-0 pb-1"> <v-card-title class="pb-1">
{{news.title}} {{news.title}}
</v-card-title> </v-card-title>
<v-row class="flex-grow-0"> <v-row class="flex-grow-0">
@@ -74,10 +74,14 @@
<v-divider/> <v-divider/>
</v-col> </v-col>
</v-row> </v-row>
<v-row> <v-row class="ma-0">
<v-col class="py-0"> <v-col class="py-0 "
<v-card-text class="py-0"> :class="news.text.length==0?'align-self-center':'my-3'"
<div v-html=limitText(news.text)></div> >
<v-card-text class="py-0 px-2">
<div v-if="news.text.length>0" v-html=limitText(news.text)></div>
<div v-else class="text-h6 text-grey text-center align-self-center text--lighten-1 font-weight-light">Без описания</div>
</v-card-text> </v-card-text>
</v-col> </v-col>
</v-row> </v-row>
+2 -91
View File
@@ -1,7 +1,7 @@
<template> <template>
<v-row> <v-row>
<v-col class="d-flex flex-column"> <v-col class="d-flex flex-column">
<v-row class=" flex-grow-1 d-flex h-0 overflow-auto"> <v-row class=" flex-grow-1 pa-1 d-flex h-0 overflow-auto">
<v-col <v-col
v-for="(x, key) in newsAll.result" v-for="(x, key) in newsAll.result"
:key="key" :key="key"
@@ -11,107 +11,20 @@
sm=12 sm=12
xs=12 xs=12
cols=12 cols=12
class="d-flex flex-column " class="d-flex pb-0 px-1 flex-column "
> >
<news-card :news="x"/> <news-card :news="x"/>
<!-- <v-card
class="h-100 rounded-0"
>
<v-card-title class="pt-0 pb-1">
{{x.title}}
</v-card-title>
<v-img
:src="`${burl}${x.link}`"
height="175px"
width="96%"
class="mx-auto"
cover
/>
<v-list-item class="w-100">
<div class="justify-self-start mt-1">
<v-icon size="x-small" class="me-1" icon="mdi-account"/>
<span class="text-caption me-2">
{{splitname(x.author)}}
</span>
</div>
<template v-slot:append>
<div class="justify-self-end">
<v-icon
size="x-small"
class="me-1"
:icon="x.scores.filter(e=> e.user==accountStore.user.login && e.score == true).length>0?'mdi-thumb-up':'mdi-thumb-up-outline'"
@click="toggleIncrementLike(x.id, true)"
/>
<span class="subheading me-2">
{{x.scores.filter(e=> e.score==true).length}}
</span>
<span class="me-1">
·
</span>
<v-icon
size="x-small"
class="me-1"
:icon="x.scores.filter(e=> e.user==accountStore.user.login && e.score == false).length>0?'mdi-thumb-down':'mdi-thumb-down-outline'"
@click="toggleIncrementLike(x.id, false)"
/>
<span class="subheading me-2">
{{x.scores.filter(e=> e.score==false).length}}
</span>
<span class="me-1">
·
</span>
<v-icon
size="x-small"
class="me-1"
icon="mdi-message-text-outline"
/>
<span class="subheading">
{{ x.comment.length }}
</span>
</div>
</template>
</v-list-item>
<v-divider/>
<v-card-text
class="pb-0"
>
<div v-html=limitText(x.text)></div>
</v-card-text>
<v-card-actions>
<v-btn
color="more_details_btn"
variant="text"
:to='`/news?id=${x.id}`'
size="small"
append-icon="mdi-step-forward-2"
>
Подробнее
</v-btn>
</v-card-actions>
</v-card> -->
</v-col> </v-col>
</v-row> </v-row>
<v-row class="flex-grow-0 "> <v-row class="flex-grow-0 ">
<v-col class="pa-0" > <v-col class="pa-0" >
<v-pagination <v-pagination
v-model="page" v-model="page"
:length=newsAll.countpage+1 :length=newsAll.countpage+1
:total-visible="7" :total-visible="7"
@update:modelValue="loadNewsAll" @update:modelValue="loadNewsAll"
/> />
</v-col> </v-col>
<v-col class="flex-grow-0 py-0"> <v-col class="flex-grow-0 py-0">
<v-select <v-select
style="width:53px" style="width:53px"
@@ -154,8 +67,6 @@ export default {
const page = ref(1) const page = ref(1)
const countpage = ref(8) const countpage = ref(8)
const route = useRoute() const route = useRoute()
const loadNewsAll = () => { const loadNewsAll = () => {
axiosApiInstance.get( `api/navigation/newscrossroad/?name=${route.path}&page=${page.value-1}&countpage=${countpage.value}`).then(result => { axiosApiInstance.get( `api/navigation/newscrossroad/?name=${route.path}&page=${page.value-1}&countpage=${countpage.value}`).then(result => {