Merge branch 'razrab' into feature/create_app
This commit is contained in:
commit
4f2e6aa2a9
9 files changed
+164
-67
No files matched your search
Generated
+19
-5
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "front",
|
||||
"version": "0.0.12",
|
||||
"version": "0.0.13",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "front",
|
||||
"version": "0.0.12",
|
||||
"version": "0.0.13",
|
||||
"dependencies": {
|
||||
"@fullcalendar/core": "^6.1.8",
|
||||
"@fullcalendar/daygrid": "^6.1.8",
|
||||
@@ -19,6 +19,7 @@
|
||||
"@vuelidate/core": "^2.0.3",
|
||||
"@vuelidate/validators": "^2.0.3",
|
||||
"axios": "^1.4.0",
|
||||
"date-fns": "^2.30.0",
|
||||
"pinia": "^2.0.23",
|
||||
"roboto-fontface": "*",
|
||||
"vue": "^3.2.0",
|
||||
@@ -2171,7 +2172,6 @@
|
||||
"version": "7.22.10",
|
||||
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.10.tgz",
|
||||
"integrity": "sha512-21t/fkKLMZI4pqP2wlmsQAWnYW1PDyKyyUV4vCi+B25ydmdaYTKXPwCj0BzSUnZf4seIiYvSA3jcZ3gdsMFkLQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"regenerator-runtime": "^0.14.0"
|
||||
},
|
||||
@@ -6957,6 +6957,21 @@
|
||||
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz",
|
||||
"integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ=="
|
||||
},
|
||||
"node_modules/date-fns": {
|
||||
"version": "2.30.0",
|
||||
"resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz",
|
||||
"integrity": "sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.21.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.11"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/date-fns"
|
||||
}
|
||||
},
|
||||
"node_modules/debug": {
|
||||
"version": "4.3.4",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
|
||||
@@ -11421,8 +11436,7 @@
|
||||
"node_modules/regenerator-runtime": {
|
||||
"version": "0.14.0",
|
||||
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz",
|
||||
"integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==",
|
||||
"dev": true
|
||||
"integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA=="
|
||||
},
|
||||
"node_modules/regenerator-transform": {
|
||||
"version": "0.15.2",
|
||||
|
||||
+2
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "front",
|
||||
"version": "0.0.12",
|
||||
"version": "0.0.13",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
@@ -21,6 +21,7 @@
|
||||
"@vuelidate/core": "^2.0.3",
|
||||
"@vuelidate/validators": "^2.0.3",
|
||||
"axios": "^1.4.0",
|
||||
"date-fns": "^2.30.0",
|
||||
"pinia": "^2.0.23",
|
||||
"roboto-fontface": "*",
|
||||
"vue": "^3.2.0",
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/>
|
||||
<v-card
|
||||
class="mx-auto mb-0 "
|
||||
v-for="(x, i) in newss.newsqueryset" :key= i
|
||||
v-for="(x, i) in newss" :key= i
|
||||
>
|
||||
<v-img
|
||||
:src="`${burl}${x.link}`"
|
||||
@@ -50,22 +50,24 @@
|
||||
<v-row >
|
||||
<v-col>
|
||||
<v-btn
|
||||
variant="text"
|
||||
icon="mdi-thumb-up-outline"
|
||||
color="blue-darken-3"
|
||||
@click="toggleIncrementLike"
|
||||
/>
|
||||
{{ incrementLikes }}
|
||||
variant="text"
|
||||
:icon="x.scores.filter(e=> e.user==accountStore.user.id && e.score ==true).length>0?'mdi-thumb-up':'mdi-thumb-up-outline'"
|
||||
color="blue-darken-3"
|
||||
@click="toggleIncrementLike(x.id, true)"
|
||||
/>
|
||||
{{x.scores.filter(e=> e.score==true).length}}
|
||||
<!-- {{ x.likes }} -->
|
||||
</v-col>
|
||||
<v-col class=" ml-8">
|
||||
<v-btn
|
||||
variant="text"
|
||||
icon="mdi-message-text-outline"
|
||||
color="teal"
|
||||
@click="commentShow=!commentShow"
|
||||
@click="x.showComment=!x.showComment"
|
||||
/>
|
||||
{{ x.comment.length }}
|
||||
<!-- @click="commentadd" -->
|
||||
{{ message }}
|
||||
|
||||
<!-- <v-btn
|
||||
:icon="x.show ? 'mdi-chevron-up' : 'mdi-chevron-down'"
|
||||
@click="x.show = !x.show"
|
||||
@@ -74,11 +76,13 @@
|
||||
<v-col class="text-center pr-0">
|
||||
<v-btn
|
||||
variant="text"
|
||||
icon="mdi-thumb-down-outline"
|
||||
:icon="x.scores.filter(e=> e.user==accountStore.user.id && e.score == false).length>0?'mdi-thumb-down':'mdi-thumb-down-outline'"
|
||||
color="red-lighten-2"
|
||||
@click="toggleDecrementLike"
|
||||
@click="toggleIncrementLike(x.id, false)"
|
||||
/>
|
||||
{{ derementLikes }}
|
||||
{{x.scores.filter(e=> e.score==false).length}}
|
||||
<!-- {{ x.dislikes }} -->
|
||||
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
@@ -91,8 +95,24 @@
|
||||
|
||||
</v-expand-transition>
|
||||
<v-expand-transition>
|
||||
<div v-show="commentShow">
|
||||
<!-- {{ x.commnet.text }} -->
|
||||
<div v-show="x.showComment" v-if="x.comment.length>0">
|
||||
<div
|
||||
v-for = "(y, key) in x.comment"
|
||||
:key="key"
|
||||
|
||||
|
||||
class="d-flex align-center flex-column py-3"
|
||||
>
|
||||
<div class="text-subtitle-2">{{dateformat(y.cdate)}}</div>
|
||||
|
||||
<v-card
|
||||
width="400"
|
||||
:subtitle=y.author
|
||||
:text=y.text
|
||||
elevation="1"
|
||||
></v-card>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</v-expand-transition>
|
||||
</v-card>
|
||||
@@ -145,6 +165,8 @@ import {useAccountStore} from '@/store/AccountStore'
|
||||
import {getfromserver} from '@/utils/universal_functions'
|
||||
import { baseURL } from '@/utils/axios-api'
|
||||
import myHelper from './UI/my-helper.vue'
|
||||
import { axiosApiInstance } from '@/utils/axios-api'
|
||||
import { format } from 'date-fns'
|
||||
|
||||
const accountStore = useAccountStore()
|
||||
|
||||
@@ -157,38 +179,61 @@ export default {
|
||||
const show=ref(false)
|
||||
const incrementLikes = ref(0)
|
||||
const derementLikes = ref(0)
|
||||
const likes = ref(0)
|
||||
const likedI = ref(false)
|
||||
const likedD = ref(false)
|
||||
const message = ref(0)
|
||||
const commentShow = ref(false)
|
||||
const dialogCommentShow = ref(false)
|
||||
|
||||
const toggleIncrementLike = () => {
|
||||
if (likedI.value) {
|
||||
incrementLikes.value--
|
||||
}
|
||||
else {
|
||||
incrementLikes.value++
|
||||
if(likedD.value){
|
||||
derementLikes.value--
|
||||
likedD.value = false
|
||||
}
|
||||
}
|
||||
likedI.value=!likedI.value
|
||||
const toggleIncrementLike = (news, scores) => {
|
||||
console.log(news, scores);
|
||||
|
||||
// let k = scores.find(e=>e.user==accountStore.user.id)
|
||||
// // if (!k.score){
|
||||
// console.log(k,'=============');
|
||||
// // }
|
||||
|
||||
// if (likedI.value) {
|
||||
// incrementLikes.value--
|
||||
// }
|
||||
// else {
|
||||
// incrementLikes.value++
|
||||
// if(likedD.value){
|
||||
// derementLikes.value--
|
||||
// likedD.value = false
|
||||
// }
|
||||
// }
|
||||
// likedI.value=!likedI.value
|
||||
// likes.value = incrementLikes.value
|
||||
// console.log(incrementLikes.value, 'incrementLikes.value');
|
||||
axiosApiInstance.post(`api/navigation/news/`, {news: news, scores: scores}).then(result => {
|
||||
|
||||
newss.value[newss.value.findIndex(e=> e.id==news)].scores= result.data
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
const toggleDecrementLike = () => {
|
||||
if (likedD.value) {
|
||||
derementLikes.value--
|
||||
}
|
||||
else {
|
||||
derementLikes.value++
|
||||
if(likedI.value){
|
||||
incrementLikes.value--
|
||||
likedI.value = false
|
||||
}
|
||||
}
|
||||
likedD.value=!likedD.value
|
||||
const dateformat = (datas) => {
|
||||
|
||||
return format(new Date(datas), 'dd.MM.yyyy')
|
||||
}
|
||||
|
||||
const toggleDecrementLike = (idnews) => {
|
||||
// if (likedD.value) {
|
||||
// derementLikes.value--
|
||||
// }
|
||||
// else {
|
||||
// derementLikes.value++
|
||||
// if(likedI.value){
|
||||
// incrementLikes.value--
|
||||
// likedI.value = false
|
||||
// }
|
||||
// }
|
||||
// likedD.value=!likedD.value
|
||||
// likes.value = derementLikes.value
|
||||
// console.log(derementLikes.value, 'derementLikes.value');
|
||||
// axiosApiInstance.post(`api/navigation/news/`, {like: likes.value, idnews: idnews})
|
||||
}
|
||||
|
||||
const burl = baseURL.slice(0,-1)
|
||||
@@ -207,6 +252,14 @@ export default {
|
||||
}
|
||||
}, {deep:true})
|
||||
|
||||
|
||||
// watch(()=>likes,(newValue,oldValue)=>{
|
||||
// if(newValue){
|
||||
// getfromserver("api/navigation/news/",newss)
|
||||
// }
|
||||
// }, {deep:true})
|
||||
|
||||
|
||||
const commentadd = () => {
|
||||
dialogCommentShow.value=!dialogCommentShow.value
|
||||
// commentShow.value =!commentShow.value
|
||||
@@ -225,7 +278,9 @@ export default {
|
||||
toggleIncrementLike,
|
||||
toggleDecrementLike,
|
||||
dialogCommentShow,
|
||||
commentadd
|
||||
commentadd,
|
||||
accountStore,
|
||||
dateformat
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- {{appStore.countvisitor}} -->
|
||||
|
||||
</v-card>
|
||||
</v-col>
|
||||
|
||||
Reference in new issue
Block a user