Răsfoiți Sursa

feat: add mandatory nuances agreement checkbox to order form

unknown 2 luni în urmă
părinte
comite
e90382ad21

+ 28 - 1
src/components/ModelUploadSection.vue

@@ -256,6 +256,29 @@
           <ShieldCheck :class="['w-5 h-5 transition-colors', allowPortfolio ? 'text-primary' : 'text-muted-foreground/30']" />
         </div>
 
+        <!-- Nuances consent (Mandatory) -->
+        <div class="flex items-start gap-4 p-4 mt-3 bg-secondary/30 border border-black/[0.03] rounded-2xl cursor-pointer hover:bg-secondary/50 transition-all active:scale-[0.99] group"
+          @click="agreeToNuances = !agreeToNuances">
+          <div :class="['mt-0.5 w-5 h-5 rounded border flex items-center justify-center transition-all',
+            agreeToNuances ? 'bg-primary border-primary' : 'bg-background border-border group-hover:border-primary/50']">
+            <Check v-if="agreeToNuances" class="w-3.5 h-3.5 text-primary-foreground" />
+          </div>
+          <div class="flex-1">
+            <p class="text-sm font-medium leading-relaxed">
+              {{ t("upload.agreeToNuances") }} 
+              <RouterLink 
+                :to="{ name: 'nuances', params: { lang: locale } }" 
+                target="_blank" 
+                class="text-primary underline hover:text-primary/80 transition-colors"
+                @click.stop
+              >
+                {{ t("upload.nuancesLink") }}
+              </RouterLink>
+            </p>
+          </div>
+          <FileText :class="['w-5 h-5 transition-colors', agreeToNuances ? 'text-primary' : 'text-muted-foreground/30']" />
+        </div>
+
         <!-- Estimate -->
         <Transition enter-active-class="transition duration-300" enter-from-class="opacity-0 translate-y-2" enter-to-class="opacity-100 translate-y-0">
           <div v-if="estimatedPrice !== null"
@@ -315,6 +338,7 @@ const companyName = ref("");
 const companyPib = ref("");
 const companyAddress = ref("");
 const allowPortfolio = ref(false);
+const agreeToNuances = ref(false);
 const materials = ref<any[]>([]);
 const selectedMaterial = ref("1");
 const selectedColor = ref("");
@@ -385,6 +409,7 @@ const isFormValid = computed(() =>
   firstName.value.trim() !== "" && lastName.value.trim() !== "" &&
   phone.value.trim() !== "" && email.value.trim() !== "" &&
   address.value.trim() !== "" && selectedMaterial.value !== "" &&
+  agreeToNuances.value &&
   (files.value.length > 0 || modelLink.value.trim() !== "") &&
   (!isCompany.value || (companyName.value.trim() !== "" && companyPib.value.trim() !== ""))
 );
@@ -465,7 +490,9 @@ async function handleSubmit() {
     toast.success(t("upload.success"));
     files.value = []; firstName.value = ""; lastName.value = ""; phone.value = "";
     email.value = ""; address.value = ""; modelLink.value = "";
-    allowPortfolio.value = false; notes.value = "";
+    allowPortfolio.value = false;
+    agreeToNuances.value = false;
+    notes.value = "";
   } catch (err: any) {
     toast.error(err.message || t("upload.error"));
   } finally {

+ 12 - 0
src/locales/master_user/upload.json

@@ -18,6 +18,18 @@
       "ru": "Мы покажем фото вашего изделия, чтобы вдохновить других клиентов.",
       "ua": "Ми покажемо фотографії вашого виробу, щоб надихнути інших клієнтів."
     },
+    "agreeToNuances": {
+      "en": "I have read and agree with the",
+      "me": "Pročitao sam i slažem se sa",
+      "ru": "Я ознакомился и согласен с",
+      "ua": "Я ознайомився та згоден з"
+    },
+    "nuancesLink": {
+      "en": "printing nuances",
+      "me": "detaljima 3D štampe",
+      "ru": "нюансами 3D-печати",
+      "ua": "нюансами 3D-друку"
+    },
     "badge": {
       "en": "Place Your Project",
       "me": "Kreiranje projekta",

+ 12 - 0
src/locales/translations.user.json

@@ -3404,6 +3404,18 @@
       "ru": "Мы покажем фото вашего изделия, чтобы вдохновить других клиентов.",
       "ua": "Ми покажемо фотографії вашого виробу, щоб надихнути інших клієнтів."
     },
+    "agreeToNuances": {
+      "en": "I have read and agree with the",
+      "me": "Pročitao sam i slažem se sa",
+      "ru": "Я ознакомился и согласен с",
+      "ua": "Я ознайомився та згоден з"
+    },
+    "nuancesLink": {
+      "en": "printing nuances",
+      "me": "detaljima 3D štampe",
+      "ru": "нюансами 3D-печати",
+      "ua": "нюансами 3D-друку"
+    },
     "badge": {
       "en": "Place Your Project",
       "me": "Kreiranje projekta",