diff --git a/frontend/raw/assets/css/catalog.css b/frontend/src/assets/css/catalog.css
similarity index 98%
rename from frontend/raw/assets/css/catalog.css
rename to frontend/src/assets/css/catalog.css
index 28d8f21..2a435a2 100644
--- a/frontend/raw/assets/css/catalog.css
+++ b/frontend/src/assets/css/catalog.css
@@ -1,6 +1,6 @@
/* Fonts */
-@import url("../../fonts/StapelS/style.css");
+@import url("@/assets/fonts/StapelS/style.css");
body {
margin: 0;
@@ -66,7 +66,7 @@ h1, h2, h3, h4, h5, h6 {
height: 96px;
margin: 0 auto;
- background: url("../images/metr.svg") center
+ background: url("@/assets/images/metr.svg") center
no-repeat;
background-size: cover;
border-right: 2px solid white;
@@ -189,7 +189,7 @@ h1, h2, h3, h4, h5, h6 {
padding-top: 250px;
background-image: linear-gradient(to top, rgb(124, 173, 201, 1), rgb(94, 196, 242, 0.3)), url(
- "../images/intro.jpg");
+ "@/assets/images/intro.jpg");
background-size: cover;
}
@@ -314,7 +314,7 @@ h1, h2, h3, h4, h5, h6 {
height: 590px;
border: 1px solid black;
background-image: linear-gradient(to top, rgb(124, 173, 201, 0.6), rgb(94, 196, 242, 0.2)), url(
- "../images/video.jpg");
+ "@/assets/images/video.jpg");
background-size: cover;
}
diff --git a/frontend/raw/assets/css/advertisment.css b/frontend/src/assets/css/offer.css
similarity index 97%
rename from frontend/raw/assets/css/advertisment.css
rename to frontend/src/assets/css/offer.css
index d3fb620..b9ca953 100644
--- a/frontend/raw/assets/css/advertisment.css
+++ b/frontend/src/assets/css/offer.css
@@ -1,6 +1,6 @@
/* Fonts */
-@import url("../../fonts/StapelS/style.css");
+@import url("@/assets/fonts/StapelS/style.css");
body {
margin: 0;
@@ -66,7 +66,7 @@ h1, h2, h3, h4, h5, h6 {
height: 96px;
margin: 0 auto;
- background: url("../images/metr.svg") center
+ background: url("../../../raw/assets/images/metr.svg") center
no-repeat;
background-size: cover;
border-right: 2px solid white;
@@ -189,7 +189,7 @@ h1, h2, h3, h4, h5, h6 {
padding-top: 250px;
background-image: linear-gradient(to top, rgb(124, 173, 201, 1), rgb(94, 196, 242, 0.6)), url(
- "../images/intro.jpg");
+ "../../../raw/assets/images/intro.jpg");
background-size: cover;
}
diff --git a/frontend/raw/assets/css/profile.css b/frontend/src/assets/css/profile.css
similarity index 91%
rename from frontend/raw/assets/css/profile.css
rename to frontend/src/assets/css/profile.css
index 88ee14e..4c563d3 100644
--- a/frontend/raw/assets/css/profile.css
+++ b/frontend/src/assets/css/profile.css
@@ -1,6 +1,6 @@
/* Fonts */
-@import url("../../fonts/StapelS/style.css");
+@import url("@/assets/fonts/StapelS/style.css");
body {
margin: 0;
@@ -66,7 +66,7 @@ h1, h2, h3, h4, h5, h6 {
height: 96px;
margin: 0 auto;
- background: url("../images/metr.svg") center
+ background: url("@/assets/images/metr.svg") center
no-repeat;
background-size: cover;
border-right: 2px solid white;
@@ -189,7 +189,7 @@ h1, h2, h3, h4, h5, h6 {
padding-top: 250px;
background-image: linear-gradient(to top, rgb(124, 173, 201, 1), rgb(94, 196, 242, 0.6)), url(
- "../images/intro.jpg");
+ "@/assets/images/intro.jpg");
background-size: cover;
}
@@ -250,21 +250,6 @@ h1, h2, h3, h4, h5, h6 {
color: white;
font-size: 15px;
font-weight: 600;
+ cursor: pointer;
}
-.about__user {
- display: flex;
- flex-direction: column;
-}
-
-.about__images {
- width: 105%;
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- margin-top: 1%;
-}
-
-.about_describtions {
- margin-top: 5%;
-}
\ No newline at end of file
diff --git a/frontend/src/assets/css/style.css b/frontend/src/assets/css/style.css
index 8eaa5ca..bffd3ed 100644
--- a/frontend/src/assets/css/style.css
+++ b/frontend/src/assets/css/style.css
@@ -1,6 +1,6 @@
/* Fonts */
- @import url("../../fonts/StapelS/style.css");
+ @import url("@/assets/fonts/StapelS/style.css");
body {
margin: 0;
diff --git a/frontend/raw/assets/images/arrow.png b/frontend/src/assets/images/arrow.png
similarity index 100%
rename from frontend/raw/assets/images/arrow.png
rename to frontend/src/assets/images/arrow.png
diff --git a/frontend/src/assets/images/forcomment.png b/frontend/src/assets/images/forcomment.png
new file mode 100644
index 0000000..7b8d9cb
Binary files /dev/null and b/frontend/src/assets/images/forcomment.png differ
diff --git a/frontend/src/assets/images/heart.png b/frontend/src/assets/images/heart.png
new file mode 100644
index 0000000..2bd0535
Binary files /dev/null and b/frontend/src/assets/images/heart.png differ
diff --git a/frontend/src/assets/images/offer1.png b/frontend/src/assets/images/offer1.png
new file mode 100644
index 0000000..f110a3c
Binary files /dev/null and b/frontend/src/assets/images/offer1.png differ
diff --git a/frontend/raw/assets/images/adv2.png b/frontend/src/assets/images/offer2.png
similarity index 100%
rename from frontend/raw/assets/images/adv2.png
rename to frontend/src/assets/images/offer2.png
diff --git a/frontend/src/assets/images/offer3.png b/frontend/src/assets/images/offer3.png
new file mode 100644
index 0000000..592a0dc
Binary files /dev/null and b/frontend/src/assets/images/offer3.png differ
diff --git a/frontend/src/assets/images/offer4.png b/frontend/src/assets/images/offer4.png
new file mode 100644
index 0000000..aaffe0d
Binary files /dev/null and b/frontend/src/assets/images/offer4.png differ
diff --git a/frontend/raw/assets/images/star.png b/frontend/src/assets/images/star.png
similarity index 100%
rename from frontend/raw/assets/images/star.png
rename to frontend/src/assets/images/star.png
diff --git a/frontend/src/assets/images/star1.png b/frontend/src/assets/images/star1.png
new file mode 100644
index 0000000..e4d9cf4
Binary files /dev/null and b/frontend/src/assets/images/star1.png differ
diff --git a/frontend/src/assets/images/starsmall.png b/frontend/src/assets/images/starsmall.png
new file mode 100644
index 0000000..1cf2978
Binary files /dev/null and b/frontend/src/assets/images/starsmall.png differ
diff --git a/frontend/raw/assets/images/userlogo.png b/frontend/src/assets/images/userlogo.png
similarity index 100%
rename from frontend/raw/assets/images/userlogo.png
rename to frontend/src/assets/images/userlogo.png
diff --git a/frontend/src/assets/images/userlogosmall.png b/frontend/src/assets/images/userlogosmall.png
new file mode 100644
index 0000000..3db5cc2
Binary files /dev/null and b/frontend/src/assets/images/userlogosmall.png differ
diff --git a/frontend/src/components/ProfileAbout.vue b/frontend/src/components/ProfileAbout.vue
new file mode 100644
index 0000000..84b4ee0
--- /dev/null
+++ b/frontend/src/components/ProfileAbout.vue
@@ -0,0 +1,38 @@
+
+
+
Обо мне
+
+
+
Занимаюсь продажей квартир более 10 лет.
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/frontend/src/components/ProfileAddOffer.vue b/frontend/src/components/ProfileAddOffer.vue
new file mode 100644
index 0000000..a77e8b5
--- /dev/null
+++ b/frontend/src/components/ProfileAddOffer.vue
@@ -0,0 +1,38 @@
+
+
+
Добавить обьявление
+
+
+
Однушка на Елизаровых, 44
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/frontend/src/components/ProfileMyOffers.vue b/frontend/src/components/ProfileMyOffers.vue
new file mode 100644
index 0000000..e1bf498
--- /dev/null
+++ b/frontend/src/components/ProfileMyOffers.vue
@@ -0,0 +1,38 @@
+
+
+
Мои объявления
+
+
+
Однушка на Елизаровых, 44
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/frontend/src/main.js b/frontend/src/main.js
index c8e37b0..4667a10 100644
--- a/frontend/src/main.js
+++ b/frontend/src/main.js
@@ -1,9 +1,10 @@
-import { createApp } from 'vue'
-import App from './App.vue'
-import router from './router'
+// Core
+import { createApp } from 'vue';
+import router from './router';
+import store from './store';
-const app = createApp(App)
+import App from './App.vue';
-app.use(router)
+const app = createApp(App);
-app.mount('#app')
+app.use(router).use(store).mount('#app');
diff --git a/frontend/src/router/index.js b/frontend/src/router/index.js
index fdc45a2..45d7855 100644
--- a/frontend/src/router/index.js
+++ b/frontend/src/router/index.js
@@ -1,6 +1,9 @@
import { createRouter, createWebHistory } from 'vue-router'
import MainView from '@/views/MainView.vue'
import AuthView from '@/views/AuthView.vue'
+import CatalogView from "@/views/CatalogView.vue";
+import ProfileView from "@/views/ProfileView.vue";
+import OfferView from "@/views/OfferView.vue";
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
@@ -15,6 +18,21 @@ const router = createRouter({
name: 'auth',
component: AuthView
},
+ {
+ path: '/catalog',
+ name: 'catalog',
+ component: CatalogView
+ },
+ {
+ path: '/profile',
+ name: 'profile',
+ component: ProfileView
+ },
+ {
+ path: '/offer',
+ name: 'offer',
+ component: OfferView
+ },
]
})
diff --git a/frontend/src/services/api.js b/frontend/src/services/api.js
new file mode 100644
index 0000000..ce14510
--- /dev/null
+++ b/frontend/src/services/api.js
@@ -0,0 +1,6 @@
+import axios from 'axios';
+
+export default axios.create({
+ baseURL: 'http://tusur.tk:9080/api',
+ withCredentials: true,
+});
diff --git a/frontend/src/services/auth.js b/frontend/src/services/auth.js
new file mode 100644
index 0000000..510fb2c
--- /dev/null
+++ b/frontend/src/services/auth.js
@@ -0,0 +1,27 @@
+import api from "@/services/api";
+
+export const AuthService = {
+ async registration(email, password) {
+ const resp = await api.post('/auth/registration', {
+ email,
+ password,
+ });
+ localStorage.setItem('auth', JSON.stringify(resp));
+ return resp;
+ },
+ async login(email, password) {
+ const resp = await api.post('/auth/login', {
+ email,
+ password,
+ });
+ localStorage.setItem('auth', JSON.stringify(resp));
+ return resp;
+ },
+ async logout() {
+ await api.post('/auth/logout');
+ localStorage.removeItem('auth');
+ return true;
+ },
+};
+
+export default AuthService;
diff --git a/frontend/src/store/index.js b/frontend/src/store/index.js
new file mode 100644
index 0000000..a0a52fb
--- /dev/null
+++ b/frontend/src/store/index.js
@@ -0,0 +1,8 @@
+import { createStore } from 'vuex';
+import auth from '@/store/modules/auth';
+
+export default createStore({
+ modules: {
+ auth,
+ },
+});
diff --git a/frontend/src/store/modules/auth.js b/frontend/src/store/modules/auth.js
new file mode 100644
index 0000000..162aabb
--- /dev/null
+++ b/frontend/src/store/modules/auth.js
@@ -0,0 +1,51 @@
+import authService from '@/services/auth';
+
+const savedUser = JSON.parse(localStorage.getItem('auth'));
+
+export const state = {
+ user: savedUser?.data?.data ?? null,
+ token: savedUser?.data?.token ?? null,
+};
+
+export const actions = {
+ async login({ commit }, { email, password }) {
+ const { data: user } = await authService.login(email, password);
+ commit('SET_USER', user.data);
+ commit('SET_TOKEN', user.token);
+ },
+ async logout({ commit }) {
+ await authService.logout();
+ commit('SET_USER', null);
+ commit('SET_TOKEN', null);
+ },
+};
+
+export const mutations = {
+ SET_USER(state, user) {
+ state.user = user;
+ },
+ SET_TOKEN(state, token) {
+ state.token = token;
+ },
+};
+
+export const getters = {
+ user(state) {
+ return state.user;
+ },
+ username(state) {
+ return state.user && state.user.last_name && state.user.first_name
+ ? `${state.user.last_name} ${state.user.first_name}`
+ : null;
+ },
+ userAuthenticated(state) {
+ return state.user !== null && state.token !== null;
+ },
+};
+
+export default {
+ state,
+ actions,
+ mutations,
+ getters,
+};
diff --git a/frontend/src/views/AuthView.vue b/frontend/src/views/AuthView.vue
index e19a171..d58dc20 100644
--- a/frontend/src/views/AuthView.vue
+++ b/frontend/src/views/AuthView.vue
@@ -1,40 +1,65 @@
-
{{authForm? "Вход" : "Регистрация" }} Метр
+ {{authForm ? "Вход" : "Регистрация" }} Метр
-
-
- Зарегистрироваться
+ Зарегистрироваться
>
diff --git a/frontend/src/views/CatalogView.vue b/frontend/src/views/CatalogView.vue
new file mode 100644
index 0000000..d29a121
--- /dev/null
+++ b/frontend/src/views/CatalogView.vue
@@ -0,0 +1,140 @@
+
+
+
+
+
+
Найти недвижимость
+
+
+
+
+
+
Квартира
+
+
+
+
+
+
Купить
+
+
+
+
+
+
Комнаты
+
+
+
+
+
+
Цена
+
+
+
+
+
+
+
+
+
+ 2-к. Квартира, 34 м кв
2 900 000₽
+
+
+
+
+
+ 3-к. Квартира, 34 м кв
4 900 000₽
+
+
+
+
+
+ 1-к. Квартира, 34 м кв
1 900 000₽
+ >
+
+
+
+
+ 5-к. Квартира, 34 м кв
10 900 000₽
+
+
+
+
+
+ 6-к. Квартира, 34 м кв
15 900 000₽
+
+
+
+
+
+ 3-к. Квартира, 34 м кв
5 900 000₽
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/frontend/src/views/MainView.vue b/frontend/src/views/MainView.vue
index feb8cfa..46e9263 100644
--- a/frontend/src/views/MainView.vue
+++ b/frontend/src/views/MainView.vue
@@ -6,13 +6,16 @@
Очень приятный владелец, все чисто и опрятно
+