This commit is contained in:
Swift
2024-01-24 23:26:54 +03:30
parent 340c8fe093
commit f011c3d5f9
5 changed files with 840 additions and 151 deletions
+2
View File
@@ -158,12 +158,14 @@
<span>اعلانات</span> <span>اعلانات</span>
</a> </a>
</nuxt-link> </nuxt-link>
<!--
<nuxt-link :to="{ name: 'account-survey' }" tag="li"> <nuxt-link :to="{ name: 'account-survey' }" tag="li">
<a> <a>
<i class="fas fa-chart-bar"></i> <i class="fas fa-chart-bar"></i>
<span>نظر سنجی</span> <span>نظر سنجی</span>
</a> </a>
</nuxt-link> </nuxt-link>
-->
<nuxt-link :to="{ name: 'account-profile' }" tag="li"> <nuxt-link :to="{ name: 'account-profile' }" tag="li">
<a> <a>
<i class="fal fa-user-edit"></i> <i class="fal fa-user-edit"></i>
+2 -1
View File
@@ -77,7 +77,8 @@ export default {
// https://go.nuxtjs.dev/axios // https://go.nuxtjs.dev/axios
'@nuxtjs/axios', '@nuxtjs/axios',
'@nuxtjs/auth-next', '@nuxtjs/auth-next',
'~/modules/WebSocketServer.js' '~/modules/WebSocketServer.js',
'nuxt-leaflet'
], ],
pwa: { pwa: {
icon: { icon: {
+738 -47
View File
File diff suppressed because it is too large Load Diff
+3 -2
View File
@@ -42,6 +42,7 @@
"nodemailer": "^6.4.17", "nodemailer": "^6.4.17",
"nodemon": "^3.0.1", "nodemon": "^3.0.1",
"nuxt": "^2.14.6", "nuxt": "^2.14.6",
"nuxt-leaflet": "^0.0.27",
"read-excel-file": "^5.2.2", "read-excel-file": "^5.2.2",
"socket.io": "^4.4.1", "socket.io": "^4.4.1",
"vue-persian-datetime-picker": "^2.10.3" "vue-persian-datetime-picker": "^2.10.3"
@@ -50,13 +51,13 @@
"@babel/eslint-parser": "^7.16.3", "@babel/eslint-parser": "^7.16.3",
"@nuxtjs/eslint-config": "^8.0.0", "@nuxtjs/eslint-config": "^8.0.0",
"@nuxtjs/eslint-module": "^3.0.2", "@nuxtjs/eslint-module": "^3.0.2",
"@nuxtjs/pwa": "^3.3.5",
"eslint": "^8.4.1", "eslint": "^8.4.1",
"eslint-config-prettier": "^8.3.0", "eslint-config-prettier": "^8.3.0",
"eslint-plugin-nuxt": "^3.1.0", "eslint-plugin-nuxt": "^3.1.0",
"eslint-plugin-vue": "^8.2.0", "eslint-plugin-vue": "^8.2.0",
"prettier": "^2.5.1",
"@nuxtjs/pwa": "^3.3.5",
"node-sass": "^5.0.0", "node-sass": "^5.0.0",
"prettier": "^2.5.1",
"sass-loader": "^10.1.0" "sass-loader": "^10.1.0"
} }
} }
+94 -100
View File
@@ -1,109 +1,103 @@
<template> <template>
<div class="contact--page page"> <div class="contact--page page">
<section class="s1"> <section class="s1">
<div class="container"> <div class="container">
<div class="row"> <div class="row" >
<div class="col-12 col-md-6 message"> <div class="col-12 col-md-6 message rounded">
<form class="form form_1" @submit.prevent="send"> <l-map :zoom="15" :center="[35.71145647679602, 51.41578735415159]">
<div class="title"> <l-tile-layer url="http://{s}.tile.osm.org/{z}/{x}/{y}.png"></l-tile-layer>
<p>برای ما پیام بگذارید:</p> <l-marker :lat-lng="[35.71145647679602, 51.41578735415159]"></l-marker>
</div> </l-map>
<div class="formRow" :class="validation.full_name ? 'err' : null"> </div>
<input v-model="formData.full_name" type="text" placeholder="نام و نام خانوادگی" /> <div class="col-12 col-md-6 mt-5 mt-md-0 contact">
<p v-if="validation.full_name">{{ validation.full_name.msg }}</p> <div class="info">
</div> <ul>
<div class="formRow" :class="validation.email ? 'err' : null"> <li>
<input v-model="formData.email" type="text" class="email" placeholder="ایمیل" /> <p>
<p v-if="validation.email">{{ validation.email.msg }}</p> <i class="fal fa-map-marker-alt"></i>
</div> <span> {{ config.address }} </span>
<div class="formRow" :class="validation.message ? 'err' : null"> </p>
<textarea v-model="formData.message" rows="3" placeholder="پیام"></textarea> </li>
<p v-if="validation.message">{{ validation.message.msg }}</p> <li>
</div> <a :href="`tel: ${config.contactTel}`">
<div class="btnRow"> <i class="fal fa-phone"></i>
<button class="btn btn-primary" type="submit">ارسال پیام</button> <span>{{ config.contactTel }}</span>
</div> </a>
</form> </li>
</div> <li>
<div class="col-12 col-md-6 mt-5 mt-md-0 contact"> <a :href="`mailto: ${config.contactEmail}`">
<div class="info"> <i class="fal fa-envelope"></i>
<ul> <span>{{ config.contactEmail }}</span>
<li> </a>
<p> </li>
<i class="fal fa-map-marker-alt"></i> </ul>
<span> {{ config.address }} </span>
</p>
</li>
<li>
<a :href="`tel: ${config.contactTel}`">
<i class="fal fa-phone"></i>
<span>{{ config.contactTel }}</span>
</a>
</li>
<li>
<a :href="`mailto: ${config.contactEmail}`">
<i class="fal fa-envelope"></i>
<span>{{ config.contactEmail }}</span>
</a>
</li>
</ul>
</div>
</div> </div>
</div> </div>
</div> </div>
</section> </div>
</div> </section>
</template> </div>
</template>
<script> <script>
export default { export default {
name: 'ContactUsPage', name: 'ContactUsPage',
data() { data() {
return { return {
formData: { formData: {
full_name: '', full_name: '',
email: '', email: '',
message: '' message: ''
}, },
validation: {} validation: {}
} }
}, },
head() { head() {
return { return {
title: 'آسان سرویس | ارتباط با ما' title: 'آسان سرویس | ارتباط با ما'
} }
}, },
computed: { computed: {
config() { config() {
return this.$config return this.$config
} }
}, },
methods: { methods: {
send() { send() {
this.validation = {} this.validation = {}
this.$axios this.$axios
.post(`/api/public/contact`, this.formData) .post(`/api/public/contact`, this.formData)
.then(res => { .then(res => {
this.$message({
type: 'success',
message: 'پیام شما با موفقیت ارسال شد.'
})
this.formData = {
full_name: '',
email: '',
message: ''
}
})
.catch(err => {
if (err.response.status === 422) this.validation = err.response.data.validation
else {
this.$message({ this.$message({
type: 'success', type: 'error',
message: 'پیام شما با موفقیت ارسال شد.' message: err.response.data.message
}) })
this.formData = { }
full_name: '', })
email: '',
message: ''
}
})
.catch(err => {
if (err.response.status === 422) this.validation = err.response.data.validation
else {
this.$message({
type: 'error',
message: err.response.data.message
})
}
})
}
} }
} }
</script> }
</script>
<style>
.leaflet-container{
height: 20rem;
border-radius: 10px;
}
.rounded{
height: 20rem;
border-radius: 10px;
}
</style>