|
@@ -6,7 +6,6 @@
|
|
|
<q-btn flat round dense icon="close" color="grey-6" size="sm" @click="onDialogCancel" />
|
|
<q-btn flat round dense icon="close" color="grey-6" size="sm" @click="onDialogCancel" />
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <!-- Avatar -->
|
|
|
|
|
<div class="column items-center q-pb-sm">
|
|
<div class="column items-center q-pb-sm">
|
|
|
<q-avatar size="64px" class="q-mb-sm">
|
|
<q-avatar size="64px" class="q-mb-sm">
|
|
|
<span
|
|
<span
|
|
@@ -23,7 +22,6 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <!-- Estrelas -->
|
|
|
|
|
<div class="column items-center q-pb-xs">
|
|
<div class="column items-center q-pb-xs">
|
|
|
<q-rating
|
|
<q-rating
|
|
|
v-model="stars"
|
|
v-model="stars"
|
|
@@ -36,7 +34,6 @@
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <!-- Tags de melhoria/qualidade -->
|
|
|
|
|
<q-card-section v-if="stars > 0" class="q-pt-xs q-pb-xs">
|
|
<q-card-section v-if="stars > 0" class="q-pt-xs q-pb-xs">
|
|
|
<div class="text-caption text-grey-7 text-center q-mb-sm">
|
|
<div class="text-caption text-grey-7 text-center q-mb-sm">
|
|
|
{{ isNegative ? $t('dashboard_client.schedule_rating.negative_label') : $t('dashboard_client.schedule_rating.positive_label') }}
|
|
{{ isNegative ? $t('dashboard_client.schedule_rating.negative_label') : $t('dashboard_client.schedule_rating.positive_label') }}
|
|
@@ -57,7 +54,6 @@
|
|
|
</div>
|
|
</div>
|
|
|
</q-card-section>
|
|
</q-card-section>
|
|
|
|
|
|
|
|
- <!-- Comentário -->
|
|
|
|
|
<q-card-section class="q-pt-xs q-pb-xs q-px-lg">
|
|
<q-card-section class="q-pt-xs q-pb-xs q-px-lg">
|
|
|
<div class="text-caption text-grey-7 q-mb-xs">
|
|
<div class="text-caption text-grey-7 q-mb-xs">
|
|
|
{{ $t('dashboard_client.schedule_rating.comment_placeholder') }}
|
|
{{ $t('dashboard_client.schedule_rating.comment_placeholder') }}
|
|
@@ -74,7 +70,27 @@
|
|
|
/>
|
|
/>
|
|
|
</q-card-section>
|
|
</q-card-section>
|
|
|
|
|
|
|
|
- <!-- Checkbox condicional -->
|
|
|
|
|
|
|
+ <q-card-section class="q-pt-xs q-pb-xs q-px-lg">
|
|
|
|
|
+ <input
|
|
|
|
|
+ ref="photoInputRef"
|
|
|
|
|
+ type="file"
|
|
|
|
|
+ accept="image/jpeg,image/png,image/webp"
|
|
|
|
|
+ multiple
|
|
|
|
|
+ class="hidden"
|
|
|
|
|
+ @change="onPhotosSelected"
|
|
|
|
|
+ />
|
|
|
|
|
+ <div class="row q-gutter-xs">
|
|
|
|
|
+ <div v-for="(preview, idx) in photoPreviews" :key="idx" class="photo-thumb">
|
|
|
|
|
+ <img :src="preview" />
|
|
|
|
|
+ <q-btn round dense flat icon="close" size="xs" class="photo-thumb__remove" @click="removePhoto(idx)" />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div v-if="photos.length < 5" class="photo-add" @click="photoInputRef.click()">
|
|
|
|
|
+ <q-icon name="mdi-camera-plus-outline" size="24px" color="grey-5" />
|
|
|
|
|
+ <div class="photo-add__label">{{ $t('dashboard_client.schedule_rating.add_photo') }}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </q-card-section>
|
|
|
|
|
+
|
|
|
<q-card-section v-if="stars > 0" class="q-pt-xs q-pb-xs q-px-lg">
|
|
<q-card-section v-if="stars > 0" class="q-pt-xs q-pb-xs q-px-lg">
|
|
|
<q-checkbox
|
|
<q-checkbox
|
|
|
v-model="checkboxValue"
|
|
v-model="checkboxValue"
|
|
@@ -87,7 +103,6 @@
|
|
|
/>
|
|
/>
|
|
|
</q-card-section>
|
|
</q-card-section>
|
|
|
|
|
|
|
|
- <!-- Botão enviar -->
|
|
|
|
|
<q-card-section class="q-pt-sm q-pb-xs q-px-lg row">
|
|
<q-card-section class="q-pt-sm q-pb-xs q-px-lg row">
|
|
|
<q-btn
|
|
<q-btn
|
|
|
unelevated
|
|
unelevated
|
|
@@ -103,7 +118,6 @@
|
|
|
/>
|
|
/>
|
|
|
</q-card-section>
|
|
</q-card-section>
|
|
|
|
|
|
|
|
- <!-- Ajuda -->
|
|
|
|
|
<q-card-section class="q-pt-xs q-pb-lg text-center">
|
|
<q-card-section class="q-pt-xs q-pb-lg text-center">
|
|
|
<span class="text-caption text-grey-6 cursor-pointer" @click="openHelp">
|
|
<span class="text-caption text-grey-6 cursor-pointer" @click="openHelp">
|
|
|
{{ $t('dashboard_client.schedule_rating.help_link') }}
|
|
{{ $t('dashboard_client.schedule_rating.help_link') }}
|
|
@@ -142,6 +156,9 @@ const checkboxValue = ref(false)
|
|
|
const tags = ref([])
|
|
const tags = ref([])
|
|
|
const loadingTags = ref(false)
|
|
const loadingTags = ref(false)
|
|
|
const loading = ref(false)
|
|
const loading = ref(false)
|
|
|
|
|
+const photos = ref([])
|
|
|
|
|
+const photoPreviews = ref([])
|
|
|
|
|
+const photoInputRef = ref(null)
|
|
|
|
|
|
|
|
const isNegative = computed(() => stars.value > 0 && stars.value <= 2)
|
|
const isNegative = computed(() => stars.value > 0 && stars.value <= 2)
|
|
|
const isPositive = computed(() => stars.value >= 3)
|
|
const isPositive = computed(() => stars.value >= 3)
|
|
@@ -173,6 +190,22 @@ const toggleTag = (id) => {
|
|
|
else selectedTagIds.value.splice(idx, 1)
|
|
else selectedTagIds.value.splice(idx, 1)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+const onPhotosSelected = (event) => {
|
|
|
|
|
+ const files = Array.from(event.target.files)
|
|
|
|
|
+ const remaining = 5 - photos.value.length
|
|
|
|
|
+ files.slice(0, remaining).forEach(file => {
|
|
|
|
|
+ photos.value.push(file)
|
|
|
|
|
+ photoPreviews.value.push(URL.createObjectURL(file))
|
|
|
|
|
+ })
|
|
|
|
|
+ event.target.value = ''
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const removePhoto = (idx) => {
|
|
|
|
|
+ URL.revokeObjectURL(photoPreviews.value[idx])
|
|
|
|
|
+ photos.value.splice(idx, 1)
|
|
|
|
|
+ photoPreviews.value.splice(idx, 1)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
const openHelp = () => {
|
|
const openHelp = () => {
|
|
|
$q.dialog({ component: ProfileHelpDialog })
|
|
$q.dialog({ component: ProfileHelpDialog })
|
|
|
}
|
|
}
|
|
@@ -191,6 +224,7 @@ const submit = async () => {
|
|
|
block_provider: isNegative.value && checkboxValue.value,
|
|
block_provider: isNegative.value && checkboxValue.value,
|
|
|
block_client: false,
|
|
block_client: false,
|
|
|
favorite_provider: isPositive.value && checkboxValue.value,
|
|
favorite_provider: isPositive.value && checkboxValue.value,
|
|
|
|
|
+ photos: photos.value,
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
onDialogOK(true)
|
|
onDialogOK(true)
|
|
@@ -249,4 +283,53 @@ onMounted(async () => {
|
|
|
font-weight: 700;
|
|
font-weight: 700;
|
|
|
padding: 10px 0;
|
|
padding: 10px 0;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+.photo-thumb {
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ width: 64px;
|
|
|
|
|
+ height: 64px;
|
|
|
|
|
+ border-radius: 8px;
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+ flex-shrink: 0;
|
|
|
|
|
+
|
|
|
|
|
+ img {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ height: 100%;
|
|
|
|
|
+ object-fit: cover;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ &__remove {
|
|
|
|
|
+ position: absolute !important;
|
|
|
|
|
+ top: 2px;
|
|
|
|
|
+ right: 2px;
|
|
|
|
|
+ background: rgba(0, 0, 0, 0.5) !important;
|
|
|
|
|
+ color: white !important;
|
|
|
|
|
+ min-height: unset !important;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.photo-add {
|
|
|
|
|
+ width: 64px;
|
|
|
|
|
+ height: 64px;
|
|
|
|
|
+ border-radius: 8px;
|
|
|
|
|
+ border: 1.5px dashed #d1d5db;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ flex-shrink: 0;
|
|
|
|
|
+
|
|
|
|
|
+ &__label {
|
|
|
|
|
+ font-size: 9px;
|
|
|
|
|
+ color: #9ca3af;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ margin-top: 2px;
|
|
|
|
|
+ line-height: 1.2;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ &:active { background: rgba(0, 0, 0, 0.03); }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.hidden { display: none; }
|
|
|
</style>
|
|
</style>
|