This commit is contained in:
iriska-gri committed 2023-09-05 16:07:55 +03:00
commit 8c95bbf909
126 files changed
+16922

No files matched your search

+172
View File
@@ -0,0 +1,172 @@
<template>
<v-card class="pt-2">
<v-card-title>
<span class="text-h5">Обратная связь</span>
</v-card-title>
<v-card-text class="px-2 py-0">
<v-container>
<v-row>
<v-col class="flex-grow-0 py-0 text-no-wrap align-self-center text-button">Оцените сайт
<!-- <my-helper
:pretext = "result.data"
/> -->
</v-col>
<v-divider/>
</v-row>
<v-row
v-for="(x, key) in btns"
:key = key
>
<v-col class="flex-grow-0 pb-0">
<v-icon
size="large"
:color="x.color"
:icon="x.ico"
/>
</v-col>
<v-col class="pb-0" lg=3>
{{x.name}}
</v-col>
<v-col class="py-0">
<v-rating
v-model="x.rating"
hover
half-increments
size="small"
color="yellow-darken-3"
/>
</v-col>
<v-divider/>
</v-row >
<!-- <v-row>
<v-divider/>
<v-col class="px-3 ">
{{myLabel()}}
</v-col>
<v-divider/>
</v-row> -->
<v-row class="mt-6">
<v-col class="pa-0 px-3">
<v-textarea
label="Ваши комментарии сделают портал лучше"
hide-details
variant="outlined"
rows="5"
row-height="15"
v-model="comment"
/>
</v-col>
</v-row>
</v-container>
<!-- <small>вы оценили сайт на <pre>{{ rating }}</pre></small> -->
</v-card-text>
<v-card-actions class="pt-0">
<v-spacer></v-spacer>
<v-btn
color="blue-darken-1"
variant="text"
@click="menusCloses"
>
Закрыть
</v-btn>
<v-btn
color="blue-darken-1"
variant="text"
@click="feedAll"
>
Отправить
</v-btn>
</v-card-actions>
</v-card>
</template>
<script>
import { ref, onMounted, computed } from 'vue'
import { axiosApiInstance } from '@/utils/axios-api'
export default {
props: {
LikeDialog: {
type: Boolean,
default: false
}
},
setup(props, context) {
const comment = ref("")
const btns = ref([])
onMounted(() => {
axiosApiInstance.get('api/feedback/formfeed/')
.then(data => btns.value = data.data)
})
const ratingStatus = computed(() => {
const decFeed = []
btns.value.map(e =>
{
const { id, rating } = {...e}
decFeed.push({id:id, rating:rating})
});
return { decFeed }
});
function feedAll() {
const feedObj = {}
feedObj.ratingstatus = ratingStatus.value.decFeed
feedObj.usercomment = comment.value
axiosApiInstance.post('api/feedback/comment/', feedObj)
}
function menusCloses() {
context.emit('menusClose')
}
return {btns, comment, feedAll, menusCloses}
}
}
// function myLabel() {
// let labels = ''
// if (rating.value <= 1)
// labels = 'Мы обязательно все исправим, с учего начать в первую очередь?'
// if (rating.value > 1 && rating.value <= 2)
// labels = 'УПС-С! А что вам не поравилось?'
// if (rating.value > 2 && rating.value <= 3)
// labels = 'Спасибо за обратную связь, что нам стоит улучшить?'
// if (rating.value > 3 && rating.value <= 4)
// labels = 'Мы рады, что портал вам понравился,скажите, за что вы поставили такую оценку?'
// if (rating.value > 4 && rating.value <= 5)
// labels = 'Класс, а что нам удалось сделать лучше всего?'
// return labels
// }
</script>
<style>
.custom_subtitle {
opacity: 1;
}
.v-selection-control__input {
width: 46%!important;
height: 46%!important;
border-radius: 0!important;
}
</style>