Compare commits

..

3 Commits

Author SHA1 Message Date
alsaze
3c4ec7aada init
All checks were successful
Deploy / build (push) Successful in 2m27s
2025-12-04 14:45:37 +03:00
alsaze
faf95ec89c init 2025-12-04 13:45:18 +03:00
alsaze
0901ac574c init 2025-12-04 13:37:16 +03:00
8 changed files with 75 additions and 39 deletions

2
.env
View File

@ -1,2 +1,4 @@
VITE_BASE_URL=http://localhost:3000
VITE_YANDEX_MAPS_KEY=13f4c06b-cb7e-4eeb-81f1-af52f12587b2
SMTP_USER=rentalservicekg@yandex.ru
SMTP_APP_PASSWORD=uljislsoihthciju

View File

@ -13,6 +13,9 @@ COPY --from=build /app/.output/ ./
ENV PORT=80
ENV VITE_BASE_URL=https://rental.koptilnya.xyz
ENV VITE_YANDEX_MAPS_KEY=13f4c06b-cb7e-4eeb-81f1-af52f12587b2
ENV SMTP_USER=rentalservicekg@yandex.ru
ENV SMTP_APP_PASSWORD=uljislsoihthciju
EXPOSE 80

View File

@ -43,9 +43,7 @@
</div>
<UCard variant="subtle" class="w-full" :ui="{ root: 'max-w-[500px]' }">
<form name="contacts" method="POST" netlify @submit.prevent="onSubmit">
<input type="hidden" name="form-name" value="contacts">
<form name="contacts" method="POST" @submit.prevent="onSubmit">
<div class="flex flex-col gap-4">
<div class="flex flex-col gap-2">
Как к вам обращаться
@ -201,20 +199,16 @@ const [service, serviceAttrs] = defineField('service')
const [comment, commentAttrs] = defineField('comment')
const onSubmit = handleSubmit(async (values) => {
const payload = new FormData()
payload.append('form-name', 'contacts')
Object.entries(values).forEach(([key, value]) => {
payload.append(key, value as any)
})
await fetch('/', {
const res = await $fetch('/api/send_mail', {
method: 'POST',
body: payload,
body: values,
})
if (res.ok) {
toast.add({
title: 'Заявка успешно отправлена!',
})
}
})
</script>

View File

@ -1,5 +1,6 @@
<template>
<div class="layout">
<ClientOnly>
<UHeader
title="Rental"
:toggle="false"
@ -24,6 +25,7 @@
</div>
</template>
</UHeader>
</ClientOnly>
<UMain>
<slot />

View File

@ -5,7 +5,7 @@ import { process } from 'std-env'
const { resolve } = createResolver(import.meta.url)
export default defineNuxtConfig({
ssr: false,
ssr: true,
compatibilityDate: '2025-05-15',
devtools: { enabled: true },
modules: [

View File

@ -14,7 +14,6 @@
},
"dependencies": {
"@nuxt/content": "^3.7.1",
"gsap": "3.13",
"@nuxt/fonts": "0.11.4",
"@nuxt/icon": "1.15.0",
"@nuxt/image": "1.10.0",
@ -26,7 +25,9 @@
"axios": "^1.12.2",
"dayjs": "^1.11.13",
"decimal.js": "^10.5.0",
"gsap": "3.13",
"maska": "^3.2.0",
"nodemailer": "^7.0.11",
"nuxt": "^4.1.3",
"swiper": "^12.0.2",
"typescript": "^5.6.3",

View File

@ -0,0 +1,29 @@
import nodemailer from 'nodemailer'
export default defineEventHandler(async (event) => {
const body = await readBody(event)
const transporter = nodemailer.createTransport({
host: 'smtp.yandex.ru',
port: 465,
secure: true,
auth: {
user: process.env.SMTP_USER,
pass: process.env.SMTP_APP_PASSWORD,
},
})
await transporter.sendMail({
from: `"Rental Concierge" <${process.env.SMTP_USER}>`,
to: 'info@rental-concierge.com',
subject: 'Новая заявка',
html: `
<b>Имя:</b> ${body.name}<br>
<b>Телефон:</b> ${body.phone}<br>
<b>Услуга:</b> ${body.service}<br>
<b>Комментарий:</b> ${body.comment}
`,
})
return { ok: true }
})

View File

@ -7068,6 +7068,11 @@ node-releases@^2.0.27:
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.27.tgz#eedca519205cf20f650f61d56b070db111231e4e"
integrity sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==
nodemailer@^7.0.11:
version "7.0.11"
resolved "https://registry.yarnpkg.com/nodemailer/-/nodemailer-7.0.11.tgz#5f7b06afaec20073cff36bea92d1c7395cc3e512"
integrity sha512-gnXhNRE0FNhD7wPSCGhdNh46Hs6nm+uTyg+Kq0cZukNQiYdnCsoQjodNP9BQVG9XrcK/v6/MgpAPBUFyzh9pvw==
nopt@^9.0.0:
version "9.0.0"
resolved "https://registry.yarnpkg.com/nopt/-/nopt-9.0.0.tgz#6bff0836b2964d24508b6b41b5a9a49c4f4a1f96"