Скролл

This commit is contained in:
iriska-gri committed 2023-11-28 15:59:51 +03:00
1 parent ea5ff5834a
commit 102236b263
1 file changed
+264 -199
+264 -199
View File
@@ -1,5 +1,255 @@
<template>
<v-row class="justify-center">
<v-row class="justify-center">
<v-col
v-if="route.path == '/news' && 'id' in route.query?false:true"
class="flex-column"
lg="6"
>
<div class="d-flex flex-column py-3 h-100 ">
<v-row class=" flex-grow-1 d-flex h-0 overflow-auto">
<v-col class="pa-0 ">
<v-card
class=" rounded-0"
v-for="(x, i) in newss.result" :key=i
>
<v-card-title class="pt-0 pb-1">
{{x.title}}
</v-card-title>
<v-img
:src="`${burl}${x.link}`"
height="350px"
width="96%"
class="mx-auto"
cover
/>
<v-list-item class="w-100">
<template v-slot:prepend>
<v-avatar
color="loading_avatar"
:image="checkremote( `${spravURL}${x.author.login}.jpg`)"
size="25"
>
</v-avatar>
<v-list-item-title class="text-caption">{{splitname(x.author)}}</v-list-item-title>
</template>
<template v-slot:append>
<div class="justify-self-end">
<v-icon 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)"></v-icon>
<span class="subheading me-2">{{x.scores.filter(e=> e.score==true).length}}</span>
<span class="me-1">·</span>
<v-icon 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 class="me-1" icon="mdi-message-text-outline" @click="openComent(x.id)"/>
<span @click="x.showComment=!x.showComment" class="pointer subheading">{{ x.comment.length }}</span>
</div>
</template>
</v-list-item>
<div >
<v-divider/>
<v-card-text>
{{x.text}}
</v-card-text>
<v-divider/>
<v-expand-transition>
<div v-show="x.showComment" v-if="x.comment.length>0">
<div
v-for = "(y, key) in x.comment"
:key="key"
class="d-flex flex-column pa-3"
>
<v-row
class="justify-space-between ma-0 align-center bgchat mr-7"
:class="accountStore.user.login==y.author.login?'bgchatnot':'bgchat'"
>
<v-col class="flex-grow-1 text-subtitle-2 pl-2 pa-0 "
>
{{ accountStore.user.login==y.author.login?'':splitname(y.author) }}
</v-col>
<v-col class="pa-0 text-center text-subtitle-2 ">
{{dateformat(y.cdate)}}
</v-col>
<v-col class="pa-0 pr-2 text-end text-subtitle-2 ">
{{ accountStore.user.login!=y.author.login?'':splitname(y.author) }}
</v-col>
</v-row>
<div class="text-subtitle-2">
</div>
<v-row>
<v-col class="pr-0">
<v-alert
color="bg_white"
rounded=0
:border="accountStore.user.login==y.author.login?'end':'start'"
:border-color="accountStore.user.login==y.author.login?'success':'deep-purple accent-4'"
elevation=0
>
{{ y.text }}
</v-alert>
</v-col>
<v-col class="flex-grow-0 d-flex pa-0 align-center"
:class="accountStore.user.login==y.author.login?'pa-0':'pa-5'"
>
<v-btn
v-if="accountStore.user.login==y.author.login"
variant="text"
size="small"
icon='mdi-delete'
color="delete_btn"
@click="deletComment(y.id, x.id)"
/>
</v-col>
</v-row>
</div>
</div>
</v-expand-transition>
</div>
</v-card>
</v-col>
</v-row>
<v-row class="flex-grow-0" v-show="route.path == '/news' && 'id' in route.query?false:true">
<v-col class="ma-0 pa-0 pt-2">
<v-pagination
v-model="page"
:length="newss.allnews"
prev-icon="mdi-menu-left"
next-icon="mdi-menu-right"
@click="pagelistNews"
/>
</v-col>
<v-col class="ma-0 flex-grow-0 mwidth mt-1 pa-0">
<v-select
hide-details
density="compact"
v-model="selecnews"
variant="underlined"
:items="['1', '2', '3', '4', '5', '6']"/>
</v-col>
</v-row>
</div>
</v-col>
<v-col v-else class="flex-column d-flex" v-for="(x, i) in newss.result" :key=i>
<v-row>
<v-col class=" flex-column d-flex">
<v-row class="flex-grow-0">
<v-col class="pb-0 pr-0">
<v-card
height="350px"
class="rounded-b-0"
>
<v-card-title class="pt-0 pb-1">
{{x.title}}
</v-card-title>
<v-img
:src="`${burl}${x.link}`"
height="350px"
width="96%"
class="mx-auto"
cover
/>
</v-card>
</v-col>
</v-row>
<v-row>
<v-col class="pt-0 pr-0">
<v-card
class="rounded-t-0 flex-column d-flex h-100 Line truncated
>
<v-list-item class="w-100">
<template v-slot:prepend>
<v-avatar
color="loading_avatar"
:image="checkremote( `${spravURL}${x.author.login}.jpg`)"
size="25"
>
</v-avatar>
<v-list-item-title class="text-caption">{{splitname(x.author)}}</v-list-item-title>
</template>
<template v-slot:append>
<div class="justify-self-end">
<v-icon 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)"></v-icon>
<span class="subheading me-2">{{x.scores.filter(e=> e.score==true).length}}</span>
<span class="me-1">·</span>
<v-icon 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 class="me-1" icon="mdi-message-text-outline" @click="openComent(x.id)"/>
<span @click="x.showComment=!x.showComment" class="pointer subheading">{{ x.comment.length }}</span>
</div>
</template>
</v-list-item>
<v-divider/>
<v-row class="ma-0 my-3 overflow-auto h-0">
<v-col class="pa-0">
<v-card-text class="pt-0">
{{x.text}}
</v-card-text>
</v-col>
</v-row>
</v-card>
</v-col>
</v-row>
</v-col>
<v-col class="bg-yellow flex-column d-flex">
<v-row class="flex-grow-0">
<v-col class="bg-red pb-0 ">
<v-card
height="350px"
>
1
</v-card>
</v-col>
</v-row>
<v-row>
<v-col class="bg-blue">
<v-card
class="h-100"
>
1
</v-card>
</v-col>
</v-row>
</v-col>
</v-row>
</v-col>
</v-row>
<!-- <v-row class="justify-center">
<v-col
v-if="route.path == '/news' && 'id' in route.query?false:true"
class="flex-column"
@@ -220,11 +470,14 @@
</v-col>
<v-col>
<!-- <v-card class="h-100">
<v-card >
<div class="overflow-auto commentHeight mb-3">
<div
v-for = "(y, key) in x.comment"
:key="key"
class="d-flex flex-column pa-3"
class="d-flex flex-column pa-3 "
>
@@ -285,7 +538,8 @@
</div>
</v-card> -->
</div>
</v-card>
</v-col>
</v-row>
</v-col>
@@ -327,200 +581,7 @@
</v-card-actions>
</v-card>
</v-dialog>
</v-row>
<!-- <div class="d-flex flex-column py-3 h-100 ">
<v-row class=" flex-grow-1 d-flex h-0 overflow-auto">
<v-col class="pa-0 ">
<v-card
class=" rounded-0"
v-for="(x, i) in newss.result" :key=i
>
<v-card-title class="pt-0 pb-1">
{{x.title}}
</v-card-title>
<v-img
:src="`${burl}${x.link}`"
height="350px"
width="96%"
class="mx-auto"
cover
/>
<v-list-item class="w-100">
<template v-slot:prepend>
<v-avatar
color="loading_avatar"
:image="checkremote( `${spravURL}${x.author.login}.jpg`)"
size="25"
>
</v-avatar>
<v-list-item-title class="text-caption">{{splitname(x.author)}}</v-list-item-title>
</template>
<template v-slot:append>
<div class="justify-self-end">
<v-icon 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)"></v-icon>
<span class="subheading me-2">{{x.scores.filter(e=> e.score==true).length}}</span>
<span class="me-1">·</span>
<v-icon 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 class="me-1" icon="mdi-message-text-outline" @click="openComent(x.id)"/>
<span @click="x.showComment=!x.showComment" class="pointer subheading">{{ x.comment.length }}</span>
</div>
</template>
</v-list-item>
<div >
<v-divider/>
<v-card-text>
{{x.text}}
</v-card-text>
<v-divider/>
<v-expand-transition>
<div v-show="x.showComment" v-if="x.comment.length>0">
<div
v-for = "(y, key) in x.comment"
:key="key"
class="d-flex flex-column pa-3"
>
<v-row
class="justify-space-between ma-0 align-center bgchat mr-7"
:class="accountStore.user.login==y.author.login?'bgchatnot':'bgchat'"
>
<v-col class="flex-grow-1 text-subtitle-2 pl-2 pa-0 "
>
{{ accountStore.user.login==y.author.login?'':splitname(y.author) }}
</v-col>
<v-col class="pa-0 text-center text-subtitle-2 ">
{{dateformat(y.cdate)}}
</v-col>
<v-col class="pa-0 pr-2 text-end text-subtitle-2 ">
{{ accountStore.user.login!=y.author.login?'':splitname(y.author) }}
</v-col>
</v-row>
<div class="text-subtitle-2">
</div>
<v-row>
<v-col class="pr-0">
<v-alert
color="bg_white"
rounded=0
:border="accountStore.user.login==y.author.login?'end':'start'"
:border-color="accountStore.user.login==y.author.login?'success':'deep-purple accent-4'"
elevation=0
>
{{ y.text }}
</v-alert>
</v-col>
<v-col class="flex-grow-0 d-flex pa-0 align-center"
:class="accountStore.user.login==y.author.login?'pa-0':'pa-5'"
>
<v-btn
v-if="accountStore.user.login==y.author.login"
variant="text"
size="small"
icon='mdi-delete'
color="delete_btn"
@click="deletComment(y.id, x.id)"
/>
</v-col>
</v-row>
</div>
</div>
</v-expand-transition>
</div>
</v-card>
</v-col>
</v-row>
<v-row class="flex-grow-0" v-show="route.path == '/news' && 'id' in route.query?false:true">
<v-col class="ma-0 pa-0 pt-2">
<v-pagination
v-model="page"
:length="newss.allnews"
prev-icon="mdi-menu-left"
next-icon="mdi-menu-right"
@click="pagelistNews"
/>
</v-col>
<v-col class="ma-0 flex-grow-0 mwidth mt-1 pa-0">
<v-select
hide-details
density="compact"
v-model="selecnews"
variant="underlined"
:items="['1', '2', '3', '4', '5', '6']"/>
</v-col>
</v-row>
<v-dialog
v-model="dialogCommentShow"
persistent
width="550"
>
<v-card>
<v-card-title class="text-h5">
Прокоментировать новость
</v-card-title>
<v-card-text>
<v-textarea
variant="solo"
hide-details
rows="5"
v-model="textcomment"
></v-textarea>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn
color="modal_btn"
variant="text"
@click="dialogCommentShow = false"
>
Отмена
</v-btn>
<v-btn
color="modal_btn"
variant="text"
@click="addComment"
>
Отправить
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</div> -->
</v-row> -->
</template>
@@ -699,7 +760,11 @@ export default {
} */
.heigCard {
height: 47vh;
height: 46vh;
}
.commentHeight {
height: 91.5vh;
}
</style>